/* ============================================================
   base.css — Design System Foundation
   All CSS custom properties (tokens) are defined here.
   All other CSS files must use these variables only.
   ============================================================ */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ui);
  background: var(--surface);
  color: var(--text-color);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}
ul {
  list-style: none;
}
img {
  display: block;
  max-width: 100%;
}
button {
  cursor: pointer;
  font: inherit;
  border: none;
  background: none;
}
button:disabled,
button[disabled] {
  cursor: not-allowed;
  opacity: 0.65;
}

/* ============================================================
   CSS CUSTOM PROPERTIES (Single source of truth)
   ============================================================ */
:root {

  /* --- Color Palette: Green --- */
  --green-900: #0d3320;
  --green-800: #134d2e;
  --green-700: #1a6b3c;
  --green-600: #228b4a;
  --green-500: #2da05a;
  --green-400: #4cbb7a;
  --green-300: #80d4a1;
  --green-100: #d6f4e4;
  --green-50:  #f0faf4;

  /* --- Color Palette: Slate --- */
  --slate-900: #0f1f16;
  --slate-700: #2c4535;
  --slate-500: #546e5f;
  --slate-300: #9ab8a5;
  --slate-100: #e8f2ec;
  --slate-50:  #f5faf7;

  /* --- Color Palette: Status --- */
  --color-error:   #e05353;
  --color-warning: #e89f2f;
  --color-info:    var(--green-400);
  --color-success: var(--green-500);

  /* --- Neutral --- */
  --white:   #ffffff;
  --black:   #000000;

  /* --- Surface & Background --- */
  --surface:        #fafcfb;
  --surface-raised: #ffffff;

  /* --- Border --- */
  --border-subtle: rgba(13, 51, 32, 0.08);
  --border-light:  rgba(13, 51, 32, 0.12);

  /* --- Shadow --- */
  --shadow-xs: 0 1px 2px  rgba(13, 51, 32, 0.06);
  --shadow-sm: 0 2px 8px  rgba(13, 51, 32, 0.08);
  --shadow-md: 0 6px 24px rgba(13, 51, 32, 0.10);
  --shadow-lg: 0 16px 48px rgba(13, 51, 32, 0.14);
  --shadow-xl: 0 24px 64px rgba(13, 51, 32, 0.18);

  /* --- Typography: Fonts --- */
  --font-ui:      "DM Sans", "Segoe UI", system-ui, sans-serif;
  --font-display: "Bricolage Grotesque", "DM Sans", sans-serif;
  --font-mono:    "JetBrains Mono", "Fira Code", monospace;

  /* Aliases for semantic use */
  --font-heading: var(--font-display);
  --font-body:    var(--font-ui);

  /* --- Typography: Size --- */
  --text-xs:   11px;
  --text-sm:   13px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   16px;

  --heading-1-size: 26px;
  --heading-2-size: 22px;
  --heading-3-size: 18px;

  /* --- Typography: Color & Weight --- */
  --text-color:       var(--slate-900);
  --heading-color:    var(--green-900);
  --heading-weight:   700;
  --muted-color:      var(--slate-500);
  --link-color:       var(--green-700);
  --link-hover-color: var(--green-800);

  /* Aliases for legacy compatibility */
  --title-color:  var(--heading-color);
  --title-weight: var(--heading-weight);

  /* --- Layout --- */
  --header-h:  60px;
  --sidebar-w: 248px;
  --footer-h:  72px;

  /* --- Border Radius --- */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* --- Animation --- */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 140ms;
  --t-mid:  220ms;
  --t-slow: 360ms;

  /* --- Button Tokens --- */
  --btn-bg:              var(--green-700);
  --btn-bg-hover:        var(--green-800);
  --btn-text:            var(--white);
  --btn-border-radius:   var(--radius-sm);
  --btn-padding:         10px 24px;
  --btn-disabled-opacity: 0.5;

  /* --- Input / Form Tokens --- */
  --input-bg:            var(--white);
  --input-border:        var(--border-light);
  --input-border-focus:  var(--green-500);
  --input-radius:        var(--radius-sm);
  --input-padding:       10px 14px;
  --input-font-size:     var(--text-base);
  --input-color:         var(--slate-900);
  --input-placeholder:   var(--slate-300);
  --input-shadow-focus:  0 0 0 3px rgba(45, 160, 90, 0.18);
  --label-color:         var(--slate-700);
  --label-font-size:     var(--text-sm);
  --label-weight:        600;

  /* --- Card Tokens --- */
  --card-bg:      var(--surface-raised);
  --card-border:  var(--border-subtle);
  --card-radius:  var(--radius-md);
  --card-shadow:  var(--shadow-md);
  --card-padding: 24px;

  /* --- Table Tokens --- */
  --table-header-bg:    var(--slate-50);
  --table-header-color: var(--slate-700);
  --table-row-hover:    var(--green-50);
  --table-border:       var(--border-subtle);

  /* --- Badge / Status Tokens --- */
  --badge-radius: 999px;
  --badge-font-size: var(--text-xs);
}

/* ============================================================
   GLOBAL PAGE LAYOUT
   ============================================================ */
.main {
  max-width: 1360px;
  margin: 2rem auto;
  padding: 0 0.75rem;
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  background: var(--surface);
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.pagetitle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.pagetitle h1,
.card_title,
.section-title,
.modal-title,
.profile-name {
  font-family: var(--font-heading);
  font-weight: var(--title-weight);
  color: var(--title-color);
}

.pagetitle h1      { font-size: var(--heading-1-size); margin: 8px 0 4px; }
.card_title,
.section-title     { font-size: var(--heading-2-size); }
.modal-title,
.profile-name      { font-size: var(--heading-3-size); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--muted-color);
  list-style: none;
  padding: 0;
}
.breadcrumb svg {
  width: 14px;
  height: 14px;
  color: var(--green-500);
}
.breadcrumb a,
.breadcrumb-item a {
  color: var(--link-color);
  text-decoration: none;
  transition: color var(--t-fast);
}
.breadcrumb a:hover,
.breadcrumb-item a:hover {
  color: var(--link-hover-color);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn,
.btn-primary,
.btn-save,
.btn-submit,
.btn-back,
.card_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--btn-text);
  background: var(--btn-bg);
  border: none;
  border-radius: var(--btn-border-radius);
  padding: var(--btn-padding);
  cursor: pointer;
  transition:
    background var(--t-fast),
    box-shadow  var(--t-fast),
    transform   var(--t-fast);
}
.btn:hover,
.btn-primary:hover,
.btn-save:hover,
.btn-submit:hover,
.card_button:hover {
  background: var(--btn-bg-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn:active,
.btn-primary:active,
.btn-save:active,
.btn-submit:active,
.card_button:active {
  transform: translateY(0);
}
.btn:disabled,
.btn-primary:disabled,
.btn-save:disabled,
.btn-submit:disabled,
.card_button:disabled {
  opacity: var(--btn-disabled-opacity);
  cursor: not-allowed;
  transform: none;
}

/* Back button — overrides to ghost style */
.btn-back {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  color: var(--link-color);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
}
.btn-back:hover {
  background: var(--green-100);
  color: var(--link-hover-color);
  box-shadow: none;
  transform: none;
}

/* ============================================================
   CARD
   ============================================================ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.card-body {
  padding: var(--card-padding);
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 900;
  background: var(--white);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: center;
  padding: 0 1.25rem 0 0.875rem;
  gap: 0.75rem;
  will-change: transform;
}

/* Sidebar toggle */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-xs);
  color: var(--green-800);
  transition: background var(--t-fast) var(--ease-out);
  flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--green-50); }
.sidebar-toggle svg   { width: 22px; height: 22px; }
.sidebar-toggle span  {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--slate-700);
}

/* Brand / Logo */
.header-brand {
  flex: 1;
  display: flex;
  justify-content: center;
}
.header-brand a {
  display: block;
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  transition: opacity var(--t-fast);
}
.header-brand a:hover { opacity: 0.82; }
.header-brand img     { height: 40px; width: auto; }

/* Actions cluster */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
  flex-shrink: 0;
}

/* Icon button */
.icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--slate-700);
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast);
}
.icon-btn:hover {
  background: var(--green-50);
  color: var(--green-700);
}
.icon-btn svg { width: 20px; height: 20px; }

/* Notification badge */
.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--badge-radius);
  background: var(--green-600);
  color: var(--white);
  font-size: var(--badge-font-size);
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
}

/* Avatar button */
.avatar-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border-radius: var(--badge-radius);
  background: var(--green-50);
  border: 1px solid var(--border-light);
  color: var(--slate-900);
  font-size: 0.82rem;
  font-weight: 600;
  transition: background var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
}
.avatar-btn:hover {
  background: var(--green-100);
  box-shadow: var(--shadow-xs);
}
.avatar-btn img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-btn .caret {
  width: 14px;
  height: 14px;
  color: var(--muted-color);
  transition: transform var(--t-fast) var(--ease-out);
}
.avatar-btn.open .caret { transform: rotate(180deg); }
.avatar-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown { position: relative; }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem 0;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  pointer-events: none;
  transform-origin: top right;
  transition:
    opacity   var(--t-mid) var(--ease-out),
    transform var(--t-mid) var(--ease-out);
  will-change: opacity, transform;
}
.dropdown-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dropdown-header-row {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dropdown-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.25rem 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1rem;
  font-size: var(--text-base);
  color: var(--slate-700);
  transition: background var(--t-fast), color var(--t-fast);
}
.dropdown-item:hover {
  background: var(--green-50);
  color: var(--green-800);
}
.dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--muted-color);
}
.dropdown-item:hover svg { color: var(--green-600); }

/* ============================================================
   NOTIFICATION PANEL
   ============================================================ */
.notif-panel {
  min-width: 320px;
  max-width: 400px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  font-size: var(--text-base);
  color: var(--slate-700);
}
.notif-panel::-webkit-scrollbar       { width: 6px; }
.notif-panel::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.notif-item {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: background var(--t-fast);
}
.notif-item:hover            { background: var(--green-50); }
.notif-item.unread           { border-left-color: var(--green-500); }
.notif-item p                { margin: 0; line-height: 1.4; }
.notif-item.unread p         { font-weight: 600; color: var(--slate-900); }
.notif-item .notif-date      { font-size: var(--text-xs); color: var(--slate-300); margin-top: 0.25rem; }

.notif-footer {
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: flex-end;
}
.notif-footer a {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--green-600);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  background: var(--green-50);
  transition: background var(--t-fast);
}
.notif-footer a:hover { background: var(--green-100); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.site-sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  bottom: var(--footer-h);
  width: var(--sidebar-w);
  z-index: 800;
  background: var(--white);
  border-right: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
  transform: translateX(0);
  transition:
    transform   var(--t-slow) var(--ease-out),
    box-shadow  var(--t-slow);
  will-change: transform;
}
.site-sidebar::-webkit-scrollbar       { width: 4px; }
.site-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
.site-sidebar.collapsed                { transform: translateX(calc(-1 * var(--sidebar-w))); box-shadow: none; }

/* Nav */
.sidebar-nav          { padding: 1rem 0 5rem; }
.nav-item             { margin: 0 0.5rem 0.125rem; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--slate-700);
  position: relative;
  overflow: hidden;
  transition:
    background  var(--t-fast),
    color       var(--t-fast),
    transform   var(--t-fast);
}
.nav-link:hover  { background: var(--green-50);  color: var(--green-800); transform: translateX(2px); }
.nav-link.active { background: var(--green-100); color: var(--green-800); font-weight: 600; }
.nav-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--green-600);
  transition: color var(--t-fast);
}
.nav-link:hover svg,
.nav-link.active svg { color: var(--green-700); }

.nav-section-label {
  padding: 1rem 1.375rem 0.25rem;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate-300);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-top: 2rem;
  margin-left: var(--sidebar-w);
  margin-bottom: calc(var(--footer-h) + 8px);
  padding: 0.75rem 0.5rem;
  min-height: calc(100vh - var(--header-h) - var(--footer-h) - 8px);
  transition: margin-left var(--t-slow) var(--ease-out);
}
.main-content.expanded { margin-left: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  position: fixed;
  inset: auto 0 0 0;
  height: var(--footer-h);
  z-index: 900;
  background: var(--green-800);
  display: flex;
  align-items: center;
  justify-content: center;
}
.site-footer p {
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--text-xs);
  text-align: center;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/* Auth footer (gradient variant) */
.auth-footer {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 900;
  width: 100%;
  min-height: var(--footer-h);
  padding: 12px 16px;
  display: grid;
  gap: 4px;
  text-align: center;
  color: var(--white);
  font-size: 0.89rem;
  line-height: 1.5;
  background: linear-gradient(90deg, #0d7c5b 0%, #124143 55%, #d99839 100%);
  box-shadow: 0 -3px 13px rgba(0, 0, 0, 0.14);
}
.auth-footer p   { max-width: 920px; margin: 0 auto; }
.auth-footer a   { color: #fef6dd; text-decoration: none; font-weight: 700; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer span {
  display: inline-block;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.72);
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-container {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
}
.flash {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-light);
  font-size: var(--text-base);
  font-weight: 500;
  color: var(--text-color);
  animation: flashIn var(--t-mid) var(--ease-spring) forwards;
  max-width: min(480px, 92vw);
}
.flash.success { border-left: 3px solid var(--color-success); }
.flash.error   { border-left: 3px solid var(--color-error); }
.flash.warning { border-left: 3px solid var(--color-warning); }
.flash.info    { border-left: 3px solid var(--color-info); }
.flash strong  { font-weight: 700; }

.flash-close {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-color);
  transition: background var(--t-fast);
  flex-shrink: 0;
}
.flash-close:hover  { background: var(--slate-100); }
.flash-close svg    { width: 14px; height: 14px; }

@keyframes flashIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)      scale(1);    }
}
@keyframes flashOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    max-height: 0;
    padding: 0;
    margin: 0;
  }
}
.flash.removing {
  animation: flashOut var(--t-mid) var(--ease-out) forwards;
  overflow: hidden;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(13, 31, 22, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-mid) var(--ease-out);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 440px;
  padding: 1.75rem;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--t-mid) var(--ease-spring);
}
.modal-overlay.open .modal-box { transform: translateY(0) scale(1); }

.modal-title {
  font-family: var(--font-display);
  font-size: var(--heading-3-size);
  font-weight: var(--heading-weight);
  color: var(--text-color);
  margin-bottom: 0.75rem;
}
.modal-body {
  font-size: 0.9rem;
  color: var(--slate-700);
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* ============================================================
   SIDEBAR BACKDROP (mobile)
   ============================================================ */
.sidebar-backdrop {
  display: none;
  pointer-events: none;
  position: fixed;
  inset: var(--header-h) 0 var(--footer-h) 0;
  background: rgba(13, 31, 22, 0.35);
  backdrop-filter: blur(2px);
  z-index: 799;
  opacity: 0;
  transition: opacity var(--t-slow);
}
.sidebar-backdrop.visible {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================
   INFO NOTICE (breadcrumb / page area)
   ============================================================ */
.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-left: 4px solid var(--green-500);
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: var(--text-sm);
  color: var(--slate-700);
  line-height: 1.55;
}
.notice-bar svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--green-600);
}

/* ============================================================
   SEARCH BAR
   ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-bar label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--slate-700);
  white-space: nowrap;
}

.search-bar input[type="search"],
.search-bar input[type="text"] {
  flex: 1;
  min-width: 200px;
  padding: var(--input-padding);
  border: 1px solid var(--input-border);
  border-radius: var(--input-radius);
  background: var(--input-bg);
  font-family: var(--font-ui);
  font-size: var(--input-font-size);
  color: var(--input-color);
  outline: none;
  transition:
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}
.search-bar input[type="search"]::placeholder,
.search-bar input[type="text"]::placeholder {
  color: var(--input-placeholder);
}
.search-bar input[type="search"]:focus,
.search-bar input[type="text"]:focus {
  border-color: var(--input-border-focus);
  box-shadow: var(--input-shadow-focus);
}

.search-bar .btn-search {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: var(--btn-border-radius);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background var(--t-fast),
    box-shadow var(--t-fast),
    transform var(--t-fast);
}
.search-bar .btn-search:hover {
  background: var(--btn-bg-hover);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.search-bar .btn-search:active {
  transform: translateY(0);
}
.search-bar .btn-search svg {
  width: 15px;
  height: 15px;
}

/* ============================================================
   PAGE HEADER ROW
   Title + filter tabs on the same line
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .filter-tabs {
    width: 100%;
  }
  .filter-tab {
    flex: 1;
    justify-content: center;
  }
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: calc(var(--footer-h) + 16px);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--green-600);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity var(--t-mid) var(--ease-out),
    transform var(--t-mid) var(--ease-out),
    background var(--t-fast);
  z-index: 800;
  text-decoration: none;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--green-500);
  box-shadow: var(--shadow-lg);
}
.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .site-sidebar {
    transform: translateX(calc(-1 * var(--sidebar-w)));
    box-shadow: none;
  }
  .site-sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  .sidebar-backdrop {
    display: block;
    pointer-events: none;
  }
  .sidebar-backdrop.visible { pointer-events: auto; }

  .main-content { margin-left: 0; }
  .avatar-name  { display: none; }

  .auth-footer {
    padding: 14px 10px;
    font-size: 0.86rem;
  }

  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar input[type="search"],
  .search-bar input[type="text"] {
    min-width: 0;
    width: 100%;
  }
  .search-bar .btn-search {
    width: 100%;
    justify-content: center;
  }

}

@media (min-width: 769px) {
  .sidebar-backdrop { display: none !important; }
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
