/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #1e3a5f;
  --primary-hover:  #162d4a;
  --primary-light:  #2d5986;
  --primary-soft:   #e8f0fb;
  --accent:         #f59e0b;
  --accent-light:   #fef3c7;
  --success:        #059669;
  --success-soft:   #d1fae5;
  --warning:        #d97706;
  --warning-soft:   #fef3c7;
  --danger:         #dc2626;
  --danger-soft:    #fee2e2;
  --info:           #0284c7;
  --info-soft:      #e0f2fe;
  --bg:             #f0f4f8;
  --surface:        #ffffff;
  --border:         #e2e8f0;
  --border-dark:    #cbd5e1;
  --text:           #0f172a;
  --text-muted:     #64748b;
  --text-light:     #94a3b8;
  --sidebar-w:      260px;
  --header-h:       64px;
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:         0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md:      0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg:      0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04);
  --transition:     all 0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.w-full { width: 100%; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(-45deg, #0f172a, #1e3a5f, #1a3a6e, #0d2444);
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
}

@keyframes gradientShift {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.login-bg-anim {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(245,158,11,0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(59,130,246,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.1);
  animation: loginSlideUp 0.5s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.login-logo svg { flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); }

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.2;
}

.login-logo p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.login-error {
  background: var(--danger-soft);
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-left: 4px solid var(--danger);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.field-group { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.25rem; }
.field-group label { font-size: 0.875rem; font-weight: 600; color: var(--text); }

.field-group input,
.field-group select,
.field-group textarea {
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: var(--transition);
  width: 100%;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.1);
}

.field-group input::placeholder { color: var(--text-light); }
.field-group textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.password-field { position: relative; }
.password-field input { padding-right: 5rem; }
.pwd-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; font-size: 0.8rem; font-weight: 600;
  color: var(--primary-light); cursor: pointer; padding: 0.25rem 0.5rem;
}

.btn-login {
  width: 100%;
  padding: 0.85rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.3px;
  margin-top: 0.5rem;
}

.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(30,58,95,0.3); }
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* ===== OVERLAY / MODAL ===== */
.overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.75rem;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}

.modal-large { max-width: 760px; }
.modal-xl    { max-width: 920px; }

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-icon { font-size: 2.5rem; text-align: center; margin-bottom: 0.75rem; }
.modal-card h2 { font-size: 1.3rem; font-weight: 700; color: var(--primary); margin-bottom: 0.5rem; text-align: center; }
.modal-card > p { color: var(--text-muted); font-size: 0.9rem; text-align: center; margin-bottom: 1.5rem; }

.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: var(--bg); border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ===== APP SHELL ===== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.25s ease, transform 0.3s ease;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-info { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 1.25rem 0 1rem; }
.sidebar.collapsed .sidebar-collapse-btn { margin-left: 0; transform: rotate(180deg); }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0.7rem; }
.sidebar.collapsed .nav-icon { width: auto; }
.sidebar.collapsed .sidebar-user { justify-content: center; }
.sidebar.collapsed .btn-logout { padding: 0.6rem; display: flex; justify-content: center; }
.sidebar.collapsed .logout-icon { display: inline; }
.sidebar.collapsed ~ .main-content { margin-left: 64px; }

.sidebar-collapse-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  transition: var(--transition);
  line-height: 1;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }

.logout-icon { display: none; font-size: 1rem; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.5rem;
}

.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 1rem; font-weight: 800; color: #fff; line-height: 1.2; }
.brand-sub  { font-size: 0.7rem; color: rgba(255,255,255,0.55); margin-top: 1px; }

.sidebar-nav {
  flex: 1;
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: rgba(255,255,255,0.65);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-item:hover { background: rgba(255,255,255,0.1); color: #fff; }

.nav-item.active {
  background: rgba(245,158,11,0.2);
  color: #fff;
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }

.unread-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.unread-badge.hidden { display: none; }

.feedback-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.feedback-btn:hover { background: rgba(245,158,11,0.25); color: #fff; }
.sidebar.collapsed .feedback-btn { justify-content: center; padding: 0.65rem; }

/* ===== INBOX ===== */
.inbox-list { display: flex; flex-direction: column; gap: 0.75rem; }
.inbox-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  cursor: pointer;
  transition: var(--transition);
}
.inbox-item:hover { box-shadow: var(--shadow); border-color: var(--primary); }
.inbox-item.unread { border-left: 3px solid var(--primary); background: #f0f4ff; }
.inbox-item-icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 0.1rem; }
.inbox-item-body { flex: 1; min-width: 0; }
.inbox-item-from { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.inbox-item-subject { font-weight: 700; font-size: 0.95rem; color: var(--text); }
.inbox-item-preview { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-item-time { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }

.sidebar-footer {
  padding: 1rem 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 38px; height: 38px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--primary);
  flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 0.875rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.75rem; color: rgba(255,255,255,0.5); }

.btn-logout {
  width: 100%;
  padding: 0.6rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.btn-logout:hover { background: rgba(220,38,38,0.3); border-color: rgba(220,38,38,0.5); color: #fff; }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--primary);
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  box-shadow: var(--shadow);
}

.hamburger { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; padding: 0.25rem; }
.mobile-brand { flex: 1; font-size: 1rem; font-weight: 800; color: #fff; }
.mobile-avatar { width: 32px; height: 32px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.8rem; color: var(--primary); }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}

.page-container {
  flex: 1;
  padding: 2rem 2.5rem;
  width: 100%;
  animation: pageIn 0.3s ease;
}

@keyframes pageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.page-header-left p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.page-header-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2rem;
}

/* ===== DASHBOARD TWO-COLUMN LAYOUT ===== */
.dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.75rem;
  align-items: start;
}

.events-panel {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: sticky;
  top: 2rem;
}

.events-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.events-panel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.events-list { padding: 0.5rem 0; max-height: 520px; overflow-y: auto; }

.event-item {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  transition: var(--transition);
}
.event-item:last-child { border-bottom: none; }
.event-item:hover { background: var(--bg); }

.event-date-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  padding: 0.3rem 0.5rem;
  text-align: center;
  min-width: 42px;
  flex-shrink: 0;
}
.event-date-badge .ev-month { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }
.event-date-badge .ev-day   { font-size: 1.1rem; font-weight: 800; line-height: 1.1; }

.event-body { flex: 1; min-width: 0; }
.event-title { font-size: 0.875rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-note  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }

.event-add-form {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}
.event-add-form.open { display: flex; }
.event-add-form input, .event-add-form textarea {
  width: 100%;
  padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text);
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}

.stat-card.blue::before   { background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.stat-card.amber::before  { background: linear-gradient(90deg, var(--accent), #fbbf24); }
.stat-card.green::before  { background: linear-gradient(90deg, var(--success), #10b981); }
.stat-card.purple::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }

.stat-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: block;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

.stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-subtitle {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* ===== SECTION HEADER (within forms) ===== */
.section-header {
  padding: 0.6rem 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: 0;
}

.section-body {
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

/* ===== FORM GRID ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
}

.form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.col-full { grid-column: 1 / -1; }

/* ===== BUTTONS ===== */
button, .btn { font-family: inherit; cursor: pointer; transition: var(--transition); border: none; outline: none; }

.btn-primary {
  padding: 0.65rem 1.25rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(30,58,95,0.25); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  padding: 0.65rem 1.25rem;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-secondary:hover { background: var(--bg); border-color: var(--border-dark); }

.btn-danger {
  padding: 0.65rem 1.25rem;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.btn-success {
  padding: 0.65rem 1.25rem;
  background: var(--success);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn-success:hover { background: #047857; transform: translateY(-1px); }

.btn-sm { padding: 0.4rem 0.8rem !important; font-size: 0.8rem !important; }
.btn-icon { padding: 0.5rem !important; border-radius: var(--radius-sm) !important; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-active   { background: var(--success-soft); color: #065f46; }
.badge-pending  { background: var(--warning-soft); color: #78350f; }
.badge-closed   { background: var(--border); color: var(--text-muted); }
.badge-approved { background: var(--success-soft); color: #065f46; }
.badge-denied   { background: var(--danger-soft); color: #991b1b; }
.badge-info     { background: var(--info-soft); color: #075985; }
.badge-hold     { background: #ede9fe; color: #5b21b6; }

/* ===== SEARCH BAR ===== */
.search-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(30,58,95,0.08);
}

.search-bar input {
  flex: 1;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
}

.search-bar input::placeholder { color: var(--text-light); }

/* ===== CLIENT LIST ===== */
.client-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  gap: 1rem;
}

.client-list-item:last-child { border-bottom: none; }
.client-list-item:hover { background: var(--bg); }

.client-avatar {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.client-info { flex: 1; min-width: 0; }
.client-name { font-weight: 700; color: var(--text); font-size: 0.95rem; }
.client-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ===== CASE CARDS ===== */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.case-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  cursor: pointer;
  transition: var(--transition);
}

.case-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.case-card.active-case { border-left-color: var(--success); }
.case-card.pending-case { border-left-color: var(--accent); }
.case-card.closed-case { border-left-color: var(--text-muted); }
.case-card.hold-case { border-left-color: #7c3aed; }

.case-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  gap: 0.5rem;
}

.case-card-id { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.case-card-date { font-size: 0.75rem; color: var(--text-light); white-space: nowrap; }

.case-row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.case-row:last-child { border-bottom: none; }
.case-row-label { font-weight: 600; color: var(--text-muted); }
.case-row-value { color: var(--text); text-align: right; max-width: 60%; }

.services-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }

.service-tag {
  background: var(--primary-soft);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.add-case-card {
  background: linear-gradient(135deg, #f8faff, #eef2ff);
  border-radius: var(--radius);
  padding: 1.5rem;
  border: 2px dashed var(--border-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  cursor: pointer;
  transition: var(--transition);
  gap: 0.75rem;
  text-align: center;
}

.add-case-card:hover { border-color: var(--primary-light); background: linear-gradient(135deg, #eef2ff, #e8f0fb); transform: translateY(-2px); }
.add-case-card .plus { font-size: 2rem; color: var(--primary-light); }
.add-case-card span { font-size: 0.9rem; font-weight: 600; color: var(--primary); }

/* ===== FA CARDS ===== */
.fa-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  cursor: pointer;
  transition: var(--transition);
}

.fa-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.fa-card.approved { border-left-color: var(--success); }
.fa-card.denied { border-left-color: var(--danger); }

/* ===== NOTES ===== */
.note-item {
  background: #f8faff;
  border-left: 3px solid var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
}

.note-meta { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.4rem; display: flex; gap: 0.75rem; align-items: center; }
.note-author { font-weight: 700; color: var(--primary); }
.note-text { font-size: 0.9rem; color: var(--text); line-height: 1.5; }

/* ===== PROFILE HEADER ===== */
.profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 60%, #3d7cc9 100%);
  border-radius: var(--radius);
  padding: 2rem;
  color: #fff;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute; top: -50%; right: -10%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.profile-hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }

.profile-avatar-large {
  width: 64px; height: 64px;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.profile-name { font-size: 1.6rem; font-weight: 800; line-height: 1.2; }
.profile-sub  { font-size: 0.875rem; opacity: 0.8; margin-top: 0.25rem; }

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.profile-meta-item { }
.profile-meta-label { font-size: 0.7rem; opacity: 0.65; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.profile-meta-value { font-size: 0.9rem; font-weight: 600; margin-top: 0.1rem; }

/* ===== TABS ===== */
.tab-bar {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.5rem;
  gap: 0;
}

.tab-btn {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn:hover:not(.active) { color: var(--text); background: var(--bg); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ===== FPL TABLE ===== */
.fpl-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.fpl-table th { background: var(--primary); color: #fff; padding: 0.75rem 1rem; text-align: left; font-weight: 700; position: sticky; top: 0; }
.fpl-table th:not(:first-child) { text-align: right; }
.fpl-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.fpl-table td:not(:first-child) { text-align: right; }
.fpl-table tr:hover td { background: var(--bg); }
.fpl-table tr:nth-child(even) td { background: #fafbfc; }
.fpl-table tr:nth-child(even):hover td { background: var(--bg); }
.fpl-table td:first-child { font-weight: 700; }

/* ===== ADMIN TABLE ===== */
.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  gap: 1rem;
  flex-wrap: wrap;
}

.user-row.admin-row { border-left-color: var(--accent); }

/* ===== ACTIVE CASES DASHBOARD CARDS ===== */
.dash-case-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--success);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.dash-case-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.dash-case-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.dash-case-card p  { font-size: 0.82rem; color: var(--text-muted); }

/* ===== INLINE EDIT ===== */
.inline-edit-btn {
  padding: 0.3rem 0.6rem;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(30,58,95,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
}

.inline-edit-btn:hover { background: var(--primary); color: #fff; }

/* ===== CHECKBOX GROUPS ===== */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.check-item:hover { border-color: var(--primary-light); background: var(--primary-soft); }
.check-item input[type="checkbox"] { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.check-item label { font-size: 0.875rem; cursor: pointer; line-height: 1.4; }
.check-item label strong { display: block; font-size: 0.9rem; color: var(--primary); }

/* ===== FPL INDICATOR ===== */
.fpl-bar {
  background: var(--warning-soft);
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* ===== ACCOUNT CREDENTIAL ITEM ===== */
.account-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.65rem;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.9rem; max-width: 300px; margin: 0 auto; }

/* ===== LOADING ===== */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: #1e293b;
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 260px;
  max-width: 360px;
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  border-left: 4px solid var(--primary-light);
}

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); background: #1a0a0a; }
.toast.warning { border-left-color: var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(110%); }
}

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 1.5rem 0; }
.divider-label { text-align: center; position: relative; margin: 1.5rem 0; }
.divider-label::before { content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--border); }
.divider-label span { background: var(--surface); padding: 0 1rem; position: relative; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ===== DETAIL ROWS ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.detail-item { }
.detail-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 0.2rem; }
.detail-value { font-size: 0.9rem; font-weight: 600; color: var(--text); }

/* ===== MODAL SECTION ===== */
.fa-section { margin-bottom: 1.25rem; }
.fa-section .section-body .form-grid { margin-bottom: 0.5rem; }

/* ===== NOTICE BANNER ===== */
.notice-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--warning-soft);
  border: 1px solid #fde68a;
  border-left: 4px solid var(--accent);
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #78350f;
  margin-bottom: 1.25rem;
}

.disclaimer-box {
  background: var(--danger-soft);
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
  font-size: 0.82rem;
  color: #7f1d1d;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

/* ===== APPOINTMENTS ===== */
.sched-cell {
  display: inline-block;
  padding: 0.3rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.sched-cell.on  { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.sched-cell.off { background: #f1f5f9; color: #94a3b8; border: 1px solid #e2e8f0; }
.sched-cell:hover { opacity: 0.75; transform: scale(1.05); }

.appt-dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}
.appt-dash-card:hover { box-shadow: var(--shadow); }
.appt-dash-time { font-size: 0.8rem; font-weight: 800; color: var(--primary); min-width: 60px; }
.appt-dash-info { flex: 1; min-width: 0; }
.appt-dash-name { font-size: 0.88rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-dash-sub  { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.1rem; }

/* ===== CHAT ===== */
.chat-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 4rem);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-sidebar {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

.chat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.chat-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  transition: var(--transition);
  opacity: 0.6;
}
.chat-icon-btn:hover { background: var(--border); opacity: 1; }

.chat-hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--border-dark);
  background: var(--surface);
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}
.chat-hdr-btn:hover { background: var(--bg); color: var(--text); border-color: var(--primary); }
.chat-hdr-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.chat-hdr-btn.primary:hover { background: var(--primary-light); border-color: var(--primary-light); }

.chat-room-list { flex: 1; overflow-y: auto; }

.chat-room-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.chat-room-item:hover { background: var(--surface); }
.chat-room-item.active { background: #eef2ff; border-left: 3px solid var(--primary); }
.chat-room-item.unread .chat-room-name { font-weight: 800; }

.chat-room-icon { font-size: 1.2rem; flex-shrink: 0; }
.chat-room-info { flex: 1; min-width: 0; }
.chat-room-name { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-room-preview { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.1rem; }

.chat-unread-dot {
  background: var(--primary);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  flex-shrink: 0;
}

.chat-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 2rem;
}

.chat-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}
.chat-header-name { font-weight: 800; font-size: 1rem; color: var(--text); }
.chat-header-sub  { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.1rem; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-date-divider {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
  font-weight: 600;
}

.chat-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}
.chat-msg-row.me { flex-direction: row-reverse; }

.chat-msg-avatar {
  width: 30px; height: 30px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.chat-msg-bubble-wrap { max-width: 70%; display: flex; flex-direction: column; }
.chat-msg-row.me .chat-msg-bubble-wrap { align-items: flex-end; }

.chat-msg-name { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.2rem; padding-left: 0.6rem; }

.chat-msg-bubble {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px 16px 16px 4px;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
  word-break: break-word;
}
.chat-msg-bubble.me {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  border-radius: 16px 16px 4px 16px;
}

.chat-msg-time { font-size: 0.68rem; color: var(--text-muted); margin-top: 0.2rem; padding: 0 0.4rem; }

.chat-input-bar {
  display: flex;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  padding: 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: none;
  max-height: 120px;
  min-height: 40px;
  line-height: 1.4;
  background: var(--bg);
  transition: border-color 0.2s;
}
.chat-input:focus { outline: none; border-color: var(--primary); }

.chat-send-btn {
  width: 40px; height: 40px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
}
.chat-send-btn:hover { background: var(--primary-light); }

/* ===== MENTION DROPDOWN ===== */
.mention-dropdown {
  position: fixed;
  z-index: 10000;
  background: var(--surface);
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  transition: background 0.12s;
}
.mention-item:hover { background: var(--bg); }
.mention-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.7rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mention-name { font-weight: 600; font-size: 0.875rem; line-height: 1.2; }
.mention-sub  { font-size: 0.75rem; color: var(--text-muted); }
.mention-highlight {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
  border-radius: 3px;
  padding: 0 2px;
}

/* @ button in chat input bar */
.chat-at-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0 0.5rem;
  height: 36px;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.chat-at-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ===== TAKEOVER WIDGETS ===== */
.takeover-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}
.takeover-item:last-child { border-bottom: none; }
.takeover-case-info .case-ref  { font-weight: 700; font-size: 0.875rem; color: var(--primary); }
.takeover-case-info .case-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.takeover-actions { display: flex; gap: 0.4rem; flex-shrink: 0; align-items: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding-top: var(--header-h); }
  .mobile-header { display: flex; }
  .page-container { padding: 1.25rem 1rem; width: 100%; }
  .form-grid.cols-2, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .cases-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .events-panel { position: static; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal-card { padding: 1.5rem 1.25rem; }
  .profile-meta-grid { grid-template-columns: 1fr 1fr; }
}
