/* ============================================================
   MTS — Maritime Transport Solutions  v2.0
   Fonts: Poppins (body/UI) + Montserrat (headings/display)
   Icons: Google Material Symbols Rounded
   Design: Clean, minimal, corporate maritime
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700;800&family=Poppins:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

:root {
  /* Brand palette — maritime blue + orange accent */
  --primary:       #1A4FA8;
  --primary-dark:  #0F2E6E;
  --primary-mid:   #1D5FBF;
  --primary-light: #EEF4FF;
  --accent:        #F07B20;
  --accent-light:  #FFF4EB;
  --success:       #059669;
  --success-light: #ECFDF5;
  --danger:        #DC2626;
  --danger-light:  #FEF2F2;
  --warning:       #D97706;
  --warning-light: #FFFBEB;
  --info:          #0284C7;
  --info-light:    #E0F2FE;

  /* Neutrals */
  --gray-50:  #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Surfaces */
  --bg:        #F0F4F9;
  --surface:   #FFFFFF;
  --sidebar-bg:#0D1B3E;
  --sidebar-w: 248px;

  /* Typography */
  --font-body:    'Poppins', sans-serif;
  --font-display: 'Montserrat', sans-serif;

  /* Spacing */
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 20px rgba(0,0,0,.09), 0 4px 6px rgba(0,0,0,.04);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
}

/* ── MATERIAL ICONS ── */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  font-size: 20px;
  flex-shrink: 0;
}
.icon-sm  { font-size: 16px; }
.icon-lg  { font-size: 24px; }
.icon-xl  { font-size: 32px; }
.icon-filled { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }

/* ────────────────────────────────────
   SIDEBAR
──────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow: hidden;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 199;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.125rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

.sidebar-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.sidebar-brand {
  text-decoration: none;
  flex: 1;
}

.sidebar-brand-fallback { }
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  line-height: 1;
}
.sidebar-brand-name span { color: var(--accent); }
.sidebar-brand-sub {
  font-size: 0.6rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.2rem;
  font-weight: 500;
}

.sidebar-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0.25rem;
  display: none;
  line-height: 1;
}
.sidebar-close:hover { color: white; }

.sidebar-nav-wrap { flex: 1; padding: 0.75rem 0; overflow-y: auto; }

.sidebar-section { margin-bottom: 0.25rem; }
.sidebar-section-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: rgba(255,255,255,0.28);
  padding: 0.875rem 1.125rem 0.4rem;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.125rem;
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  font-size: 0.835rem;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.14s;
  border-left: 3px solid transparent;
}
.sidebar-nav li a:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.06);
}
.sidebar-nav li a.active {
  color: white;
  background: rgba(26, 79, 168, 0.35);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sidebar-nav li a .material-symbols-rounded { font-size: 19px; }

.sidebar-footer {
  flex-shrink: 0;
  padding: 1rem 1.125rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-user { display: flex; align-items: center; gap: 0.6rem; flex: 1; min-width: 0; }
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-mid), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  text-transform: capitalize;
}
.sidebar-logout {
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  line-height: 1;
  padding: 0.25rem;
  flex-shrink: 0;
}
.sidebar-logout:hover { color: rgba(255,255,255,0.7); }

/* ────────────────────────────────────
   MAIN WRAP
──────────────────────────────────── */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── TOPBAR ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  height: 58px;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.topbar-menu-btn {
  background: none;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0.35rem;
  display: none;
  line-height: 1;
  border-radius: var(--radius);
}
.topbar-menu-btn:hover { background: var(--gray-100); color: var(--gray-700); }

.topbar-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-700);
  flex: 1;
}

.topbar-right { display: flex; align-items: center; gap: 0.75rem; }

.topbar-user { display: flex; align-items: center; gap: 0.5rem; }
.topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-mid), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  color: white;
}
.topbar-username { font-size: 0.8rem; font-weight: 500; color: var(--gray-700); }
.topbar-logout {
  color: var(--gray-400);
  text-decoration: none;
  padding: 0.35rem;
  border-radius: var(--radius);
}
.topbar-logout:hover { background: var(--gray-100); color: var(--gray-700); }

/* ── NOTIFICATION BELL ── */
.notif-bell-wrap {
  position: relative;
}
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0.35rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.notif-bell-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.notif-bell-btn .material-symbols-rounded { font-size: 22px; }
.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--danger);
  color: white;
  font-size: 0.55rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
  pointer-events: none;
  border: 2px solid white;
}
.notif-badge.hidden { display: none; }
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 999;
  overflow: hidden;
  display: none;
}
.notif-dropdown.open { display: block; }
.notif-drop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
}
.notif-drop-title { font-size: 0.8rem; font-weight: 700; color: var(--gray-800); }
.notif-drop-markall {
  font-size: 0.7rem;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-weight: 500;
  padding: 0;
}
.notif-drop-markall:hover { text-decoration: underline; }
.notif-list { max-height: 340px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--gray-50);
  cursor: pointer;
  transition: background .12s;
  text-decoration: none;
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: #EFF6FF; }
.notif-item.unread:hover { background: #DBEAFE; }
.notif-icon {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-icon .material-symbols-rounded { font-size: 15px; color: var(--primary); }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 0.75rem; font-weight: 600; color: var(--gray-800); line-height: 1.35; }
.notif-msg   { font-size: 0.7rem; color: var(--gray-500); margin-top: 1px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: 0.63rem; color: var(--gray-400); margin-top: 2px; }
.notif-unread-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0; margin-top: 5px;
}
.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--gray-400);
  font-size: 0.8rem;
}
.notif-drop-footer {
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--gray-100);
  text-align: center;
}
.notif-drop-footer a {
  font-size: 0.75rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.notif-drop-footer a:hover { text-decoration: underline; }

/* ── PAGE CONTENT ── */
.page-content {
  flex: 1;
  padding: 1.5rem 1.75rem;
  max-width: 1400px;
  width: 100%;
}

/* ── FLASH MESSAGES ── */
.flash-wrap { padding: 0.75rem 1.75rem 0; }
.flash-alert {
  position: relative;
  animation: fadeDown 0.25s ease;
}
.flash-close {
  background: none;
  border: none;
  cursor: pointer;
  color: currentColor;
  opacity: 0.5;
  padding: 0;
  margin-left: auto;
  line-height: 1;
}
.flash-close:hover { opacity: 0.9; }

/* ── PAGE HEADER ── */
.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.page-header p {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.page-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.page-header-row h1 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}
.page-header-row p {
  font-size: 0.83rem;
  color: var(--gray-500);
  margin-top: 0.2rem;
}

/* ────────────────────────────────────
   CARDS
──────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  gap: 0.75rem;
}
.card-title {
  font-family: var(--font-display);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-title .material-symbols-rounded { color: var(--primary); }
.card-body { padding: 1.25rem; }

/* ────────────────────────────────────
   STAT CARDS
──────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.stat-icon-wrap {
  width: 46px; height: 46px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon-wrap .material-symbols-rounded { font-size: 22px; }
.stat-icon-wrap.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon-wrap.green  { background: var(--success-light); color: var(--success); }
.stat-icon-wrap.amber  { background: var(--accent-light);  color: var(--accent); }
.stat-icon-wrap.red    { background: var(--danger-light);  color: var(--danger); }
.stat-icon-wrap.gray   { background: var(--gray-100);      color: var(--gray-600); }
.stat-icon-wrap.teal   { background: var(--info-light);    color: var(--info); }

.stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 0.2rem;
}
.stat-trend {
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.stat-trend.up   { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ────────────────────────────────────
   FORMS
──────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}
.form-group label .req { color: var(--danger); margin-left: 2px; }

input[type=text], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=tel],
input[type=url], select, textarea {
  width: 100%;
  padding: 0.55rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--gray-800);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,79,168,0.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%2394A3B8' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.625rem center;
  padding-right: 2rem;
}
textarea { resize: vertical; min-height: 90px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

.form-hint { font-size: 0.72rem; color: var(--gray-400); margin-top: 0.3rem; }

/* ── SEARCH BAR ── */
.search-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}
.search-wrap .material-symbols-rounded {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 17px;
  color: var(--gray-400);
  pointer-events: none;
}
.search-wrap input {
  padding-left: 2.4rem;
}

/* ────────────────────────────────────
   BUTTONS
──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.835rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.14s;
  white-space: nowrap;
  line-height: 1.4;
}
.btn .material-symbols-rounded { font-size: 17px; }
.btn-sm  { padding: 0.35rem 0.75rem; font-size: 0.775rem; }
.btn-lg  { padding: 0.7rem 1.4rem; font-size: 0.9rem; }
.btn-block { width: 100%; justify-content: center; }
.btn-icon {
  padding: 0.5rem;
  background: none;
  border: none;
  color: var(--gray-500);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.14s;
  line-height: 1;
}
.btn-icon:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-icon.danger:hover { background: var(--danger-light); color: var(--danger); }

.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent    { background: var(--accent); color: white; }
.btn-accent:hover { filter: brightness(0.92); }
.btn-success   { background: var(--success); color: white; }
.btn-success:hover { filter: brightness(0.9); }
.btn-danger    { background: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(0.9); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-ghost     { background: none; color: var(--gray-600); border: 1.5px solid var(--gray-200); }
.btn-ghost:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-white     { background: white; color: var(--primary); font-weight: 600; }
.btn-white:hover { background: var(--gray-100); }
.btn-ghost-white { background: rgba(255,255,255,0.12); color: white; border: 1.5px solid rgba(255,255,255,0.22); }
.btn-ghost-white:hover { background: rgba(255,255,255,0.2); }

/* ────────────────────────────────────
   TABLES
──────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.835rem;
}
.data-table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
  border-bottom: 1.5px solid var(--gray-100);
  white-space: nowrap;
  background: var(--gray-50);
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table .actions { display: flex; gap: 0.25rem; }

.ref-code {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* ────────────────────────────────────
   BADGES
──────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0.03em;
}
.badge-success   { background: var(--success-light);  color: var(--success); }
.badge-danger    { background: var(--danger-light);   color: var(--danger); }
.badge-warning   { background: var(--warning-light);  color: var(--warning); }
.badge-delayed   { background: #FEF3C7;  color: #B45309; }
.badge-critical  { background: #FEE2E2;  color: #B91C1C; animation: badgePulse 1.6s ease-in-out infinite; }
@keyframes badgePulse { 0%,100%{opacity:1;} 50%{opacity:.55;} }
.badge-info      { background: var(--info-light);     color: var(--info); }
.badge-secondary { background: var(--gray-100);       color: var(--gray-600); }
.badge-primary   { background: var(--primary-light);  color: var(--primary); }
.badge-accent    { background: var(--accent-light);   color: var(--accent); }
.badge-express   { background: #FEF3C7; color: #92400E; }
.badge-basic     { background: var(--primary-light);  color: var(--primary); }
.badge-collective{ background: var(--success-light);  color: var(--success); }

/* ────────────────────────────────────
   ALERTS
──────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.83rem;
  margin-bottom: 1rem;
}
.alert .material-symbols-rounded { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-info    { background: var(--primary-light); color: var(--primary); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-error   { background: var(--danger-light);  color: var(--danger); }

/* ────────────────────────────────────
   PAGINATION
──────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gray-600);
  transition: all 0.14s;
  border: 1.5px solid transparent;
}
.pagination a:hover { background: var(--primary-light); color: var(--primary); }
.pagination .active { background: var(--primary); color: white; }
.pagination .disabled { color: var(--gray-300); pointer-events: none; }
.pagination-info { font-size: 0.78rem; color: var(--gray-400); margin-left: auto; }

/* ────────────────────────────────────
   MODAL
──────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.22s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0.25rem;
  border-radius: var(--radius);
  line-height: 1;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* ────────────────────────────────────
   PACKAGE CARDS (Estimator)
──────────────────────────────────── */
.packages-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.pkg-card {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.15s;
  background: white;
  position: relative;
}
.pkg-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.pkg-card.selected { box-shadow: var(--shadow-md); }
.pkg-card.selected.express    { border-color: var(--accent); background: var(--accent-light); }
.pkg-card.selected.basic      { border-color: var(--primary); background: var(--primary-light); }
.pkg-card.selected.collective { border-color: var(--success); background: var(--success-light); }
.pkg-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.express    .pkg-name { color: var(--accent); }
.basic      .pkg-name { color: var(--primary); }
.collective .pkg-name { color: var(--success); }
.pkg-desc { font-size: 0.78rem; color: var(--gray-500); margin-bottom: 0.9rem; line-height: 1.5; }
.pkg-features { list-style: none; }
.pkg-features li {
  font-size: 0.75rem;
  color: var(--gray-600);
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.pkg-features li .material-symbols-rounded { font-size: 14px; color: var(--success); }
.pkg-multiplier {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 99px;
  display: inline-block;
}
.express    .pkg-multiplier { background: #FEF3C7; color: #92400E; }
.basic      .pkg-multiplier { background: #DBEAFE; color: #1E40AF; }
.collective .pkg-multiplier { background: #D1FAE5; color: #065F46; }
.pkg-radio {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: white;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.pkg-card.selected .pkg-radio { background: var(--success); border-color: var(--success); }
.pkg-card.selected .pkg-radio::after { content:''; width:8px; height:8px; background:white; border-radius:50%; }

/* ────────────────────────────────────
   RESULT BOX (Estimator)
──────────────────────────────────── */
.result-card {
  background: var(--gray-900);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 1.5rem;
  color: white;
}
.result-card h3 {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 1.25rem;
}
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 1.25rem; }
.result-item .r-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.result-item .r-val {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  line-height: 1.2;
}
.result-item .r-val.big { font-size: 1.7rem; color: var(--accent); }
.result-divider { border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 1.5rem 0; }
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row span { color: rgba(255,255,255,0.5); }
.breakdown-row strong { color: white; font-family: var(--font-display); font-weight: 600; }

/* ────────────────────────────────────
   TRACKING
──────────────────────────────────── */
.track-steps {
  display: flex;
  align-items: flex-start;
  margin: 1.5rem 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.track-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  min-width: 80px;
}
.track-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 16px);
  width: calc(100% - 32px);
  height: 2px;
  background: var(--gray-200);
}
.track-step.done:not(:last-child)::after   { background: var(--success); }
.track-step.active:not(:last-child)::after { background: linear-gradient(to right, var(--success), var(--gray-200)); }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  background: white;
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1;
  transition: all 0.3s;
}
.step-dot .material-symbols-rounded { font-size: 14px; color: var(--gray-300); }
.track-step.done   .step-dot { background: var(--success); border-color: var(--success); }
.track-step.done   .step-dot .material-symbols-rounded { color: white; font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.track-step.active .step-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px rgba(26,79,168,0.15); }
.track-step.active .step-dot .material-symbols-rounded { color: white; }
.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  margin-top: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
}
.track-step.done   .step-label { color: var(--success); }
.track-step.active .step-label { color: var(--primary); }

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--gray-200);
}
.tl-item { display: flex; gap: 1rem; padding: 0.75rem 0; position: relative; }
.tl-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--gray-200);
  border: 2px solid white;
  position: absolute;
  left: -1.5rem; top: 1rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--gray-200);
}
.tl-dot.done   { background: var(--success); box-shadow: 0 0 0 2px rgba(5,150,105,0.2); }
.tl-dot.active { background: var(--primary); box-shadow: 0 0 0 3px rgba(26,79,168,0.2); }
.tl-time  { font-size: 0.72rem; color: var(--gray-400); font-weight: 500; min-width: 130px; padding-top: 2px; }
.tl-event { font-size: 0.85rem; color: var(--gray-700); font-weight: 500; }
.tl-loc   { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.1rem; display: flex; align-items: center; gap: 0.25rem; }
.tl-loc .material-symbols-rounded { font-size: 12px; }

/* ────────────────────────────────────
   DOCUMENT (Quotation / Invoice)
──────────────────────────────────── */
.doc-layout { display: grid; grid-template-columns: 1fr 420px; gap: 1.5rem; align-items: start; }
.doc-sticky { position: sticky; top: 76px; }
.doc-paper { background: white; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.doc-inner { padding: 2.5rem; }
.doc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-900);
}
.doc-brand-name {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.03em;
}
.doc-brand-sub { font-size: 0.7rem; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.25rem; }
.doc-type-label {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  text-align: right;
  letter-spacing: -0.02em;
}
.doc-ref-label { font-family: 'Courier New', monospace; font-size: 0.8rem; color: var(--gray-400); text-align: right; margin-top: 0.2rem; }
.doc-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.75rem; }
.doc-meta-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--gray-400); font-weight: 600; margin-bottom: 0.25rem; }
.doc-meta-val   { font-size: 0.875rem; color: var(--gray-800); font-weight: 500; }
.doc-meta-sub   { font-size: 0.78rem; color: var(--gray-500); }
.doc-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.82rem; }
.doc-table th { background: var(--gray-900); color: white; padding: 0.6rem 0.85rem; text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.doc-table td { padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
.doc-table tr:last-child td { border-bottom: none; }
.doc-table .tar { text-align: right; }
.doc-totals { max-width: 260px; margin-left: auto; margin-top: 0.5rem; }
.doc-total-row { display: flex; justify-content: space-between; padding: 0.35rem 0; font-size: 0.82rem; color: var(--gray-600); }
.doc-total-row.grand { font-weight: 700; font-size: 0.95rem; color: var(--gray-900); padding-top: 0.6rem; border-top: 2px solid var(--gray-900); margin-top: 0.3rem; }
.doc-total-row .amount { font-family: var(--font-display); font-weight: 600; }
.doc-footer-note { font-size: 0.75rem; color: var(--gray-400); margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--gray-100); line-height: 1.7; }
.doc-empty { padding: 4rem 2rem; text-align: center; color: var(--gray-400); }
.doc-empty .material-symbols-rounded { font-size: 48px; margin-bottom: 0.75rem; display: block; color: var(--gray-300); }
.doc-empty p { font-size: 0.85rem; }

/* ────────────────────────────────────
   QUICK LINKS (Dashboard)
──────────────────────────────────── */
.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.25rem; }
.quick-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--gray-800);
  box-shadow: var(--shadow);
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.quick-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.quick-icon-wrap {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.25rem;
}
.quick-icon-wrap.blue   { background: var(--primary-light); color: var(--primary); }
.quick-icon-wrap.amber  { background: var(--accent-light);  color: var(--accent); }
.quick-icon-wrap.green  { background: var(--success-light); color: var(--success); }
.quick-icon-wrap.gray   { background: var(--gray-100);      color: var(--gray-600); }
.quick-icon-wrap.teal   { background: var(--info-light);    color: var(--info); }
.quick-icon-wrap.red    { background: var(--danger-light);  color: var(--danger); }
.quick-name { font-family: var(--font-display); font-size: 0.875rem; font-weight: 700; color: var(--gray-800); }
.quick-desc { font-size: 0.75rem; color: var(--gray-500); line-height: 1.4; }

/* ────────────────────────────────────
   DASHBOARD HERO
──────────────────────────────────── */
.dash-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-mid) 60%, #1a6fcf 100%);
  border-radius: var(--radius-xl);
  padding: 2rem;
  color: white;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}
.dash-hero::before {
  content: '';
  position: absolute;
  right: -60px; top: -60px;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
  pointer-events: none;
}
.dash-hero::after {
  content: '';
  position: absolute;
  right: 60px; bottom: -80px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
  pointer-events: none;
}
.dash-hero-content { position: relative; z-index: 1; }
.dash-hero h1 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}
.dash-hero h1 span { color: var(--accent); }
.dash-hero p { font-size: 0.875rem; color: rgba(255,255,255,0.65); }
.dash-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; flex-wrap: wrap; }

/* ────────────────────────────────────
   EMPTY STATE
──────────────────────────────────── */
.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--gray-400);
}
.empty-state .material-symbols-rounded { font-size: 52px; display: block; margin: 0 auto 1rem; color: var(--gray-300); }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--gray-500); margin-bottom: 0.35rem; }
.empty-state p  { font-size: 0.83rem; }

/* ────────────────────────────────────
   STATUS INDICATOR
──────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  flex-shrink: 0;
}
.status-dot.active  { background: var(--success); box-shadow: 0 0 0 3px rgba(5,150,105,0.2); }
.status-dot.idle    { background: var(--warning); }
.status-dot.offline { background: var(--gray-300); }
.status-dot.danger  { background: var(--danger); }

/* ────────────────────────────────────
   INFO ROW (detail view)
──────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; }
.info-item .info-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray-400); margin-bottom: 0.2rem; }
.info-item .info-val   { font-size: 0.875rem; color: var(--gray-800); font-weight: 500; }

/* ────────────────────────────────────
   LOGIN
──────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(145deg, var(--primary-dark) 0%, #0a1e4a 60%, #0D1B3E 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-split {
  display: grid;
  grid-template-columns: 1fr 420px;
  min-height: 100vh;
  width: 100%;
}
.login-left {
  background: linear-gradient(145deg, var(--primary-dark) 0%, #0a1e4a 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  position: relative;
  overflow: hidden;
}
.login-left::before {
  content: '';
  position: absolute;
  right: -100px; top: -100px;
  width: 500px; height: 500px;
  background: rgba(26,79,168,0.2);
  border-radius: 50%;
}
.login-left-content { position: relative; z-index: 1; }
.login-left-logo { height: 50px; margin-bottom: 3rem; }
.login-left h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 1rem;
}
.login-left h1 span { color: var(--accent); }
.login-left p { font-size: 0.925rem; color: rgba(255,255,255,0.55); line-height: 1.7; max-width: 380px; }
.login-left-features { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.875rem; }
.login-feature {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
}
.login-feature .material-symbols-rounded { font-size: 20px; color: var(--accent); flex-shrink: 0; }

.login-right {
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.login-box {
  width: 100%;
  max-width: 360px;
}
.login-box-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.login-box-sub { font-size: 0.83rem; color: var(--gray-400); margin-bottom: 1.75rem; }
.login-error {
  background: var(--danger-light);
  color: var(--danger);
  border-radius: var(--radius);
  padding: 0.65rem 0.875rem;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ────────────────────────────────────
   SITE FOOTER
──────────────────────────────────── */
.site-footer {
  background: white;
  border-top: 1px solid var(--gray-100);
  padding: 0.875rem 1.75rem;
  font-size: 0.75rem;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ────────────────────────────────────
   UTILITIES
──────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end  { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: 0.35rem; }
.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }
.mb-1   { margin-bottom: 0.5rem; }
.mb-2   { margin-bottom: 1rem; }
.mb-3   { margin-bottom: 1.5rem; }
.mt-1   { margin-top: 0.5rem; }
.mt-2   { margin-top: 1rem; }
.mt-3   { margin-top: 1.5rem; }
.p-0    { padding: 0; }
.text-sm    { font-size: 0.8rem; }
.text-xs    { font-size: 0.72rem; }
.text-muted { color: var(--gray-400); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono  { font-family: 'Courier New', monospace; }
.font-display { font-family: var(--font-display); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.color-primary { color: var(--primary); }
.color-success { color: var(--success); }
.color-danger  { color: var(--danger); }
.color-accent  { color: var(--accent); }
.divider { border: none; border-top: 1px solid var(--gray-100); margin: 1rem 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ────────────────────────────────────
   ANIMATIONS
──────────────────────────────────── */
@keyframes fadeIn   { from { opacity:0; } to { opacity:1; } }
@keyframes fadeUp   { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes fadeDown { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp  { from { opacity:0; transform:translateY(20px) scale(.98); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes pulse    { 0%,100%{opacity:1} 50%{opacity:.5} }
.animate-pulse { animation: pulse 2s ease infinite; }

/* ────────────────────────────────────
   RESPONSIVE
──────────────────────────────────── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .quick-grid  { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-248px); width: 248px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .sidebar-close { display: block; }
  .main-wrap { margin-left: 0; }
  .topbar-menu-btn { display: flex; }
  .doc-layout { grid-template-columns: 1fr; }
  .packages-grid { grid-template-columns: 1fr; }
  .login-split { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .login-right { padding: 2rem; }
  .info-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 768px) {
  .page-content { padding: 1rem; }
  .page-header-row { flex-direction: column; align-items: flex-start; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .col-span-2, .col-span-3 { grid-column: span 1; }
  .dash-hero { padding: 1.5rem; }
  .dash-hero h1 { font-size: 1.3rem; }
  .topbar-username { display: none; }
  .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid  { grid-template-columns: 1fr 1fr; }
}

@media print {
  .sidebar, .topbar, .btn, .doc-layout > form,
  .site-footer, .flash-wrap, .sidebar-overlay { display: none !important; }
  .main-wrap { margin-left: 0; }
  .doc-layout { grid-template-columns: 1fr; }
  .doc-paper { box-shadow: none; }
  body { background: white; }
}


/* ── Dropdown (status controls) ─────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 9999;
  min-width: 160px; background: var(--card, #fff); border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14); padding: 4px; overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem;
  font-size: .82rem; color: var(--text, #1e293b); border-radius: 7px; text-decoration: none;
  white-space: nowrap; transition: background .12s;
}
.dropdown-item:hover { background: var(--hover, #f1f5f9); }
.dropdown-item .material-symbols-rounded { font-size: 16px; }
/* Two-column detail layout (form left, related panels right) */
@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr !important; }
}
