/* ─── Design tokens ──────────────────────────── */
:root {
  --primary: #1a56db;
  --primary-dark: #1341a8;
  --primary-light: #e8f0fe;
  --accent: #00b87a;
  --accent-dark: #00915f;
  --dark: #0f172a;
  --dark-secondary: #1e293b;
  --dark-tertiary: #334155;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --white: #ffffff;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --info: #3b82f6;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --header-height: 64px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

/* ─── Reset ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ─── Buttons ────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,219,0.35); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-outline-white { background: transparent; border-color: rgba(255,255,255,0.7); color: #fff; }
.btn-outline-white:hover { background: rgba(255,255,255,0.15); }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface); color: var(--text-primary); }

/* ─── Badges ─────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em;
}
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red    { background: #fee2e2; color: #991b1b; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-gray   { background: #f1f5f9; color: #475569; }

/* ─── Utility helpers ────────────────────────── */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.section-label {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 800;
  line-height: 1.2; color: var(--dark); margin-bottom: 16px;
}
.section-subtitle { font-size: 1.05rem; color: var(--text-secondary); max-width: 560px; line-height: 1.7; }
.text-center { text-align: center; }
.text-center .section-subtitle { margin: 0 auto; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ─── Icon box ───────────────────────────────── */
.icon-box { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.icon-box svg { width: 22px; height: 22px; }
.icon-box-blue   { background: #dbeafe; color: #1d4ed8; }
.icon-box-green  { background: #d1fae5; color: #059669; }
.icon-box-purple { background: #ede9fe; color: #7c3aed; }
.icon-box-orange { background: #ffedd5; color: #ea580c; }
.icon-box-red    { background: #fee2e2; color: #dc2626; }
.icon-box-teal   { background: #ccfbf1; color: #0f766e; }

/* ─── Avatar ─────────────────────────────────── */
.avatar { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-md { width: 40px; height: 40px; font-size: 0.875rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1rem; }
.avatar-blue   { background: #dbeafe; color: #1d4ed8; }
.avatar-green  { background: #d1fae5; color: #059669; }
.avatar-purple { background: #ede9fe; color: #7c3aed; }
.avatar-orange { background: #ffedd5; color: #ea580c; }

/* ─── Card ───────────────────────────────────── */
.card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--border); padding: 28px;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }

/* ════════════════════════════════════════════════
   APP SHELL LAYOUT
   ════════════════════════════════════════════════ */

body.app-layout {
  background: var(--surface);
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width); background: var(--dark);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200; transition: transform var(--transition), width var(--transition);
}
.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; }
.sidebar-brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 900; color: white; letter-spacing: -1px; flex-shrink: 0;
}
.sidebar-brand-name { font-size: 1.1rem; font-weight: 800; color: white; }
.sidebar-brand-sub { font-size: 0.65rem; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-section-label {
  padding: 16px 20px 6px; font-size: 0.65rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.25);
}

/* ── Menu search ─────────────────────────────────────────────────────────── */
.nav-search-wrap {
  position: relative; margin: 12px 12px 6px; display: flex; align-items: center;
}
.nav-search-icon {
  position: absolute; left: 10px; width: 15px; height: 15px;
  color: rgba(255,255,255,0.35); pointer-events: none;
}
.nav-search {
  width: 100%; padding: 8px 30px 8px 32px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px; color: white; font-size: 0.82rem; font-family: inherit;
  transition: border-color var(--transition), background var(--transition);
}
.nav-search::placeholder { color: rgba(255,255,255,0.35); }
.nav-search:focus { outline: none; border-color: var(--primary); background: rgba(255,255,255,0.09); }
.nav-search-clear {
  position: absolute; right: 8px; width: 18px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; color: rgba(255,255,255,0.45);
  border-radius: 4px;
}
.nav-search-clear:hover { color: white; background: rgba(255,255,255,0.1); }
.nav-search-clear svg { width: 13px; height: 13px; }
.nav-empty {
  padding: 20px 20px; text-align: center; font-size: 0.8rem; color: rgba(255,255,255,0.35);
}

/* ── Collapsible module groups ───────────────────────────────────────────── */
.nav-group { margin: 1px 0; }
.nav-group-header {
  width: calc(100% - 16px); margin: 1px 8px; box-sizing: border-box;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: none; border-radius: 8px; cursor: pointer;
  background: none; color: rgba(255,255,255,0.5);
  font-family: inherit; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; text-align: left;
  transition: background var(--transition), color var(--transition);
}
.nav-group-header:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); }
.nav-group-icon { width: 16px; height: 16px; flex-shrink: 0; color: rgba(255,255,255,0.4); }
.nav-group-header:hover .nav-group-icon { color: rgba(255,255,255,0.65); }
.nav-group-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-count {
  font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08); border-radius: 9px; padding: 1px 6px; min-width: 16px; text-align: center;
}
.nav-group-chevron {
  width: 14px; height: 14px; flex-shrink: 0; color: rgba(255,255,255,0.35);
  transition: transform var(--transition);
}
.nav-group.open .nav-group-chevron { transform: rotate(180deg); }
.nav-group.has-active > .nav-group-header .nav-group-icon,
.nav-group.has-active > .nav-group-header .nav-group-title { color: rgba(255,255,255,0.9); }
/* Collapsible body — animate height via max-height */
.nav-group-items {
  overflow: hidden; max-height: 0;
  transition: max-height var(--transition);
}
.nav-group.open > .nav-group-items { max-height: 1200px; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 22px; margin: 1px 8px; border-radius: 8px;
  cursor: pointer; text-decoration: none;
  color: rgba(255,255,255,0.55); font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-item-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.85); }
.nav-item.active { background: var(--primary); color: white; }
.nav-item.active .nav-icon { color: white !important; }
.nav-icon { width: 17px; height: 17px; flex-shrink: 0; color: rgba(255,255,255,0.4); }
.nav-item:hover .nav-icon { color: rgba(255,255,255,0.7); }

/* ── Collapsed (icon-only) sidebar ───────────────────────────────────────── */
.sidebar-collapse-btn {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px; cursor: pointer; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center; transition: background var(--transition);
}
.sidebar-collapse-btn:hover { background: var(--border); color: var(--dark); }

@media (min-width: 769px) {
  body.sidebar-collapsed .sidebar { width: var(--sidebar-collapsed-width); }
  body.sidebar-collapsed .main { margin-left: var(--sidebar-collapsed-width); }

  /* Logo: shrink + center */
  body.sidebar-collapsed .sidebar-logo { padding: 18px 8px 14px; }
  body.sidebar-collapsed .sidebar-brand { justify-content: center; }
  body.sidebar-collapsed .sidebar-brand img { height: 28px !important; }

  /* Let flyouts escape the rail (short list — no vertical scroll needed) */
  body.sidebar-collapsed .sidebar-nav { overflow: visible; }

  /* Search collapses to a centered icon button that re-expands the rail */
  body.sidebar-collapsed .nav-search-wrap { margin: 12px 8px 6px; cursor: pointer; }
  body.sidebar-collapsed .nav-search { padding: 0; height: 34px; width: 100%; color: transparent; cursor: pointer; }
  body.sidebar-collapsed .nav-search::placeholder { color: transparent; }
  body.sidebar-collapsed .nav-search-icon { left: 50%; transform: translateX(-50%); }
  body.sidebar-collapsed .nav-search-clear { display: none !important; }

  /* Group header → icon only */
  body.sidebar-collapsed .nav-group-header { justify-content: center; padding: 10px 0; }
  body.sidebar-collapsed .nav-group-title,
  body.sidebar-collapsed .nav-group-count,
  body.sidebar-collapsed .nav-group-chevron { display: none; }
  body.sidebar-collapsed .nav-group.has-active > .nav-group-header {
    background: rgba(255,255,255,0.08); border-radius: 8px;
  }

  /* Item list becomes a hover flyout anchored to the right of the group */
  body.sidebar-collapsed .nav-group { position: relative; }
  body.sidebar-collapsed .nav-group-items {
    position: absolute; left: calc(100% + 6px); top: 0; z-index: 300;
    min-width: 200px; max-height: none; overflow: visible;
    background: var(--dark); border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    opacity: 0; visibility: hidden; transform: translateX(-4px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  body.sidebar-collapsed .nav-group-items::before {
    content: attr(data-group-label);
    display: block; padding: 4px 10px 8px; font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4);
  }
  body.sidebar-collapsed .nav-group:hover > .nav-group-items {
    opacity: 1; visibility: visible; transform: translateX(0);
  }
  body.sidebar-collapsed .nav-group-items .nav-item { padding-left: 12px; }

  /* Footer → avatar + logout stacked and centered */
  body.sidebar-collapsed .sidebar-footer { flex-direction: column; gap: 8px; padding: 12px 8px; }
  body.sidebar-collapsed .sidebar-user { justify-content: center; padding: 6px; }
  body.sidebar-collapsed .sidebar-user-info { display: none; }
}
.nav-item-badge {
  margin-left: auto; color: white; font-size: 0.65rem; font-weight: 700;
  padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center;
  background: var(--danger);
}
.nav-item-badge-yellow { background: var(--warning); }
.nav-item-badge-blue { background: var(--primary); }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,0.07); display: flex; align-items: center; gap: 4px; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; transition: background var(--transition); flex: 1; min-width: 0; }
.sidebar-user:hover { background: rgba(255,255,255,0.06); }
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 0.72rem; color: rgba(255,255,255,0.4); }
.sidebar-logout-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.4);
  transition: background var(--transition), color var(--transition);
}
.sidebar-logout-btn:hover { background: rgba(220,38,38,0.15); color: #f87171; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.5); z-index: 150;
}

/* ─── Main area ──────────────────────────────── */
.main { margin-left: var(--sidebar-width); flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; transition: margin-left var(--transition); }

/* ─── Topbar ─────────────────────────────────── */
.topbar {
  height: var(--header-height); background: white; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; position: sticky; top: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.page-title { font-size: 1rem; font-weight: 700; color: var(--dark); }
.page-breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--text-muted); padding: 10px 28px 0; }
.page-breadcrumb span { color: var(--dark); font-weight: 500; }

.mobile-menu-btn {
  display: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px; cursor: pointer; color: var(--text-secondary);
  align-items: center; justify-content: center;
}
.notif-btn {
  position: relative; width: 36px; height: 36px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); color: var(--text-secondary);
}
.notif-btn:hover { border-color: var(--primary); color: var(--primary); }
.notif-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; background: var(--danger); border-radius: 50%; border: 2px solid white; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  cursor: pointer; font-size: 0.83rem; font-weight: 600; color: var(--dark);
  transition: all var(--transition);
}
.user-chip:hover { border-color: var(--primary); }

/* ─── User menu dropdown ─────────────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface-elevated, #fff);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  min-width: 220px;
  z-index: 9999;
  overflow: hidden;
  animation: dropIn .15s ease;
}
@keyframes dropIn { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.user-dropdown-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary), #1341a8);
  color: #fff;
}
.user-dropdown-name { font-weight: 700; font-size: 0.88rem; }
.user-dropdown-role { font-size: 0.72rem; color: rgba(255,255,255,0.7); margin-top: 2px; }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 0; }
.user-dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px;
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}
.user-dropdown-item:hover { background: var(--surface); }
.user-dropdown-item-danger { color: #dc2626; }
.user-dropdown-item-danger:hover { background: #fef2f2; }
.branch-dd-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: 0.83rem; color: var(--text-primary,#111); cursor: pointer; }
.branch-dd-item:hover { background: var(--bg-secondary,#f9fafb); }
.branch-dd-item.active { font-weight: 600; color: var(--primary,#f97316); }
.branch-dd-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-color,#d1d5db); flex-shrink: 0; }
.branch-dd-item.active .branch-dd-dot { background: var(--primary,#f97316); }

.date-picker-btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--surface); border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); font-size: 0.83rem; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; transition: all var(--transition);
}
.date-picker-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ─── Page content ───────────────────────────── */
.page-content { padding: 16px 28px 28px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-header-left h1 { display: none; }
.page-header-left p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0; }
.page-header-actions { display: flex; gap: 10px; }

/* ─── Filter toolbar ─────────────────────────── */
.filter-toolbar {
  background: white; border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 20px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border-dark);
  border-radius: var(--radius-sm); padding: 0 12px; flex: 1; min-width: 220px; max-width: 320px;
}
.search-box input {
  border: none; background: transparent; outline: none; font-size: 0.875rem;
  font-family: inherit; color: var(--dark); padding: 8px 0; width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.filter-select {
  height: 36px; border: 1px solid var(--border-dark); border-radius: var(--radius-sm);
  padding: 0 28px 0 10px; font-size: 0.83rem; font-family: inherit; color: var(--text-secondary);
  background: var(--surface) 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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 8px center;
  -webkit-appearance: none; appearance: none; outline: none; cursor: pointer;
}
.filter-count { margin-left: auto; font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; }

/* ─── Table card ─────────────────────────────── */
.table-card { background: white; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.table-card-header, .table-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.table-card-title, .table-title { font-size: 0.9rem; font-weight: 700; color: var(--dark); }
.table-card-sub, .table-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  padding: 10px 16px; text-align: left; font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.data-table th.sortable { cursor: pointer; user-select: none; }
.data-table th.sortable:hover { color: var(--primary); }
.data-table td { padding: 13px 16px; font-size: 0.85rem; color: var(--text-secondary); border-bottom: 1px solid var(--border); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface); }
.data-table.dense th { padding: 8px 8px; }
.data-table.dense td { padding: 7px 8px; font-size: 0.8rem; }
.data-table th.sticky-action, .data-table td.sticky-action {
  position: sticky; right: 0; background: white;
  box-shadow: -6px 0 8px -6px rgba(0,0,0,0.12);
}
.data-table th.sticky-action { background: var(--surface); z-index: 1; }
.data-table tbody tr:hover td.sticky-action { background: var(--surface); }
.td-code { font-weight: 700; color: var(--dark); font-family: monospace; font-size: 0.8rem; }
.td-name { font-weight: 600; color: var(--dark); }
.td-id { font-weight: 700; color: var(--dark); font-family: monospace; }
/* Clickable Qty OH cell — opens the item's stock movement history popup */
.qoh-link {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--primary); font-weight: 700;
  border-bottom: 1px dashed currentColor;
}
.qoh-link:hover { border-bottom-style: solid; }
.td-amount { font-weight: 700; color: var(--dark); }
.bool-yes { color: var(--success); }
.bool-no { color: var(--text-muted); }

.action-btns { display: flex; gap: 6px; }
.action-btn {
  width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border);
  background: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #fff1f2; }
/* Worded action ("Release", "Assign") — plain .action-btn is a fixed 30x30 icon slot, so a
   text label overflows the box instead of sitting inside it. Must stay after .action-btn
   to win on equal specificity. */
.action-btn.action-btn-text {
  display: inline-flex; /* so the cell's text-align can position it; .action-btn is block-level flex */
  width: auto; height: 28px; padding: 0 10px; gap: 4px;
  font-size: 0.78rem; font-weight: 600; white-space: nowrap; color: var(--text-secondary);
}

/* ─── Pagination ─────────────────────────────── */
.pagination {
  padding: 14px 20px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.pagination-info { font-size: 0.8rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 4px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  background: white; cursor: pointer; font-size: 0.8rem; font-family: inherit;
  color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ─── Slide panel ────────────────────────────── */
.panel-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(2px);
  z-index: 400; opacity: 0; pointer-events: none; transition: opacity 0.25s ease;
}
.panel-overlay.open { opacity: 1; pointer-events: all; }
.slide-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 680px;
  background: white; box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  z-index: 500; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.slide-panel.open { transform: translateX(0); }
.slide-panel-wide { width: 960px; }
.slide-panel-xwide { width: min(1280px, 96vw); }
.panel-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.panel-title { font-size: 1rem; font-weight: 700; color: var(--dark); }
.panel-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.panel-close {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--border);
  background: white; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all var(--transition);
}
.panel-close:hover { border-color: var(--danger); color: var(--danger); }
.panel-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 24px; flex-shrink: 0; }
.panel-tab {
  padding: 12px 20px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: none; background: transparent; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: all var(--transition); white-space: nowrap;
}
.panel-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.panel-tab:hover:not(.active) { color: var(--dark); }
.seg-control {
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px; flex-shrink: 0;
}
.seg-btn {
  border: none; background: transparent; padding: 6px 16px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-secondary);
  border-radius: 6px; cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.seg-btn:hover:not(.active) { color: var(--text-primary); }
.seg-btn.active { background: var(--white); color: var(--primary); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12); }
.panel-body { flex: 1; overflow-y: auto; padding: 24px; }
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
.panel-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); flex-shrink: 0;
}
.panel-footer-left { font-size: 0.78rem; color: var(--text-muted); }
.panel-footer-right { display: flex; gap: 10px; }

/* ─── Form components ────────────────────────── */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-row.single { grid-template-columns: 1fr; }
.form-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 0.78rem; font-weight: 600; color: var(--dark); }
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-input, .form-select-full {
  height: 38px; border: 1.5px solid var(--border-dark); border-radius: var(--radius-sm);
  padding: 0 12px; font-size: 0.875rem; font-family: inherit;
  color: var(--dark); background: white; outline: none; transition: all var(--transition);
}
.form-input:focus, .form-select-full:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.form-input.error, .form-select-full.error { border-color: var(--danger); }
.form-input::placeholder { color: var(--text-muted); }
.form-input:disabled { background: var(--surface); cursor: not-allowed; color: var(--text-muted); }
.form-select-full {
  background: white 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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; cursor: pointer; padding-right: 30px;
}
.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.form-error-msg { font-size: 0.72rem; color: var(--danger); display: none; }
.form-error-msg.show { display: block; }
.form-section-title {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin: 20px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* ─── Toggle switch ──────────────────────────── */
.checkbox-group { display: flex; align-items: center; gap: 10px; padding: 10px 0; }
.checkbox-toggle { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.checkbox-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; background: var(--border-dark); border-radius: 20px;
  cursor: pointer; transition: background 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform 0.2s;
}
.checkbox-toggle input:checked + .toggle-slider { background: var(--primary); }
.checkbox-toggle input:checked + .toggle-slider::before { transform: translateX(18px); }
.checkbox-label-text { font-size: 0.875rem; color: var(--dark); font-weight: 600; }
.checkbox-label-hint { font-size: 0.72rem; color: var(--text-muted); }

/* ─── Modal ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px); z-index: 600; display: none;
  align-items: center; justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal-card { background: white; border-radius: var(--radius-lg); padding: 32px; width: 400px; box-shadow: var(--shadow-lg); text-align: center; }
.modal-icon-danger { width: 52px; height: 52px; background: #fee2e2; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.modal-title { font-size: 1.1rem; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.modal-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* ─── Empty state ────────────────────────────── */
.empty-state { padding: 60px 20px; text-align: center; }
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; }
.empty-state-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }

/* ─── Dashboard ──────────────────────────────── */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.dashboard-greeting-title { font-size: 1.35rem; font-weight: 800; color: var(--dark); }
.dashboard-greeting-sub { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.dashboard-actions { display: flex; gap: 8px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; transition: box-shadow var(--transition); }
.kpi-card:hover { box-shadow: var(--shadow); }
.kpi-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kpi-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.kpi-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.kpi-icon-blue  { background: #eff6ff; color: #1d4ed8; }
.kpi-icon-green { background: #f0fdf4; color: #16a34a; }
.kpi-icon-amber { background: #fffbeb; color: #d97706; }
.kpi-icon-violet{ background: #f5f3ff; color: #7c3aed; }
.kpi-value { font-size: 1.9rem; font-weight: 800; color: var(--dark); line-height: 1.1; margin-bottom: 6px; }
.kpi-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 20px; }
.kpi-delta.up      { background: #f0fdf4; color: #16a34a; }
.kpi-delta.down    { background: #fef2f2; color: #dc2626; }
.kpi-delta.neutral { background: #f8fafc; color: var(--text-secondary); }
.kpi-sub { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.main-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; margin-bottom: 24px; }
.chart-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.chart-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 1rem; font-weight: 700; color: var(--dark); }
.chart-subtitle { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.chart-tabs { display: flex; gap: 4px; }
.chart-tab { padding: 4px 12px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--text-secondary); transition: all var(--transition); }
.chart-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chart-tab:hover:not(.active) { background: var(--surface); }
.svg-chart-wrapper { overflow: hidden; margin-top: 8px; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; }
.chart-axis-label { font-size: 0.72rem; color: var(--text-muted); }

.side-panel-grid { display: grid; gap: 16px; }

.recent-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.recent-table th { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 0 0 8px; border-bottom: 1px solid var(--border); text-align: left; }
.recent-table td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-primary); }
.recent-table tr:last-child td { border-bottom: none; }

.top-item-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.top-item-row:last-child { border-bottom: none; }
.top-item-rank { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); font-size: 0.72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.top-item-name { flex: 1; font-size: 0.83rem; font-weight: 600; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-item-revenue { font-size: 0.83rem; font-weight: 700; color: var(--text-primary); white-space: nowrap; }
.top-item-qty { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }

.stat-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 0.83rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }
.stat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-value { font-size: 0.9rem; font-weight: 700; color: var(--dark); }

.dash-range-btn { padding: 5px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: var(--white); color: var(--text-secondary); transition: all var(--transition); white-space: nowrap; }
.dash-range-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.dash-range-btn:hover:not(.active) { background: var(--surface); color: var(--text-primary); }

.loading-skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Responsive ─────────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity var(--transition); }
  .sidebar-overlay.open { opacity: 1; pointer-events: all; }
  .main { margin-left: 0; }
  .mobile-menu-btn { display: flex; }
  .sidebar-collapse-btn { display: none; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .slide-panel { width: 100%; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.triple { grid-template-columns: 1fr 1fr; }
}

/* ─── Language Switcher ──────────────────────────────────────────────────── */
.lang-switcher-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  cursor: pointer;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-primary, #111);
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.lang-switcher-btn:hover { background: var(--bg-secondary, #f9fafb); border-color: var(--primary, #4f46e5); }
.lang-switcher-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; }
.lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 140px;
  background: var(--bg-primary, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 9999;
  overflow: hidden;
  padding: 4px;
}
.lang-dd-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none; border-radius: 7px;
  background: none;
  cursor: pointer;
  font-family: inherit; font-size: 0.85rem;
  color: var(--text-primary, #111);
  text-align: left;
  transition: background 0.12s;
}
.lang-dd-item:hover { background: var(--bg-secondary, #f3f4f6); }
.lang-dd-item.active { background: var(--primary-light, #ede9fe); color: var(--primary, #4f46e5); font-weight: 600; }
.lang-dd-code { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; min-width: 22px; color: var(--text-muted, #6b7280); }
.lang-dd-item.active .lang-dd-code { color: var(--primary, #4f46e5); }
.lang-dd-native { font-size: 0.85rem; }

/* ── Employee Schedule — weekly grid ─────────────────────────────────────── */
.sched-weeknav { display: flex; align-items: center; gap: 8px; }
.sched-week-label { font-weight: 600; font-size: 0.85rem; color: var(--text-primary); min-width: 190px; text-align: center; }
.sched-totals { margin-left: auto; display: flex; align-items: center; gap: 16px; font-size: 0.82rem; }
.sched-totals-hrs { color: var(--text-secondary); font-weight: 600; }
.sched-totals-cost { color: var(--primary); font-weight: 700; }

.sched-grid-scroll { overflow-x: auto; }
.sched-grid-loading { padding: 40px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }

.sched-grid { width: 100%; border-collapse: collapse; min-width: 900px; }
.sched-grid th, .sched-grid td { border: 1px solid var(--border); vertical-align: top; }
.sched-grid thead th {
  background: var(--surface); padding: 8px 10px; text-align: center;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; color: var(--text-secondary); text-transform: uppercase;
}
.sched-grid thead th.sched-today { background: #eff6ff; color: var(--primary); }
.sched-dayname { font-size: 0.75rem; }
.sched-daydate { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; margin-top: 2px; }

.sched-emp-col { width: 180px; min-width: 180px; text-align: left; background: var(--surface); padding: 10px; }
.sched-emp-col .td-name { font-weight: 600; font-size: 0.83rem; color: var(--text-primary); }
.sched-emp-role { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.sched-cell { position: relative; padding: 4px; min-width: 110px; height: 62px; }
.sched-cell:hover { background: var(--surface); }
.sched-add {
  position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 5px;
  border: 1px dashed var(--border-dark, #cbd5e1); background: #fff; color: var(--text-muted);
  font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity var(--transition);
}
.sched-cell:hover .sched-add { opacity: 1; }
.sched-add:hover { border-color: var(--primary); color: var(--primary); }

.sched-shift {
  position: relative; background: #eff6ff; border: 1px solid #bfdbfe; border-left: 3px solid var(--primary);
  border-radius: 6px; padding: 5px 7px; margin-bottom: 4px; cursor: pointer; transition: background var(--transition);
}
.sched-shift:hover { background: #dbeafe; }
.sched-shift-time { font-size: 0.74rem; font-weight: 700; color: var(--text-primary); }
.sched-shift-hrs { font-size: 0.68rem; color: var(--text-secondary); margin-top: 1px; }
.sched-shift-role { font-size: 0.66rem; color: var(--primary); margin-top: 1px; font-weight: 600; }
.sched-shift-del {
  position: absolute; top: 2px; right: 3px; border: none; background: transparent; color: var(--text-muted);
  font-size: 14px; line-height: 1; cursor: pointer; padding: 0 2px; opacity: 0; transition: opacity var(--transition);
}
.sched-shift:hover .sched-shift-del { opacity: 1; }
.sched-shift-del:hover { color: var(--danger); }

.sched-total-col { width: 120px; min-width: 120px; text-align: center; padding: 10px; background: var(--surface); }
.sched-total-hrs { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; justify-content: center; gap: 6px; }
.sched-total-hrs.muted { color: var(--text-muted); font-weight: 500; }
.sched-total-cost { font-size: 0.78rem; color: var(--primary); font-weight: 600; margin-top: 3px; }

/* Repeat-day picker */
.sched-day-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sched-day-chip { position: relative; cursor: pointer; user-select: none; }
.sched-day-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.sched-day-chip span {
  display: inline-block; padding: 6px 12px; border: 1px solid var(--border-dark, #cbd5e1); border-radius: 20px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); background: #fff; transition: all var(--transition);
}
.sched-day-chip input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.sched-day-quick { display: flex; gap: 6px; margin-top: 8px; }

/* Bulk-action toast */
.sched-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 20px);
  background: #0f172a; color: #fff; padding: 11px 18px; border-radius: 8px; font-size: 0.83rem; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); opacity: 0; pointer-events: none; transition: all 0.25s ease; z-index: 2000;
}
.sched-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Manual Entry — Receive from File: saved mapping cards */
.mer-shortcut {
  border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
  background: var(--surface-alt); margin-bottom: 16px;
}
.mer-shortcut-title { font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.mer-maps { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.mer-map-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 11px 16px 11px 13px; border: 1.5px solid var(--border); border-radius: 12px;
  cursor: pointer; background: var(--white, #fff); transition: border-color .15s, box-shadow .15s, background .15s;
  min-width: 200px;
}
.mer-map-card:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(15,23,42,.10); }
.mer-map-card.selected { border-color: var(--primary); background: rgba(232,160,32,.08); }
.mer-map-ico {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--white, #fff); color: var(--primary); border: 1px solid var(--border);
}
.mer-map-card.selected .mer-map-ico { background: var(--primary); color: #fff; border-color: var(--primary); }
.mer-map-name { font-weight: 600; font-size: 0.9rem; line-height: 1.2; }
.mer-map-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 3px; }
.mer-map-check {
  position: absolute; top: 7px; right: 7px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--primary); color: #fff; display: none; align-items: center; justify-content: center;
}
.mer-map-card.selected .mer-map-check { display: flex; }
.mer-map-clear {
  background: none; border: none; cursor: pointer; padding: 0; margin-top: 10px;
  font-size: 0.78rem; color: var(--text-muted); text-decoration: underline;
}
.mer-map-clear:hover { color: var(--text-primary); }
.mer-uploadhint { font-size: 0.78rem; color: var(--text-muted); margin: 0 0 8px; }

/* ── Customer view panel — read-only detail (cv-*) ────────────────────────── */
/* Used by the "View" slide-panel on the Customers page. Read-only throughout:
   nothing here is an input, so the field styling is deliberately flatter than
   .form-input and carries no focus/hover state. */
.cv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin-bottom: 22px; }
.cv-grid.single { grid-template-columns: minmax(0, 1fr); }
.cv-field { min-width: 0; }
.cv-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.cv-value { font-size: 0.88rem; color: var(--text-primary); word-break: break-word; }
.cv-value.muted { color: var(--text-muted); }
.cv-value a { color: var(--primary); text-decoration: none; }
.cv-value a:hover { text-decoration: underline; }

/* Summary cards — the house-charge balance strip. */
.cv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.cv-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--surface); }
.cv-card-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.cv-card-value { font-size: 1.15rem; font-weight: 700; color: var(--dark); }
.cv-card-value.owes { color: var(--danger); }
.cv-card-value.clear { color: var(--success); }

.cv-section-title { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); margin: 4px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.cv-empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 0.85rem; }
.cv-table-wrap { overflow-x: auto; }
.cv-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.cv-pager-info { font-size: 0.8rem; color: var(--text-muted); }
.cv-amount-debit { color: var(--danger); font-weight: 600; }
.cv-amount-credit { color: var(--success); font-weight: 600; }
