/* ============================================
   Giooby Dashboard — TailAdmin-inspired Theme
   Sidebar: #3C8ACC | Body: #EBEBEB
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 0.875rem;
  background: #e8f0fa;
  color: #1a1a2e;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: #3C8ACC; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* === CSS Variables === */
:root {
  /* Primary */
  --primary: #0364B1;
  --primary-dark: #024f8e;
  --primary-light: #e8f2fb;
  --primary-50: #f0f7ff;

  /* Sidebar */
  --sidebar-bg: #0364B1;
  --sidebar-width: 170px;
  --sidebar-collapsed: 52px;
  --sidebar-text: #ffffff;
  --sidebar-text-muted: rgba(255, 255, 255, 0.7);
  --sidebar-active-bg: #024f8e;
  --sidebar-active-text: #ffffff;
  --sidebar-hover-bg: rgba(255, 255, 255, 0.15);
  --sidebar-border: rgba(255, 255, 255, 0.08);

  /* Body */
  --body-bg: #e8f0fa;
  --card-bg: #ffffff;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --card-radius: 7px;

  /* Topbar */
  --topbar-bg: #ffffff;
  --topbar-height: 64px;
  --topbar-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  /* Text */
  --text-primary: #1a1a2e;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-placeholder: #a0aec0;

  /* Borders */
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Status */
  --success: #22c55e;
  --success-bg: #dcfce7;
  --success-text: #166534;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --danger-text: #991b1b;
  --info: #3C8ACC;
  --info-bg: #e8f2fb;
  --info-text: #1e5a8a;

  /* Transitions */
  --transition: 0.2s ease;
}

/* === Typography === */
h1 { font-size: 1.75rem; font-weight: 700; color: var(--text-primary); line-height: 1.3; }
h2 { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); line-height: 1.3; }
h3 { font-size: 1.15rem; font-weight: 600; color: var(--text-primary); line-height: 1.4; }
h4 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.125rem; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-center { text-align: center; }

/* === Quick Filter Pills === */
.quick-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.quick-filter:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.quick-filter.active {
  background: #d0e4f7;
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.quick-filter.active .qf-count {
  color: inherit;
  opacity: 0.8;
}
.qf-count {
  font-size: 0.8em;
  font-weight: 400;
  color: inherit;
  opacity: 0.7;
}

/* === Layout: App Shell === */
.app { display: flex; min-height: 100vh; }

/* === Sidebar === */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 50;
  transition: width var(--transition);
  overflow: visible;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

/* Sidebar Logo */
.sidebar-logo {
  height: auto;
  padding: 6px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  background: #ffffff;
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.sidebar-location {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  text-align: right;
  width: 100%;
  margin-top: -16px;
  line-height: 1;
}
.collapsed .logo-text { display: none; }
.collapsed .logo-full { display: none !important; }
.collapsed .logo-mark { display: block !important; }

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.nav-section { margin-bottom: 20px; width: 100%; }
.nav-section-title {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
  white-space: nowrap;
}
.collapsed .nav-section-title { visibility: hidden; height: 0; margin: 0; padding: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 0.9375rem;
  font-weight: 400;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}
.nav-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-active-text);
  text-decoration: none;
}
.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #fbbf24;
  border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}
.nav-item .nav-label { white-space: nowrap; }
.collapsed .nav-label { display: none; }
.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.collapsed .nav-item .nav-icon { margin: 0; }
.collapsed .nav-item.active::before { display: none; }
/* Nav notification dot — right-side marker indicating new activity */
.nav-item .nav-dot {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  background: #fbbf24;
  border-radius: 50%;
}
.collapsed .nav-dot { right: 4px; }

/* Sidebar Bottom Nav (Settings) */
.sidebar-bottom-nav {
  padding: 8px 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
  margin-top: auto;
}
.collapsed .sidebar-bottom-nav .nav-item { justify-content: center; padding: 10px 0; }

/* Sidebar Toggle Button */
.sidebar-collapse-btn {
  position: absolute;
  bottom: 70px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: var(--sidebar-bg);
  border: 2px solid var(--border-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 51;
  transition: transform 0.2s ease, background 0.2s ease;
  color: #fff;
}
.sidebar-collapse-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}
.sidebar-collapse-btn svg { transition: transform 0.2s ease; }
.collapsed .sidebar-collapse-btn svg { transform: rotate(180deg); }

/* Sidebar User */
.sidebar-user {
  padding: 16px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user .user-info { white-space: nowrap; overflow: hidden; }
.sidebar-user .user-name { font-weight: 600; font-size: 13px; color: #fff; }
.sidebar-user .user-role { font-size: 11px; color: var(--sidebar-text-muted); }
.collapsed .user-info { display: none; }

/* === Main Content === */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .main { margin-left: var(--sidebar-collapsed); }

/* === Topbar === */
.topbar {
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--topbar-shadow);
}
.topbar-toggle {
  background: var(--primary);
  border: none;
  color: #ffffff;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-toggle:hover { background: var(--primary-dark); }
.topbar-toggle svg { transition: transform 0.2s ease; }
.sidebar.collapsed ~ .main .topbar-toggle svg { transform: rotate(180deg); }

.topbar-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.topbar-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #eef2f7;
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: border-color var(--transition);
}
.topbar-search input::placeholder { color: var(--text-placeholder); }
.topbar-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(60,138,204,0.1); }
.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-btn {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 1.15rem;
  position: relative;
  transition: background var(--transition);
}
.topbar-btn:hover { background: var(--border-light); }
.topbar-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--topbar-bg);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  transition: background var(--transition);
}
.topbar-user:hover { background: var(--border-light); }
.topbar-user .avatar-sm {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #fff;
}
.topbar-user .user-info-sm { text-align: left; }
.topbar-user .user-name-sm { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.topbar-user .user-role-sm { font-size: 11px; color: var(--text-secondary); }

/* === Content Area === */
.content { flex: 1; padding: 24px; max-width: 1280px; }
.dashboard-grid-3 > .card,
.dashboard-grid-equal > .card,
.dashboard-grid > .card { min-width: 0; overflow: hidden; }

/* === Page Header === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.page-header .breadcrumb a { color: var(--text-secondary); }
.page-header .breadcrumb a:hover { color: var(--primary); }
.page-header .breadcrumb .sep { color: var(--text-muted); }
.page-header-actions { display: flex; gap: 8px; }
.page-subtitle { margin-top: 4px; }
.btn-icon-img { height: 18px; vertical-align: middle; }
.export-icon { height: 42px; }
.export-icon-svg { height: 36px; width: 36px; vertical-align: middle; }

/* === Cards === */
.card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 20px; }
.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* === KPI Cards (global standard — matches Dashboard) === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.kpi-card {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  padding: 14px 16px;
}
.kpi-card .kpi-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.kpi-card .kpi-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: -2px;
}
.kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.kpi-card .kpi-label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 4px;
}
.kpi-label--title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.kpi-subtitle {
  margin-top: 4px;
  color: var(--text-secondary);
}
.kpi-card .kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-primary);
}
.kpi-card .kpi-trend {
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.kpi-card .kpi-trend.up { color: var(--success-text); background: var(--success-bg); }
.kpi-card .kpi-trend.down { color: var(--danger-text); background: var(--danger-bg); }
.kpi-card .kpi-trend.neutral { color: var(--text-secondary); background: #f1f5f9; }
.kpi-value--danger { color: var(--danger); }
.kpi-value--warning { color: var(--warning); }
.kpi-value-suffix {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* === Legacy stat-card aliases (use kpi-* for new pages) === */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.stat-card { background: var(--card-bg); border-radius: var(--card-radius); box-shadow: var(--card-shadow); border: 1px solid var(--border-color); padding: 14px 16px; display: flex; align-items: flex-start; gap: 16px; }
.stat-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-content { flex: 1; }
.stat-label { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.stat-change { display: inline-flex; align-items: center; gap: 4px; font-size: 0.75rem; font-weight: 600; margin-top: 6px; padding: 2px 6px; border-radius: 4px; }
.stat-change.up { color: var(--success-text); background: var(--success-bg); }
.stat-change.down { color: var(--danger-text); background: var(--danger-bg); }

/* === Filter Bar (global — search + pills + selectors above tables) === */
.filter-bar {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  background: #e3e3e3;
}
.filter-bar__search {
  flex: 0 0 auto;
  width: 350px;
  min-width: 180px;
}
.filter-bar__search-input {
  padding: 10px 12px;
  width: 100%;
  font-size: 0.8125rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  color: var(--text-primary);
  background: #fff;
}
.filter-bar__search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(60,138,204,0.12);
}
.filter-bar__search--with-btn {
  position: relative;
}
.filter-bar__search--with-btn .filter-bar__search-input {
  padding-right: 40px;
}
.filter-bar__search-btn {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  border: none;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.filter-bar__right {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* === Filter Pills (global — product type + status selectors) === */
.pricing-pill-filters {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pricing-pill {
  padding: 5px 12px;
  border: 1.5px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pricing-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pricing-pill--active {
  background: #d0e4f7;
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.pricing-pill--status-available {
  border: 2px solid #22c55e;
  color: var(--text-primary);
  font-weight: 600;
  background: #fff;
}
.pricing-pill--status-transit {
  border: 2px solid #3b82f6;
  color: var(--text-primary);
  font-weight: 600;
  background: #fff;
}
.pricing-pill--status-reserved {
  border: 2px solid #f59e0b;
  color: var(--text-primary);
  font-weight: 600;
  background: #fff;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--card-bg); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-light); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--border-light); color: var(--text-primary); }
.btn-sm { padding: 5px 12px; font-size: 0.8125rem; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-icon.sm { width: 30px; height: 30px; }

/* === Tables === */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #2a60ac;
  background: #ececed;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}
.th-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}
.th-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 5px;
  text-decoration: none;
  flex-shrink: 0;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--primary-50); }
.table-wrap::after {
  content: '';
  display: block;
  height: 24px;
}
.table-actions { display: flex; gap: 4px; }

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(0,0,0,0.08);
}
.badge-success { background: var(--success-bg); color: var(--success-text); border-color: #bbf7d0; }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); border-color: #fde68a; }
.badge-danger { background: var(--danger-bg); color: var(--danger-text); border-color: #fecaca; }
.badge-info { background: var(--info-bg); color: var(--info-text); border-color: #bfdbfe; }
.badge-neutral { background: #f1f5f9; color: #475569; border-color: #d0d5dd; }
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}
.badge-success.badge-dot::before { background: var(--success); }
.badge-warning.badge-dot::before { background: var(--warning); }
.badge-danger.badge-dot::before { background: var(--danger); }
.badge-info.badge-dot::before { background: var(--info); }

/* === Product Type Badge Variants === */
.badge--natural-slab {
  background: #c8def5; color: #0a4a8a;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge--engineered-slab {
  background: #ddd0f7; color: #5b21b6;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge--tiles-pavers {
  background: #b2f0e6; color: #065f56;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge--miscellaneous {
  background: #fde68a; color: #78350f;
  display: inline-flex; align-items: center; gap: 5px;
}
.badge--service {
  background: #c8e6c9; color: #2e7d32;
  display: inline-flex; align-items: center; gap: 5px;
}

/* === Forms === */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #64748b;
  border-radius: 7px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: #ffffff;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control::placeholder { color: var(--text-placeholder); }
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(60, 138, 204, 0.12);
}
.form-control.error { border-color: var(--danger); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' stroke='%2364748b' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
textarea.form-control { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* Checkbox / Toggle */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* === Tabs === */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #cbd5e1;
  margin-bottom: 20px;
}
.tab {
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* === Pagination === */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pagination .page-btn {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  transition: all var(--transition);
}
.pagination .page-btn:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .page-btn.disabled { opacity: 0.4; pointer-events: none; }

/* === Modal === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card-bg);
  border-radius: 7px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 1.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: var(--border-light); color: var(--text-primary); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* === Toast === */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 16px;
  border-radius: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  animation: toast-in 0.3s ease;
  min-width: 300px;
}
.toast-success { background: var(--success); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast-warning { background: var(--warning); color: #fff; }
.toast-info { background: var(--primary); color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === Dropdown === */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 60;
  padding: 4px;
}
.dropdown-menu.open { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-primary);
  border-radius: 6px;
  transition: background var(--transition);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.dropdown-item:hover { background: var(--border-light); text-decoration: none; }
.dropdown-divider { height: 1px; background: var(--border-color); margin: 4px 0; }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}
.empty-state h3 { color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { color: var(--text-secondary); margin-bottom: 20px; }

/* === Utility === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.p-4 { padding: 16px; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* === Responsive === */
@media (max-width: 1200px) {
  .stats-grid, .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { margin-left: 0 !important; }
  .stats-grid, .kpi-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* === Login Page === */
.auth-page {
  display: flex;
  min-height: 100vh;
}
.auth-form-panel {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 40px 40px;
  background: #e8f0fa;
}
.auth-form-inner { width: 100%; max-width: 420px; }
.auth-form-inner h1 { margin-bottom: 8px; }
.auth-form-inner .subtitle { color: var(--text-secondary); margin-bottom: 32px; }
.auth-brand-panel {
  flex: 1;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16vh 40px 40px;
  position: relative;
  overflow: hidden;
}
.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(60,138,204,0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(60,138,204,0.1) 0%, transparent 50%);
}
.auth-brand-panel .brand-content { position: relative; text-align: center; color: #fff; }
.auth-brand-panel .brand-logo {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  margin: 0 auto 20px;
}
.auth-brand-panel .brand-title { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.auth-brand-panel .brand-desc { font-size: 15px; color: rgba(255,255,255,0.7); max-width: 360px; line-height: 1.6; }

/* Grid Pattern for Auth Panel */
.grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
