/* ============================================================
   WORKSPACE SSO v2 — Global Stylesheet
   Theme: White background, Brown-Red (#8B2500) accent
   Google Workspace-inspired layout
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --color-primary:        #8B2500;
  --color-primary-dark:   #6B1C00;
  --color-primary-light:  #B03A00;
  --color-primary-bg:     #FDF4F0;
  --color-primary-border: #E8C4B0;

  /* Semantic Colors */
  --color-success:    #137333;
  --color-success-bg: #E6F4EA;
  --color-warning:    #B45309;
  --color-warning-bg: #FFFBEB;
  --color-danger:     #C5221F;
  --color-danger-bg:  #FCE8E6;
  --color-info:       #1967D2;
  --color-info-bg:    #E8F0FE;
  --color-gray:       #5F6368;
  --color-gray-bg:    #F1F3F4;

  /* Surface & Background */
  --color-surface:          #FFFFFF;
  --color-bg:               #FFFFFF;
  --color-bg-secondary:     #F8F9FA;
  --color-bg-tertiary:      #F1F3F4;

  /* Text */
  --color-text:             #202124;
  --color-text-secondary:   #5F6368;
  --color-text-muted:       #9AA0A6;
  --color-text-inverse:     #FFFFFF;

  /* Borders */
  --color-border:           #DADCE0;
  --color-border-light:     #F1F3F4;
  --color-border-dark:      #BDC1C6;

  /* Layout */
  --sidebar-width:          240px;
  --header-height:          60px;
  --content-max-width:      1200px;

  /* Border Radius */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs:  0 1px 2px rgba(0,0,0,.06);
  --shadow-sm:  0 1px 4px rgba(0,0,0,.08), 0 0 1px rgba(0,0,0,.04);
  --shadow-md:  0 2px 10px rgba(0,0,0,.10), 0 0 1px rgba(0,0,0,.04);
  --shadow-lg:  0 4px 20px rgba(0,0,0,.12), 0 0 2px rgba(0,0,0,.06);
  --shadow-xl:  0 8px 40px rgba(0,0,0,.16);

  /* Transitions */
  --transition-fast:   0.12s ease;
  --transition-normal: 0.22s ease;
  --transition-slow:   0.38s ease;

  /* Typography */
  --font-sans: 'Google Sans', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-size-xs:  0.72rem;
  --font-size-sm:  0.82rem;
  --font-size-base: 0.92rem;
  --font-size-md:  1rem;
  --font-size-lg:  1.125rem;
  --font-size-xl:  1.35rem;
  --font-size-2xl: 1.65rem;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; }

code, pre {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--color-bg-tertiary);
  border-radius: var(--radius-sm);
}
code  { padding: .15em .4em; }
pre   { padding: 1rem; overflow-x: auto; line-height: 1.7; border: 1px solid var(--color-border); }
pre code { background: none; padding: 0; }

/* ── Layout: Page Wrapper ─────────────────────────────────── */
.page-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-normal);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }

.sidebar-section { padding: .5rem 0; }
.sidebar-section + .sidebar-section { border-top: 1px solid var(--color-border-light); }
.sidebar-section-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  padding: .75rem 1.25rem .25rem;
}

/* ── Nav Items ────────────────────────────────────────────── */
.nav-item {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .6rem 1.15rem;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
  position: relative;
  text-decoration: none;
  margin: .05rem .5rem;
  border-radius: var(--radius-sm);
}
.nav-item:hover { background: var(--color-bg-secondary); color: var(--color-text); }
.nav-item.active {
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px; top: 15%; height: 70%;
  width: 3px;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--color-primary);
  color: white;
  font-size: .65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .3rem;
}

/* ── Header ───────────────────────────────────────────────── */
.header {
  height: var(--header-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.5rem;
  box-shadow: var(--shadow-xs);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 700;
  color: var(--color-text);
  font-size: .97rem;
  text-decoration: none;
}
.brand-logo {
  width: 32px; height: 32px;
  background: var(--color-primary);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(139,37,0,.3);
}
.brand-name span { color: var(--color-text-secondary); font-weight: 400; font-size: .85rem; }

.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.header-search .search-icon {
  position: absolute;
  left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}
.header-search input {
  width: 100%;
  padding: .55rem .85rem .55rem 2.75rem;
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  transition: all var(--transition-fast);
  outline: none;
}
.header-search input:focus {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139,37,0,.08);
}

.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

.header-icon-btn {
  width: 38px; height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.header-icon-btn:hover { background: var(--color-bg-secondary); color: var(--color-text); }

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--header-height);
  min-height: 100vh;
  flex: 1;
  padding-left: 0;
  padding-right: 0;
}

/* main content area */

/* Inner padding wrapper for page content */
.page-header {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  background: var(--color-surface);
  margin: -1.5rem -2rem 1.5rem;  /* Cancel content-pad padding, add bottom margin */
}
.content-pad > .page-header:first-child {
  margin-top: 0;
}
.page-title {
  font-size: var(--font-size-xl);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--color-text);
}
.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: .2rem;
}
.page-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* Content area padding wrapper */
.content-pad { padding: 1.5rem 2rem; }

/* Cards never have outer padding (they self-contain) */
.card { padding: 0; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}
.card:hover { box-shadow: var(--shadow-sm); }

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
}
.card-title {
  font-size: .93rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--color-text);
}
.card-body   { padding: 1.5rem; }
.card-footer {
  padding: .85rem 1.5rem;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-secondary);
}

.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all var(--transition-normal);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-value { font-size: 1.55rem; font-weight: 800; color: var(--color-text); line-height: 1; }
.stat-label { font-size: var(--font-size-xs); color: var(--color-text-secondary); margin-top: .25rem; }

/* ── App Grid & Cards ─────────────────────────────────────── */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.app-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.app-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0) 60%, rgba(0,0,0,.015));
  pointer-events: none;
}
.app-card:hover {
  border-color: var(--color-primary-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.app-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .85rem;
}
.app-card-name {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .2rem;
}
.app-card-desc {
  font-size: .75rem;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.table th {
  background: var(--color-bg-secondary);
  padding: .75rem 1rem;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-text-secondary);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
}
.table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}
.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--color-bg-secondary); }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition-fast);
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  user-select: none;
}
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  box-shadow: 0 2px 8px rgba(139,37,0,.25);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover:not(:disabled) {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) { background: var(--color-bg-secondary); color: var(--color-text); }

.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}
.btn-danger:hover:not(:disabled) { background: #A31812; }

.btn-sm  { padding: .4rem .85rem; font-size: .78rem; border-radius: var(--radius-sm); }
.btn-lg  { padding: .85rem 1.65rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-block { width: 100%; }
.btn-loading { position: relative; pointer-events: none; }
.btn-loading svg { animation: spin .7s linear infinite; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: .4rem;
}
.form-control {
  width: 100%;
  padding: .65rem .9rem;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  color: var(--color-text);
  font-family: var(--font-sans);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139,37,0,.1);
}
.form-control:disabled { background: var(--color-bg-secondary); cursor: not-allowed; opacity: .7; }
.form-control.error   { border-color: var(--color-danger); }
.form-text { font-size: .73rem; color: var(--color-text-muted); margin-top: .3rem; display: block; }
select.form-control   { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235F6368' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .85rem center; padding-right: 2.5rem; cursor: pointer; }

.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.input-addon {
  padding: 0 .85rem;
  background: var(--color-bg-secondary);
  border: 1.5px solid var(--color-border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast);
}
.input-addon:hover { background: var(--color-bg-tertiary); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: 1.25rem;
  border: 1.5px solid;
  animation: slideDown .22s ease;
}
.alert-success { background: var(--color-success-bg); color: var(--color-success); border-color: #B7DFC5; }
.alert-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  border-color: #F5C6C5; }
.alert-warning { background: var(--color-warning-bg); color: var(--color-warning); border-color: #FDE68A; }
.alert-info    { background: var(--color-info-bg);    color: var(--color-info);    border-color: #BFDBFE; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .65rem;
  border-radius: var(--radius-full);
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.4;
}
.badge-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-danger  { background: var(--color-danger-bg);  color: var(--color-danger);  }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-info    { background: var(--color-info-bg);    color: var(--color-info);    }
.badge-primary { background: var(--color-primary-bg); color: var(--color-primary); }
.badge-gray    { background: var(--color-gray-bg);    color: var(--color-gray);    }

/* ── Modals ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(32,33,36,.5);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  animation: fadeIn .18s ease;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp .25s cubic-bezier(.34,1.56,.64,1);
}
.modal-header {
  padding: 1.35rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border-light);
  position: sticky;
  top: 0;
  background: var(--color-surface);
  z-index: 1;
}
.modal-title  { font-size: 1.1rem; font-weight: 800; color: var(--color-text); }
.modal-close  { background: none; border: none; cursor: pointer; color: var(--color-text-secondary); width: 32px; height: 32px; border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center; transition: background var(--transition-fast); }
.modal-close:hover { background: var(--color-bg-secondary); color: var(--color-text); }
.modal-body   { padding: 1.35rem 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--color-border-light); display: flex; align-items: center; justify-content: flex-end; gap: .75rem; background: var(--color-bg-secondary); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }

/* ── Dropdowns ────────────────────────────────────────────── */
.user-menu { position: relative; }
.user-avatar {
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2px solid var(--color-border);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  object-fit: cover;
}
.user-avatar:hover { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(139,37,0,.15); }

.dropdown-menu {
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  display: none;
  overflow: hidden;
  animation: dropdownOpen .18s ease;
}
.dropdown-menu.open { display: block; }
.dropdown-header { padding: 1rem; border-bottom: 1px solid var(--color-border-light); }
.user-name  { font-weight: 700; font-size: .9rem; color: var(--color-text); }
.user-email { font-size: .78rem; color: var(--color-text-secondary); margin-top: .15rem; word-break: break-all; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem;
  color: var(--color-text);
  font-size: .85rem;
  transition: background var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--color-bg-secondary); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: var(--color-danger-bg); }
.dropdown-divider { border-top: 1px solid var(--color-border-light); margin: .25rem 0; }

/* ── Auth Pages ───────────────────────────────────────────── */
.auth-wrapper {
  display: flex;
  min-height: 100vh;
}
.auth-visual {
  flex: 0 0 42%;
  background: linear-gradient(160deg, var(--color-primary) 0%, #5C1800 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  top: -100px; right: -100px;
}
.auth-visual::after {
  content: '';
  position: absolute;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  bottom: -80px; left: -80px;
}
.auth-visual-content {
  position: relative;
  z-index: 1;
  color: white;
  max-width: 340px;
}
.auth-visual-logo {
  width: 56px; height: 56px;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.35);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 900;
  margin-bottom: 1.75rem;
  backdrop-filter: blur(8px);
}
.auth-visual h1 { font-size: 2rem; font-weight: 800; margin-bottom: .65rem; line-height: 1.2; }
.auth-visual p  { font-size: .9rem; opacity: .8; line-height: 1.6; }

.auth-form-side  {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  overflow-y: auto;
}
.auth-form-wrap  { width: 100%; max-width: 440px; }
.auth-logo-mobile {
  display: none;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 1.75rem;
  color: var(--color-text);
}
.logo-box {
  width: 36px; height: 36px;
  background: var(--color-primary);
  color: white;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .95rem;
}

.divider {
  text-align: center;
  position: relative;
  margin: 1.25rem 0;
  color: var(--color-text-muted);
  font-size: .8rem;
}
.divider::before {
  content: '';
  position: absolute;
  top: 50%; left: 0; right: 0;
  height: 1px;
  background: var(--color-border);
  z-index: 0;
}
.divider span {
  background: var(--color-surface);
  padding: 0 .85rem;
  position: relative;
  z-index: 1;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-wrapper { background: var(--color-surface); }
.admin-tabs  {
  display: flex;
  gap: .5rem;
  padding: .75rem 0 0;
  border-bottom: 1.5px solid var(--color-border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tab {
  padding: .6rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .5rem;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.admin-tab:hover  { background: var(--color-bg-secondary); color: var(--color-text); }
.admin-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); background: var(--color-primary-bg); }
.tab-content { padding: 0; }
.tab-content.hidden { display: none; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: .35rem; }
.page-link {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: .82rem; font-weight: 600;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
  text-decoration: none;
  transition: all var(--transition-fast);
}
.page-link:hover  { background: var(--color-bg-secondary); color: var(--color-text); }
.page-link.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--color-text-secondary);
}
.empty-state svg  { opacity: .25; margin-bottom: 1rem; }
.empty-state h3   { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; color: var(--color-text); }
.empty-state p    { font-size: .85rem; color: var(--color-text-secondary); }

/* ── Sidebar Overlay (mobile) ─────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 95;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.active { display: block; }

/* ── Utility Classes ──────────────────────────────────────── */
.flex           { display: flex; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-1          { gap: .5rem; }
.gap-2          { gap: 1rem; }
.flex-wrap      { flex-wrap: wrap; }
.hidden         { display: none !important; }
.text-muted     { color: var(--color-text-secondary); }
.mt-1           { margin-top: .5rem; }
.mt-2           { margin-top: 1rem; }
.ms-auto        { margin-left: auto; }

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn        { from { opacity: 0; }            to { opacity: 1; } }
@keyframes slideDown     { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalSlideUp  { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dropdownOpen  { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin          { to { transform: rotate(360deg); } }
@keyframes pulse         { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* ── Toast Notifications ──────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1.2rem;
  background: var(--color-text);
  color: white;
  border-radius: var(--radius-md);
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn .28s cubic-bezier(.34,1.56,.64,1);
  pointer-events: all;
  max-width: 340px;
}
.toast.success { background: var(--color-success); }
.toast.error   { background: var(--color-danger); }
.toast.warning { background: var(--color-warning); }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); }    to { opacity: 0; transform: translateX(20px); } }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .app-grid   { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }

  .header {
    left: 0;
  }
  .main-content {
    margin-left: 0;
  }
  .main-content > * { padding-left: 1rem; padding-right: 1rem; }

  .page-header { padding: 1.25rem 1rem; }
  .page-title  { font-size: 1.15rem; }

  .auth-wrapper    { flex-direction: column; }
  .auth-visual     { flex: 0 0 auto; padding: 2rem; min-height: auto; }
  .auth-visual h1  { font-size: 1.5rem; }
  .auth-logo-mobile{ display: flex; }

  .header-search   { display: none; }
  .brand-name      { display: none; }
  .stats-grid      { grid-template-columns: 1fr 1fr; }

  .group-chip { display: none !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal       { border-radius: var(--radius-lg); }
}
