/* =========================================================
   Nexus Hub — Core Styles (LTR base, logical properties)
   ========================================================= */
:root {
  --primary: #4F46E5;
  --primary-600: #4338CA;
  --primary-50: #EEF2FF;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --text: #0F172A;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 4px 14px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px rgba(15,23,42,.12);
  --topbar-h: 60px;
  --sidebar-w: 240px;
  --sidebar-collapsed: 64px;
  --transition: 200ms ease;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Cairo", "Tajawal", Roboto, Inter, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}
.content {
  padding: 1.5rem 2rem;
  min-width: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-block-end: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-inline: 1rem;
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: .75rem; min-width: var(--sidebar-w); }
.topbar-search { flex: 1; max-width: 480px; }
.topbar-search input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: .55rem 1rem;
  font-size: 14px;
  outline: none;
  transition: var(--transition);
}
.topbar-search input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.topbar-right {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.brand {
  display: flex; align-items: center; gap: .55rem;
  color: var(--text); font-weight: 700; font-size: 1.05rem;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #7C3AED);
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.brand-name { font-weight: 700; }
.icon-btn {
  width: 38px; height: 38px; border: 0; background: transparent;
  border-radius: 8px; color: var(--text-muted);
  display: grid; place-items: center; transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.lang-toggle { font-weight: 700; font-size: 12px; }
.profile-btn {
  display: flex; align-items: center; gap: .5rem;
  background: transparent; border: 0; padding: .25rem .5rem;
  border-radius: 8px; color: var(--text);
}
.profile-btn:hover { background: var(--surface-2); }
.profile-name { font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #A855F7);
  color: #fff; display: grid; place-items: center; font-weight: 700;
  text-transform: uppercase;
}
.avatar-sm { width: 26px; height: 26px; font-size: 12px; }
.presence-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-muted); border: 2px solid var(--surface);
  display: inline-block;
}
.presence-online { background: var(--success); }
.presence-busy   { background: var(--danger); }
.presence-away   { background: var(--warning); }
.presence-offline{ background: #94A3B8; }

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}
.dropdown-head {
  padding: .75rem 1rem;
  border-block-end: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.dropdown-foot {
  padding: .6rem 1rem;
  border-block-start: 1px solid var(--border);
  text-align: center;
}
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  padding: .75rem 1rem;
  border-block-end: 1px solid var(--border);
  display: block; color: var(--text);
  cursor: pointer; transition: var(--transition);
}
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: var(--primary-50); }
.notif-item small { color: var(--text-muted); }
.dropdown-section { padding: .75rem 1rem; border-block-end: 1px solid var(--border); }
.presence-options { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-start: .35rem; }
.presence-pill {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: .25rem .55rem;
  border-radius: 999px;
  font-size: 12px;
  display: inline-flex; align-items: center; gap: .35rem;
}
.presence-pill:hover { background: var(--surface-2); }
.dropdown-form { padding: .5rem; }
.dropdown-link {
  display: block; width: 100%; text-align: start;
  background: transparent; border: 0; padding: .55rem .75rem;
  border-radius: 6px; color: var(--text);
}
.dropdown-link:hover { background: var(--surface-2); }
.dropdown-link.danger { color: var(--danger); }

.badge {
  position: absolute;
  inset-block-start: -2px; inset-inline-end: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  padding: 1px 6px;
  font-weight: 700;
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  padding: 1rem .75rem;
  position: sticky;
  inset-block-start: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .55rem .85rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary-50); color: var(--primary-600); }
.nav-link svg { flex-shrink: 0; }
.nav-section { margin-block-start: 1rem; padding-block-start: .75rem; border-block-start: 1px solid var(--border); }
.nav-section-title {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: .25rem .85rem .5rem;
  font-weight: 700;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-head {
  padding: 1rem 1.25rem;
  border-block-end: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-head h3 { margin: 0; font-size: 15px; }
.card-body { padding: 1.25rem; }
.card-section { padding: 1rem 1.25rem; border-block-start: 1px solid var(--border); }
.card-wide { grid-column: 1 / -1; }

/* ---------- Page head ---------- */
.page-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; margin-block-end: 1.5rem;
}
.page-title { margin: 0 0 .25rem; font-size: 1.5rem; font-weight: 700; }
.page-actions { display: flex; gap: .5rem; }

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-block-end: 1.5rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.kpi-card::before {
  content: "";
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 4px; height: 100%;
  border-start-start-radius: var(--radius);
  border-end-start-radius: var(--radius);
}
.kpi-blue::before  { background: var(--primary); }
.kpi-amber::before { background: var(--warning); }
.kpi-red::before   { background: var(--danger); }
.kpi-green::before { background: var(--success); }
.kpi-label { color: var(--text-muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi-value { font-size: 2rem; font-weight: 700; margin-block-start: .35rem; line-height: 1; }
.kpi-value small { font-size: 14px; color: var(--text-muted); font-weight: 500; }

/* ---------- Dashboard grid ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
@media (max-width: 992px) { .dashboard-grid { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger  { background: var(--danger);  color: #fff; border-color: var(--danger); }
.btn-ghost   { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: .35rem .65rem; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Forms ---------- */
.form-card { padding: 1.5rem; }
.form-card h3 { margin-block-start: 0; }
.field { display: block; margin-block-end: 1rem; }
.field-label {
  display: block; font-weight: 600; font-size: 13px;
  color: var(--text); margin-block-end: .35rem;
}
.field input, .field select, .field textarea,
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="datetime-local"],
input[type="color"], select, textarea {
  width: 100%;
  padding: .55rem .85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}
.field input:focus, .field select:focus, .field textarea:focus,
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
textarea { resize: vertical; min-height: 90px; }
.checkbox {
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer; user-select: none;
}
.checkbox input { width: auto; }
.field-row { display: flex; justify-content: space-between; align-items: center; margin-block-end: 1rem; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-block-start: 1rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-split { display: grid; grid-template-columns: 380px 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 992px) { .grid-split { grid-template-columns: 1fr; } }
.inline-form { display: flex; gap: .5rem; align-items: center; }
.inline { display: inline-block; }

/* ---------- Tables ---------- */
.data-table {
  width: 100%; border-collapse: collapse;
}
.data-table th, .data-table td {
  text-align: start; padding: .75rem 1rem;
  border-block-end: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  background: var(--surface-2);
  font-size: 12px; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  font-weight: 700;
}
.data-table tr:hover td { background: var(--surface-2); }
.data-table .ellipsis-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-strong { font-weight: 700; }
.pagination {
  display: flex; gap: .25rem; padding: 1rem;
  justify-content: center;
}
.pagination a {
  padding: .35rem .7rem; border-radius: 6px;
  border: 1px solid var(--border); color: var(--text);
}
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  position: static;
  border: 0;
}
.badge-blue    { background: #DBEAFE; color: #1E40AF; }
.badge-success { background: #D1FAE5; color: #065F46; }
.priority-low      { background: #DBEAFE; color: #1E3A8A; }
.priority-medium   { background: #E0E7FF; color: #3730A3; }
.priority-high     { background: #FED7AA; color: #9A3412; }
.priority-critical { background: #FEE2E2; color: #991B1B; }
.status-open             { background: #DBEAFE; color: #1E40AF; }
.status-pending          { background: #FEF3C7; color: #854D0E; }
.status-in_progress      { background: #DDD6FE; color: #5B21B6; }
.status-waiting_response { background: #FCE7F3; color: #9D174D; }
.status-completed        { background: #D1FAE5; color: #065F46; }
.status-closed           { background: #E5E7EB; color: #374151; }
.status-rejected         { background: #FEE2E2; color: #991B1B; }
.status-escalated        { background: #FECACA; color: #7F1D1D; }
.status-active           { background: #D1FAE5; color: #065F46; }
.status-suspended        { background: #FEF3C7; color: #854D0E; }
.status-disabled         { background: #FEE2E2; color: #991B1B; }
.severity-info     { background: #DBEAFE; color: #1E40AF; }
.severity-warning  { background: #FEF3C7; color: #854D0E; }
.severity-critical { background: #FEE2E2; color: #991B1B; }

/* ---------- Filter bar ---------- */
.filter-bar {
  display: flex; gap: .5rem; align-items: center;
  padding: .75rem; margin-block-end: 1rem; flex-wrap: wrap;
}
.filter-bar input, .filter-bar select { width: auto; min-width: 160px; }

/* ---------- Tickets show ---------- */
.ticket-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.25rem; align-items: start; }
@media (max-width: 992px) { .ticket-grid { grid-template-columns: 1fr; } }
.ticket-side { display: flex; flex-direction: column; gap: 1rem; }
.ticket-body { font-size: 15px; line-height: 1.7; }
.attachments { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .35rem; }
.meta-list { padding: 1rem 1.25rem; }
.meta-list > div { padding: .35rem 0; border-block-end: 1px dashed var(--border); }
.meta-list > div:last-child { border: 0; }

/* ---------- Messages / Discussion ---------- */
.messages { padding: 1rem 1.25rem; max-height: 600px; overflow-y: auto; }
.message { padding: .75rem 0; border-block-end: 1px solid var(--border); }
.message:last-child { border: 0; }
.message-head { display: flex; align-items: center; gap: .5rem; margin-block-end: .35rem; }
.message-internal { background: #FFFBEB; padding: .75rem; border-radius: 8px; margin: .5rem 0; }
.message-body { font-size: 14px; line-height: 1.6; padding-inline-start: 36px; }
.tag {
  display: inline-block; font-size: 11px; padding: 2px 6px;
  border-radius: 4px; background: var(--surface-2); color: var(--text-muted);
}
.reply-form {
  padding: 1rem 1.25rem; border-block-start: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .5rem;
}
.reply-actions { display: flex; justify-content: space-between; align-items: center; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; padding: 1rem 1.25rem; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.timeline li { display: flex; gap: .75rem; }
.timeline .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); margin-block-start: 6px; flex-shrink: 0;
}

/* ---------- Activity feed ---------- */
.activity-feed { list-style: none; padding: 0; margin: 0; }
.activity-feed li { display: flex; gap: .75rem; padding: .65rem 0; border-block-end: 1px solid var(--border); }
.activity-feed li:last-child { border: 0; }
.activity-feed .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--primary);
  margin-block-start: 6px; flex-shrink: 0;
}

/* ---------- People list ---------- */
.people-list { list-style: none; padding: 0; margin: 0; }
.people-list li { display: flex; gap: .65rem; align-items: center; padding: .5rem 0; border-block-end: 1px solid var(--border); }
.people-list li:last-child { border: 0; }

/* ---------- Tickets mini ---------- */
.tickets-mini { list-style: none; padding: 0; margin: 0; }
.tickets-mini li { padding: .5rem 0; border-block-end: 1px solid var(--border); }
.tickets-mini li:last-child { border: 0; }
.tickets-mini a {
  display: flex; gap: .5rem; align-items: center;
  color: var(--text);
}
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Tasks ---------- */
.task-list { list-style: none; padding: 0; margin: 0; }
.task-item {
  display: flex; gap: 1rem; padding: 1rem 1.25rem;
  border-block-end: 1px solid var(--border);
}
.task-item:last-child { border: 0; }
.task-done .task-main strong { text-decoration: line-through; color: var(--text-muted); }
.task-main { flex: 1; }
.task-main p { margin: .35rem 0; }
.task-actions { display: flex; gap: .35rem; align-items: flex-start; }
.progress-bar {
  height: 6px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden; margin-block-start: .5rem;
}
.progress-fill { height: 100%; background: var(--primary); transition: width .3s; }

/* ---------- Chat page ---------- */
.chat-page {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  height: calc(100vh - var(--topbar-h) - 4rem);
}
@media (max-width: 768px) { .chat-page { grid-template-columns: 1fr; height: auto; } }
.chat-sidebar { display: flex; flex-direction: column; overflow: hidden; }
.chat-tabs { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.tab-buttons { display: flex; padding: .5rem; gap: .25rem; }
.tab-buttons button {
  flex: 1; padding: .4rem; border: 0; background: transparent;
  border-radius: 6px; color: var(--text-muted); font-weight: 600;
}
.tab-buttons button.active { background: var(--primary-50); color: var(--primary-600); }
.conv-list { flex: 1; overflow-y: auto; }
.conv-item, .conv-item-form {
  display: flex; align-items: center; gap: .65rem;
  padding: .65rem 1rem;
  border-block-end: 1px solid var(--border);
  cursor: pointer; color: var(--text); width: 100%;
  border: 0; background: transparent; text-align: start;
}
.conv-item:hover { background: var(--surface-2); text-decoration: none; }
.conv-item.active { background: var(--primary-50); }
.conv-item-form { padding: 0; }
.conv-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-info .ellipsis { font-size: 12px; }
.chat-main { display: flex; flex-direction: column; overflow: hidden; }
.chat-empty {
  flex: 1; display: grid; place-items: center; text-align: center;
  padding: 2rem;
}
.big-emoji { font-size: 4rem; opacity: .6; }
.chat-head {
  padding: .75rem 1.25rem;
  border-block-end: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-messages {
  flex: 1; overflow-y: auto; padding: 1rem 1.25rem;
  display: flex; flex-direction: column; gap: .75rem;
}
.msg { max-width: 75%; }
.msg-meta { display: flex; gap: .5rem; align-items: center; font-size: 12px; }
.msg-body {
  background: var(--surface-2); padding: .55rem .85rem;
  border-radius: 12px; border-start-start-radius: 4px;
  margin-block-start: .25rem;
}
.msg-mine { align-self: flex-end; }
.msg-mine .msg-body {
  background: var(--primary); color: #fff;
  border-radius: 12px; border-start-end-radius: 4px;
}
.msg-mine .msg-meta { justify-content: flex-end; }
.chat-composer {
  display: flex; gap: .5rem; padding: .75rem 1rem;
  border-block-start: 1px solid var(--border);
}
.chat-composer textarea {
  flex: 1; resize: none; min-height: 42px; max-height: 120px;
}

/* ---------- Floating chat widget ---------- */
.chat-widget {
  position: fixed;
  inset-block-end: 24px; inset-inline-end: 24px;
  z-index: 60;
}
.chat-widget-fab {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff; border: 0;
  display: grid; place-items: center;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.chat-widget-fab:hover { background: var(--primary-600); }
.chat-widget-badge {
  position: absolute;
  inset-block-start: -2px; inset-inline-end: -2px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 1px 6px;
}
.chat-widget-panel {
  position: absolute;
  inset-block-end: 70px; inset-inline-end: 0;
  width: 320px; max-height: 500px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-widget-head {
  padding: .75rem 1rem;
  border-block-end: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.chat-widget-list { flex: 1; overflow-y: auto; }

/* ---------- KB ---------- */
.kb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.kb-card {
  display: block; padding: 1.25rem;
  color: var(--text);
  transition: var(--transition);
}
.kb-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.kb-card h3 { margin: .35rem 0 .5rem; font-size: 15px; }
.kb-article { font-size: 15px; line-height: 1.75; }

/* ---------- Permissions grid ---------- */
.perms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.perm-module {
  border: 1px solid var(--border); border-radius: 8px;
  padding: .75rem; margin: 0;
}
.perm-module legend { padding: 0 .35rem; font-weight: 700; font-size: 12px; text-transform: uppercase; color: var(--text-muted); }
.perm-module label { display: flex; gap: .5rem; padding: .25rem 0; }

/* ---------- Department color dot ---------- */
.dept-color {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 3px; vertical-align: middle;
  margin-inline-end: .35rem;
}

/* ---------- Notifications page ---------- */
.notif-full-list { list-style: none; padding: 0; margin: 0; }
.notif-row {
  display: flex; gap: 1rem; align-items: center;
  padding: 1rem 1.25rem; border-block-end: 1px solid var(--border);
}
.notif-row.unread { background: var(--primary-50); }
.notif-icon { font-size: 1.5rem; }
.notif-body { flex: 1; }
.notif-body p { margin: .25rem 0; }

/* ---------- Auth ---------- */
.auth-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #EC4899 100%);
  display: grid; place-items: center; padding: 1rem;
}
.auth-shell {
  width: 100%; max-width: 400px;
  background: var(--surface);
  padding: 2.5rem 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
}
.auth-brand { text-align: center; margin-block-end: 1.5rem; }
.auth-brand h1 { margin: .5rem 0 .25rem; font-size: 1.5rem; }
.auth-brand .brand-mark { width: 56px; height: 56px; font-size: 1.5rem; margin: 0 auto; }
.auth-form { display: flex; flex-direction: column; }
.auth-help { margin-block-start: 1rem; }
.auth-footer {
  margin-block-start: 1.5rem; text-align: center;
  display: flex; justify-content: center; gap: .5rem;
  color: var(--text-muted);
}
.auth-footer a.active { color: var(--primary); font-weight: 700; }

/* ---------- Flash & toasts ---------- */
.flash {
  padding: .75rem 1rem; border-radius: 8px;
  margin-block-end: 1rem;
  border: 1px solid;
}
.flash-success { background: #D1FAE5; color: #065F46; border-color: #6EE7B7; }
.flash-error   { background: #FEE2E2; color: #991B1B; border-color: #FCA5A5; }
.toast-container {
  position: fixed; inset-block-end: 1rem; inset-inline-end: 1rem;
  z-index: 200; display: flex; flex-direction: column; gap: .5rem;
}
.toast {
  background: var(--surface); border: 1px solid var(--border);
  padding: .75rem 1rem; border-radius: 8px; box-shadow: var(--shadow-lg);
  min-width: 280px; animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Misc ---------- */
.muted { color: var(--text-muted); }
.muted-link { color: var(--text-muted); font-size: 12px; }
.center { text-align: center; }
.pad { padding: 1.5rem; }
.small { font-size: 12px; }
.error-page { text-align: center; padding: 4rem 2rem; }
.sla-meta { padding: 0 1.25rem 1.25rem; display: flex; align-items: center; gap: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .sidebar.open { display: block; position: fixed; z-index: 90; width: 100%; }
  .topbar-search { display: none; }
  .content { padding: 1rem; }
  .brand-name, .profile-name { display: none; }
}
