﻿/* ====================================
   DESIGN SYSTEM - DSP ADNETWORK 2.0
==================================== */

:root {
  /* Brand Colors */
  --primary: #02182B;
  --primary-light: #0D2E47;
  --primary-dark: #000F1A;
  --accent: #C69C40;
  --accent-hover: #B08A35;
  --accent-light: #E8DCC8;

  /* Neutrals */
  --white: #FFFFFF;
  --surface: #F8F9FC;
  --surface-2: #EEF1F7;
  --border: #D8E0EB;
  --border-light: #E8EEF5;

  /* Text */
  --text-primary: #0F172A;
  --text-secondary: #52617B;
  --text-muted: #7A8A9E;

  /* Status Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  /* Spacing */
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 4px 0 rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 4px 8px 0 rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 16px 0 rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition: 180ms ease-out;
  --transition-slow: 280ms ease-out;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #072238;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

.app-root {
  min-height: 100vh;
  background: var(--surface);
}

/* ====================================
   LAYOUT
==================================== */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  background: var(--surface);
}

.sidebar {
  width: 280px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: var(--space-20) var(--space-16);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--white);
  text-transform: uppercase;
  line-height: 1.2;
  font-size: 14px;
  margin-bottom: var(--space-24);
}

.brand img {
  width: 170px;
  max-width: 100%;
  height: auto;
  display: block;
}

.role-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  display: grid;
  gap: var(--space-6);
  margin-bottom: var(--space-20);
}

.role-name {
  font-weight: 700;
  color: var(--white);
}

.role-title {
  font-size: 13px;
  color: var(--accent-light);
}

.role-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  padding: var(--space-12);
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-item.active {
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-16);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.main {
  min-width: 0;
  padding: 36px;
  overflow-y: auto;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.mobile-only {
  display: none;
}

.mobile-nav {
  display: none !important;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 12, 27, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 30;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100vh;
  background: #072238;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  z-index: 40;
  transition: right 0.25s ease;
  display: flex;
  flex-direction: column;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-title {
  font-weight: 700;
  color: var(--white);
}

.drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--white);
}

.drawer-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.drawer-empty {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  padding: 12px;
}

.drawer-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.6);
  margin: 8px 0;
  font-weight: 700;
}

.drawer-section-body {
  display: grid;
  gap: 8px;
}

.drawer-body .nav-item {
  color: rgba(255, 255, 255, 0.85);
}

.drawer-body .nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.drawer-body .nav-item.active {
  background: var(--accent);
  color: var(--white);
}

body.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.drawer-open .mobile-drawer {
  right: 0;
}

.side-panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 12, 27, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 45;
}

.side-panel {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transition: right 0.25s ease;
}

.side-panel.open {
  right: 0;
}

.side-panel-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.side-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-light);
}

.side-panel-title {
  font-size: 16px;
  font-weight: 800;
}

.side-panel-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.side-panel-body {
  padding: 16px 18px 24px;
  overflow-y: auto;
  display: grid;
  gap: 18px;
}

.panel-section {
  display: grid;
  gap: 10px;
}

.panel-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}

.panel-notes {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
}

.panel-kpi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.panel-kpi {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}

.panel-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.panel-kpi-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel-empty {
  color: var(--text-muted);
  font-size: 13px;
}

.profile-alert {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 14px;
}

.profile-alert.success {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  color: #0f766e;
}

.profile-alert.error {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
}

.profile-alert.warning {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
}

.input-valid {
  border-color: rgba(16, 185, 129, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
}

.input-invalid {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.announcement-bar {
  background: #072238;
  color: #ffffff;
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-track {
  white-space: nowrap;
  display: inline-block;
  animation: announcement-scroll 18s linear infinite;
}

@keyframes announcement-scroll {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.toggle input {
  width: 16px;
  height: 16px;
}

.report-notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.report-notes-grid .report-notes {
  min-height: 120px;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-16);
}

.topbar-left {
  display: grid;
  gap: 4px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-summary {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.top-summary-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}

.top-summary-body {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-actions {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 8px;
}

.quick-actions-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
}

.quick-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-action {
  padding: 8px 12px;
  font-size: 12px;
}

.topbar h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

/* ====================================
   CARDS
==================================== */
.card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.card.main-card {
  min-height: 180px;
}

.card.metric-card {
  min-height: 160px;
  padding: 26px;
}

.card.metric-card .metric {
  margin-top: 12px;
}

.card.metric-card .metric-label {
  margin-top: 6px;
}

.card.soft {
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.card h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-12);
}

.block {
  margin-top: var(--space-16);
}

.block-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.list {
  margin: var(--space-8) 0 0 18px;
  color: var(--text-secondary);
}

/* ====================================
   GRID
==================================== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 14px;
}

/* ====================================
   FORMS & BUTTONS
==================================== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.input,
.select,
.textarea,
textarea,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 15px;
  color: var(--text-primary);
  background: var(--white);
  transition: all var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 156, 64, 0.1);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button {
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
}

.button:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md);
}

.button.secondary {
  background: var(--white);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.button.secondary:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--border);
}

.button.danger {
  background: var(--danger);
  color: var(--white);
  border: 1px solid var(--danger);
}

.button.small {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}

/* ====================================
   TABLES
==================================== */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  padding: 14px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
  color: var(--text-primary);
}

.table tbody tr:hover {
  background: var(--surface);
}

.table-wrap {
  overflow-x: auto;
  min-height: 220px;
}

.list-panel {
  min-height: 260px;
}

.section-plans .card.main-card {
  min-height: 320px;
}

.section-plans-list .list-panel {
  min-height: 300px;
}

.section-reports .card.main-card {
  min-height: 320px;
}

.section-reports-list .list-panel {
  min-height: 320px;
}

.section-tasks .card.main-card {
  min-height: 320px;
}

.section-tasks-list .list-panel {
  min-height: 300px;
}

.card-grid,
.grid-3 {
  align-items: stretch;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ====================================
   STATUS
==================================== */
.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-draft { background: rgba(148, 163, 184, 0.15); color: #475569; border-color: rgba(148, 163, 184, 0.35); }
.status-submitted { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.35); }
.status-approved { background: rgba(16, 185, 129, 0.15); color: #047857; border-color: rgba(16, 185, 129, 0.35); }
.status-rejected { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.35); }
.status-locked { background: rgba(59, 130, 246, 0.1); color: #1e3a8a; border-color: rgba(59, 130, 246, 0.3); }
.status-todo { background: rgba(148, 163, 184, 0.15); color: #475569; border-color: rgba(148, 163, 184, 0.35); }
.status-doing { background: rgba(245, 158, 11, 0.12); color: #92400e; border-color: rgba(245, 158, 11, 0.35); }
.status-done { background: rgba(16, 185, 129, 0.15); color: #047857; border-color: rgba(16, 185, 129, 0.35); }
.status-blocked { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.35); }

.priority-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.priority-low { background: rgba(148, 163, 184, 0.15); color: #475569; border-color: rgba(148, 163, 184, 0.35); }
.priority-medium { background: rgba(59, 130, 246, 0.12); color: #1d4ed8; border-color: rgba(59, 130, 246, 0.35); }
.priority-high { background: rgba(245, 158, 11, 0.12); color: #92400e; border-color: rgba(245, 158, 11, 0.35); }
.priority-critical { background: rgba(239, 68, 68, 0.12); color: #b91c1c; border-color: rgba(239, 68, 68, 0.35); }

/* ====================================
   KPI / METRICS
==================================== */
.metric {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: var(--space-8);
  font-family: 'Poppins', sans-serif;
}

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

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-12);
}

.kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* ====================================
   MISC
==================================== */
.note {
  margin: var(--space-12) 0;
  font-size: 12px;
  color: var(--text-muted);
}

.section {
  display: grid;
  gap: 18px;
  margin: 0 auto 26px;
  max-width: 1240px;
  width: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.section-title {
  font-family: 'Poppins', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.section-split {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cell-textarea {
  min-height: 56px;
  resize: vertical;
}

.report-notes {
  min-height: 160px;
  width: 100%;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.team-chip {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  display: grid;
  gap: 4px;
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-sm);
}

.team-chip span {
  color: var(--text-muted);
  font-size: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-light);
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  background: #072238;
  position: relative;
}

.login-card {
  width: min(460px, 100%);
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card h1 {
  font-size: 28px;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.login-card .form-row {
  margin-bottom: 20px;
}

.login-brand {
  justify-content: center;
  margin-bottom: 18px;
}

.login-brand img {
  width: 210px;
}

.login-title {
  text-align: center;
}

.login-footer {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.input-group {
  position: relative;
  width: 100%;
}

.input-group .input {
  padding-right: 84px;
}

.input-action {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.input-action:hover {
  background: var(--surface);
}

.login .button {
  min-height: 44px;
}

.notice {
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(198, 156, 64, 0.35);
  background: rgba(198, 156, 64, 0.12);
  color: #7a5b16;
  font-size: 13px;
}

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0b1f2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(2, 12, 27, 0.25);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 999;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ====================================
   RESPONSIVE
==================================== */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .main {
    padding: 24px;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .card-grid,
  .section-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .section {
    max-width: 100%;
  }

  .main {
    padding: 20px 16px 28px;
  }

  .side-panel {
    width: 100%;
    right: -100%;
  }

  .side-panel.open {
    right: 0;
  }

  .mobile-drawer {
    width: 100%;
    right: -100%;
  }

  body.drawer-open .mobile-drawer {
    right: 0;
  }

  .drawer-body .nav-item {
    width: 100%;
  }
  .mobile-only {
    display: inline-flex;
  }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--white);
    border-top: 1px solid var(--border-light);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    z-index: 20;
  }

  .mobile-tab {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
  }

  .mobile-tab.active {
    color: var(--accent);
  }

  .main {
    padding-bottom: 28px;
  }
}

@media (min-width: 769px) {
  .mobile-drawer,
  .drawer-backdrop,
  .mobile-nav,
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body,
  .app-root,
  .main {
    overflow-x: hidden;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .brand img {
    width: 140px;
  }

  .topbar-right {
    width: auto;
    justify-content: flex-end;
  }

  .topbar-right > :not(.mobile-only) {
    display: none !important;
  }

  .topbar-right {
    gap: 0;
  }

  .topbar-left .subtitle {
    display: none;
  }

  .menu-button {
    background: var(--white);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    gap: 8px;
  }

  .menu-button:active,
  .menu-button:focus-visible {
    background: #072238;
    color: var(--white);
    border-color: #072238;
  }

  .menu-icon {
    width: 16px;
    height: 12px;
    display: inline-block;
    position: relative;
  }

  .menu-icon::before,
  .menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .menu-icon::before {
    top: 0;
  }

  .menu-icon::after {
    bottom: 0;
  }

  .menu-icon span {
    position: absolute;
    left: 0;
    right: 0;
    top: 5px;
    height: 2px;
    background: currentColor;
    border-radius: 999px;
  }

  .table.mobile-stack thead {
    display: none;
  }

  .table.mobile-stack tbody tr {
    display: block;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--white);
  }

  .table.mobile-stack td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-light);
  }

  .table.mobile-stack td:last-child {
    border-bottom: none;
  }

  .table.mobile-stack td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted);
    min-width: 0;
  }

  .table-wrap {
    overflow-x: visible;
  }

  .table,
  .table.mobile-stack {
    width: 100%;
  }

  .table.mobile-stack textarea,
  .table.mobile-stack input,
  .table.mobile-stack select {
    width: 100%;
  }
}
