/* ═══════════════════════════════════════════════════════════
   OBG — Design System
   ═══════════════════════════════════════════════════════════ */

/* ── Custom Properties ───────────────────────────────────── */
:root {
  --bg: #E1EADD;
  --bg-muted: #d5e0d0;
  --surface: #FFFFFF;
  --elevated: #FFFFFF;
  --accent: #FCB427;
  --accent-hover: #e5a220;
  --primary: #0D4C92;
  --primary-light: #1a6bc4;
  --primary-dark: #093a71;
  --cream: #E1DECE;
  --sage: #ADC4BF;
  --text: #2c2c2c;
  --text-muted: #6b6b6b;
  --text-on-primary: #FFFFFF;
  --text-on-accent: #2c2c2c;
  --border: #cdd5c8;
  --border-light: #d8e0d3;
  --danger: #c0392b;
  --danger-hover: #a93226;
  --success: #27ae60;
  --warning: #f39c12;
  --info: #2980b9;
  --info-bg: #d1ecf1;
  --info-text: #0c5460;
  --success-bg: #d4edda;
  --success-text: #155724;
  --error-bg: #f8d7da;
  --error-text: #721c24;
  --warning-bg: #fff8e1;
  --warning-text: #856404;
  --font: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-brand: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --btn-border: var(--primary);
  --btn-text: var(--primary);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(13, 76, 146, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(13, 76, 146, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(13, 76, 146, 0.10), 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-elevated: 0 12px 40px rgba(13, 76, 146, 0.12), 0 4px 12px rgba(0, 0, 0, 0.08);
  --transition: 150ms ease;
}

[data-theme="dark"] {
  --bg: #141210;
  --bg-muted: #1e1b17;
  --surface: #1a1714;
  --elevated: #23201b;
  --accent: #2d6090;
  --accent-hover: #245580;
  --primary: #fcb427;
  --primary-light: #fdc550;
  --primary-dark: #e5a220;
  --cream: #3a3630;
  --sage: #2a3634;
  --text: #ede8e0;
  --text-muted: #a8a196;
  --text-on-primary: #1a1208;
  --text-on-accent: #ede8e0;
  --border: #33302a;
  --border-light: #2a2722;
  --danger: #ef7b6b;
  --danger-hover: #ff968a;
  --success: #6acc8a;
  --warning: #f0b84a;
  --info: #7db8e8;
  --info-bg: #1c2a30;
  --info-text: #a8d4f0;
  --success-bg: #1c2e22;
  --success-text: #b0e0c4;
  --error-bg: #361f1f;
  --error-text: #f0bbb8;
  --warning-bg: #302818;
  --warning-text: #e8cc80;
  --btn-border: var(--primary);
  --btn-text: var(--primary);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 12px 40px rgba(0, 0, 0, 0.65), 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

img { max-width: 100%; display: block; }

/* ── Skip to main content ────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}
.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-elevated);
  text-decoration: none;
}

/* ── Container ────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
.site-header {
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary);
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  font-family: var(--font-brand);
}

.header-logo img {
  height: 36px;
  width: 36px;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-nav a {
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
}

.header-nav a:hover {
  color: var(--text);
  background: var(--bg-muted);
}

.header-nav a.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

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

/* ── Theme toggle ────────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--sage);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS — outline/border-based
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--btn-border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--btn-text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), border-color var(--transition);
  line-height: 1.4;
}

.btn:hover {
  background: color-mix(in srgb, var(--btn-border) 10%, transparent);
}

.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--btn-border); outline-offset: 2px; }

.btn-primary {
  border-color: var(--btn-border);
  color: var(--btn-text);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--btn-border) 15%, transparent);
}

.btn-secondary {
  border-color: var(--border);
  color: var(--text);
}

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

.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
  background: transparent;
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.btn-icon:hover { color: var(--text); border-color: var(--sage); }

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-row-inline {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.form-input {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}

.form-input::placeholder { color: var(--text-muted); }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-input option {
  color: var(--text);
  background: var(--surface);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* ═══════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════ */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.5;
}

.alert-info { background: var(--info-bg); color: var(--info-text); }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-responsive .admin-table {
  min-width: 600px;
}

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

.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 16px;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
}

.admin-table td {
  padding: 14px 16px;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-light);
}

.admin-table tbody tr {
  transition: background var(--transition);
}

.admin-table tbody tr:hover {
  background: var(--bg-muted);
}

.admin-table tbody tr.clickable {
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge-paid { background: rgba(39, 174, 96, 0.12); color: var(--success); }
.badge-pending { background: rgba(252, 180, 39, 0.12); color: #c48d00; }
.badge-partial { background: rgba(41, 128, 185, 0.12); color: var(--info); }
.badge-overdue { background: rgba(192, 57, 43, 0.12); color: var(--danger); }
.badge-active { background: rgba(39, 174, 96, 0.12); color: var(--success); }
.badge-inactive { background: rgba(192, 57, 43, 0.10); color: var(--danger); }

[data-theme="dark"] .badge-pending { color: var(--warning); }

/* ═══════════════════════════════════════════════════════════
   SIDEBAR LAYOUT (App pages)
   ═══════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 64px);
}

.app-sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  padding: 24px 0;
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.app-sidebar-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 8px;
}

.app-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color var(--transition), background var(--transition);
}

.app-sidebar a:hover {
  color: var(--text);
  background: var(--bg);
}

.app-sidebar a.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  border-left-color: var(--primary);
  font-weight: 600;
}

.app-main {
  flex: 1;
  padding: 32px;
  max-width: 100%;
  overflow-x: auto;
}

.app-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.app-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg) 100%);
  padding: 32px 0;
  border-bottom: 1px solid var(--border-light);
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-bottom: 4px;
}

.hero p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 600px;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════
   LINK CARDS (Homepage app grid)
   ═══════════════════════════════════════════════════════════ */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}

.link-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: var(--text);
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}

.link-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.link-card-label {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: 2px;
}

.link-card-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

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

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--primary);
}

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

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-card-sub {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  width: 100%;
  max-width: 400px;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.login-logo img {
  height: 72px;
  width: 72px;
}

.login-logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
  font-family: var(--font-brand);
}

.login-theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
}

/* ═══════════════════════════════════════════════════════════
   FLASH MESSAGES
   ═══════════════════════════════════════════════════════════ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flash-error { background: var(--error-bg); color: var(--error-text); }
.flash-success { background: var(--success-bg); color: var(--success-text); }
.flash-info { background: var(--info-bg); color: var(--info-text); }

/* ═══════════════════════════════════════════════════════════
   USER DROPDOWN
   ═══════════════════════════════════════════════════════════ */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color var(--transition);
}

.user-menu-trigger:hover {
  border-color: var(--sage);
}

.user-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 200;
  padding: 4px;
}

.user-menu-dropdown.open {
  display: block;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  font-size: 0.875rem;
  color: var(--text);
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  transition: background var(--transition);
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
  background: var(--bg-muted);
  color: var(--text);
}

.user-menu-dropdown .danger {
  color: var(--danger);
}

/* ═══════════════════════════════════════════════════════════
   HAMBURGER MENU
   ═══════════════════════════════════════════════════════════ */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  padding: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  z-index: 99;
  padding: 16px;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav a {
  display: block;
  padding: 12px 16px;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}

.mobile-nav a:hover,
.mobile-nav a.active {
  background: var(--bg-muted);
  color: var(--primary);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border-light);
  margin: 8px 0;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL SEARCH
   ═══════════════════════════════════════════════════════════ */
.search-result-item:hover,
.search-result-item:focus {
  background: var(--bg-muted) !important;
}

.search-result-item:last-child {
  border-bottom: none !important;
}

/* ═══════════════════════════════════════════════════════════
   SECTION
   ═══════════════════════════════════════════════════════════ */
.section {
  padding: 48px 0;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state-desc {
  font-size: 0.875rem;
  max-width: 400px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════
   SEARCH & FILTERS
   ═══════════════════════════════════════════════════════════ */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-bar .form-input {
  flex: 1;
  min-width: 200px;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */
.site-footer {
  margin-top: auto;
  padding: 24px;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */
main {
  flex: 1;
  padding: 32px 0;
}

/* ═══════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .hamburger { display: flex; }
  .header-nav { display: none; }
  .header-actions .user-menu { display: none; }
  .header-actions .global-search { display: none; }
  .container { padding: 0 16px; }
  .form-grid-2 { grid-template-columns: 1fr; }

  /* Sidebar → horizontal tabs on mobile */
  .app-layout { flex-direction: column; }
  .app-sidebar {
    width: 100%;
    min-width: unset;
    position: static;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding: 0;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .app-sidebar-title { display: none; }
  .app-sidebar a {
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: 12px 16px;
  }
  .app-sidebar a.active {
    border-left-color: transparent;
    border-bottom-color: var(--primary);
  }
  .app-main { padding: 20px 16px; }

  /* Grids */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .links-grid { grid-template-columns: 1fr; }

  /* Hero */
  .hero h1 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .login-card { padding: 28px 20px; }
}
