/* ==========================================================================
   RMC BACKOFFICE — DESIGN SYSTEM v2.0
   Rwanda Media Commission Admin Panel
   
   Sections:
    1.  Tokens (CSS Custom Properties)
    2.  Reset & Base
    3.  Typography
    4.  Layout Shell (sidebar + topbar + content)
    5.  Sidebar
    6.  Top Navbar
    7.  Cards & Panels
    8.  Tables & DataTables
    9.  Forms & Inputs
   10.  Buttons
   11.  Badges & Status Pills
   12.  Modals & Dialogs
   13.  Alerts & Toasts
   14.  Stat Cards (Dashboard)
   15.  Tabs & Navs
   16.  Breadcrumbs & Page Headers
   17.  Dropdowns
   18.  Pagination
   19.  Wizard / Multi-step Forms
   20.  Utilities
   21.  Loading & Spinners
   22.  Animations & Transitions
   23.  Print
   24.  Responsive
   ========================================================================== */


/* ==========================================================================
   1. TOKENS
   ========================================================================== */

:root {
  /* — Brand — */
  --rmc-blue:          #034EA2;
  --rmc-blue-dark:     #022E63;
  --rmc-blue-light:    #E6EFF9;
  --rmc-blue-50:       #F0F6FF;
  --rmc-teal:          #0D9488;
  --rmc-teal-dark:     #0A5F57;

  /* — Semantic — */
  --rmc-primary:       var(--rmc-blue);
  --rmc-primary-hover: #02397A;
  --rmc-primary-light: var(--rmc-blue-light);
  --rmc-success:       #059669;
  --rmc-success-light: #ECFDF5;
  --rmc-warning:       #D97706;
  --rmc-warning-light: #FFFBEB;
  --rmc-danger:        #DC2626;
  --rmc-danger-light:  #FEF2F2;
  --rmc-info:          #0284C7;
  --rmc-info-light:    #F0F9FF;

  /* — Surfaces — */
  --rmc-bg:            #F4F6F9;
  --rmc-surface:       #FFFFFF;
  --rmc-surface-hover: #F8FAFC;
  --rmc-surface-alt:   #F8FAFD;
  --rmc-border:        #E2E8F0;
  --rmc-border-light:  #F1F5F9;
  --rmc-divider:       #EEF2F6;

  /* — Text — */
  --rmc-text:          #1A2332;
  --rmc-text-secondary:#5A6777;
  --rmc-text-muted:    #94A3B8;
  --rmc-text-inverse:  #FFFFFF;
  --rmc-text-link:     var(--rmc-primary);

  /* — Sidebar — */
  --sidebar-bg:        #0B1929;
  --sidebar-hover:     #122340;
  --sidebar-active:    var(--rmc-primary);
  --sidebar-text:      #94A3B8;
  --sidebar-text-active:#FFFFFF;
  --sidebar-width:     260px;
  --sidebar-collapsed: 68px;
  --sidebar-section:   rgba(255,255,255,0.04);

  /* — Topbar — */
  --topbar-bg:         #FFFFFF;
  --topbar-height:     60px;
  --topbar-shadow:     0 1px 3px rgba(0,0,0,0.06);

  /* — Typography — */
  --font-heading:      'Outfit', sans-serif;
  --font-body:         'DM Sans', sans-serif;
  --font-mono:         'JetBrains Mono', monospace;

  /* — Sizing scale — */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.8125rem;  /* 13px */
  --text-base: 0.875rem;   /* 14px */
  --text-md:   1rem;       /* 16px */
  --text-lg:   1.125rem;   /* 18px */
  --text-xl:   1.25rem;    /* 20px */
  --text-2xl:  1.5rem;     /* 24px */
  --text-3xl:  1.875rem;   /* 30px */

  /* — Spacing scale — */
  --space-1:  0.25rem;   /* 4px  */
  --space-2:  0.5rem;    /* 8px  */
  --space-3:  0.75rem;   /* 12px */
  --space-4:  1rem;      /* 16px */
  --space-5:  1.25rem;   /* 20px */
  --space-6:  1.5rem;    /* 24px */
  --space-8:  2rem;      /* 32px */
  --space-10: 2.5rem;    /* 40px */
  --space-12: 3rem;      /* 48px */

  /* — Radii — */
  --radius-sm:  4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  12px;
  --radius-2xl: 16px;
  --radius-pill: 9999px;

  /* — Shadows — */
  --shadow-xs:  0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

  /* — Transitions — */
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* — Z-index — */
  --z-sidebar:  100;
  --z-topbar:   110;
  --z-dropdown: 200;
  --z-modal:    300;
  --z-toast:    400;
  --z-overlay:  250;
}


/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--rmc-text);
  background-color: var(--rmc-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--rmc-text-link); text-decoration: none; transition: color var(--duration-fast); }
a:hover { color: var(--rmc-primary-hover); }

hr {
  border: none;
  border-top: 1px solid var(--rmc-divider);
  margin: var(--space-6) 0;
}

::selection {
  background-color: var(--rmc-blue-light);
  color: var(--rmc-blue-dark);
}

:focus-visible {
  outline: 2px solid var(--rmc-primary);
  outline-offset: 2px;
}


/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--rmc-text);
  margin: 0 0 var(--space-3) 0;
}

h1 { font-size: var(--text-3xl); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl);  }
h4 { font-size: var(--text-lg);  }
h5 { font-size: var(--text-md);  }
h6 { font-size: var(--text-base); text-transform: uppercase; letter-spacing: 0.04em; color: var(--rmc-text-secondary); }

p { margin: 0 0 var(--space-4) 0; color: var(--rmc-text-secondary); }
p:last-child { margin-bottom: 0; }

small, .text-sm  { font-size: var(--text-sm); }
.text-xs         { font-size: var(--text-xs); }
.text-base       { font-size: var(--text-base); }
.text-md         { font-size: var(--text-md); }
.text-lg         { font-size: var(--text-lg); }

.font-heading    { font-family: var(--font-heading); }
.font-mono       { font-family: var(--font-mono); }
.font-medium     { font-weight: 500; }
.font-semibold   { font-weight: 600; }
.font-bold       { font-weight: 700; }

.text-primary    { color: var(--rmc-primary) !important; }
.text-success    { color: var(--rmc-success) !important; }
.text-warning    { color: var(--rmc-warning) !important; }
.text-danger     { color: var(--rmc-danger) !important; }
.text-info       { color: var(--rmc-info) !important; }
.text-muted      { color: var(--rmc-text-muted) !important; }
.text-secondary  { color: var(--rmc-text-secondary) !important; }
.text-white      { color: #fff !important; }

code, .code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  background: var(--rmc-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rmc-border);
}


/* ==========================================================================
   4. LAYOUT SHELL
   ========================================================================== */

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: var(--z-sidebar);
  transition: width var(--duration-base) var(--ease-out);
  overflow: hidden;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--duration-base) var(--ease-out);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-height);
  flex-shrink: 0;
}

.app-content {
  flex: 1;
  padding: var(--space-6);
}

.app-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--rmc-border);
  background: var(--rmc-surface);
  font-size: var(--text-sm);
  color: var(--rmc-text-muted);
}

/* Collapsed sidebar state */
.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed); }
.sidebar-collapsed .app-main   { margin-left: var(--sidebar-collapsed); }
.sidebar-collapsed .sidebar-brand-text,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .nav-section-title,
.sidebar-collapsed .nav-link-text,
.sidebar-collapsed .nav-arrow { opacity: 0; width: 0; overflow: hidden; }
.sidebar-collapsed .sidebar-brand { justify-content: center; padding: var(--space-4) var(--space-2); }
.sidebar-collapsed .sidebar-nav .nav-link { justify-content: center; padding: var(--space-3) var(--space-2); }
.sidebar-collapsed .sidebar-nav .nav-link .nav-icon { margin-right: 0; }


/* ==========================================================================
   5. SIDEBAR
   ========================================================================== */

.app-sidebar {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
}

/* Brand area */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  min-height: var(--topbar-height);
}

.sidebar-brand img {
  height: 32px;
  width: auto;
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-family: var(--font-heading);
  font-size: var(--text-md);
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  transition: opacity var(--duration-fast);
}

.sidebar-brand-text span {
  display: block;
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--sidebar-text);
  letter-spacing: 0.03em;
}

/* Navigation */
.sidebar-nav-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-nav-wrap::-webkit-scrollbar { width: 4px; }
.sidebar-nav-wrap::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-section-title {
  padding: var(--space-4) var(--space-5) var(--space-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  transition: opacity var(--duration-fast);
}

.sidebar-nav .nav-item { position: relative; }

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-5);
  margin: 1px var(--space-2);
  color: var(--sidebar-text);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-nav .nav-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.sidebar-nav .nav-link.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.sidebar-nav .nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: var(--text-base);
  opacity: 0.8;
}

.sidebar-nav .nav-link.active .nav-icon { opacity: 1; }
.sidebar-nav .nav-link-text { transition: opacity var(--duration-fast); }

.nav-arrow {
  margin-left: auto;
  font-size: var(--text-xs);
  transition: transform var(--duration-fast), opacity var(--duration-fast);
}

.nav-item.open > .nav-link .nav-arrow { transform: rotate(90deg); }

/* Sub-nav */
.sub-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-base) var(--ease-out);
}

.nav-item.open > .sub-nav { max-height: 500px; }

.sub-nav .nav-link {
  padding-left: calc(var(--space-5) + 32px);
  font-size: var(--text-sm);
  font-weight: 400;
}

.sub-nav .nav-link::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--sidebar-text);
  opacity: 0.4;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.sub-nav .nav-link:hover::before,
.sub-nav .nav-link.active::before {
  background: var(--sidebar-text-active);
  opacity: 1;
}

.sub-nav .nav-link.active {
  background: rgba(255,255,255,0.06);
}

/* Sidebar footer */
.sidebar-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}


/* ==========================================================================
   6. TOP NAVBAR
   ========================================================================== */

.app-topbar {
  background: var(--topbar-bg);
  box-shadow: var(--topbar-shadow);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.topbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--rmc-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: var(--text-lg);
}

.topbar-toggle:hover {
  background: var(--rmc-bg);
  color: var(--rmc-text);
}

/* ── AI Search topbar button ── */
.topbar-ai-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 34px;
  border-radius: var(--radius-full, 999px);
  background: #ede9fe;
  color: #7c3aed;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .12s;
  white-space: nowrap;
}
.topbar-ai-btn:hover {
  background: #ddd6fe;
  box-shadow: 0 2px 8px rgba(124,58,237,.18);
  transform: translateY(-1px);
  color: #6d28d9;
  text-decoration: none;
}
.topbar-ai-btn.active {
  background: #7c3aed;
  color: #fff;
}
.topbar-ai-label {
  font-size: .8rem;
}
@media (max-width: 600px) {
  .topbar-ai-label { display: none; }
  .topbar-ai-btn   { padding: 0 10px; }
}

.topbar-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--rmc-text);
}

.topbar-spacer { flex: 1; }

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

.topbar-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--rmc-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: var(--text-md);
}

.topbar-btn:hover {
  background: var(--rmc-bg);
  color: var(--rmc-text);
}

.topbar-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--rmc-danger);
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
}

/* User menu */
.topbar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-1) var(--space-3) var(--space-1) var(--space-1);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background var(--duration-fast);
  border: none;
  background: none;
}

.topbar-user:hover { background: var(--rmc-bg); }

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--rmc-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  flex-shrink: 0;
}

.topbar-user-info {
  text-align: left;
  line-height: 1.3;
}

.topbar-user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--rmc-text);
}

.topbar-user-role {
  font-size: var(--text-xs);
  color: var(--rmc-text-muted);
}


/* ==========================================================================
   7. CARDS & PANELS
   ========================================================================== */

.card {
  background: var(--rmc-surface);
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-fast);
}

.card:hover { box-shadow: var(--shadow-sm); }
.card-flat { box-shadow: none; }
.card-flat:hover { box-shadow: none; }
.card-elevated { box-shadow: var(--shadow-md); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--rmc-border);
  gap: var(--space-4);
}

.card-header-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--rmc-text);
  margin: 0;
}

.card-header-subtitle {
  font-size: var(--text-sm);
  color: var(--rmc-text-muted);
  margin: 0;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-body {
  padding: var(--space-6);
}

.card-body-compact { padding: var(--space-4); }
.card-body-flush   { padding: 0; }

.card-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--rmc-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}

.card-accent-top { border-top: 3px solid var(--rmc-primary); }
.card-accent-success { border-top: 3px solid var(--rmc-success); }
.card-accent-warning { border-top: 3px solid var(--rmc-warning); }
.card-accent-danger  { border-top: 3px solid var(--rmc-danger); }


/* ==========================================================================
   8. TABLES & DATATABLES
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.rmc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.rmc-table thead th {
  background: var(--rmc-surface-alt);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rmc-text-secondary);
  border-bottom: 2px solid var(--rmc-border);
  white-space: nowrap;
}

.rmc-table tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--rmc-divider);
  vertical-align: middle;
  color: var(--rmc-text);
}

.rmc-table tbody tr { transition: background var(--duration-fast); }
.rmc-table tbody tr:hover { background: var(--rmc-blue-50); cursor: default; }
.rmc-table tbody tr.clickable:hover { cursor: pointer; }
.rmc-table tbody tr:last-child td { border-bottom: none; }

/* DataTables overrides */
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast);
  outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--rmc-primary);
  box-shadow: 0 0 0 3px var(--rmc-blue-light);
}

.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.dataTables_info { font-size: var(--text-sm); color: var(--rmc-text-muted); }


/* ==========================================================================
   9. FORMS & INPUTS
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--rmc-text);
  margin-bottom: var(--space-2);
}

.form-label .required {
  color: var(--rmc-danger);
  margin-left: 2px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.5625rem 0.75rem;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--rmc-text);
  background: var(--rmc-surface);
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--rmc-primary);
  box-shadow: 0 0 0 3px var(--rmc-blue-light);
}

.form-control::placeholder { color: var(--rmc-text-muted); }
.form-control:disabled, .form-control[readonly] {
  background: var(--rmc-bg);
  cursor: not-allowed;
  opacity: 0.7;
}

.form-control.is-invalid  { border-color: var(--rmc-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--rmc-danger-light); }

.form-control-sm { padding: 0.375rem 0.625rem; font-size: var(--text-sm); }
.form-control-lg { padding: 0.75rem 1rem; font-size: var(--text-md); }

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

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235A6777' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--rmc-text-muted);
  margin-top: var(--space-1);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--rmc-danger);
  margin-top: var(--space-1);
}

/* Input group */
.input-group {
  display: flex;
  align-items: stretch;
}

.input-group .form-control { border-radius: var(--radius-md) 0 0 var(--radius-md); }

.input-group-append {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  background: var(--rmc-bg);
  border: 1px solid var(--rmc-border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  color: var(--rmc-text-muted);
  font-size: var(--text-sm);
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.form-check-input {
  width: 16px;
  height: 16px;
  accent-color: var(--rmc-primary);
  cursor: pointer;
}

.form-check-label {
  font-size: var(--text-sm);
  color: var(--rmc-text);
  cursor: pointer;
}

/* Form layout helpers */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.form-row-2 { grid-template-columns: 1fr 1fr; }
.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }


/* ==========================================================================
   10. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.5625rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn i, .btn .icon { font-size: 1em; }

/* Primary */
.btn-primary {
  background: var(--rmc-primary);
  color: #fff;
  border-color: var(--rmc-primary);
}
.btn-primary:hover { background: var(--rmc-primary-hover); border-color: var(--rmc-primary-hover); color: #fff; }

/* Secondary / Outline */
.btn-secondary {
  background: var(--rmc-surface);
  color: var(--rmc-text);
  border-color: var(--rmc-border);
}
.btn-secondary:hover { background: var(--rmc-bg); color: var(--rmc-text); }

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--rmc-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--rmc-bg); color: var(--rmc-text); }

/* Success / Warning / Danger */
.btn-success { background: var(--rmc-success); color: #fff; border-color: var(--rmc-success); }
.btn-success:hover { background: #047857; color: #fff; }
.btn-warning { background: var(--rmc-warning); color: #fff; border-color: var(--rmc-warning); }
.btn-warning:hover { background: #B45309; color: #fff; }
.btn-danger  { background: var(--rmc-danger);  color: #fff; border-color: var(--rmc-danger); }
.btn-danger:hover  { background: #B91C1C; color: #fff; }

/* Soft variants */
.btn-soft-primary { background: var(--rmc-blue-light); color: var(--rmc-primary); }
.btn-soft-primary:hover { background: var(--rmc-primary); color: #fff; }
.btn-soft-success { background: var(--rmc-success-light); color: var(--rmc-success); }
.btn-soft-success:hover { background: var(--rmc-success); color: #fff; }
.btn-soft-danger { background: var(--rmc-danger-light); color: var(--rmc-danger); }
.btn-soft-danger:hover { background: var(--rmc-danger); color: #fff; }

/* Sizes */
.btn-sm { padding: 0.375rem 0.75rem; font-size: var(--text-xs); }
.btn-lg { padding: 0.75rem 1.5rem; font-size: var(--text-md); }
.btn-block { width: 100%; }

/* Icon-only button */
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
}
.btn-icon.btn-sm { width: 30px; height: 30px; }
.btn-icon.btn-lg { width: 44px; height: 44px; }


/* ==========================================================================
   11. BADGES & STATUS PILLS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2em 0.6em;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.badge-primary   { background: var(--rmc-blue-light); color: var(--rmc-primary); }
.badge-success   { background: var(--rmc-success-light); color: var(--rmc-success); }
.badge-warning   { background: var(--rmc-warning-light); color: var(--rmc-warning); }
.badge-danger    { background: var(--rmc-danger-light);  color: var(--rmc-danger); }
.badge-info      { background: var(--rmc-info-light);    color: var(--rmc-info); }
.badge-neutral   { background: var(--rmc-bg);            color: var(--rmc-text-secondary); }

/* Status dot */
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Solid badges */
.badge-solid-primary { background: var(--rmc-primary); color: #fff; }
.badge-solid-success { background: var(--rmc-success); color: #fff; }
.badge-solid-warning { background: var(--rmc-warning); color: #fff; }
.badge-solid-danger  { background: var(--rmc-danger);  color: #fff; }


/* ==========================================================================
   12. MODALS & DIALOGS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 41, 0.5);
  backdrop-filter: blur(4px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  z-index: var(--z-modal);
  background: var(--rmc-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-base) var(--ease-out);
}

.modal-dialog.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.modal-dialog-lg { max-width: 720px; }
.modal-dialog-xl { max-width: 960px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--rmc-border);
}

.modal-header h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  margin: 0;
  color: var(--rmc-text);
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  color: var(--rmc-text-muted);
  cursor: pointer;
  transition: all var(--duration-fast);
  font-size: var(--text-lg);
}

.modal-close:hover { background: var(--rmc-bg); color: var(--rmc-text); }

.modal-body { padding: var(--space-6); }

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--rmc-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
}


/* ==========================================================================
   13. ALERTS & TOASTS
   ========================================================================== */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.alert-content { flex: 1; }
.alert-title   { font-weight: 600; margin-bottom: var(--space-1); }
.alert-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  transition: opacity var(--duration-fast);
  font-size: var(--text-lg);
}
.alert-dismiss:hover { opacity: 1; }

.alert-info    { background: var(--rmc-info-light);    color: var(--rmc-info);    border-color: #BAE6FD; }
.alert-success { background: var(--rmc-success-light); color: var(--rmc-success); border-color: #A7F3D0; }
.alert-warning { background: var(--rmc-warning-light); color: var(--rmc-warning); border-color: #FDE68A; }
.alert-danger  { background: var(--rmc-danger-light);  color: var(--rmc-danger);  border-color: #FECACA; }

/* Toast */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  background: var(--rmc-surface);
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-4) var(--space-5);
  min-width: 320px;
  max-width: 420px;
  animation: toast-in var(--duration-base) var(--ease-out);
}

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


/* ==========================================================================
   14. STAT CARDS (Dashboard)
   ========================================================================== */

.stat-card {
  background: var(--rmc-surface);
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  transition: all var(--duration-fast);
  box-shadow: var(--shadow-xs);
}

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

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.stat-icon-primary { background: var(--rmc-blue-light); color: var(--rmc-primary); }
.stat-icon-success { background: var(--rmc-success-light); color: var(--rmc-success); }
.stat-icon-warning { background: var(--rmc-warning-light); color: var(--rmc-warning); }
.stat-icon-danger  { background: var(--rmc-danger-light);  color: var(--rmc-danger); }
.stat-icon-info    { background: var(--rmc-info-light);    color: var(--rmc-info); }

.stat-content { flex: 1; min-width: 0; }

.stat-label {
  font-size: var(--text-sm);
  color: var(--rmc-text-muted);
  margin-bottom: var(--space-1);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--rmc-text);
  line-height: 1.2;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: var(--space-1);
}

.stat-change-up   { color: var(--rmc-success); }
.stat-change-down { color: var(--rmc-danger); }


/* ==========================================================================
   15. TABS & NAVS
   ========================================================================== */

.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--rmc-border);
  gap: var(--space-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }

.tab-link {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--rmc-text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all var(--duration-fast);
}

.tab-link:hover { color: var(--rmc-text); }
.tab-link.active {
  color: var(--rmc-primary);
  border-bottom-color: var(--rmc-primary);
  font-weight: 600;
}

.tab-content { display: none; padding: var(--space-5) 0; }
.tab-content.active { display: block; }


/* ==========================================================================
   16. BREADCRUMBS & PAGE HEADERS
   ========================================================================== */

.page-header {
  margin-bottom: var(--space-6);
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--rmc-text);
  margin: 0;
  letter-spacing: -0.01em;
}

.page-subtitle {
  font-size: var(--text-sm);
  color: var(--rmc-text-muted);
  margin: var(--space-1) 0 0 0;
}

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

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-3) 0;
  font-size: var(--text-sm);
}

.breadcrumb-item { color: var(--rmc-text-muted); }
.breadcrumb-item a { color: var(--rmc-text-secondary); }
.breadcrumb-item a:hover { color: var(--rmc-primary); }
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  margin-right: var(--space-2);
  color: var(--rmc-text-muted);
  opacity: 0.5;
}
.breadcrumb-item.active { color: var(--rmc-text); font-weight: 500; }


/* ==========================================================================
   17. DROPDOWNS
   ========================================================================== */

.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: var(--rmc-surface);
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all var(--duration-fast) var(--ease-out);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(4px);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--rmc-text);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.dropdown-item:hover { background: var(--rmc-bg); }
.dropdown-item i { color: var(--rmc-text-muted); width: 16px; text-align: center; }

.dropdown-divider {
  height: 1px;
  background: var(--rmc-divider);
  margin: var(--space-2) 0;
}

.dropdown-item-danger { color: var(--rmc-danger); }
.dropdown-item-danger:hover { background: var(--rmc-danger-light); }

.dropdown-section-label {
  padding: var(--space-2) var(--space-3) var(--space-1);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--rmc-text-muted);
}

.topbar-btn.active { color: var(--rmc-primary); }


/* ==========================================================================
   18. PAGINATION
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 var(--space-2);
  font-size: var(--text-sm);
  color: var(--rmc-text-secondary);
  border: 1px solid var(--rmc-border);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.page-link:hover { background: var(--rmc-bg); color: var(--rmc-text); }

.page-item.active .page-link {
  background: var(--rmc-primary);
  color: #fff;
  border-color: var(--rmc-primary);
}

.page-item.disabled .page-link {
  opacity: 0.4;
  pointer-events: none;
}


/* ==========================================================================
   19. WIZARD / MULTI-STEP FORMS
   ========================================================================== */

.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-8);
  position: relative;
}

.wizard-step {
  flex: 1;
  text-align: center;
  position: relative;
}

.wizard-step::before {
  content: '';
  position: absolute;
  top: 16px;
  left: -50%;
  right: 50%;
  height: 2px;
  background: var(--rmc-border);
}

.wizard-step:first-child::before { display: none; }
.wizard-step.completed::before { background: var(--rmc-success); }
.wizard-step.active::before    { background: var(--rmc-primary); }

.wizard-step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  background: var(--rmc-bg);
  border: 2px solid var(--rmc-border);
  color: var(--rmc-text-muted);
  position: relative;
  z-index: 1;
  transition: all var(--duration-base);
}

.wizard-step.active .wizard-step-number {
  background: var(--rmc-primary);
  border-color: var(--rmc-primary);
  color: #fff;
}

.wizard-step.completed .wizard-step-number {
  background: var(--rmc-success);
  border-color: var(--rmc-success);
  color: #fff;
}

.wizard-step-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--rmc-text-muted);
  margin-top: var(--space-2);
  font-weight: 500;
}

.wizard-step.active .wizard-step-label { color: var(--rmc-primary); font-weight: 600; }
.wizard-step.completed .wizard-step-label { color: var(--rmc-success); }


/* ==========================================================================
   20. UTILITIES
   ========================================================================== */

/* Display */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }

/* Flex */
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }

/* Gap */
.gap-1 { gap: var(--space-1); } .gap-2 { gap: var(--space-2); } .gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); } .gap-5 { gap: var(--space-5); } .gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid */
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Margin */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; }      .mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: var(--space-2); }     .mb-2 { margin-bottom: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }     .mb-3 { margin-bottom: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }     .mb-4 { margin-bottom: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }     .mb-5 { margin-bottom: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }     .mb-6 { margin-bottom: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }     .mb-8 { margin-bottom: var(--space-8); }
.mr-2 { margin-right: var(--space-2); }   .ml-2 { margin-left: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }   .ml-3 { margin-left: var(--space-3); }
.ml-auto { margin-left: auto; }           .mr-auto { margin-right: auto; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-4 { padding: var(--space-4); } .p-5 { padding: var(--space-5); } .p-6 { padding: var(--space-6); }

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* Visibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Rounded */
.rounded-sm  { border-radius: var(--radius-sm); }
.rounded     { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 50%; }

/* Borders */
.border { border: 1px solid var(--rmc-border); }
.border-top { border-top: 1px solid var(--rmc-border); }
.border-bottom { border-bottom: 1px solid var(--rmc-border); }


/* ==========================================================================
   21. LOADING & SPINNERS
   ========================================================================== */

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--rmc-border);
  border-top-color: var(--rmc-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 2px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.spinner-white { border-color: rgba(255,255,255,0.3); border-top-color: #fff; }

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

/* Dot flashing loader */
.dot-loader {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot-loader span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rmc-primary);
  animation: dot-bounce 1.2s infinite ease-in-out;
}

.dot-loader span:nth-child(2) { animation-delay: 0.2s; }
.dot-loader span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dot-bounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--rmc-bg) 25%, var(--rmc-border-light) 50%, var(--rmc-bg) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

.skeleton-text { height: 14px; margin-bottom: var(--space-2); }
.skeleton-title { height: 22px; width: 60%; margin-bottom: var(--space-3); }
.skeleton-circle { width: 40px; height: 40px; border-radius: 50%; }

@keyframes skeleton-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Fullscreen loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-toast);
  backdrop-filter: blur(2px);
}


/* ==========================================================================
   22. ANIMATIONS & TRANSITIONS
   ========================================================================== */

.fade-in {
  animation: fadeIn var(--duration-base) var(--ease-out);
}

.slide-up {
  animation: slideUp var(--duration-base) var(--ease-out);
}

.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }

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

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}


/* ==========================================================================
   23. PRINT
   ========================================================================== */

@media print {
  .app-sidebar, .app-topbar, .app-footer,
  .btn, .no-print { display: none !important; }
  .app-main { margin-left: 0 !important; }
  .app-content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  body { font-size: 12pt; }
}


/* ==========================================================================
   24. RESPONSIVE
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }

  .app-sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--ease-out);
  }
  .app-main { margin-left: 0; }

  .sidebar-open .app-sidebar { transform: translateX(0); }
  .sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: calc(var(--z-sidebar) - 1);
  }
}

/* Mobile */
@media (max-width: 640px) {
  :root {
    --space-6: 1rem;
  }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row-2, .form-row-3 { grid-template-columns: 1fr; }

  .page-header-row { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: var(--text-xl); }

  .card-header { padding: var(--space-4); }
  .card-body   { padding: var(--space-4); }

  .stat-card { flex-direction: column; gap: var(--space-3); }

  .topbar-user-info { display: none; }
  .topbar-title { display: none; }
}
