/* ═══════════════════════════════════════════════════════════════════════════
   OHTAAWACRM — Design System
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Jost:wght@200;300;400;500&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────── */
/* Dark base + OHTAAWA brand green (#5a705b) as accent only */
:root {
  --bg:          #07070f;
  --bg-2:        #0d0d1a;
  --bg-3:        #131325;
  --bg-4:        #1a1a30;
  --bg-5:        #22223c;

  --gold:        #5a705b;
  --gold-light:  #7a9c7c;
  --gold-dark:   #3d5440;
  --gold-glow:   rgba(90, 112, 91, 0.18);

  --text:        #f0f0fa;
  --text-2:      #a0a0c0;
  --text-3:      #60608a;

  --border:      rgba(255, 255, 255, 0.07);
  --border-2:    rgba(255, 255, 255, 0.12);
  --border-gold: rgba(90, 112, 91, 0.40);

  --success:     #22c55e;
  --danger:      #ef4444;
  --warning:     #f59e0b;
  --info:        #3b82f6;

  --success-bg:  rgba(34, 197, 94, 0.12);
  --danger-bg:   rgba(239, 68, 68, 0.12);
  --warning-bg:  rgba(245, 158, 11, 0.12);
  --info-bg:     rgba(59, 130, 246, 0.12);

  --sidebar-w:   260px;
  --sidebar-collapsed-w: 88px;
  --header-h:    64px;

  --r:    10px;
  --r-sm: 6px;
  --r-lg: 16px;
  --r-xl: 24px;

  --shadow:      0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 0 40px rgba(201, 168, 76, 0.12);

  --t: 0.18s ease;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(90, 112, 91, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(90, 112, 91, 0.03) 0%, transparent 60%),
    var(--bg);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

.login-wrap {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .brand {
  font-family: 'Jost', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 200;
  letter-spacing: 0.22em;
  color: var(--text);
  text-transform: uppercase;
}

.login-logo .brand span {
  color: var(--gold-light);
  font-weight: 300;
}

.login-logo .tagline {
  font-family: 'Jost', 'Inter', sans-serif;
  font-size: 10px;
  color: var(--text-3);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-top: 5px;
  font-weight: 300;
}

/* Override: keep user/nav text white (not green-tinted) */
.nav-item, .user-info .uname, td, th, .card-title, .page-title, .page-subtitle,
.stat-label, .stat-value, .modal-title { color: inherit; }

.login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 36px 32px;
  box-shadow: var(--shadow), var(--shadow-gold);
}

.login-card h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card .subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 28px;
}

/* ── Form fields ────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 7px;
  letter-spacing: 0.02em;
}

.field .input-wrap {
  position: relative;
}

.field .input-wrap .icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
  width: 16px;
  height: 16px;
}

.field input, .field select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 14px;
  padding: 11px 14px 11px 40px;
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}

.field input::placeholder { color: var(--text-3); }

.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.field.no-icon input, .field.no-icon select {
  padding-left: 14px;
}

.field .eye-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-3);
  padding: 4px;
  border-radius: 4px;
  transition: color var(--t);
  display: flex;
}
.field .eye-btn:hover { color: var(--text-2); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--r);
  border: 1px solid transparent;
  transition: all var(--t);
  white-space: nowrap;
  outline: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #f0f5f2;
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(90, 112, 91, 0.25);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 0 30px rgba(90, 112, 91, 0.40);
  transform: translateY(-1px);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-4);
  color: var(--text);
  border-color: var(--border-2);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-5);
  border-color: var(--text-3);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.2);
}

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

.btn-icon {
  padding: 8px;
  border-radius: var(--r-sm);
}

.btn-full { width: 100%; }
.btn-sm { font-size: 12.5px; padding: 7px 14px; }

/* ── Alert ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 11px 14px;
  border-radius: var(--r);
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alert-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.25); }
.alert-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.alert-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.alert.hidden { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   APP SHELL (Dashboard + Admin)
   ══════════════════════════════════════════════════════════════════════════ */

.app { display: flex; min-height: 100vh; }

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  border: none;
  padding: 0;
  background: rgba(7, 8, 17, 0.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
  z-index: 95;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow: hidden;
  transition:
    width 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.34s ease,
    border-color 0.34s ease;
}

.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 38px;
}

.sidebar-logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.sidebar-logo .logo-text .name {
  font-family: 'Jost', 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 200;
  letter-spacing: 0.20em;
  color: var(--text);
  text-transform: uppercase;
}
.sidebar-logo .logo-text .sub {
  font-family: 'Jost', 'Inter', sans-serif;
  font-size: 9px;
  color: var(--gold-light);
  letter-spacing: 0.20em;
  text-transform: uppercase;
  font-weight: 300;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--r);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 450;
  transition: all var(--t);
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
  text-decoration: none;
}
.nav-text {
  min-width: 0;
  overflow: hidden;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; transition: opacity var(--t); }
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: var(--bg-4);
  color: var(--gold);
  border-color: var(--border-gold);
}
.nav-item.active svg { opacity: 1; color: var(--gold); }

.nav-item .badge {
  margin-left: auto;
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 8px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-item.soon { opacity: 0.4; cursor: default; }
.nav-item.soon:hover { background: transparent; color: var(--text-2); }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border);
  transition: padding 0.24s ease;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background var(--t);
}
.sidebar-user:hover { background: var(--bg-3); }

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #0a0800;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; overflow: hidden; }
.user-info,
.nav-section-label,
.session-timer,
.nav-unread-badge {
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.user-info .uname {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-info .urole {
  font-size: 11px;
  color: var(--text-3);
}

.logout-btn {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 6px;
  border-radius: var(--r-sm);
  display: flex;
  transition: color var(--t);
}
.logout-btn:hover { color: var(--danger); }
.logout-btn svg { width: 16px; height: 16px; }

/* Session timer */
.session-timer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg-3);
  border-radius: var(--r);
  margin: 0 12px 10px;
  font-size: 11.5px;
  color: var(--text-3);
}
.session-timer svg { width: 12px; height: 12px; color: var(--gold); flex-shrink: 0; }
.session-timer .time { color: var(--gold); font-weight: 500; margin-left: auto; }

/* ── Main content ───────────────────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.header {
  height: var(--header-h);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0));
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t), background var(--t), color var(--t), transform 0.24s ease;
}

.mobile-menu-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-menu-btn:hover {
  border-color: var(--border-gold);
  color: var(--text);
}

.mobile-menu-btn.is-desktop:hover svg {
  transform: translateX(-1px);
}

.mobile-menu-btn.is-desktop.is-collapsed:hover svg {
  transform: translateX(1px);
}

.header-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}
.header-sub { font-size: 12px; color: var(--text-3); font-weight: 400; margin-left: 8px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.content {
  flex: 1;
  padding: 28px;
  max-width: 1400px;
  width: 100%;
}

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title svg { width: 16px; height: 16px; color: var(--gold); }

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

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t), transform var(--t);
}
.stat-card:hover { border-color: var(--border-2); transform: translateY(-2px); }

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  opacity: 0;
  transition: opacity var(--t);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r);
  background: var(--bg-4);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.stat-icon svg { width: 18px; height: 18px; color: var(--gold); }

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
}

/* ── Table ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--r);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th:first-child { border-radius: var(--r-sm) 0 0 0; }
th:last-child  { border-radius: 0 var(--r-sm) 0 0; }

td {
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-3); }

.td-name { font-weight: 500; color: var(--text); }

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 500;
}
.badge-admin   { background: var(--gold-glow); color: var(--gold); border: 1px solid var(--border-gold); }
.badge-user    { background: var(--info-bg); color: var(--info); border: 1px solid rgba(59,130,246,0.25); }
.badge-active  { background: var(--success-bg); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.badge-inactive{ background: var(--bg-4); color: var(--text-3); border: 1px solid var(--border); }

/* ── Modal ──────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: none; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  padding: 6px;
  border-radius: var(--r-sm);
  display: flex;
  transition: color var(--t), background var(--t);
}
.modal-close:hover { color: var(--text); background: var(--bg-4); }
.modal-close svg { width: 18px; height: 18px; }

.modal-body { padding: 22px 24px; }
.modal-footer {
  padding: 16px 24px 22px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Password gen row ────────────────────────────────────────────────────── */
.pw-row {
  display: flex;
  gap: 8px;
}
.pw-row input { flex: 1; }

/* ── Page header ─────────────────────────────────────────────────────────── */
.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 28px;
}

/* ── Welcome card ────────────────────────────────────────────────────────── */
.welcome-card {
  background: linear-gradient(135deg, var(--bg-3), var(--bg-4));
  border: 1px solid var(--border-gold);
  border-radius: var(--r-xl);
  padding: 28px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.welcome-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(90, 112, 91, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.welcome-card p  { font-size: 13px; color: var(--text-2); }

/* ── Overview dashboard ─────────────────────────────────────────────────── */
.overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.period-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.period-chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-2);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--t), background var(--t), color var(--t), transform 0.18s ease;
}

.period-chip:hover {
  border-color: var(--border-2);
  color: var(--text);
  transform: translateY(-1px);
}

.period-chip.active {
  background: rgba(90, 112, 91, 0.16);
  border-color: var(--border-gold);
  color: var(--gold-light);
}

.overview-pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.overview-picker {
  position: relative;
  min-width: 170px;
}

.overview-picker label,
.overview-meta-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.overview-native-input {
  position: absolute;
  inset: auto auto 0 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-w);
}

body.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed-w);
}

body.sidebar-collapsed .sidebar-header {
  padding-left: 14px;
  padding-right: 14px;
}

body.sidebar-collapsed .sidebar-logo {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-logo .logo-text,
body.sidebar-collapsed .nav-section-label,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .session-timer {
  opacity: 0;
  transform: translateX(-8px);
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-logo .logo-text,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .user-info {
  max-width: 0;
}

body.sidebar-collapsed .nav-section-label {
  max-height: 0;
  margin-bottom: 0;
  overflow: hidden;
}

body.sidebar-collapsed .nav-section {
  margin-bottom: 16px;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding: 11px 8px;
  position: relative;
  border-radius: 16px;
}

body.sidebar-collapsed .nav-item svg {
  opacity: 0.9;
}

body.sidebar-collapsed .nav-item.active {
  background: linear-gradient(180deg, rgba(90, 112, 91, 0.18), rgba(90, 112, 91, 0.1));
  box-shadow:
    inset 0 0 0 1px rgba(90, 112, 91, 0.16),
    inset 4px 0 0 0 var(--gold);
}

body.sidebar-collapsed .nav-item[data-tooltip]::after,
body.sidebar-collapsed .sidebar-user[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(12, 14, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.sidebar-collapsed .nav-item[data-tooltip]::before,
body.sidebar-collapsed .sidebar-user[data-tooltip]::before {
  content: '';
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg) translateX(-4px);
  background: rgba(12, 14, 24, 0.96);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  z-index: 119;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.sidebar-collapsed .nav-item[data-tooltip]:hover::after,
body.sidebar-collapsed .nav-item[data-tooltip]:hover::before,
body.sidebar-collapsed .sidebar-user[data-tooltip]:hover::after,
body.sidebar-collapsed .sidebar-user[data-tooltip]:hover::before {
  opacity: 1;
}

body.sidebar-collapsed .nav-item[data-tooltip]:hover::after,
body.sidebar-collapsed .sidebar-user[data-tooltip]:hover::after {
  transform: translateY(-50%) translateX(0);
}

body.sidebar-collapsed .nav-item[data-tooltip]:hover::before,
body.sidebar-collapsed .sidebar-user[data-tooltip]:hover::before {
  transform: translateY(-50%) rotate(45deg) translateX(0);
}

body.sidebar-collapsed .nav-item .badge,
body.sidebar-collapsed .nav-unread-badge,
body.sidebar-collapsed .logout-btn {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  visibility: hidden;
}

body.sidebar-collapsed .sidebar-footer {
  padding: 12px 10px;
}

body.sidebar-collapsed .sidebar-user {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
  position: relative;
  border-radius: 16px;
}

body.sidebar-collapsed .session-timer {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  overflow: hidden;
}

.overview-picker-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0)),
    linear-gradient(135deg, rgba(17, 18, 33, 0.94), rgba(22, 24, 40, 0.98));
  color: var(--text);
  cursor: pointer;
  transition: border-color var(--t), transform 0.18s ease, box-shadow 0.18s ease, background var(--t);
}

.overview-picker-button:hover {
  border-color: var(--border-gold);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.24);
}

.overview-picker-button:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.overview-picker-button-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.overview-picker-button-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(188, 163, 111, 0.10);
  border: 1px solid rgba(188, 163, 111, 0.14);
  color: var(--gold-light);
}

.overview-picker-button-icon svg {
  width: 18px;
  height: 18px;
}

.overview-meta {
  margin-left: auto;
  min-width: 220px;
}

.overview-meta-value {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

.overview-meta-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.overview-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: grab;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, opacity 0.22s ease;
}

.overview-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-2);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

.overview-card.dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.overview-card.drag-over {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.overview-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(90, 112, 91, 0.20), rgba(188, 163, 111, 0.08));
  color: var(--gold-light);
  border: 1px solid rgba(188, 163, 111, 0.18);
}

.overview-card-icon svg {
  width: 18px;
  height: 18px;
}

.overview-card-handle {
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

.overview-card-title {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.overview-card-value {
  font-size: 30px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
}

.overview-card-note {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.45;
}

.stats-panels {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.stats-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stats-panel-meta {
  font-size: 12px;
  color: var(--text-3);
}

.stats-section {
  overflow: hidden;
}

.stats-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.stats-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.stats-section-arrow {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  transition: transform var(--t), border-color var(--t), color var(--t);
}

.stats-section-arrow svg {
  width: 18px;
  height: 18px;
}

.stats-section.open .stats-section-arrow {
  transform: rotate(180deg);
  color: var(--gold-light);
  border-color: var(--border-gold);
}

.stats-section-body {
  display: none;
  padding: 0 22px 22px;
  border-top: 1px solid var(--border);
}

.stats-section.open .stats-section-body {
  display: block;
}

.stats-orders-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.stats-search-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 520px;
  min-width: min(100%, 360px);
}

.stats-search-scope {
  flex: 0 0 170px;
  max-width: 170px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color var(--t), box-shadow var(--t);
}

.stats-search-scope:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.stats-search-input {
  min-width: 220px;
  max-width: none;
  width: auto;
  flex: 1 1 auto;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}

.stats-search-input:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.stats-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.stats-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
}

.stats-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stats-filter-input {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text);
  outline: none;
  font-size: 13px;
  transition: border-color var(--t), box-shadow var(--t);
}

.stats-filter-input:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.stats-filter-clear {
  align-self: flex-end;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: color var(--t), border-color var(--t);
  white-space: nowrap;
}

.stats-filter-clear:hover {
  color: var(--text);
  border-color: var(--text-3);
}

.stats-orders-table {
  min-width: 1220px;
  table-layout: fixed;
}

.stats-orders-table th:nth-child(1),
.stats-orders-table td:nth-child(1) { width: 12%; }
.stats-orders-table th:nth-child(2),
.stats-orders-table td:nth-child(2) { width: 8%; }
.stats-orders-table th:nth-child(3),
.stats-orders-table td:nth-child(3) { width: 12%; }
.stats-orders-table th:nth-child(4),
.stats-orders-table td:nth-child(4) { width: 12%; }
.stats-orders-table th:nth-child(5),
.stats-orders-table td:nth-child(5) { width: 11%; }
.stats-orders-table th:nth-child(6),
.stats-orders-table td:nth-child(6) { width: 13%; }
.stats-orders-table th:nth-child(7),
.stats-orders-table td:nth-child(7) { width: 17%; }
.stats-orders-table th:nth-child(8),
.stats-orders-table td:nth-child(8) { width: 4%; }
.stats-orders-table th:nth-child(9),
.stats-orders-table td:nth-child(9) { width: 11%; }
.stats-orders-table td:nth-child(9) {
  text-align: right;
  font-weight: 600;
}

.stats-orders-table .stats-col-date { width: 12%; }
.stats-orders-table .stats-col-status { width: 8%; }
.stats-orders-table .stats-col-client { width: 12%; }
.stats-orders-table .stats-col-car { width: 12%; }
.stats-orders-table .stats-col-opened { width: 11%; }
.stats-orders-table .stats-col-master { width: 13%; }
.stats-orders-table .stats-col-service { width: 17%; }
.stats-orders-table .stats-col-extras { width: 4%; }
.stats-orders-table .stats-col-sum { width: 11%; }

.stats-client-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-cell-sub {
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-orders-table td {
  vertical-align: middle;
}

.stats-orders-table .stats-col-client,
.stats-orders-table .stats-col-opened,
.stats-orders-table .stats-col-master,
.stats-orders-table .stats-col-car,
.stats-orders-table .stats-col-sum {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-orders-table .stats-col-sum {
  font-weight: 600;
  text-align: right;
}

.stats-person-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.stats-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(188, 163, 111, 0.12);
  border: 1px solid rgba(188, 163, 111, 0.18);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stats-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.stats-status-closed {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.20);
  color: #7de2a0;
}

.stats-status-open {
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.20);
  color: #8ab8ff;
}

.stats-status-cancelled {
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.20);
  color: #ff9a9a;
}

.stats-date-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stats-date-main {
  color: var(--text);
  font-weight: 600;
}

.stats-date-sub {
  color: var(--text-3);
  font-size: 12px;
}

.stats-services-list {
  max-width: 360px;
  color: var(--text-2);
}

.stats-empty-cell {
  text-align: center;
  color: var(--text-3);
  padding: 26px 14px;
}

.stats-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

.stats-sort-btn::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.18;
  transform: translateY(1px);
}

.stats-sort-btn.active::after {
  opacity: 0.9;
}

.stats-sort-btn.active[data-dir="asc"]::after {
  transform: rotate(180deg) translateY(1px);
}

.stats-sort-btn:hover {
  color: var(--text);
}

/* ── Coming soon ─────────────────────────────────────────────────────────── */
.coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
}
.coming-soon svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.3; }
.coming-soon h3  { font-size: 16px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.coming-soon p   { font-size: 13px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--text);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 340px;
  animation: toastIn 0.2s ease forwards;
}
.toast.removing { animation: toastOut 0.2s ease forwards; }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; }
.toast-success { border-left: 3px solid var(--success); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--gold); }
.toast-success svg { color: var(--success); }
.toast-error   svg { color: var(--danger); }
.toast-info    svg { color: var(--gold); }

@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(20px); } }

/* ── Divider ─────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.rebuild-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}
.rebuild-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.4s ease;
}

/* ── Utility ─────────────────────────────────────────────────────────────── */
.text-gold    { color: var(--gold); }
.text-muted   { color: var(--text-3); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.flex         { display: flex; }
.flex-center  { display: flex; align-items: center; justify-content: center; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.mt-4         { margin-top: 4px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mb-4         { margin-bottom: 4px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.fs-12        { font-size: 12px; }
.fs-13        { font-size: 13px; }
.fw-500       { font-weight: 500; }
.fw-600       { font-weight: 600; }
.w-full       { width: 100%; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --header-h: auto; }
  body.sidebar-open {
    overflow: hidden;
    touch-action: none;
  }
  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .sidebar {
    width: min(290px, calc(100vw - 28px));
    transform: translateX(-110%);
    border-right-color: var(--border-2);
    box-shadow: 24px 0 60px rgba(0, 0, 0, 0.34);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .content {
    padding: 14px 14px 24px;
    max-width: none;
  }
  .card,
  .welcome-card,
  .kpi-hero,
  .messenger-sidebar,
  .messenger-main {
    border-radius: 20px;
  }
  .card { padding: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .header {
    min-height: 64px;
    height: auto;
    padding: 12px 14px;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .mobile-menu-btn { display: inline-flex; }
  .header-title {
    width: 100%;
    font-size: 18px;
    line-height: 1.25;
    order: 2;
  }
  .header-sub {
    display: block;
    margin: 4px 0 0;
    line-height: 1.45;
  }
  .header > .btn,
  .header > .header-actions,
  .header > [id^="btn-"],
  .header > [style*="margin-left:auto"] {
    order: 3;
    width: 100%;
    margin-left: 0 !important;
  }
  .header-actions,
  .header > [style*="margin-left:auto"] {
    justify-content: stretch;
  }
  .header-actions > *,
  .header > [style*="margin-left:auto"] > * {
    flex: 1 1 140px;
  }
  .header > .btn {
    width: 100%;
    justify-content: center;
  }
  .welcome-card {
    padding: 18px;
  }
  .welcome-card h2 {
    font-size: 18px;
    line-height: 1.25;
  }
  .welcome-card p {
    line-height: 1.55;
  }
  .login-card { padding: 24px 20px; }
  .overview-toolbar {
    align-items: stretch;
    gap: 12px;
  }
  .overview-toolbar > *,
  .overview-toolbar > .overview-pickers {
    width: 100%;
  }
  .period-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }
  .period-chip {
    justify-content: center;
    padding: 11px 10px;
  }
  .overview-pickers {
    width: 100%;
    gap: 10px;
  }
  .overview-picker {
    min-width: 0;
    width: 100%;
  }
  .overview-picker-button {
    padding: 12px 14px;
    border-radius: 14px;
  }
  .overview-picker-button-text {
    font-size: 15px;
  }
  .overview-picker-button-icon {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }
  .overview-meta { margin-left: 0; min-width: 100%; }
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .stats-panels { grid-template-columns: 1fr; }
  .overview-picker {
    min-height: 72px;
  }
  .overview-native-input {
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.01;
    pointer-events: auto;
    z-index: 3;
    cursor: pointer;
  }
  .overview-picker-button {
    pointer-events: none;
  }
  .stats-section-toggle {
    padding: 16px 18px;
    align-items: flex-start;
  }
  .stats-section-body {
    padding: 0 16px 16px;
  }
  .stats-orders-toolbar {
    justify-content: stretch;
    gap: 12px;
  }
  .stats-orders-toolbar > * {
    width: 100%;
  }
  .stats-search-shell { min-width: 0; flex-basis: 100%; }
  .stats-search-scope { flex-basis: 150px; max-width: 150px; }
  .stats-search-input { min-width: 0; max-width: none; }
  .stats-section-heading { flex-direction: column; align-items: flex-start; }
  th {
    padding: 9px 12px;
    font-size: 11px;
  }
  td {
    padding: 10px 12px;
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  .content {
    padding: 12px 12px 22px;
  }
  .overview-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .period-switch {
    grid-template-columns: 1fr;
  }
  .stats-search-shell { flex-direction: column; align-items: stretch; }
  .stats-search-scope { max-width: none; width: 100%; }
  .stats-search-input { width: 100%; }
  .header-title {
    font-size: 17px;
  }
  .card {
    padding: 16px;
  }
  .modal {
    border-radius: 20px;
  }
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .modal-footer {
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideLeft {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes shimmer {
  0%        { transform: translateX(-100%); }
  60%, 100% { transform: translateX(220%); }
}
@keyframes floatOrb {
  0%, 100% { transform: translateY(0)    scale(1);    opacity: 0.6; }
  50%       { transform: translateY(-36px) scale(1.08); opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 16px var(--gold-glow), var(--shadow); }
  50%       { box-shadow: 0 0 32px rgba(90, 112, 91, 0.35), var(--shadow); }
}
@keyframes bonusReveal {
  from { opacity: 0; transform: scale(0.8) translateY(6px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

/* ── Utility animation classes ──────────────────────────────────────────── */
.anim       { opacity: 0; animation: fadeUp  0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.anim-fade  { opacity: 0; animation: fadeIn  0.4s ease forwards; }
.anim-scale { opacity: 0; animation: scaleIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards; }

.anim-d1 { animation-delay: 0.06s; }
.anim-d2 { animation-delay: 0.12s; }
.anim-d3 { animation-delay: 0.18s; }
.anim-d4 { animation-delay: 0.24s; }
.anim-d5 { animation-delay: 0.30s; }
.anim-d6 { animation-delay: 0.38s; }

/* ── App shell entrance ─────────────────────────────────────────────────── */
.sidebar { animation: slideLeft 0.38s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.main    { opacity: 0; animation: fadeIn 0.35s 0.08s ease forwards; }

/* ── Nav active indicator ───────────────────────────────────────────────── */
.nav-item { position: relative; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
  animation: scaleIn 0.22s ease forwards;
}

/* ── Logo mark glow ─────────────────────────────────────────────────────── */

/* ── Login page entrance ────────────────────────────────────────────────── */
.login-logo {
  animation: fadeUp 0.52s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.login-card {
  opacity: 0;
  animation: fadeUp 0.5s 0.12s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.login-page > .login-footer {
  opacity: 0;
  animation: fadeIn 0.4s 0.3s ease forwards;
}
/* Background floating orbs */
.bg-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: floatOrb var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

/* ── Welcome card shimmer ───────────────────────────────────────────────── */
.welcome-card { overflow: hidden; }
.welcome-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 45%;
  background: linear-gradient(90deg, transparent, rgba(90,112,91,0.08), transparent);
  animation: shimmer 5s ease-in-out infinite 2s;
  pointer-events: none;
}

/* ── Stat cards ─────────────────────────────────────────────────────────── */
.stat-card {
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}
.stat-card::before { transition: opacity 0.25s ease; }

/* ── Cards general hover ────────────────────────────────────────────────── */
.metric-card, .stat-mini {
  transition: transform 0.22s ease, border-color 0.2s ease, box-shadow 0.22s ease;
}
.metric-card:hover, .stat-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.3);
}

/* ── KPI-specific ───────────────────────────────────────────────────────── */
.kpi-gauge-wrap  { opacity: 0; animation: scaleIn 0.5s 0.1s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.kpi-hero-info   { opacity: 0; animation: fadeUp  0.45s 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards; }
.kpi-bonus-amount{ opacity: 0; animation: bonusReveal 0.55s 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* ── Table rows stagger ─────────────────────────────────────────────────── */
tbody tr { opacity: 0; animation: fadeIn 0.28s ease forwards; }
tbody tr:nth-child(1)  { animation-delay: 0.04s; }
tbody tr:nth-child(2)  { animation-delay: 0.08s; }
tbody tr:nth-child(3)  { animation-delay: 0.12s; }
tbody tr:nth-child(4)  { animation-delay: 0.16s; }
tbody tr:nth-child(5)  { animation-delay: 0.20s; }
tbody tr:nth-child(6)  { animation-delay: 0.24s; }
tbody tr:nth-child(7)  { animation-delay: 0.28s; }
tbody tr:nth-child(8)  { animation-delay: 0.32s; }
tbody tr:nth-child(n+9){ animation-delay: 0.36s; }

/* ── Button press feel ──────────────────────────────────────────────────── */
.btn { transition: all 0.18s ease; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn-primary:active:not(:disabled) { transform: scale(0.97) translateY(0) !important; }

/* ── Accessibility ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   KPI PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.kpi-gauge-wrap { position: relative; width: 164px; height: 164px; flex-shrink: 0; }
.kpi-gauge { width: 100%; height: 100%; }
.kpi-gauge-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.kpi-pct-value { font-size: 30px; font-weight: 700; color: var(--text); line-height: 1; }
.kpi-pct-label { font-size: 10px; color: var(--text-3); letter-spacing: 0.12em; text-transform: uppercase; }

.kpi-hero {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-xl);
  padding: 28px; display: flex; align-items: center; gap: 32px; margin-bottom: 20px;
}
.kpi-hero-info { flex: 1; }
.kpi-hero-info .employee-name { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.kpi-hero-info .month-label   { font-size: 12px; color: var(--text-3); margin-bottom: 20px; }
.kpi-bonus-block {
  background: var(--bg-3); border: 1px solid var(--border-gold); border-radius: var(--r-lg);
  padding: 16px 20px; display: inline-flex; flex-direction: column; gap: 3px;
}
.kpi-bonus-label  { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.kpi-bonus-amount { font-size: 26px; font-weight: 700; color: var(--gold-light); line-height: 1; }
.kpi-bonus-max    { font-size: 11px; color: var(--text-3); }

.kpi-formula {
  background: var(--bg-3); border: 1px solid var(--border); border-radius: var(--r);
  padding: 11px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 14px; line-height: 1.7;
}
.kpi-formula .f-val    { color: var(--gold-light); font-weight: 600; }
.kpi-formula .f-result { color: var(--text); font-weight: 700; }

.metric-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.metric-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; transition: border-color var(--t);
}
.metric-card:hover { border-color: var(--border-2); }
.mc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.mc-title { font-size: 13px; font-weight: 500; color: var(--text-2); line-height: 1.4; max-width: 160px; }
.mc-weight {
  font-size: 11px; color: var(--text-3); background: var(--bg-4); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 9px; flex-shrink: 0;
}
.mc-values { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.mc-actual { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; }
.mc-target-info { font-size: 12px; color: var(--text-3); }
.mc-bar-wrap { height: 5px; background: var(--bg-5); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.mc-bar { height: 100%; border-radius: 3px; transition: width 0.6s ease; background: var(--gold); }
.mc-bar.good { background: var(--success); }
.mc-bar.ok   { background: var(--warning); }
.mc-bar.bad  { background: var(--danger); }
.mc-footer   { display: flex; align-items: center; justify-content: space-between; }
.mc-pct      { font-size: 13px; font-weight: 600; }
.mc-pct.good { color: var(--success); } .mc-pct.ok { color: var(--warning); } .mc-pct.bad { color: var(--danger); }
.mc-unit     { font-size: 11px; color: var(--text-3); }

.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat-mini { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; }
.stat-mini .sm-val   { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 5px; }
.stat-mini .sm-label { font-size: 12px; color: var(--text-3); }

.quality-score-line { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.quality-score-val { font-size: 32px; font-weight: 700; }
.quality-score-val.good { color: var(--success); } .quality-score-val.ok { color: var(--warning); } .quality-score-val.bad { color: var(--danger); }
.quality-deduction-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; background: var(--bg-3); border: 1px solid var(--border);
  border-radius: var(--r); margin-bottom: 8px;
}
.qd-reason { flex: 1; font-size: 13px; color: var(--text-2); }
.qd-amount { font-size: 13px; font-weight: 600; color: var(--danger); white-space: nowrap; }
.qd-meta   { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.qd-remove { background: none; border: none; color: var(--text-3); padding: 4px; border-radius: 4px; cursor: pointer; display: flex; }
.qd-remove:hover { color: var(--danger); }
.quality-empty { text-align: center; padding: 20px; color: var(--text-3); font-size: 13px; }

.preset-btns { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.preset-btn {
  background: var(--bg-4); border: 1px solid var(--border-2); color: var(--text-2);
  border-radius: var(--r); padding: 6px 12px; font-size: 12px; cursor: pointer;
  transition: all var(--t); font-family: inherit;
}
.preset-btn:hover { background: var(--bg-5); border-color: var(--gold); color: var(--text); }

.no-data-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  color: var(--text-3); background: var(--bg-4); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px;
}
.kpi-pct-cell { font-size: 14px; font-weight: 700; }
.kpi-pct-cell.good { color: var(--success); } .kpi-pct-cell.ok { color: var(--warning); } .kpi-pct-cell.bad { color: var(--danger); }

.detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.back-btn {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3);
  background: none; border: none; cursor: pointer; padding: 6px 10px;
  border-radius: var(--r-sm); transition: all var(--t); font-family: inherit;
}
.back-btn:hover { background: var(--bg-3); color: var(--text); }
.back-btn svg { width: 14px; height: 14px; }

.kpi-dash-widget {
  background: var(--bg-2); border: 1px solid var(--border-gold); border-radius: var(--r-lg);
  padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  text-decoration: none; transition: border-color var(--t), transform var(--t); margin-bottom: 20px;
}
.kpi-dash-widget:hover { border-color: var(--gold-light); transform: translateY(-1px); }
.kpi-dash-left { flex: 1; }
.kpi-dash-title { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.kpi-dash-val   { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; }
.kpi-dash-bonus { font-size: 13px; color: var(--gold-light); font-weight: 500; }
.kpi-dash-month { font-size: 11px; color: var(--text-3); }
.kpi-dash-arrow { color: var(--gold); opacity: 0.6; }

@media (max-width: 768px) {
  .kpi-hero { flex-direction: column; align-items: stretch; }
  .kpi-gauge-wrap { margin: 0 auto; }
  .kpi-header-actions {
    gap: 8px;
  }
  .kpi-header-actions > * {
    flex: 1 1 140px;
    min-width: 0;
  }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .quality-score-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .detail-header {
    flex-wrap: wrap;
    margin-bottom: 18px;
  }
}
@media (max-width: 480px) {
  .metric-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }
  .kpi-hero {
    padding: 18px;
  }
  .kpi-bonus-block {
    width: 100%;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   MESSENGER
   ══════════════════════════════════════════════════════════════════════════ */

.nav-unread-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.messenger-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 132px);
}

.messenger-sidebar,
.messenger-main {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  min-height: 0;
}

.messenger-sidebar {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.messenger-sidebar-top {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.messenger-sidebar-meta {
  font-size: 12px;
  color: var(--text-3);
}

.messenger-field input {
  padding-left: 14px !important;
}

.messenger-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messenger-conversation-item,
.messenger-search-hit {
  width: 100%;
  text-align: left;
  background: var(--bg-3);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--r);
  padding: 12px 13px;
  transition: border-color var(--t), transform var(--t), background var(--t);
}

.messenger-conversation-item:hover,
.messenger-search-hit:hover {
  border-color: var(--border-2);
  background: var(--bg-4);
}

.messenger-conversation-item.active {
  border-color: var(--border-gold);
  box-shadow: 0 0 0 1px rgba(90, 112, 91, 0.18) inset;
}

.messenger-conversation-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.messenger-conversation-title,
.messenger-search-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.messenger-conversation-snippet,
.messenger-search-snippet {
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 4px;
  line-height: 1.45;
}

.messenger-conversation-meta,
.messenger-search-meta,
.messenger-picker-meta,
.messenger-soft-note {
  font-size: 11.5px;
  color: var(--text-3);
}

.messenger-unread-pill,
.messenger-unread-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  white-space: nowrap;
}

.messenger-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.messenger-main-empty,
.messenger-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-3);
  padding: 32px;
  gap: 10px;
}

.messenger-main-empty svg {
  width: 42px;
  height: 42px;
  color: var(--gold);
}

.messenger-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.messenger-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.messenger-title-line h2 {
  font-size: 18px;
  line-height: 1.2;
}

.messenger-participants {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-3);
  color: var(--text-2);
  border: 1px solid var(--border);
  font-size: 12px;
}

.messenger-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.messenger-thread-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}

.messenger-thread-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
  flex-shrink: 0;
}

.messenger-thread-chip.active {
  border-color: var(--border-gold);
}

.messenger-thread-main,
.messenger-thread-pin {
  background: transparent;
  color: var(--text);
  border: none;
  padding: 8px 10px;
}

.messenger-thread-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.messenger-thread-pin {
  color: var(--gold-light);
  border-left: 1px solid var(--border);
}

.messenger-thread-pinmark {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.messenger-tools {
  padding: 12px 20px 0;
}

.messenger-message-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}

.messenger-message-row {
  display: flex;
}

.messenger-message-row.mine {
  justify-content: flex-end;
}

.messenger-message-bubble {
  max-width: min(720px, 82%);
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px 12px;
}

.messenger-message-row.mine .messenger-message-bubble {
  background: rgba(90, 112, 91, 0.12);
  border-color: var(--border-gold);
}

.messenger-message-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 6px;
}

.messenger-message-text {
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
}

.messenger-composer {
  border-top: 1px solid var(--border);
  padding: 14px 20px 18px;
}

.messenger-composer-meta {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.messenger-composer-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.messenger-composer textarea {
  width: 100%;
  resize: vertical;
  min-height: 86px;
  max-height: 180px;
  padding: 12px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  outline: none;
}

.messenger-composer textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.messenger-picker {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.messenger-picker-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg-3);
}

.messenger-picker-item input {
  margin-top: 2px;
}

.messenger-files-panel {
  margin: 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-3);
}

.messenger-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.messenger-files-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.messenger-files-list {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.messenger-file-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg-4);
}

.messenger-file-card-main {
  min-width: 0;
}

.messenger-file-card-name,
.messenger-message-file-name,
.messenger-attachment-pill-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

.messenger-file-card-meta,
.messenger-message-file-size {
  font-size: 11.5px;
  color: var(--text-3);
}

.messenger-message-files {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.messenger-message-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  text-decoration: none;
}

.messenger-message-file:hover {
  border-color: var(--border-gold);
  background: rgba(90, 112, 91, 0.08);
}

.messenger-attachment-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.messenger-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-3);
}

.messenger-attachment-pill button {
  border: none;
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0;
}

.messenger-composer-actions {
  display: grid;
  gap: 10px;
  align-content: start;
}

.messenger-mobile-list-btn,
.messenger-mobile-back {
  display: none;
}

@media (max-width: 1024px) {
  .messenger-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .messenger-mobile-list-btn,
  .messenger-mobile-back {
    display: inline-flex;
  }

  .messenger-layout {
    display: block;
    min-height: auto;
  }

  .messenger-layout.mobile-panel-active .messenger-sidebar {
    display: none;
  }

  .messenger-layout.mobile-list-active .messenger-main {
    display: none;
  }

  .messenger-sidebar-top,
  .messenger-header,
  .messenger-thread-bar,
  .messenger-tools,
  .messenger-message-list,
  .messenger-composer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .messenger-header {
    flex-direction: column;
    padding-top: 14px;
    gap: 12px;
  }

  .messenger-title-line {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
  }

  .messenger-title-line h2 {
    font-size: 16px;
    width: 100%;
  }

  .messenger-actions {
    width: 100%;
  }

  .messenger-actions .btn {
    flex: 1 1 140px;
    justify-content: center;
  }

  .messenger-files-panel {
    margin: 0 14px;
  }

  .messenger-main-empty,
  .messenger-empty-state {
    padding: 24px 16px;
  }

  .messenger-composer-row {
    grid-template-columns: 1fr;
  }

  .messenger-message-bubble {
    max-width: 100%;
  }

  .messenger-file-card,
  .messenger-message-file {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .messenger-actions .btn,
  .messenger-composer-actions .btn {
    width: 100%;
  }
}
