/* ============================================================
   BLINDS BROTHERS — Design System v1.0
   Drop-in replacement for DaisyUI
   Usage: replace your DaisyUI <link> with this file
   Fonts: add to <head>:
     <link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet">
   ============================================================ */


/* ── 1. RESET & BASE ─────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--bb-royal); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
hr { border: none; border-top: 1px solid var(--border-light); }


/* ── 2. DESIGN TOKENS ────────────────────────────────────── */

:root {
  /* Brand */
  --bb-navy:          #243856;
  --bb-navy-dark:     #172541;
  --bb-navy-deep:     #0f1d30;
  --bb-royal:         #4a73b1;
  --bb-royal-hover:   #3d62a0;
  --bb-royal-active:  #2f5191;
  --bb-royal-light:   #e8eef7;
  --bb-royal-mid:     #c5d5ed;
  --bb-gold:          #b8870a;
  --bb-gold-light:    #fdf6e3;
  --bb-gold-border:   #e8c96a;

  /* Semantic colors */
  --color-success:        #059669;
  --color-success-light:  #d1fae5;
  --color-success-dark:   #065f46;
  --color-warning:        #d97706;
  --color-warning-light:  #fef3c7;
  --color-warning-dark:   #92400e;
  --color-error:          #dc2626;
  --color-error-light:    #fee2e2;
  --color-error-dark:     #991b1b;
  --color-info:           #0284c7;
  --color-info-light:     #e0f2fe;
  --color-info-dark:      #0c4a6e;

  /* Surfaces */
  --bg-page:        #f0f3f8;
  --bg-card:        #ffffff;
  --bg-secondary:   #f7f9fc;
  --bg-tertiary:    #eef2f9;
  --bg-table-head:  #eef2f9;
  --bg-row-alt:     #f7f9fc;
  --bg-overlay:     rgba(0, 0, 0, 0.45);

  /* Text */
  --text-primary:   #1a2535;
  --text-secondary: #5a6a80;
  --text-muted:     #8fa0b8;
  --text-disabled:  #b8c5d4;
  --text-inverse:   #ffffff;
  --text-on-navy:   rgba(255, 255, 255, 0.88);

  /* Borders */
  --border-light: #e2e8f0;
  --border-mid:   #cbd5e1;
  --border-strong:#94a3b8;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.14), 0 8px 16px rgba(0,0,0,0.06);

  /* Typography */
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', 'Menlo', monospace;
  --text-xs:   11px;
  --text-sm:   12px;
  --text-base: 14px;
  --text-md:   15px;
  --text-lg:   16px;
  --text-xl:   18px;
  --text-2xl:  22px;
  --text-3xl:  28px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Z-index scale */
  --z-base:    1;
  --z-sticky:  10;
  --z-dropdown:50;
  --z-sidebar: 100;
  --z-overlay: 200;
  --z-modal:   300;
  --z-toast:   400;
  --z-topbar:  500;

  /* Transitions */
  --transition-fast: 0.12s ease;
  --transition-base: 0.18s ease;
  --transition-slow: 0.28s ease;
}


/* ── 3. TYPOGRAPHY ───────────────────────────────────────── */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-md); }
h6 { font-size: var(--text-base); }

p { color: var(--text-secondary); line-height: 1.65; }

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

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

.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-disabled  { color: var(--text-disabled); }
.text-success   { color: var(--color-success); }
.text-warning   { color: var(--color-warning); }
.text-error     { color: var(--color-error); }
.text-info      { color: var(--color-info); }
.text-navy      { color: var(--bb-navy); }
.text-royal     { color: var(--bb-royal); }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uppercase { text-transform: uppercase; letter-spacing: 0.06em; }
.label-caps {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}


/* ── 4. LAYOUT UTILITIES ─────────────────────────────────── */

.container      { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--space-6); }
.container-sm   { max-width: 900px; }
.container-lg   { max-width: 1440px; }

.flex           { display: flex; }
.inline-flex    { display: inline-flex; }
.grid           { display: grid; }
.block          { display: block; }
.inline-block   { display: inline-block; }
.hidden         { display: none !important; }

.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.items-stretch  { align-items: stretch; }
.justify-start  { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.justify-between{ justify-content: space-between; }
.flex-1         { flex: 1 1 0%; }
.flex-shrink-0  { flex-shrink: 0; }
.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-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

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

.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }
.inset-0  { inset: 0; }


/* ── 5. TOPBAR / NAVBAR ──────────────────────────────────── */

.navbar,
.topbar {
  background: var(--bb-navy);
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 2px 8px rgba(0,0,0,0.25);
  gap: var(--space-3);
}

.navbar-brand,
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo {
  width: 34px; height: 34px;
  background: var(--bb-royal);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: white;
  flex-shrink: 0;
}

.navbar-title {
  color: white;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.navbar-menu,
.topbar-nav {
  display: flex;
  gap: 2px;
  flex: 1;
  justify-content: center;
}

.navbar-menu a,
.topbar-nav a {
  color: white;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.navbar-menu a:hover,
.topbar-nav a:hover  { background: rgba(255,255,255,0.08); color: white; text-decoration: none; }
.navbar-menu a.active,
.topbar-nav a.active { background: rgba(255,255,255,0.14); color: white; }

.navbar-end,
.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Navbar ghost button (replaces btn-ghost on dark bg) */
.navbar-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  transition: all var(--transition-fast);
}
.navbar-btn:hover { background: rgba(255,255,255,0.14); color: white; }

/* Hamburger (mobile) */
.navbar-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
}
.navbar-hamburger span {
  display: block;
  width: 16px; height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: all 0.2s;
}


/* ── LAYOUT ───────────────────────────────────────────────── */

.layout {
  display: flex;
  min-height: calc(100vh - 58px);
}

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


/* ── 6. SIDEBAR (removed from app) ────────────────────────── */
/* .sidebar-item, .sidebar-section still in use by mobile drawer & welcome page */


/* ── 7. BUTTONS ──────────────────────────────────────────── */

/* Base .btn — replaces DaisyUI btn */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
  line-height: 1;
  user-select: none;
  vertical-align: middle;
}
.btn:active       { transform: scale(0.975); }
.btn:focus-visible{ outline: 2px solid var(--bb-royal); outline-offset: 2px; }
.btn:disabled,
.btn[disabled]    { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Sizes */
.btn-xs  { padding: 4px 9px;  font-size: var(--text-xs); border-radius: var(--radius-sm); gap: 4px; }
.btn-sm  { padding: 6px 12px; font-size: var(--text-sm); gap: 5px; }
.btn-md  { padding: 8px 16px; font-size: 13px; }
.btn-lg  { padding: 11px 22px;font-size: var(--text-md); gap: 9px; }
.btn-xl  { padding: 14px 28px;font-size: var(--text-lg); gap: 10px; }
.btn-wide{ width: 100%; }
.btn-icon{ padding: 7px; }
.btn-icon.btn-sm { padding: 6px; }
.btn-icon.btn-lg { padding: 10px; }
.btn-circle { border-radius: var(--radius-full); padding: 8px; }

/* Variants */
.btn-primary {
  background: var(--bb-royal);
  color: white;
  border-color: var(--bb-royal);
  box-shadow: 0 1px 3px rgba(74,115,177,0.30);
}
.btn-primary:hover  { background: var(--bb-royal-hover); border-color: var(--bb-royal-hover); text-decoration: none; color: white; }
.btn-primary:active { background: var(--bb-royal-active); }

.btn-secondary {
  background: var(--bb-navy);
  color: white;
  border-color: var(--bb-navy);
}
.btn-secondary:hover { background: var(--bb-navy-dark); border-color: var(--bb-navy-dark); color: white; text-decoration: none; }

.btn-outline {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-mid);
}
.btn-outline:hover { background: var(--bg-secondary); border-color: var(--bb-royal); color: var(--bb-royal); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-secondary); border-color: var(--border-light); text-decoration: none; }

.btn-link {
  background: transparent;
  color: var(--bb-royal);
  border-color: transparent;
  padding-left: 0; padding-right: 0;
}
.btn-link:hover { text-decoration: underline; }

.btn-success {
  background: var(--color-success);
  color: white;
  border-color: var(--color-success);
}
.btn-success:hover { background: var(--color-success-dark); border-color: var(--color-success-dark); color: white; text-decoration: none; }

.btn-warning {
  background: var(--color-warning);
  color: white;
  border-color: var(--color-warning);
}
.btn-warning:hover { background: var(--color-warning-dark); border-color: var(--color-warning-dark); color: white; text-decoration: none; }

.btn-error,
.btn-danger {
  background: var(--color-error);
  color: white;
  border-color: var(--color-error);
}
.btn-error:hover,
.btn-danger:hover { background: var(--color-error-dark); border-color: var(--color-error-dark); color: white; text-decoration: none; }

.btn-info {
  background: var(--color-info);
  color: white;
  border-color: var(--color-info);
}
.btn-info:hover { background: var(--color-info-dark); color: white; text-decoration: none; }

/* Button group */
.btn-group {
  display: inline-flex;
}
.btn-group .btn { border-radius: 0; border-right-width: 0; }
.btn-group .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-right-width: 1px; }


/* ── 8. FORM ELEMENTS ────────────────────────────────────── */

/* Base shared styles — replaces input, select, textarea DaisyUI */
.input,
.select,
.textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  display: block;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-card);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  line-height: 1;
  appearance: none;
  -webkit-appearance: none;
}
.input:focus,
.select:focus,
.textarea:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--bb-royal);
  box-shadow: 0 0 0 3px rgba(74,115,177,0.12);
}
.input:disabled,
select:disabled,
textarea:disabled {
  background: var(--bg-secondary);
  color: var(--text-disabled);
  cursor: not-allowed;
}
.input-error,
.input.error,
input.error { border-color: var(--color-error); }
.input-error:focus,
.input.error:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }

/* Search input used in index pages */
.search-input { display: block; width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border-mid); border-radius: var(--radius-md); font-size: 13px; font-family: var(--font-sans); color: var(--text-primary); background: var(--bg-card); transition: border-color var(--transition-fast), box-shadow var(--transition-fast); line-height: 1; appearance: none; -webkit-appearance: none; }
.search-input:focus { outline: none; border-color: var(--bb-royal); box-shadow: 0 0 0 3px rgba(74,115,177,0.12); }

/* Sizes */
.input-xs, .select-xs { height: 26px; padding: 0 7px; font-size: var(--text-xs); border-radius: var(--radius-sm); }
.input-sm, .select-sm { height: 32px; padding: 0 8px; font-size: var(--text-sm); }
.input-md, .select-md { height: 38px; }
.input-lg, .select-lg { height: 44px; padding: 0 14px; font-size: var(--text-md); }

/* Bordered variant (explicit DaisyUI class) */
.input-bordered,
.select-bordered { border-color: var(--border-mid); }

/* Ghost variant */
.input-ghost,
.select-ghost {
  background: transparent;
  border-color: transparent;
}
.input-ghost:focus,
.select-ghost:focus {
  background: var(--bg-card);
  border-color: var(--bb-royal);
}

/* Select arrow */
select,
.select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238fa0b8' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* Textarea */
textarea,
.textarea {
  height: auto;
  min-height: 90px;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.5;
}

/* Checkbox & radio */
input[type="checkbox"],
input[type="radio"] {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  vertical-align: middle;
  padding: 0;
}
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:checked {
  background: var(--bb-royal);
  border-color: var(--bb-royal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='white' stroke-width='2' d='M2 6l3 3 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
input[type="radio"]:checked {
  background: var(--bb-royal);
  border-color: var(--bb-royal);
  box-shadow: inset 0 0 0 3px white;
}
input[type="checkbox"]:focus,
input[type="radio"]:focus { outline: 2px solid var(--bb-royal); outline-offset: 2px; }

/* Toggle (replaces DaisyUI toggle) */
.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: var(--space-2);
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 36px; height: 20px;
  background: var(--border-mid);
  border-radius: var(--radius-full);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-xs);
}
.toggle input:checked ~ .toggle-track { background: var(--bb-royal); }
.toggle input:checked ~ .toggle-track::after { transform: translateX(16px); }

/* Range input */
input[type="range"] {
  height: 4px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--bb-royal-mid);
  cursor: pointer;
  padding: 0;
  accent-color: var(--bb-royal);
}

/* Form group / label */
.form-group,
.field-group { display: flex; flex-direction: column; gap: 5px; }
.form-label,
.field-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
}
.form-hint { font-size: var(--text-xs); color: var(--text-muted); margin-top: 3px; }
.form-error { font-size: var(--text-xs); color: var(--color-error); margin-top: 3px; }


/* ── 9. CARDS ────────────────────────────────────────────── */

/* Replaces DaisyUI card, card-body */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: var(--space-5) 22px; }
.card-header {
  padding: 14px 22px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.card-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.card-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
}
.card-compact .card-body { padding: var(--space-3) var(--space-4); }

/* Stat card (replaces DaisyUI stat) */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}
.stat-title  { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }
.stat-value  { font-size: var(--text-2xl); font-weight: 700; color: var(--text-primary); font-family: var(--font-sans); }
.stat-desc   { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.stat-figure { font-size: 28px; color: var(--bb-royal); }


/* ── 10. BADGES ──────────────────────────────────────────── */

/* Replaces DaisyUI badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-xs  { padding: 2px 6px; font-size: 10px; }
.badge-sm  { padding: 3px 8px; }
.badge-md  { padding: 3px 9px; }
.badge-lg  { padding: 5px 12px; font-size: var(--text-sm); }

.badge-primary  { background: var(--bb-royal-light); color: var(--bb-royal); border-color: var(--bb-royal-mid); }
.badge-secondary{ background: #e8ecf2; color: var(--bb-navy); }
.badge-success  { background: var(--color-success-light); color: var(--color-success-dark); }
.badge-warning  { background: var(--color-warning-light); color: var(--color-warning-dark); }
.badge-error    { background: var(--color-error-light); color: var(--color-error-dark); }
.badge-info     { background: var(--color-info-light); color: var(--color-info-dark); }
.badge-ghost    { background: var(--bg-secondary); color: var(--text-secondary); border-color: var(--border-light); }
.badge-outline  { background: transparent; border-color: currentColor; }

/* Dot badge (status indicator) */
.badge-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-sm);
}
.badge-dot::before {
  content: '';
  display: block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.badge-dot.success::before { background: var(--color-success); }
.badge-dot.warning::before { background: var(--color-warning); }
.badge-dot.error::before   { background: var(--color-error); }
.badge-dot.info::before    { background: var(--color-info); }


/* ── 11. TABLES ──────────────────────────────────────────── */

/* Replaces DaisyUI table, table-sm, table-zebra */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  white-space: nowrap;
}

.table thead tr {
  background: var(--bg-table-head);
  border-bottom: 2px solid var(--bb-royal-mid);
}
.table thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  white-space: nowrap;
}
.table thead th:first-child { border-radius: var(--radius-lg) 0 0 0; }
.table thead th:last-child  { border-radius: 0 var(--radius-lg) 0 0; }

.table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--bb-royal-light); }

.table tbody td {
  padding: 10px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* Modifiers */
.table-sm thead th,
.table-sm tbody td { padding: 6px 10px; font-size: var(--text-sm); }

.table-xs thead th,
.table-xs tbody td { padding: 4px 8px; font-size: var(--text-xs); }

.table-zebra tbody tr:nth-child(even) { background: var(--bg-row-alt); }
.table-zebra tbody tr:nth-child(even):hover { background: var(--bb-royal-light); }

.table-fixed { table-layout: fixed; }


/* ── 12. ALERTS ──────────────────────────────────────────── */

/* Replaces DaisyUI alert, alert-success, alert-warning etc. */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  border: 1px solid transparent;
  line-height: 1.5;
}
.alert i, .alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 600; margin-bottom: 2px; }

.alert-info    { background: var(--color-info-light);    color: var(--color-info-dark);    border-color: #bae6fd; }
.alert-success { background: var(--color-success-light); color: var(--color-success-dark); border-color: #bbf7d0; }
.alert-warning { background: var(--color-warning-light); color: var(--color-warning-dark); border-color: #fde68a; }
.alert-error   { background: var(--color-error-light);   color: var(--color-error-dark);   border-color: #fecaca; }
.alert-neutral { background: var(--bg-secondary);        color: var(--text-primary);        border-color: var(--border-light); }


/* ── 13. MODALS ──────────────────────────────────────────── */

/* Replaces DaisyUI modal, modal-box */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  transform: scale(0.95) translateY(8px);
  transition: transform var(--transition-base);
}
.modal-backdrop.open .modal-box {
  transform: scale(1) translateY(0);
}

.modal-box.modal-sm  { max-width: 380px; }
.modal-box.modal-lg  { max-width: 720px; }
.modal-box.modal-xl  { max-width: 960px; }
.modal-box.modal-full{ max-width: 95vw; max-height: 92vh; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) 24px var(--space-4);
  border-bottom: 1px solid var(--border-light);
}
.modal-title { font-size: var(--text-xl); font-weight: 600; }
.modal-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 5px;
  border-radius: var(--radius-sm);
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center;
  transition: all var(--transition-fast);
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-secondary); }
.modal-body   { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}


/* ── 14. DROPDOWNS ───────────────────────────────────────── */

.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: var(--z-dropdown);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 4px;
  display: none;
}
.dropdown-menu.open,
.dropdown:focus-within .dropdown-menu { display: block; }
.dropdown-menu.dropdown-right  { left: auto; right: 0; }
.dropdown-menu.dropdown-top    { top: auto; bottom: calc(100% + 4px); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  text-decoration: none;
  transition: background var(--transition-fast);
}
.dropdown-item:hover { background: var(--bb-royal-light); color: var(--bb-royal); text-decoration: none; }
.dropdown-item.active{ background: var(--bb-royal-light); color: var(--bb-royal); }
.dropdown-item.danger{ color: var(--color-error); }
.dropdown-item.danger:hover { background: var(--color-error-light); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }
.dropdown-label {
  padding: 6px 12px 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}


/* ── 15. TABS ────────────────────────────────────────────── */

.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-5);
}
.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.tab:hover { color: var(--bb-royal); text-decoration: none; }
.tab.active,
.tab[aria-selected="true"] {
  color: var(--bb-royal);
  border-bottom-color: var(--bb-royal);
  font-weight: 600;
}

/* Pill tabs variant */
.tabs-pill {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 3px;
  border-bottom: none;
  margin-bottom: var(--space-5);
}
.tabs-pill .tab {
  border-bottom: none;
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  margin-bottom: 0;
}
.tabs-pill .tab.active { background: var(--bg-card); color: var(--bb-royal); box-shadow: var(--shadow-xs); }


/* ── 16. LOADING / SPINNERS ──────────────────────────────── */

/* Replaces DaisyUI loading, loading-spinner */
.loading,
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid var(--bb-royal-mid);
  border-top-color: var(--bb-royal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.loading-xs, .spinner-xs { width: 12px; height: 12px; border-width: 2px; }
.loading-sm, .spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.loading-lg, .spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.loading-xl, .spinner-xl { width: 48px; height: 48px; border-width: 4px; }

.loading-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.loading-dots span {
  display: block;
  width: 6px; height: 6px;
  background: var(--bb-royal);
  border-radius: 50%;
  animation: blink 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes blink { 0%, 80%, 100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Full-page loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}


/* ── 17. TOASTS / FLASH MESSAGES ─────────────────────────── */

.toast-container {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: 380px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 13px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  background: var(--text-primary);
  color: white;
  animation: toastIn 0.2s ease-out;
  border-left: 4px solid transparent;
}
.toast-success { background: var(--color-success-dark); border-left-color: var(--color-success); }
.toast-warning { background: var(--color-warning-dark); border-left-color: var(--color-warning); }
.toast-error   { background: var(--color-error-dark);   border-left-color: var(--color-error); }
.toast-info    { background: var(--color-info-dark);    border-left-color: var(--color-info); }
.toast-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer; font-size: 16px; line-height: 1; padding: 0; }
.toast-close:hover { color: white; }

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

/* Rails flash messages */
.flash { padding: 12px 16px; border-radius: var(--radius-md); font-size: 13px; margin-bottom: var(--space-4); display: flex; align-items: center; gap: var(--space-2); }
.flash-notice,  .flash-success { background: var(--color-success-light); color: var(--color-success-dark); border: 1px solid #bbf7d0; }
.flash-alert,   .flash-warning { background: var(--color-warning-light); color: var(--color-warning-dark); border: 1px solid #fde68a; }
.flash-error,   .flash-danger  { background: var(--color-error-light);   color: var(--color-error-dark);   border: 1px solid #fecaca; }


/* ── 18. AVATAR ──────────────────────────────────────────── */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bb-royal-light);
  color: var(--bb-royal);
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  width: 36px; height: 36px;
}
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 30px; height: 30px; font-size: 12px; }
.avatar-md { width: 36px; height: 36px; font-size: 14px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 60px; height: 60px; font-size: 22px; }
.avatar-square { border-radius: var(--radius-md); }
.avatar-navy  { background: var(--bb-navy);  color: white; }
.avatar-royal { background: var(--bb-royal); color: white; }


/* ── 19. PAGINATION ──────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.page-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--transition-fast);
  background: transparent;
}
.page-item:hover { background: var(--bb-royal-light); color: var(--bb-royal); text-decoration: none; }
.page-item.active{ background: var(--bb-royal); color: white; border-color: var(--bb-royal); }
.page-item.disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }


/* ── 20. PROGRESS BAR ────────────────────────────────────── */

.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--bb-royal);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}
.progress-sm .progress-bar { height: 4px; }
.progress-lg .progress-bar { height: 10px; }
.progress-success .progress-bar { background: var(--color-success); }
.progress-warning .progress-bar { background: var(--color-warning); }
.progress-error   .progress-bar { background: var(--color-error); }


/* ── 21. TOOLTIPS ────────────────────────────────────────── */

[data-tip] { position: relative; cursor: default; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: white;
  font-size: var(--text-xs);
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: var(--z-dropdown);
}
[data-tip]:hover::after { opacity: 1; }


/* ── 22. DIVIDERS ────────────────────────────────────────── */

.divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin: var(--space-4) 0;
}
.divider::before,
.divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }


/* ── 23. BB-SPECIFIC COMPONENTS ──────────────────────────── */
/*    (custom to the CRM — not in DaisyUI)                    */

/* Option block (line items section) */
.option-block {
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.option-header {
  background: var(--bb-royal-light);
  border-bottom: 1px solid var(--bb-royal-mid);
  padding: 11px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.option-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--bb-navy);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.option-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ctrl-group  { display: flex; align-items: center; gap: 5px; }
.ctrl-label  { font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; display: flex; align-items: center; gap: 4px; }
.ctrl-select {
  height: 28px; padding: 0 6px;
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: white; color: var(--text-primary);
  width: 52px; cursor: pointer;
}

/* Addons bar */
.addons-bar {
  background: #f4f7fb;
  border-bottom: 1px solid var(--border-light);
  padding: 8px 18px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.addons-bar-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); white-space: nowrap; }
.addon-group { display: flex; align-items: center; gap: 5px; }
.addon-label { font-size: var(--text-sm); color: var(--text-secondary); white-space: nowrap; }
.addon-input {
  height: 26px; padding: 0 7px;
  border: 1px solid var(--border-mid); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: white; color: var(--text-primary);
  transition: border-color var(--transition-fast);
}
.addon-input:focus { outline: none; border-color: var(--bb-royal); }
.addon-sep { color: var(--border-mid); font-size: 16px; padding: 0 2px; }

/* Customer chip */
.customer-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 18px;
}

/* Appointment card */
.appt-card {
  background: var(--bb-gold-light);
  border: 1px solid var(--bb-gold-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.appt-title { font-size: 13px; font-weight: 600; color: #7a5000; display: flex; align-items: center; gap: 7px; margin-bottom: 14px; }
.appt-grid  { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

/* Summary panel */
.summary-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.summary-row:last-child { border-bottom: none; }
.summary-row.total-row {
  font-size: 16px; font-weight: 600; padding-top: 10px;
  border-top: 2px solid var(--bb-royal-mid); border-bottom: none; margin-top: 2px;
}
.summary-label { color: var(--text-secondary); }
.summary-val   { font-family: var(--font-sans); font-weight: 500; }
.summary-val.discount { color: var(--color-error); }

/* Line item inline inputs */
.ci {
  height: 30px; padding: 0 7px;
  border: 1px solid var(--border-light); border-radius: var(--radius-sm);
  font-size: var(--text-sm); background: transparent; color: var(--text-primary);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.ci:focus { border-color: var(--bb-royal); background: white; outline: none; box-shadow: 0 0 0 2px rgba(74,115,177,0.1); }
.ci-readonly { background: var(--bg-secondary) !important; cursor: default !important; color: var(--text-muted) !important; }
.price-input { font-family: var(--font-sans); text-align: right; }

/* Meta grid */
.meta-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 0.8fr 0.8fr;
  gap: 14px;
  align-items: end;
}

/* Table footer actions */
.table-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
  display: flex; align-items: center; gap: var(--space-4);
}
.tf-btn {
  font-size: var(--text-sm); font-weight: 600;
  background: none; border: none; cursor: pointer;
  display: flex; align-items: center; gap: 5px;
  padding: 0; transition: opacity var(--transition-fast);
  font-family: var(--font-sans);
}
.tf-btn:hover { opacity: 0.65; }
.tf-btn.add    { color: var(--bb-royal); }
.tf-btn.dup    { color: var(--color-success); }
.tf-btn.dup-opt{ color: var(--color-warning); }
.tfsep { color: var(--border-mid); }

/* Section label */
.section-label {
  font-size: var(--text-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 14px;
}

.section-divider { border: none; border-top: 1px solid var(--border-light); margin: 24px 0 16px; }

.section-hdr {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-hdr h2 {
  font-size: 16px; font-weight: 700; color: var(--text-primary); margin: 0;
  display: flex; align-items: center; gap: 6px;
}

/* Bottom row layout (notes + summary) */
.bottom-row { display: grid; grid-template-columns: 1fr 280px; gap: var(--space-4); align-items: start; }


/* ── 24. MOBILE STICKY SAVE BAR ──────────────────────────── */

.mobile-save-bar { display: none; }


/* ── 25. PAGE HEADER / BREADCRUMBS ───────────────────────── */

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-5); gap: var(--space-4);
}
.breadcrumb {
  display: flex; align-items: center; gap: 5px;
  font-size: var(--text-sm); color: var(--text-muted);
  margin-bottom: 6px;
}
.breadcrumb a { color: var(--bb-royal); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.page-title { font-size: var(--text-2xl); font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
.header-actions { display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }


/* ── 26. RESPONSIVE BREAKPOINTS ─────────────────────────── */

@media (max-width: 900px) {
  .navbar-menu,
  .topbar-nav { display: none; }
  .navbar-hamburger { display: flex; }
  .hide-md { display: none !important; }
}

@media (max-width: 768px) {
  /* Topbar */
  .navbar,
  .topbar { padding: 0 14px; gap: var(--space-2); }
  .navbar-title,
  .topbar .brand-name { display: none; }
  .navbar-btn span { display: none; }

  /* Layout */
  .layout { display: block; }
  .main, .page-main { padding: 14px; }

  /* Grids collapse */
  .meta-grid          { grid-template-columns: 1fr 1fr; }
  .appt-grid          { grid-template-columns: 1fr 1fr; }
  .bottom-row         { grid-template-columns: 1fr; }

  /* Page header */
  .page-header        { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .header-actions     { width: 100%; justify-content: flex-end; }
  .page-title         { font-size: var(--text-xl); }

  /* Customer chip */
  .customer-chip      { flex-wrap: wrap; gap: 8px; }

  /* Addons bar */
  .addons-bar         { gap: 8px; padding: 8px 12px; }
  .addon-sep          { display: none; }

  /* Hide desktop save, show mobile bar */
  .header-actions .btn-primary { display: none; }
  .mobile-save-bar {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--border-light);
    padding: 10px 16px;
    gap: 10px;
    z-index: calc(var(--z-sidebar) - 50);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  }
  .mobile-save-bar .btn { flex: 1; justify-content: center; }
  .main, .page-main   { padding-bottom: 80px; }

  /* Modal full width on mobile */
  .modal-backdrop     { padding: var(--space-3); align-items: flex-end; }
  .modal-box          { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-backdrop.open .modal-box { transform: scale(1) translateY(0); }

  .hide-sm { display: none !important; }
}

@media (max-width: 480px) {
  .meta-grid   { grid-template-columns: 1fr; }
  .appt-grid   { grid-template-columns: 1fr; }
  .customer-chip { flex-direction: column; align-items: flex-start; }
  .hide-xs { display: none !important; }
}

/* ── 27. PRINT ───────────────────────────────────────────── */

@media print {
  .navbar, .topbar, .mobile-save-bar,
  .no-print { display: none !important; }
  .main, .page-main { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  body { background: white; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   BB DESIGN SYSTEM — ADDITIONS
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Remove DM Mono entirely — use DM Sans everywhere ────────────────────── */
* { font-family: var(--font-sans); }

/* ── Topbar tweaks ────────────────────────────────────────────────────────── */
.topbar { height: 54px; gap: 12px; }
.navbar-title { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; color: white; white-space: nowrap; }
.topbar-btn { display: inline-flex; align-items: center; gap: 5px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12) !important; color: rgba(255,255,255,0.7); padding: 4px 10px; border-radius: 5px; font-size: 12px; font-weight: 500; cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s; }
.topbar-btn:hover { background: rgba(255,255,255,0.14) !important; color: white; }
.topbar-btn form, .topbar-btn input { display: contents; }

/* Hamburger button (shown at ≤900px) */
.topbar-hamburger { display: none; align-items: center; justify-content: center; width: 34px; height: 34px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); border-radius: 5px; color: rgba(255,255,255,0.8); font-size: 16px; cursor: pointer; flex-shrink: 0; }

/* ── Mobile drawer ────────────────────────────────────────────────────────── */
.mobile-drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 198; }
.mobile-drawer-overlay.open { display: block; }
.mobile-drawer { position: fixed; top: 54px; left: 0; bottom: 0; width: 260px; background: white; z-index: 199; transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 4px 0 24px rgba(0,0,0,0.15); overflow-y: auto; }
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-inner { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.mobile-drawer-divider { height: 1px; background: var(--border-light); margin: 8px 0; }
.mobile-drawer-signout { width: 100%; text-align: left; background: none; border: none; cursor: pointer; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius-md); font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.flash-notice { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.flash-alert  { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }

/* ── Sidebar removed ──────────────────────────────────────────────────────── */

/* ── Summary panel — no mono font ────────────────────────────────────────── */
.summary-val { font-weight: 600; }

/* ── Responsive additions ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .topbar-nav { display: none; }
  .topbar-hamburger { display: flex; }
}

/* ── Admin Dashboard Components ──────────────────────────────────────────── */

/* Page header with subtitle */
.page-title { font-size: 22px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.page-title i { color: var(--bb-royal); font-size: 20px; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* Admin badge in topbar */
.admin-badge { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); padding: 2px 9px; border-radius: 20px; letter-spacing: 0.04em; }

/* App layout (sidebar + main column) */
.app-layout { display: flex; min-height: calc(100vh - 54px); }
.main-content { flex: 1; padding: 28px 32px; overflow-y: auto; min-width: 0; }

/* Stat cards grid */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 20px 24px; display: flex; align-items: center; gap: 16px; }
.stat-icon { width: 44px; height: 44px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.stat-icon.royal  { background: var(--bb-royal-light); color: var(--bb-royal); }
.stat-icon.green  { background: #dcfce7; color: #16a34a; }
.stat-icon.muted  { background: var(--bg-secondary); color: var(--text-muted); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; font-weight: 500; }

/* Section title */
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 14px; }

/* Quick link cards grid */
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.link-card { background: #fff; border: 1px solid var(--border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 20px; text-decoration: none; display: flex; align-items: flex-start; gap: 14px; transition: all 0.18s; }
.link-card:hover { border-color: var(--bb-royal-mid); box-shadow: var(--shadow-md); transform: translateY(-1px); text-decoration: none; }
.link-icon { width: 40px; height: 40px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.link-body { min-width: 0; }
.link-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.link-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

/* Icon color pairs */
.ic-amber  { background: #fef3c7; color: #d97706; }
.ic-sky    { background: #e0f2fe; color: #0284c7; }
.ic-green  { background: #dcfce7; color: #16a34a; }
.ic-purple { background: #ede9fe; color: #7c3aed; }
.ic-orange { background: #ffedd5; color: #ea580c; }
.ic-indigo { background: #e0e7ff; color: #4338ca; }
.ic-rose   { background: #ffe4e6; color: #e11d48; }
.ic-slate  { background: #f1f5f9; color: #475569; }
.ic-teal   { background: #ccfbf1; color: #0f766e; }

/* Responsive collapse for admin dashboard grids */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .links-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .main-content { padding: 16px; }
  .stat-grid, .links-grid { grid-template-columns: 1fr; }
}
