/* Sabre Connect Admin Dashboard - Styles */

:root {
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --primary-light: #a78bfa;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  --bg-dark: #0f0f1a;
  --bg-darker: #0a0a12;
  --bg-card: #1a1a2e;
  --bg-card-hover: #252542;
  --bg-input: #12121f;
  --border: #2d2d4a;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --sidebar-width: 260px;
  --header-height: 64px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Light Theme */
[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-darker: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --border: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Medium Theme */
[data-theme="medium"] {
  --bg-dark: #334155;
  --bg-darker: #293548;
  --bg-card: #475569;
  --bg-card-hover: #526274;
  --bg-input: #3d4d5e;
  --border: #64748b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Theme Toggle Buttons */
.theme-toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-btn {
  padding: 10px 16px;
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  border-color: var(--primary-light);
  color: var(--text-primary);
}

.theme-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.hidden {
  display: none !important;
}

a {
  color: var(--primary-light);
  text-decoration: none;
}
a:hover {
  color: var(--primary);
}

/* Dev Banner */
.dev-banner {
  background: linear-gradient(90deg, #ff6b35, #f7931e);
  color: white;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

.dev-banner a {
  color: white;
  text-decoration: underline;
  margin: 0 4px;
}

.dev-links {
  margin-left: 16px;
}

body.has-dev-banner .sidebar {
  top: 37px;
}
body.has-dev-banner .main-header {
  top: 37px;
}
body.has-dev-banner .login-screen {
  padding-top: 37px;
}

/* Dev Footer */
.dev-footer {
  position: fixed;
  bottom: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
}

.refresh-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-block {
  width: 100%;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Login Screen */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header .logo-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
}

.login-header .accent {
  color: var(--primary);
}

.login-header p {
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.login-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  margin-top: 16px;
  min-height: 20px;
}

/* Dashboard Layout */
.dashboard-app {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-darker);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header .logo-icon {
  font-size: 1.8rem;
}
.sidebar-header .logo-text {
  font-size: 1.2rem;
  font-weight: 700;
}
.sidebar-header .accent {
  color: var(--primary);
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
}

.nav-icon {
  font-size: 1.2rem;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.user-details {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}
.user-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-logout {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.btn-logout:hover {
  background: var(--bg-card);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
}

.main-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-darker);
  position: sticky;
  top: 0;
  z-index: 50;
}

.main-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.page-content {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.1);
  border-radius: var(--radius-md);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  display: block;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.card-body {
  padding: 24px;
}

/* Page Header */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
}

/* Tables */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--bg-darker);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(124, 58, 237, 0.05);
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
}

/* Channels Grid */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.2s;
}

.channel-card:hover {
  border-color: var(--primary);
}

.channel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.channel-icon {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.channel-icon.whatsapp {
  background: rgba(37, 211, 102, 0.15);
}
.channel-icon.email {
  background: rgba(59, 130, 246, 0.15);
}
.channel-icon.chat {
  background: rgba(124, 58, 237, 0.15);
}

.channel-info h4 {
  font-weight: 600;
  margin-bottom: 4px;
}
.channel-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.channel-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 16px;
}

.channel-status.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
}

.channel-status.inactive {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.channel-actions {
  display: flex;
  gap: 8px;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent);
}
.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}
.badge-primary {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
}

/* Action buttons in tables */
.action-btns {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

/* Client Tree View */
.org-row .tree-line {
  color: var(--text-muted);
  margin-right: 8px;
  font-family: monospace;
}

.org-row .org-icon {
  margin-right: 8px;
}

.org-row .has-children {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.org-row.clickable-org {
  cursor: pointer;
}

.org-row.clickable-org:hover td {
  background: var(--bg-card-hover);
}

/* Tree Toggle Controls */
.tree-toggle {
  cursor: pointer;
  color: var(--primary-light);
  margin-right: 8px;
  font-size: 0.8rem;
  width: 16px;
  display: inline-block;
  text-align: center;
}

.tree-toggle:hover {
  color: var(--primary);
}

.tree-toggle-placeholder {
  color: var(--text-muted);
  margin-right: 8px;
  font-size: 0.6rem;
  width: 16px;
  display: inline-block;
  text-align: center;
}

.org-name {
  cursor: pointer;
}

.org-name:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.child-count {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 8px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.badge-info {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
}

/* Client Navigation */
.page-title-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.org-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.org-nav .btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.viewing-indicator {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.viewing-indicator strong {
  color: var(--primary-light);
}

/* Payment Status Badges */
.badge-paid {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.badge-unpaid {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.badge-free {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

/* Client Edit Form */
.org-edit-form .form-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.org-edit-form .form-row:last-child {
  border-bottom: none;
}

.org-edit-form label {
  color: var(--text-secondary);
}

.org-edit-form p {
  margin: 0;
  text-align: right;
}

/* Responsive */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Context Menu */
.context-menu {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 10000;
  padding: 8px 0;
}

.context-menu-item {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.context-menu-item:hover {
  background: var(--bg-card-hover);
}

.context-menu-item span {
  width: 20px;
  text-align: center;
}

.context-menu-danger {
  color: var(--danger);
}

.context-menu-primary {
  color: var(--primary-light);
  font-weight: 500;
}

.context-menu-primary:hover {
  background: rgba(124, 58, 237, 0.15);
}

.context-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

/* Reseller View-Only Details */
.org-view-details {
  background: var(--bg-input);
  border-radius: var(--radius-md);
  padding: 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* Form Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* Modal Actions */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

/* Billing Page */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

.period-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.period-dates {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.period-dates span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.totals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.total-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.total-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.total-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--primary-light);
}

.invoice-header {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
}

.snapshot-summary {
  display: flex;
  gap: 24px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.header-actions {
  display: flex;
  gap: 12px;
}

@media (max-width: 768px) {
  .billing-grid {
    grid-template-columns: 1fr;
  }
  .totals-grid {
    grid-template-columns: 1fr;
  }
}

/* My Account Page */
.subscription-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.sub-row:last-child {
  border-bottom: none;
}

.sub-label {
  color: var(--text-muted);
}

.statement-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: var(--bg-card);
  padding: 16px;
  border-radius: var(--radius-md);
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-row span {
  color: var(--text-muted);
}

/* Billing Overview Grid */
.billing-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.billing-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
  padding: 16px;
  background: var(--bg-main);
  border-radius: var(--radius-md);
}

.billing-label {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.billing-value {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--primary-light);
}

@media (max-width: 768px) {
  .billing-overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Sidebar Dev Info */
.sidebar-dev-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
}

.dev-timestamp {
  color: var(--text-muted);
}

.btn-refresh {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.btn-refresh:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

/* User row in sidebar footer */
.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ======================== */
/* Navigation Section Divider */
/* ======================== */
.nav-section-divider {
  display: flex;
  align-items: center;
  padding: 16px 16px 8px 16px;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.nav-section-divider::before,
.nav-section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.nav-section-divider::before {
  margin-right: 10px;
}

.nav-section-divider::after {
  margin-left: 10px;
}

/* Hide nav items based on role (JS toggles .role-hidden) */
.nav-item.role-hidden,
.nav-section-divider.role-hidden {
  display: none !important;
}

/* ======================== */
/* Impersonation Context Banner */
/* ======================== */
.impersonation-banner {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  color: white;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.impersonation-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.impersonation-icon {
  font-size: 1.2rem;
}

.impersonation-text {
  font-size: 0.95rem;
}

.impersonation-type {
  opacity: 0.8;
  font-size: 0.85rem;
}

.impersonation-user {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.impersonation-exit {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  color: white !important;
}

.impersonation-exit:hover {
  background: rgba(255, 255, 255, 0.3) !important;
}

/* Adjust layout when impersonation banner is visible */
body.has-impersonation-banner .sidebar {
  top: 48px;
}

body.has-impersonation-banner .main-header {
  top: 48px;
}

body.has-impersonation-banner .impersonation-banner {
  top: 0;
}

/* When both dev banner and impersonation banner are active */
body.has-dev-banner.has-impersonation-banner .impersonation-banner {
  top: 37px;
}

body.has-dev-banner.has-impersonation-banner .sidebar {
  top: 85px;
}

body.has-dev-banner.has-impersonation-banner .main-header {
  top: 85px;
}

/* Sidebar visual indicator when impersonating */
body.has-impersonation-banner .sidebar {
  border-left: 3px solid #f59e0b;
}

/* ============ WHITE-LABEL SETTINGS ============ */

.whitelabel-section .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.whitelabel-fields {
  margin-top: 16px;
  transition: opacity 0.2s ease;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

.badge-primary {
  background: var(--primary);
  color: white;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-dark);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* Color picker styling */
input[type="color"] {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  background: var(--bg-input);
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 2px;
}

input[type="color"]::-webkit-color-swatch {
  border-radius: 2px;
  border: none;
}
