/**
 * SAW GLOBAL MINING ENTERPRISE SYSTEM
 * Premium Design System v2
 * Brand: Deep Navy (#061B36) + Gold (#D6A62E)
 * Inspiration: Ayman NPetro Enterprise Platform
 */

:root {
  --saw-primary: #061B36;
  --saw-secondary: #0B2D52;
  --saw-deep: #031326;
  --saw-gold: #D6A62E;
  --saw-gold-light: #F4C766;
  --saw-white: #FFFFFF;
  --saw-bg: #F4F7FB;
  --saw-text: #0F172A;
  --saw-muted: #64748B;
  --saw-border: #DCE3EC;
  --saw-card: #FFFFFF;
  --saw-success: #16A34A;
  --saw-danger: #DC2626;
  --saw-warning: #F59E0B;
  --saw-info: #2563EB;
  --saw-purple: #7C3AED;
  --saw-cyan: #0891B2;
  --saw-orange: #EA580C;

  --shadow-xs: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0,0,0,0.1),0 1px 2px -1px rgba(0,0,0,0.1);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1),0 8px 10px -6px rgba(0,0,0,0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0,0,0,0.25);
  --shadow-gold: 0 4px 14px 0 rgba(214,166,46,0.25);
  --shadow-navy: 0 4px 14px 0 rgba(6,27,54,0.15);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 280px;
  --topbar-height: 74px;
  --transition-fast: 150ms cubic-bezier(0.4,0,0.2,1);
  --transition-base: 250ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 350ms cubic-bezier(0.4,0,0.2,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--saw-text);
  background-color: var(--saw-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }

/* ===== SVG ICON ===== */
.icon { width: 20px; height: 20px; stroke: currentColor; flex: 0 0 auto; stroke-width: 2; }
.nav-link .icon { width: 18px; height: 18px; }

/* ===== LAYOUT ===== */
.app-shell { display: flex; min-height: 100vh; }
.print-brand-header, .print-brand-footer { display: none; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  background: linear-gradient(180deg, #061B36 0%, #0B2D52 30%, #031326 100%);
  box-shadow: 12px 0 35px rgba(6,27,54,0.18);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-base);
  overflow: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(214,166,46,0.35); border-radius: var(--radius-full); }

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  position: relative;
}
.sidebar-logo { width: 46px; height: 46px; object-fit: contain; border-radius: 14px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.sidebar-brand::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(214,166,46,0.3), transparent);
}
.sidebar-brand .brand-text strong { letter-spacing: 0.02em; }
.sidebar-brand .brand-text small { letter-spacing: 0.12em; }
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--saw-gold), var(--saw-gold-light));
  color: var(--saw-primary);
  display: grid;
  place-items: center;
  font-weight: 1000;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.brand-text { display: flex; flex-direction: column; }
.brand-text strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--saw-white);
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.brand-text small {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--saw-gold-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 0.5rem 0 2rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(214,166,46,0.25) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(214,166,46,0.25); border-radius: var(--radius-full); }

.nav-section {
  padding: 0.7rem 1.25rem 0.3rem;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5);
  margin-top: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.nav-section:first-child { margin-top: 0; border-top: none; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin: 2px 10px;
  border-radius: 14px;
  color: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.nav-link:hover {
  color: var(--saw-white);
  background: rgba(255,255,255,0.1);
  transform: translateX(3px);
}
.nav-link.active {
  background: linear-gradient(135deg, rgba(214,166,46,0.2) 0%, rgba(214,166,46,0.06) 100%);
  color: var(--saw-white);
  font-weight: 700;
  box-shadow: inset 4px 0 0 var(--saw-gold), 0 0 20px rgba(214,166,46,0.08);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 10px;
  bottom: 10px;
  width: 4px;
  background: var(--saw-gold);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
  box-shadow: 0 0 12px rgba(214,166,46,0.4);
}
.nav-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s ease;
  color: var(--saw-gold-light);
}
.nav-link:hover .nav-icon { background: rgba(214,166,46,0.12); transform: scale(1.08); box-shadow: 0 0 20px rgba(214,166,46,0.06); }
.nav-link.active .nav-icon { background: rgba(214,166,46,0.18); color: var(--saw-gold); box-shadow: 0 0 16px rgba(214,166,46,0.1); }
.nav-link.active .nav-icon .icon { stroke: var(--saw-gold); }
.nav-link .nav-icon .icon { transition: stroke 0.25s ease; }

.nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 20px);
  margin: 2px 10px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: var(--saw-gold-light);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.08); border-color: rgba(214,166,46,0.15); }
.nav-group-toggle .icon { color: var(--saw-gold); opacity: 0.8; }
.nav-group-toggle .chevron { margin-left: auto; transition: transform 0.3s ease; color: rgba(255,255,255,0.3); display: flex; }
.nav-group-toggle .chevron .icon { width: 16px; height: 16px; color: rgba(255,255,255,0.3); opacity: 1; }
.nav-group.closed .chevron { transform: rotate(-90deg); }
.nav-group.closed .nav-subgroup { display: none; }
.nav-subgroup { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 4px 12px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,0.06); }
.nav-subgroup .nav-link { font-size: 0.75rem; margin: 1px 6px; padding: 8px 12px; }
.nav-subgroup .nav-link .nav-icon { width: 28px; height: 28px; font-size: 0.7rem; }
.nav-subgroup .nav-link .nav-icon .icon { width: 14px; height: 14px; }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(3,19,38,0.5);
  z-index: 1035;
  backdrop-filter: blur(4px);
}
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar-overlay { display: none; }
  .nav-open .sidebar { transform: translateX(0); }
  .nav-open .sidebar-overlay { display: block; }
}

/* ===== MAIN CONTENT ===== */
main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-height);
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--saw-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1030;
  box-shadow: 0 4px 20px rgba(6,27,54,0.04);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-left .page-title-block { display: flex; flex-direction: column; }
.topbar-left .page-title-block b { font-size: 1.1rem; font-weight: 800; color: var(--saw-primary); letter-spacing: -0.01em; }
.topbar-left .page-title-block small { font-size: 0.7rem; color: var(--saw-muted); font-weight: 500; }
.hamb {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--saw-border);
  border-radius: 12px;
  background: var(--saw-white);
  color: var(--saw-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hamb:hover { border-color: var(--saw-gold); color: var(--saw-gold); }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--saw-border);
  border-radius: 12px;
  background: var(--saw-white);
  color: var(--saw-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.icon-btn:hover { border-color: var(--saw-gold); color: var(--saw-gold); background: #FFFDF5; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(214,166,46,0.12); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn .badge-dot {
  position: absolute; top: -2px; right: -2px;
  width: 10px; height: 10px; background: var(--saw-danger);
  border: 2px solid var(--saw-white); border-radius: 50%;
}
.top-search {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--saw-border);
  background: var(--saw-bg);
  border-radius: 14px;
  padding: 0 12px;
  min-height: 40px;
  color: var(--saw-text);
  transition: all 0.25s ease;
}
.top-search:focus-within { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1), 0 4px 12px rgba(214,166,46,0.06); background: var(--saw-white); transform: scale(1.01); }
.top-search:focus-within .icon { color: var(--saw-gold); }
.top-search .icon { color: var(--saw-muted); transition: color 0.2s ease; }
.top-search input {
  border: 0;
  background: transparent;
  min-height: 36px;
  width: 180px;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
}
.top-search input::placeholder { color: #B0B8C8; font-weight: 400; }
.user-profile-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--saw-border);
  border-radius: 100px;
  background: var(--saw-white);
  transition: all 0.2s ease;
  text-decoration: none;
}
.user-profile-btn:hover { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.08); }
.user-profile-btn .user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--saw-primary), var(--saw-secondary));
  color: var(--saw-white); font-size: 0.7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.user-profile-btn span:last-child { font-size: 0.8rem; font-weight: 600; color: var(--saw-text); }
.top-search .icon { width: 16px; height: 16px; color: var(--saw-muted); }
  background: var(--saw-white);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.user-profile-btn:hover { border-color: var(--saw-gold); }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--saw-primary), var(--saw-secondary));
  color: var(--saw-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}
.user-profile-btn span { font-size: 0.8rem; font-weight: 600; color: var(--saw-text); }

/* ===== CONTENT AREA ===== */
.content {
  flex: 1;
  padding: 24px 28px 40px;
  max-width: 100%;
  animation: pageEnter 0.4s ease;
}
@media (max-width: 820px) {
  .content { padding: 18px 16px 28px; }
}
@media (max-width: 480px) {
  .content { padding: 14px 12px 24px; }
}

/* ===== SECTION HEADERS ===== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.section-head h2 { font-size: 1.25rem; font-weight: 800; color: var(--saw-primary); letter-spacing: -0.01em; }
.section-head p { font-size: 0.8rem; color: var(--saw-muted); margin-top: 4px; line-height: 1.5; }
.section-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.section-head .section-head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  background: var(--saw-primary);
  color: var(--saw-white);
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-navy); }
.btn:active { transform: translateY(0); }
.btn.gold { background: linear-gradient(135deg, var(--saw-gold), #C49420); color: var(--saw-primary); box-shadow: var(--shadow-gold); }
.btn.gold:hover { box-shadow: 0 6px 20px rgba(214,166,46,0.35); }
.btn.light {
  background: var(--saw-white);
  color: var(--saw-text);
  border: 1px solid var(--saw-border);
}
.btn.light:hover { border-color: var(--saw-gold); color: var(--saw-gold); background: #FFFDF5; box-shadow: 0 4px 12px rgba(214,166,46,0.08); transform: translateY(-1px); }
.btn.small { padding: 7px 14px; font-size: 0.7rem; border-radius: 9px; gap: 6px; }
.btn.small .icon { width: 14px; height: 14px; }
.btn.outline { background: transparent; border: 1.5px solid var(--saw-gold); color: var(--saw-gold); }
.btn.outline:hover { background: rgba(214,166,46,0.08); box-shadow: 0 4px 12px rgba(214,166,46,0.12); }
.btn.danger { background: var(--saw-danger); }
.btn.danger:hover { box-shadow: 0 6px 20px rgba(220,38,38,0.25); }
.btn .icon { width: 16px; height: 16px; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ===== TOASTS / ALERTS ===== */
.toast {
  padding: 16px 20px;
  border-radius: 14px;
  font-size: 0.82rem;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideDown 0.35s ease;
  border: 1px solid;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}
.toast.success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.toast.danger { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.toast.success::before { content: '✓'; font-weight: 900; font-size: 1rem; }
.toast.danger::before { content: '✗'; font-weight: 900; font-size: 1rem; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

/* ===== DASHBOARD HERO ===== */
.dashboard-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #061B36 0%, #0B2D52 58%, #123F6C 100%);
  border-radius: var(--radius-2xl);
  color: var(--saw-white);
  padding: 32px 36px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: minmax(0,1fr) 280px;
  gap: 22px;
  align-items: stretch;
  box-shadow: 0 26px 70px rgba(6,27,54,0.24);
}
.dashboard-hero::before {
  content: '';
  position: absolute;
  inset: auto -80px -140px auto;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(214,166,46,0.35), transparent 65%);
  pointer-events: none;
}
.dashboard-hero .hero-content { position: relative; z-index: 1; }
.dash-hero-logo { display: none; }
@media (min-width: 1024px) {
  .dash-hero-logo { display: block; position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: 90px; height: 90px; object-fit: contain; opacity: 0.12; pointer-events: none; }
}
.dashboard-hero .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(214,166,46,0.12);
  border: 1px solid rgba(214,166,46,0.18);
  border-radius: 100px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--saw-gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
  width: fit-content;
}
.dashboard-hero .hero-kicker::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--saw-gold); flex-shrink: 0; }
.dashboard-hero h1 { font-size: clamp(28px,3.5vw,42px); font-weight: 800; line-height: 1.08; margin: 0 0 10px; letter-spacing: -0.02em; }
.dashboard-hero h1 span { background: linear-gradient(135deg, var(--saw-gold), var(--saw-gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.dashboard-hero p { max-width: 680px; color: rgba(255,255,255,0.55); font-size: 0.85rem; line-height: 1.7; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.hero-actions .btn { font-size: 0.82rem; padding: 12px 22px; }
.hero-actions .btn.outline { border-color: rgba(255,255,255,0.25); color: rgba(255,255,255,0.8); }
.hero-actions .btn.outline:hover { border-color: var(--saw-gold); color: var(--saw-gold); background: rgba(214,166,46,0.08); }
.hero-panel {
  position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-xl);
  padding: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-panel .hero-date { font-size: 1.5rem; font-weight: 800; color: var(--saw-white); letter-spacing: -0.01em; }
.hero-panel .hero-label { font-size: 0.62rem; color: var(--saw-gold-light); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 4px; }
.hero-meter { height: 8px; border-radius: var(--radius-full); background: rgba(255,255,255,0.1); overflow: hidden; margin: 16px 0; box-shadow: inset 0 1px 2px rgba(0,0,0,0.1); }
.hero-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--saw-gold), var(--saw-gold-light)); box-shadow: 0 0 8px rgba(214,166,46,0.15); }

/* ===== DASHBOARD DATE FILTER ===== */
.dash-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-xl);
  padding: 14px 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(6,27,54,0.04);
  flex-wrap: wrap;
}
.dash-filter-bar .df-label {
  font-size: 0.72rem; font-weight: 700; color: var(--saw-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 6px;
}
.dash-filter-bar input[type="date"] {
  padding: 8px 12px;
  border: 1px solid var(--saw-border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-family: inherit;
  background: var(--saw-bg);
  color: var(--saw-text);
  outline: none;
  min-height: 38px;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.dash-filter-bar input[type="date"]:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.08); background: var(--saw-white); }
.dash-filter-bar input[type="date"]:hover { border-color: #CDD3DF; }
.dash-filter-bar .df-sep { color: var(--saw-muted); font-weight: 700; font-size: 0.9rem; }
.dash-filter-bar .btn-filter {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: 10px;
  background: var(--saw-primary); color: var(--saw-white);
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.2s ease;
}
.dash-filter-bar .btn-filter:hover { background: var(--saw-secondary); box-shadow: 0 4px 12px rgba(6,27,54,0.2); transform: translateY(-1px); }
.dash-filter-bar .btn-filter-reset {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 9px 14px; border: 1px solid var(--saw-border); border-radius: 10px;
  background: var(--saw-white); color: var(--saw-muted);
  font-size: 0.8rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all 0.2s ease;
}
.dash-filter-bar .btn-filter-reset:hover { border-color: var(--saw-gold); color: var(--saw-gold); }

/* ===== PROFILE HERO ===== */
.profile-hero {
  background: linear-gradient(135deg, var(--saw-primary), var(--saw-secondary));
  border-radius: var(--radius-2xl);
  padding: 28px;
  color: var(--saw-white);
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  box-shadow: 0 20px 50px rgba(6,27,54,0.18);
  position: relative;
  overflow: hidden;
}
.profile-hero::before {
  content: '';
  position: absolute;
  inset: auto -80px -100px auto;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(214,166,46,0.2), transparent 65%);
  pointer-events: none;
}
.profile-hero .profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saw-gold), var(--saw-gold-light));
  color: var(--saw-primary);
  font-size: 1.5rem;
  font-weight: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  border: 3px solid rgba(255,255,255,0.15);
}
.profile-hero > div { position: relative; z-index: 1; }

/* ===== KPI CARDS ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.kpi-grid.fill-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kpi-grid.stretch-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.stretch-4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.stretch-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid.stretch-6 { grid-template-columns: repeat(6, 1fr); }
.kpi-card {
  border-radius: var(--radius-xl);
  padding: 22px 22px 18px;
  box-shadow: 0 2px 8px rgba(6,27,54,0.06);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
}
.kpi-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}
.kpi-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(6,27,54,0.12); }
.kpi-card .kpi-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  position: relative;
  z-index: 1;
}
.kpi-card .kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.kpi-card .kpi-hint {
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  position: relative;
  z-index: 1;
  margin-top: 2px;
}
.kpi-card .kpi-icon {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.06);
}
.kpi-card .kpi-icon .icon { width: 22px; height: 22px; }
.kpi-card .kpi-icon svg { stroke: rgba(255,255,255,0.9); }

/* Tone variants */
.kpi-card.tone-navy { background: linear-gradient(135deg, #061B36, #0B2D52); border: 1px solid rgba(255,255,255,0.08); }
.kpi-card.tone-navy .kpi-value { color: var(--saw-white); }
.kpi-card.tone-navy .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-navy::after { background: linear-gradient(90deg, #D6A62E, #F4C766); }

.kpi-card.tone-gold { background: linear-gradient(135deg, #B8860B, #D6A62E, #E8B930); border: 1px solid rgba(255,255,255,0.15); }
.kpi-card.tone-gold .kpi-value { color: #1A1200; }
.kpi-card.tone-gold .kpi-label { color: rgba(26,18,0,0.65); }
.kpi-card.tone-gold .kpi-hint { color: rgba(26,18,0,0.5); }
.kpi-card.tone-gold::after { background: linear-gradient(90deg, #5C3D00, #1A1200); }

.kpi-card.tone-green { background: linear-gradient(135deg, #065F46, #047857, #059669); border: 1px solid rgba(255,255,255,0.1); }
.kpi-card.tone-green .kpi-value { color: var(--saw-white); }
.kpi-card.tone-green .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-green::after { background: linear-gradient(90deg, #6EE7B7, #34D399); }

.kpi-card.tone-red { background: linear-gradient(135deg, #7F1D1D, #B91C1C, #DC2626); border: 1px solid rgba(255,255,255,0.1); }
.kpi-card.tone-red .kpi-value { color: var(--saw-white); }
.kpi-card.tone-red .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-red::after { background: linear-gradient(90deg, #FCA5A5, #F87171); }

.kpi-card.tone-blue { background: linear-gradient(135deg, #1E3A5F, #0B6FA4, #0891B2); border: 1px solid rgba(255,255,255,0.1); }
.kpi-card.tone-blue .kpi-value { color: var(--saw-white); }
.kpi-card.tone-blue .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-blue::after { background: linear-gradient(90deg, #7DD3FC, #38BDF8); }

.kpi-card.tone-amber { background: linear-gradient(135deg, #78350F, #B45309, #D97706); border: 1px solid rgba(255,255,255,0.1); }
.kpi-card.tone-amber .kpi-value { color: var(--saw-white); }
.kpi-card.tone-amber .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-amber::after { background: linear-gradient(90deg, #FCD34D, #FBBF24); }

.kpi-card.tone-slate { background: linear-gradient(135deg, #1E293B, #334155, #475569); border: 1px solid rgba(255,255,255,0.08); }
.kpi-card.tone-slate .kpi-value { color: var(--saw-white); }
.kpi-card.tone-slate .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-slate::after { background: linear-gradient(90deg, #94A3B8, #CBD5E1); }

.kpi-card.tone-purple { background: linear-gradient(135deg, #4C1D95, #6D28D9, #7C3AED); border: 1px solid rgba(255,255,255,0.1); }
.kpi-card.tone-purple .kpi-value { color: var(--saw-white); }
.kpi-card.tone-purple .kpi-hint { color: rgba(255,255,255,0.5); }
.kpi-card.tone-purple::after { background: linear-gradient(90deg, #C4B5FD, #A78BFA); }

/* --- Dashboard KPI grid: controlled column count, not auto-stretch --- */
.kpi-grid.dash-kpi {
  grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 1200px) {
  .kpi-grid.dash-kpi { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
  .kpi-grid.dash-kpi { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpi-grid.dash-kpi { grid-template-columns: 1fr; }
}

/* ===== ANALYTICS STRIP ===== */
.analytics-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.analytics-card {
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.25s ease;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}
.analytics-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 3px;
  background: var(--saw-gold);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.analytics-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(214,166,46,0.25); }
.analytics-card:hover::before { opacity: 1; }
.analytics-card .a-label { font-size: 0.7rem; font-weight: 700; color: var(--saw-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.analytics-card .a-value { font-size: 1.4rem; font-weight: 800; color: var(--saw-primary); letter-spacing: -0.01em; }

/* ===== MODULE SHOWCASE ===== */
.module-showcase {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(135deg, #061B36 0%, #0B2D52 58%, #123F6C 100%);
  border-radius: var(--radius-2xl);
  padding: 24px 28px;
  color: var(--saw-white);
  margin-bottom: 20px;
  box-shadow: 0 20px 50px rgba(6,27,54,0.18);
}
.module-showcase .ms-content { flex: 1; }
.module-showcase .ms-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.6rem; font-weight: 700; color: var(--saw-gold-light);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.module-showcase h1 { font-size: 1.5rem; font-weight: 800; margin: 6px 0 8px; letter-spacing: -0.01em; }
.module-showcase p { color: rgba(255,255,255,0.65); font-size: 0.8rem; max-width: 620px; line-height: 1.65; }
.module-showcase .ms-actions { display: flex; gap: 10px; flex-shrink: 0; }
.module-showcase .ms-actions .btn { box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.module-showcase .ms-actions .btn.light, .module-showcase .ms-actions .btn.outline { box-shadow: none; }

/* ===== TOOLBAR ===== */
.toolbar {
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-xl);
  padding: 16px 20px;
  box-shadow: 0 2px 8px rgba(6,27,54,0.04);
  margin-bottom: 18px;
}
.toolbar .tb-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .tb-row + .tb-row { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--saw-border); }
.toolbar input, .toolbar select {
  padding: 8px 12px;
  border: 1px solid var(--saw-border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-family: inherit;
  background: var(--saw-bg);
  color: var(--saw-text);
  min-height: 38px;
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.08); background: var(--saw-white); }
.toolbar input:hover, .toolbar select:hover { border-color: #CDD3DF; }
.toolbar label { font-size: 0.75rem; font-weight: 600; color: var(--saw-muted); display: flex; align-items: center; gap: 6px; }
.tb-title { font-size: 0.7rem; font-weight: 700; color: var(--saw-muted); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; }

/* ===== TABLE CARD ===== */
.table-card {
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-2xl);
  box-shadow: 0 18px 45px rgba(15,23,42,0.07);
  overflow: hidden;
}
.table-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--saw-border);
  background: linear-gradient(180deg, #fff, #F8FAFC);
}
.table-card-head h3 { margin: 0; color: var(--saw-primary); font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.table-card-head p { margin: 4px 0 0; color: var(--saw-muted); font-size: 0.72rem; line-height: 1.5; }
.table-card-head .table-chip-row { gap: 8px; }
.table-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.table-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  background: #FFF7DC;
  border: 1px solid #F2D47A;
  border-radius: var(--radius-full);
  font-size: 0.65rem;
  font-weight: 700;
  color: #7A5400;
}
.table-scroll { overflow-x: auto; }
.smart-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.8rem; }
.smart-table th {
  background: var(--saw-primary);
  color: var(--saw-white);
  padding: 14px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-bottom: 2px solid rgba(214,166,46,0.08);
}
.smart-table th a { color: var(--saw-white); display: inline-flex; align-items: center; gap: 4px; }
.smart-table th a::after { content: '⇅'; font-size: 9px; color: var(--saw-gold); opacity: 0.7; }
.smart-table th a:hover::after { opacity: 1; }
.smart-table td {
  padding: 13px 16px;
  border-bottom: 1px solid #EEF2F7;
  vertical-align: middle;
  color: var(--saw-text);
}
.smart-table tbody tr { transition: all 0.18s ease; }
.smart-table tbody tr:hover td { background: #F0F5FF !important; }
.smart-table td b { display: block; font-weight: 700; color: var(--saw-primary); font-size: 0.82rem; }
.smart-table td small { display: block; font-size: 0.68rem; color: var(--saw-muted); margin-top: 1px; }
.smart-table .actions { display: flex; gap: 4px; }
.smart-table .select-col { width: 44px; text-align: center; }
.smart-table .select-col input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--saw-primary); cursor: pointer; }

/* ===== EMPTY STATE ===== */
.smart-table .empty { text-align: center; padding: 48px 20px; }
.smart-table .empty b { display: block; font-size: 1rem; color: var(--saw-primary); margin-bottom: 6px; }
.smart-table .empty small { display: block; color: var(--saw-muted); margin-bottom: 16px; }

/* ===== ACTION ICON BUTTONS ===== */
.action-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--saw-border);
  border-radius: 10px;
  background: var(--saw-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--saw-muted);
}
.action-icon-btn:hover { border-color: var(--saw-gold); color: var(--saw-gold); box-shadow: 0 4px 12px rgba(214,166,46,0.08); transform: translateY(-1px); }
.action-icon-btn.view:hover { border-color: var(--saw-info); color: var(--saw-info); box-shadow: 0 4px 12px rgba(37,99,235,0.08); }
.action-icon-btn.edit:hover { border-color: var(--saw-gold); color: var(--saw-gold); box-shadow: 0 4px 12px rgba(214,166,46,0.08); }
.action-icon-btn.pdf:hover { border-color: var(--saw-danger); color: var(--saw-danger); box-shadow: 0 4px 12px rgba(220,38,38,0.08); }
.action-icon-btn.delete:hover { border-color: var(--saw-danger); color: var(--saw-danger); background: #FEF2F2; box-shadow: 0 4px 12px rgba(220,38,38,0.08); }
.action-icon-btn .icon { width: 16px; height: 16px; }
.danger-action { color: var(--saw-danger) !important; }
body.dark-mode .action-icon-btn { background: #1E293B; border-color: #334155; }
body.dark-mode .action-icon-btn:hover { background: #1E293B; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.badge.status-active, .badge.status-approved, .badge.status-completed, .badge.status-paid { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.badge.status-inactive, .badge.status-rejected, .badge.status-terminated { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.badge.status-pending, .badge.status-draft, .badge.status-submitted, .badge.status-reviewed { background: #FFF4D8; color: #8A5C00; border: 1px solid #F2D47A; }

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; padding: 16px 20px; justify-content: center; }
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--saw-border);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--saw-text);
  transition: all 0.2s ease;
}
.pagination a:hover { border-color: var(--saw-gold); color: var(--saw-gold); }
.pagination .active { background: var(--saw-primary); color: var(--saw-white); border-color: var(--saw-primary); }
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ===== CARDS ===== */
.card {
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: 0.95rem; font-weight: 800; color: var(--saw-primary); margin-bottom: 14px; }
.card p { color: var(--saw-muted); font-size: 0.8rem; }

/* ===== FORM STYLES ===== */
.form-card { max-width: 100%; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.form-grid label, .form-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--saw-text);
  letter-spacing: 0.01em;
}
.form-grid label.full, .form-card label.full { grid-column: 1 / -1; }
.form-card input, .form-card select, .form-card textarea {
  padding: 11px 14px;
  border: 1.5px solid var(--saw-border);
  border-radius: 12px;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--saw-white);
  color: var(--saw-text);
  transition: all 0.2s ease;
  outline: none;
  min-height: 44px;
}
.form-card input:focus, .form-card select:focus, .form-card textarea:focus {
  border-color: var(--saw-gold);
  box-shadow: 0 0 0 3px rgba(214,166,46,0.1);
  background: var(--saw-white);
}
.form-card input:hover, .form-card select:hover, .form-card textarea:hover {
  border-color: #CDD3DF;
}
.form-card textarea { min-height: 110px; resize: vertical; padding-top: 12px; }
.form-card input[type="file"] { padding: 8px 12px; border-style: dashed; cursor: pointer; }
.form-card input[type="file"]:hover { border-color: var(--saw-gold); background: #FFFDF5; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--saw-border); flex-wrap: wrap; }

/* ===== MODULE FORM LAYOUT ===== */
.module-form-layout { display: grid; grid-template-columns: 280px minmax(0,1fr); gap: 22px; align-items: start; }
.premium-module-form { box-shadow: 0 18px 45px rgba(15,23,42,0.07); border-radius: var(--radius-2xl); }
.module-form-guide {
  background: linear-gradient(135deg, #061B36, #0B2D52);
  color: var(--saw-white);
  border-radius: var(--radius-2xl);
  padding: 24px;
  position: sticky;
  top: 100px;
  border-bottom: 4px solid var(--saw-gold);
  box-shadow: 0 18px 45px rgba(6,27,54,0.18);
  overflow: hidden;
}
.module-form-guide::before {
  content: '';
  position: absolute;
  inset: auto -60px -80px auto;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(214,166,46,0.12), transparent);
  pointer-events: none;
}
.module-form-guide .fg-kicker { font-size: 0.6rem; font-weight: 700; color: var(--saw-gold-light); text-transform: uppercase; letter-spacing: 0.1em; position: relative; z-index: 1; }
.module-form-guide h3 { font-size: 1rem; font-weight: 800; margin: 10px 0 12px; color: var(--saw-white); position: relative; z-index: 1; letter-spacing: -0.01em; }
.module-form-guide p { font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-bottom: 8px; line-height: 1.55; padding-left: 14px; position: relative; z-index: 1; }
.module-form-guide p::before { content: '✦'; color: var(--saw-gold); position: absolute; left: 0; font-weight: 900; font-size: 0.5rem; top: 4px; }
.form-guide-card {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 16px;
  position: relative; z-index: 1;
}
.form-guide-card b { display: block; font-size: 1rem; color: var(--saw-gold-light); }
.form-guide-card small { display: block; font-size: 0.68rem; color: rgba(255,255,255,0.55); margin-top: 4px; line-height: 1.5; }
.form-guide-card small + small { margin-top: 2px; }

/* ===== WIZARD ===== */
.wizard-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  background: linear-gradient(135deg, #F8FAFC, #FFFFFF);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.wizard-head .wh-step {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--saw-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.wizard-head .wh-step b { color: var(--saw-primary); font-size: 0.85rem; }
.wizard-head h3 { font-size: 1rem; font-weight: 800; color: var(--saw-primary); margin: 6px 0 4px; letter-spacing: -0.01em; }
.wizard-head p { font-size: 0.75rem; color: var(--saw-muted); margin: 0; line-height: 1.5; }
.wizard-progress {
  width: 160px;
  height: 10px;
  background: #E8EEF6;
  border-radius: var(--radius-full);
  overflow: hidden;
  flex-shrink: 0;
  margin-top: 10px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.04);
}
.wizard-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--saw-gold), var(--saw-gold-light));
  border-radius: inherit;
  transition: width 0.4s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 0 8px rgba(214,166,46,0.2);
}
.wizard-hidden { display: none !important; }
.wizard-actions { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--saw-border); display: flex; gap: 10px; flex-wrap: wrap; }
.wizard-actions .btn { min-width: 100px; justify-content: center; }

/* ===== DASHBOARD GRID ===== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.dashboard-card {
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-2xl);
  padding: 22px;
  box-shadow: 0 18px 45px rgba(15,23,42,0.07);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.dashboard-card:hover { border-color: rgba(214,166,46,0.15); box-shadow: 0 20px 50px rgba(15,23,42,0.1); }
.dashboard-card .section-head { margin-bottom: 14px; }
.dashboard-card .section-head h3 { font-size: 1rem; font-weight: 800; color: var(--saw-primary); letter-spacing: -0.01em; }
.dashboard-card .section-head p { font-size: 0.75rem; color: var(--saw-muted); margin-top: 2px; }
.wide-chart-card { grid-column: 1 / -1; }

/* ===== CHART CONTAINERS ===== */
.chart-card { display: flex; flex-direction: column; }
.chart-card .section-head { flex-shrink: 0; }
.chart-container { flex: 1; position: relative; min-height: 220px; margin-top: 4px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }
.chart-container-wide { min-height: 180px; }
body.dark-mode .chart-container canvas { filter: brightness(0.9); }

/* ===== DASHBOARD TABLE CARD ===== */
.dashboard-table-card { margin-top: 0; }
.dashboard-table-card .smart-table th:first-child { min-width: 100px; }
.activity-date-cell { white-space: nowrap; font-size: 0.75rem; color: var(--saw-muted); }

/* ===== HERO STATUS TEXT ===== */
.hero-status-text { color: rgba(255,255,255,0.6); font-size: 0.75rem; margin: 0; }

/* ===== EMPTY MINI ===== */
.empty-mini-txt { color: var(--saw-muted); font-size: 0.8rem; padding: 12px; }

/* ===== OPERATIONS SPOTLIGHT ===== */
.operations-spotlight {
  display: grid;
  grid-template-columns: minmax(0,1.15fr) repeat(3, minmax(160px, 0.4fr));
  gap: 14px;
  margin-bottom: 22px;
}
.spotlight-main {
  position: relative; overflow: hidden;
  border-radius: var(--radius-2xl);
  padding: 24px;
  background: linear-gradient(135deg, #061B36, #0B2D52);
  color: var(--saw-white);
  box-shadow: 0 20px 54px rgba(6,27,54,0.18);
}
.spotlight-main::after {
  content: '';
  position: absolute; right: -55px; bottom: -80px; width: 230px; height: 230px;
  border-radius: 48px; background: rgba(214,166,46,0.2); transform: rotate(18deg);
}
.spotlight-main .sp-kicker { font-size: 0.6rem; font-weight: 700; color: var(--saw-gold-light); text-transform: uppercase; letter-spacing: 0.08em; }
.spotlight-main h2 { font-size: 1.3rem; font-weight: 800; margin: 8px 0; line-height: 1.2; position: relative; z-index: 1; }
.spotlight-main p { color: rgba(255,255,255,0.6); font-size: 0.8rem; line-height: 1.6; position: relative; z-index: 1; }
.spotlight-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl);
  padding: 20px;
  min-height: 150px;
  color: var(--saw-white);
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 18px 42px rgba(15,23,42,0.1);
  transition: all 0.22s ease;
}
.spotlight-card:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(15,23,42,0.15); }
.spotlight-card b { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; position: relative; z-index: 1; }
.spotlight-card small { color: rgba(255,255,255,0.75); font-weight: 600; font-size: 0.68rem; position: relative; z-index: 1; }
.spotlight-card .sp-badge {
  align-self: flex-start;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative; z-index: 1;
}
.spotlight-card.tone-gold { background: linear-gradient(135deg, #9A6B00, var(--saw-gold)); color: #061B36; }
.spotlight-card.tone-gold small { color: #3B2A00; }
.spotlight-card.tone-gold .sp-badge { background: rgba(6,27,54,0.1); border-color: rgba(6,27,54,0.15); color: #061B36; }
.spotlight-card.tone-blue { background: linear-gradient(135deg, #061B36, #0B6FA4); }
.spotlight-card.tone-green { background: linear-gradient(135deg, #064E3B, #047857); }

/* ===== DASHBOARD ACTIONS ===== */
.dashboard-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dashboard-actions a {
  display: flex; flex-direction: column;
  padding: 14px 12px;
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  background: var(--saw-white);
}
.dashboard-actions a:hover { border-color: var(--saw-gold); box-shadow: 0 6px 16px rgba(214,166,46,0.10); transform: translateY(-1px); background: #FFFDF5; }
.dashboard-actions a:active { transform: translateY(0); }
.dashboard-actions a b { font-size: 0.8rem; font-weight: 700; color: var(--saw-primary); }
.dashboard-actions a small { font-size: 0.65rem; color: var(--saw-muted); margin-top: 1px; }
body.dark-mode .dashboard-actions a { background: #1E293B; }
body.dark-mode .dashboard-actions a:hover { background: #1E293B; border-color: var(--saw-gold); }
body.dark-mode .dashboard-actions a b { color: #F1F5F9; }

/* ===== ACTIVITY LIST ===== */
.activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  text-decoration: none;
}
.activity-list a:hover { border-color: var(--saw-gold); background: #FFFDF5; box-shadow: 0 4px 12px rgba(214,166,46,0.06); }
.activity-list a b { font-size: 0.82rem; font-weight: 700; color: var(--saw-primary); }
.activity-list a small { font-size: 0.68rem; color: var(--saw-muted); flex-shrink: 0; margin-left: 8px; }

/* ===== GRID TWO ===== */
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary div { padding: 10px; border: 1px solid var(--saw-border); border-radius: var(--radius-lg); }
.summary div span { display: block; font-size: 0.7rem; font-weight: 700; color: var(--saw-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.summary div b { display: block; font-size: 1rem; font-weight: 800; color: var(--saw-primary); margin-top: 4px; }

/* ===== FILE PREVIEW GRID ===== */
.file-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.file-preview {
  display: flex; flex-direction: column;
  padding: 12px;
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-lg);
  background: #F8FAFC;
  transition: all 0.2s ease;
}
.file-preview:hover { border-color: var(--saw-gold); background: #FFF8E1; }
.file-preview b { font-size: 0.8rem; font-weight: 700; color: var(--saw-primary); }
.file-preview small { font-size: 0.65rem; color: var(--saw-muted); }

/* ===== LIST ===== */
.list { display: flex; flex-direction: column; gap: 8px; }
.list span { padding: 10px; border: 1px solid var(--saw-border); border-radius: var(--radius-lg); background: #F8FAFC; }
.list span b { display: block; font-weight: 700; color: var(--saw-primary); font-size: 0.8rem; }
.list span small { display: block; font-size: 0.65rem; color: var(--saw-muted); }

/* ===== UPLOAD DROP ===== */
.upload-drop { border: 2px dashed var(--saw-border); border-radius: var(--radius-lg); padding: 20px; text-align: center; background: #F8FAFC; }
.upload-drop:hover { border-color: var(--saw-gold); background: #FFFDF5; }
.upload-drop small { font-size: 0.7rem; color: var(--saw-muted); margin-top: 4px; }

/* ===== TOGGLE ROW ===== */
.toggle-row { display: flex; align-items: center; gap: 8px; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; }

/* ===== MODAL ===== */
.saw-modal {
  position: fixed; inset: 0;
  background: rgba(3,19,38,0.62);
  display: none;
  place-items: center;
  z-index: 1000;
  padding: 22px;
}
.saw-modal.open { display: grid; }
.saw-modal-panel {
  width: min(1040px, 96vw);
  height: min(840px, 92vh);
  background: var(--saw-white);
  border: 1px solid rgba(214,166,46,0.45);
  border-radius: var(--radius-2xl);
  box-shadow: 0 30px 90px rgba(0,0,0,0.3);
  overflow: hidden;
  animation: modalIn 0.25s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.saw-modal-head {
  height: 58px;
  background: linear-gradient(135deg, var(--saw-primary), var(--saw-secondary));
  color: var(--saw-white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 4px solid var(--saw-gold);
}
.saw-modal-head button {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--saw-white);
  border-radius: 12px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.78rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.saw-modal-head button:hover { background: rgba(214,166,46,0.15); border-color: var(--saw-gold); transform: translateY(-1px); }
.saw-modal-head button::before { content: '✕'; font-size: 0.8rem; }
.saw-modal iframe { width: 100%; height: calc(100% - 60px); border: 0; background: var(--saw-bg); }

/* ===== COMMAND PALETTE ===== */
.command-palette {
  display: none;
  position: fixed; inset: 0;
  background: rgba(3,19,38,0.58);
  z-index: 1100;
  place-items: start center;
  padding-top: 9vh;
}
.command-palette.open { display: grid; }
.command-panel {
  width: min(560px, 92vw);
  background: var(--saw-white);
  border: 1px solid rgba(214,166,46,0.5);
  border-radius: var(--radius-2xl);
  box-shadow: 0 30px 90px rgba(0,0,0,0.32);
  overflow: hidden;
  animation: modalIn 0.25s ease;
}
.command-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, var(--saw-primary), var(--saw-secondary));
  color: var(--saw-white);
  border-bottom: 4px solid var(--saw-gold);
  padding: 16px 18px;
}
.command-head button {
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.08);
  color: var(--saw-white);
  border-radius: 10px;
  padding: 7px 10px;
  font-weight: 900;
  cursor: pointer;
}
.command-panel a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--saw-border);
  font-weight: 700;
  color: var(--saw-primary);
  transition: all 0.15s ease;
  text-decoration: none;
  font-size: 0.85rem;
}
.command-panel a:hover { background: #FFF8E1; padding-left: 24px; }
.command-panel a:last-child { border-bottom: none; }
.command-panel a::after { content: '→'; color: var(--saw-gold); font-size: 0.9rem; opacity: 0; transition: opacity 0.15s ease; }
.command-panel a:hover::after { opacity: 1; }
body.dark-mode .command-panel a { color: #F1F5F9; border-bottom-color: #334155; }
body.dark-mode .command-panel a:hover { background: rgba(214,166,46,0.08); }

/* ===== SWEETALERT OVERRIDES ===== */
.saw-alert { border-radius: var(--radius-xl) !important; border: 1px solid #F2D47A !important; }
.saw-toast { border-radius: var(--radius-lg) !important; border: 1px solid var(--saw-border) !important; box-shadow: 0 18px 45px rgba(15,23,42,0.12) !important; }

/* ===== SEARCH RESULTS ===== */
.search-result {
  display: block;
  padding: 14px;
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-lg);
  background: var(--saw-white);
  transition: all 0.2s ease;
}
.search-result:hover { border-color: var(--saw-gold); box-shadow: var(--shadow-md); }

/* ===== DARK MODE ===== */
body.dark-mode {
  --saw-bg: #0F172A;
  --saw-card: #1E293B;
  --saw-white: #1E293B;
  --saw-border: #334155;
  --saw-text: #F1F5F9;
  --saw-muted: #94A3B8;
}
body.dark-mode .topbar { background: rgba(15,23,42,0.92); border-bottom-color: #334155; backdrop-filter: blur(20px); }
body.dark-mode .top-search { background: #1E293B; border-color: #334155; }
body.dark-mode .top-search input::placeholder { color: #64748B; }
body.dark-mode .table-card-head { background: linear-gradient(180deg, #1E293B, #0F172A); }
body.dark-mode .smart-table td { border-bottom-color: #1E293B; }
body.dark-mode .smart-table th { border-bottom-color: rgba(214,166,46,0.06); }
body.dark-mode .smart-table tbody tr:hover td { background: rgba(255,255,255,0.03) !important; }
body.dark-mode .smart-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.015); }
body.dark-mode .dashboard-card { background: #1E293B; border-color: #334155; }
body.dark-mode .dashboard-card:hover { border-color: rgba(214,166,46,0.15); }
body.dark-mode .analytics-card { background: #1E293B; border-color: #334155; }
body.dark-mode .analytics-card:hover { border-color: rgba(214,166,46,0.25); }
body.dark-mode .analytics-card .a-value { color: #F1F5F9; }
body.dark-mode .activity-list a { background: #1E293B; border-color: #334155; }
body.dark-mode .activity-list a:hover { background: #1E293B; border-color: var(--saw-gold); }
body.dark-mode .activity-list a b { color: #F1F5F9; }
body.dark-mode .dashboard-actions a { background: #1E293B; }
body.dark-mode .dashboard-actions a b { color: #F1F5F9; }
body.dark-mode .wizard-head { background: linear-gradient(135deg, #1E293B, #0F172A); border-color: #334155; }
body.dark-mode .wizard-head h3 { color: #F1F5F9; }
body.dark-mode .wizard-progress { background: #334155; }
body.dark-mode .table-chip { background: #1E293B; border-color: #475569; color: #94A3B8; }
body.dark-mode .section-head h2 { color: #F1F5F9; }
body.dark-mode .dashboard-card .section-head h3 { color: #F1F5F9; }
body.dark-mode .card { background: #1E293B; border-color: #334155; }
body.dark-mode .card h3 { color: #F1F5F9; }
body.dark-mode .summary div { border-color: #334155; background: #0F172A; }
body.dark-mode .summary div span { color: #94A3B8; }
body.dark-mode .summary div b { color: #F1F5F9; }
body.dark-mode .toolbar { background: #1E293B; border-color: #334155; }
body.dark-mode .table-tools { background: #1E293B; border-color: #334155; }
body.dark-mode .dash-filter-bar { background: #1E293B; border-color: #334155; }
body.dark-mode .dash-filter-bar input[type="date"] { background: #0F172A; border-color: #334155; color: #F1F5F9; }
body.dark-mode .dash-filter-bar .btn-filter-reset { background: #1E293B; border-color: #334155; color: #94A3B8; }
body.dark-mode .user-profile-btn { background: #1E293B; border-color: #334155; }
body.dark-mode .user-profile-btn span:last-child { color: #F1F5F9; }
body.dark-mode .icon-btn { background: #1E293B; border-color: #334155; }
body.dark-mode .icon-btn:hover { background: #1E293B; }
body.dark-mode .page-title-block b { color: #F1F5F9; }
body.dark-mode .saw-modal-panel { background: #1E293B; border-color: #334155; }
body.dark-mode .saw-modal-head { border-bottom-color: var(--saw-gold); }
body.dark-mode .form-card input, body.dark-mode .form-card select, body.dark-mode .form-card textarea { background: #0F172A; border-color: #334155; color: #F1F5F9; }
body.dark-mode .form-card input:focus, body.dark-mode .form-card select:focus, body.dark-mode .form-card textarea:focus { background: #0F172A; }
body.dark-mode .form-grid label, body.dark-mode .form-card label { color: #E2E8F0; }
body.dark-mode .form-actions { border-top-color: #334155; }
body.dark-mode .preferences-card { background: #1E293B; border-color: #334155; }
body.dark-mode .pref-toggle-row { background: #0F172A; border-color: #334155; }
body.dark-mode .pref-toggle-row .pref-info b { color: #F1F5F9; }
body.dark-mode .upload-drop { background: #0F172A; border-color: #334155; }
body.dark-mode .upload-drop:hover { background: #0F172A; }
body.dark-mode .kpi-card.tone-gold .kpi-value { color: #1A1200; }
body.dark-mode .kpi-card.tone-navy { background: linear-gradient(135deg, #0F172A, #1E293B); }
body.dark-mode .profile-hero { background: linear-gradient(135deg, #0F172A, #1E293B); }
body.dark-mode .hero-panel { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.1); }
body.dark-mode .login-form-panel { background: #0F172A; }
body.dark-mode .login-card { background: #1E293B; border-color: #334155; }
body.dark-mode .login-header h2 { color: #F1F5F9; }
body.dark-mode .form-group label { color: #E2E8F0; }
body.dark-mode .form-control { background: #0F172A; border-color: #334155; color: #F1F5F9; }
body.dark-mode .form-check-label { color: #94A3B8; }
body.dark-mode .login-footer { color: #64748B; }
body.dark-mode .login-security p { color: #94A3B8; }
body.dark-mode .session-status { background: #064E3B; border-color: #065F46; color: #6EE7B7; }
body.dark-mode .alert-danger { background: #451A1A; border-color: #7F1D1D; color: #FCA5A5; }
body.dark-mode .alert-success { background: #064E3B; border-color: #065F46; color: #6EE7B7; }
body.dark-mode .show-fields-table th { background: #1E293B; }
body.dark-mode .show-fields-table td { border-bottom-color: #334155; }
body.dark-mode .show-fields-table tr:hover td { background: rgba(255,255,255,0.03); }
body.dark-mode .list span { background: #1E293B; border-color: #334155; }
body.dark-mode .list span b { color: #F1F5F9; }
body.dark-mode .file-preview { background: #0F172A; border-color: #334155; }
body.dark-mode .file-preview b { color: #F1F5F9; }
body.dark-mode .form-guide-card b { color: #F4C766; }

/* ===== DARK MODE: mining chart enhancements ===== */
body.dark-mode .chart-container canvas { filter: brightness(0.9) saturate(0.8); }
body.dark-mode .hero-status-text { color: rgba(255,255,255,0.5); }

/* ===== MOBILE RESPONSIVE — TABBED SHOW VIEWS ===== */
@media (max-width: 820px) {
  .show-fields-table { font-size: 0.75rem; }
  .show-fields-table th, .show-fields-table td { padding: 6px 8px; word-break: break-word; }
  .tab-navigation { overflow-x: auto; white-space: nowrap; display: flex; gap: 0; }
  .tab-navigation .tab-btn { padding: 8px 12px; font-size: 0.7rem; white-space: nowrap; flex-shrink: 0; }
  .tab-panel { padding: 12px; }
  .file-preview-grid { grid-template-columns: 1fr; }
  .kpi-grid.mini-kpi { grid-template-columns: repeat(2, 1fr); }
  .wizard-head { flex-direction: column; }
  .wizard-progress { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .line-item { grid-template-columns: 1fr 1fr; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .module-showcase { flex-direction: column; }
  .ms-actions { width: 100%; }
  .ms-actions .btn { flex: 1; justify-content: center; }
  .quick-actions-grid { grid-template-columns: 1fr; }
  .spotlight-card { min-height: 120px; }
  .dashboard-hero { padding: 24px; }
  .hero-content .hero-features { display: none; }
  .toolbar .tb-row { flex-direction: column; align-items: stretch; }
  .toolbar .tb-row input, .toolbar .tb-row select { width: 100%; }
  .table-tools { flex-direction: column; }
  .table-tools form { width: 100%; }
  .table-tools form select { flex: 1; }
  .bulk-action-row { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .topbar { padding: 0 8px; }
  .topbar-right { gap: 4px; }
  .user-profile-btn span:last-child { display: none; }
  .kpi-grid.mini-kpi { grid-template-columns: 1fr; }
  .tab-navigation .tab-btn { padding: 6px 10px; font-size: 0.65rem; }
  .show-fields-table { font-size: 0.7rem; }
  .smart-table td b { font-size: 0.75rem; }
  .smart-table td small { font-size: 0.6rem; }
  .action-icon-btn { width: 32px; height: 32px; }
  .action-icon-btn .icon { width: 14px; height: 14px; }
  .dashboard-hero { padding: 18px; border-radius: var(--radius-lg); }
  .module-showcase { padding: 18px; border-radius: var(--radius-lg); }
  .spotlight-card { min-height: 100px; padding: 14px; }
  .wizard-head { padding: 14px; }
  .wizard-head h3 { font-size: 0.85rem; }
  .table-card-head { flex-direction: column; align-items: flex-start; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
  .operations-spotlight { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .module-form-layout { grid-template-columns: 1fr; }
  .module-form-guide { position: relative; top: 0; }
  .grid.two { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  main { margin-left: 0; }
  .hamb { display: inline-flex; }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .sidebar-overlay { display: block; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-hero { grid-template-columns: 1fr; }
  .operations-spotlight { grid-template-columns: 1fr; }
  .analytics-strip { grid-template-columns: repeat(2, 1fr); }
  .top-search { display: none; }
  .file-preview-grid { grid-template-columns: 1fr; }
  .dashboard-actions { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .analytics-strip { grid-template-columns: 1fr; }
  .content { padding: 14px 16px; }
  .topbar { padding: 0 12px; }
  .dashboard-hero, .module-showcase, .table-card { border-radius: var(--radius-lg); }
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(3,19,38,0.5);
  z-index: 1039;
}

/* ===== PROFILE HERO ===== */
.profile-hero {
  background: linear-gradient(135deg, #061B36, #0B2D52);
  border-radius: var(--radius-2xl);
  padding: 32px;
  color: var(--saw-white);
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
  box-shadow: 0 20px 50px rgba(6,27,54,0.18);
}
.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--saw-gold), var(--saw-gold-light));
  color: var(--saw-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ===== PRINT STYLES ===== */
@media print {
  .sidebar, .topbar, .toolbar, .table-tools, .module-showcase, .module-form-guide,
  .command-palette, .saw-modal, .no-print, .icon-btn, .top-search { display: none !important; }
  main { margin-left: 0; }
  .content { padding: 0; }
  .table-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .smart-table th { background: #061B36 !important; color: white !important; }
  .print-brand-header, .print-brand-footer { display: block; }
}

/* ===== ANIMATIONS ===== */
.fade-up { animation: fadeUp 0.45s ease forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.fade-up-delay-1 { animation-delay: 0.05s; }
.fade-up-delay-2 { animation-delay: 0.1s; }
.fade-up-delay-3 { animation-delay: 0.15s; }
.fade-up-delay-4 { animation-delay: 0.2s; }
.fade-up-delay-5 { animation-delay: 0.25s; }
.fade-up-delay-6 { animation-delay: 0.3s; }
.fade-up-delay-7 { animation-delay: 0.35s; }
.fade-up-delay-8 { animation-delay: 0.4s; }

/* ===== TABLE TOOLS ===== */
.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}
.table-tools form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.column-toggle { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.column-toggle span { font-size: 0.7rem; font-weight: 700; color: var(--saw-muted); text-transform: uppercase; }
.column-toggle label { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; color: var(--saw-text); }

/* ===== KANBAN ===== */
.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 20px; align-items: start; overflow: auto; padding-bottom: 8px; }
.kanban-column { background: linear-gradient(180deg, #F1F5F9, #F8FAFC); border: 1px solid var(--saw-border); border-radius: var(--radius-xl); padding: 16px; min-height: 280px; box-shadow: var(--shadow-sm); }
.kanban-column h3 { display: flex; justify-content: space-between; align-items: center; margin: 0 0 14px; color: var(--saw-primary); font-size: 0.9rem; font-weight: 700; letter-spacing: 0.02em; }
.kanban-column h3 span { background: linear-gradient(135deg, #FFF4D8, #FCE8A0); color: #7A4E00; border: 1px solid #F2D47A; border-radius: var(--radius-full); padding: 4px 10px; font-size: 0.65rem; font-weight: 800; }
.kanban-card { background: var(--saw-white); border: 1px solid var(--saw-border); border-left: 4px solid var(--saw-gold); border-radius: var(--radius-lg); padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow-sm); transition: all 0.2s ease; position: relative; }
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(214,166,46,0.3); }
.kanban-card b { display: block; color: var(--saw-primary); font-size: 0.85rem; }
.kanban-card small { display: block; color: var(--saw-muted); font-size: 0.72rem; margin: 4px 0; }
.kanban-card p { font-size: 0.75rem; color: var(--saw-muted); margin: 6px 0; line-height: 1.5; }
.kanban-card .kanban-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; color: var(--saw-gold); text-decoration: none; margin-top: 6px; transition: color 0.2s ease; }
.kanban-card .kanban-link:hover { color: var(--saw-primary); }
.kanban-card .kanban-module-icon { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: rgba(214,166,46,0.1); border-radius: 8px; margin-bottom: 6px; }
.kanban-empty { text-align: center; padding: 24px 12px; color: var(--saw-muted); font-size: 0.8rem; }

/* ===== MODULE KPI STYLES (backward compat for plain .kpi inside .kpi-grid) ===== */
.kpi-grid .kpi:not(.module-kpi) {
  min-height: 130px;
  border-radius: var(--radius-xl);
  padding: 22px 20px;
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--saw-border);
  background: var(--saw-white);
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(6,27,54,0.04);
  position: relative; overflow: hidden;
}
.kpi-grid .kpi:not(.module-kpi):hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(6,27,54,0.08); border-color: rgba(214,166,46,0.3); }
.kpi-grid .kpi:not(.module-kpi) span { font-size: 0.7rem; font-weight: 700; color: var(--saw-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-grid .kpi:not(.module-kpi) b { font-size: 1.5rem; font-weight: 800; color: var(--saw-primary); letter-spacing: -0.01em; }
.kpi-grid .kpi:not(.module-kpi) small { font-size: 0.68rem; color: var(--saw-muted); margin-top: 2px; }
body.dark-mode .kpi-grid .kpi:not(.module-kpi) { background: #1E293B; border-color: #334155; }
body.dark-mode .kpi-grid .kpi:not(.module-kpi) b { color: #F1F5F9; }
body.dark-mode .kpi-grid .kpi:not(.module-kpi):hover { border-color: rgba(214,166,46,0.3); }

/* ===== ROLES PERMISSIONS ===== */
.roles-permissions-title { margin-bottom: 14px; font-size: 0.95rem; font-weight: 800; color: var(--saw-primary); }
.roles-permission-card { border: 1px solid var(--saw-border); border-radius: var(--radius-lg); padding: 14px; background: var(--saw-white); transition: border-color 0.2s ease; }
.roles-permission-card:hover { border-color: rgba(214,166,46,0.2); }
.roles-permission-head { font-size: 0.8rem; font-weight: 800; color: var(--saw-primary); margin-bottom: 8px; text-transform: capitalize; letter-spacing: 0.02em; }
.roles-permission-row { margin-bottom: 4px; }
.roles-permission-label { font-size: 0.75rem; }
body.dark-mode .roles-permission-card { background: #0F172A; border-color: #334155; }
body.dark-mode .roles-permission-head { color: #F1F5F9; }

/* ===== CHECKBOX GRID ===== */
.checkbox-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ===== PREMIUM PREFERENCES ===== */
.preferences-card { background: var(--saw-white); border: 1px solid var(--saw-border); border-radius: var(--radius-xl); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.preferences-card .pref-header { margin-bottom: 1.5rem; }
.preferences-card .pref-header h3 { font-size: 1rem; font-weight: 700; color: var(--saw-primary); }
.preferences-card .pref-header p { font-size: 0.8rem; color: var(--saw-muted); margin-top: 4px; }
.pref-toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--saw-border); border-radius: var(--radius-lg); margin-bottom: 10px; transition: all 0.2s ease; background: var(--saw-white); }
.pref-toggle-row:hover { border-color: rgba(214,166,46,0.25); box-shadow: var(--shadow-sm); }
.pref-toggle-row .pref-info { display: flex; flex-direction: column; }
.pref-toggle-row .pref-info b { font-size: 0.85rem; color: var(--saw-text); font-weight: 600; }
.pref-toggle-row .pref-info small { font-size: 0.72rem; color: var(--saw-muted); }
.pref-toggle-row input[type="checkbox"] { width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--saw-border); accent-color: var(--saw-primary); cursor: pointer; flex-shrink: 0; }
.pref-actions { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--saw-border); display: flex; gap: 10px; }

/* ===== PREMIUM DUPLICATES ===== */
.duplicate-group { margin-bottom: 1.5rem; border: 1px solid var(--saw-border); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-sm); }
.duplicate-group:last-child { margin-bottom: 0; }
.duplicate-group .dg-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: linear-gradient(135deg, #F8FAFC, #FFFFFF); border-bottom: 1px solid var(--saw-border); }
.duplicate-group .dg-header h4 { font-size: 0.9rem; font-weight: 700; color: var(--saw-primary); margin: 0; }
.duplicate-group .dg-header .badge { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; border-radius: var(--radius-full); padding: 3px 10px; font-size: 0.65rem; font-weight: 700; }
.duplicate-group .dg-table { padding: 0; }
.duplicate-group .dg-table table { margin: 0; border: none; }
.duplicate-group .dg-table table th { background: #F8FAFC; }
.duplicate-group .dg-table table td:last-child { text-align: right; }
.duplicate-group .dg-table table th:last-child { text-align: right; }

/* ===== PREMIUM IMPORT ===== */
.import-card { background: var(--saw-white); border: 1px solid var(--saw-border); border-radius: var(--radius-xl); padding: 2rem; box-shadow: var(--shadow-sm); }
.import-dropzone { border: 2px dashed var(--saw-border); border-radius: var(--radius-xl); padding: 2.5rem 2rem; text-align: center; background: #F8FAFC; transition: all 0.25s ease; cursor: pointer; }
.import-dropzone:hover { border-color: var(--saw-gold); background: #FFFDF5; }
.import-dropzone .dz-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; background: rgba(214,166,46,0.1); border-radius: 16px; margin-bottom: 12px; }
.import-dropzone b { display: block; font-size: 0.95rem; color: var(--saw-text); margin-bottom: 4px; }
.import-dropzone p { font-size: 0.8rem; color: var(--saw-muted); margin: 0; }
.import-dropzone small { font-size: 0.7rem; color: var(--saw-muted); display: block; margin-top: 8px; }
.import-dropzone input[type="file"] { display: none; }
.import-info { background: #F0F9FF; border: 1px solid #BAE6FD; border-radius: var(--radius-lg); padding: 14px 16px; margin-top: 1.25rem; }
.import-info b { display: block; font-size: 0.8rem; color: #0369A1; margin-bottom: 4px; }
.import-info p { font-size: 0.75rem; color: #0C4A6E; margin: 0; line-height: 1.6; }

/* ===== LINE ITEM ===== */
.line-item { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; align-items: end; margin-bottom: 8px; }
.line-item label { font-size: 0.7rem; }

/* ===== SIGNATURE GRID ===== */
.signature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.signature-item { border-top: 2px solid var(--saw-primary); padding-top: 8px; }
.signature-item b { font-size: 0.8rem; color: var(--saw-primary); }

/* ===== RESPONSIVE FIXES FOR EXISTING ===== */
@media (max-width: 1100px) {
  .table-tools { flex-direction: column; align-items: stretch; }
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .kanban-board, .checkbox-grid, .line-item, .signature-grid { grid-template-columns: 1fr; }
  .column-toggle { flex-wrap: wrap; }
}

/* ============================================
   PREMIUM LOGIN — Inspired by Ayman NPetro
   ============================================ */
.login-page {
  background: var(--saw-bg);
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.login-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ===== LEFT PANEL — HERO / BRANDING ===== */
.login-hero {
  flex: 0 0 58%;
  position: relative;
  background: var(--saw-primary);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  isolation: isolate;
}
.hero-watermark {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
  animation: watermarkPulse 6s ease-in-out infinite alternate;
}
.hero-watermark-1 { width: 420px; height: 420px; top: 10%; right: -60px; }
.hero-watermark-2 { width: 280px; height: 280px; bottom: 8%; left: -40px; animation-delay: 2s; }
.hero-watermark img { width: 100%; height: 100%; object-fit: contain; }
@keyframes watermarkPulse { 0% { opacity: 0.04; transform: scale(1) rotate(0deg); } 100% { opacity: 0.1; transform: scale(1.05) rotate(2deg); } }
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--saw-gold);
  border-radius: 50%;
  opacity: 0;
  animation: particleRise 8s ease-in-out infinite;
}
.hero-particle:nth-child(1) { left: 10%; bottom: 0; animation-delay: 0s; }
.hero-particle:nth-child(2) { left: 20%; bottom: 0; animation-delay: 1.2s; width: 3px; height: 3px; opacity: 0.3; }
.hero-particle:nth-child(3) { left: 35%; bottom: 0; animation-delay: 2.4s; width: 5px; height: 5px; }
.hero-particle:nth-child(4) { left: 50%; bottom: 0; animation-delay: 0.6s; width: 3px; height: 3px; opacity: 0.2; }
.hero-particle:nth-child(5) { left: 65%; bottom: 0; animation-delay: 3.6s; }
.hero-particle:nth-child(6) { left: 78%; bottom: 0; animation-delay: 1.8s; width: 5px; height: 5px; }
.hero-particle:nth-child(7) { left: 90%; bottom: 0; animation-delay: 4.2s; width: 3px; height: 3px; opacity: 0.3; }
.hero-particle:nth-child(8) { left: 45%; bottom: 0; animation-delay: 3s; }
@keyframes particleRise {
  0% { transform: translateY(0) scale(0); opacity: 0; }
  20% { opacity: 0.6; }
  80% { opacity: 0.4; }
  100% { transform: translateY(-90vh) scale(1); opacity: 0; }
}
.login-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(214,166,46,0.08) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(214,166,46,0.05) 0%, transparent 60%);
  z-index: 0;
  animation: heroGlow 8s ease-in-out infinite alternate;
}
@keyframes heroGlow { 0% { opacity: 0.6; } 100% { opacity: 1; } }
.login-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  pointer-events: none;
}
.hero-dot {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.hero-dot-1 { width: 6px; height: 6px; background: var(--saw-gold); top: 15%; right: 25%; box-shadow: 0 0 12px rgba(214,166,46,0.4); animation: dotFloat 5s ease-in-out infinite; }
.hero-dot-2 { width: 4px; height: 4px; background: rgba(255,255,255,0.4); bottom: 35%; left: 12%; animation: dotFloat 7s ease-in-out infinite 1s; }
.hero-dot-3 { width: 8px; height: 8px; background: var(--saw-gold); top: 45%; right: 15%; box-shadow: 0 0 16px rgba(214,166,46,0.3); animation: dotFloat 6s ease-in-out infinite 0.5s; }
.hero-dot-4 { width: 3px; height: 3px; background: rgba(255,255,255,0.5); top: 22%; left: 30%; animation: dotFloat 8s ease-in-out infinite 2s; }
.hero-dot-5 { width: 5px; height: 5px; background: rgba(214,166,46,0.6); bottom: 18%; right: 30%; box-shadow: 0 0 10px rgba(214,166,46,0.3); animation: dotFloat 6.5s ease-in-out infinite 1.5s; }
@keyframes dotFloat { 0%,100% { transform: translateY(0) scale(1); opacity: 0.6; } 50% { transform: translateY(-16px) scale(1.2); opacity: 1; } }
.hero-wave {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 180px;
  z-index: 3;
  pointer-events: none;
}
.hero-wave svg { width: 100%; height: 100%; display: block; }
.hero-accent {
  position: absolute;
  top: -60px;
  right: -60px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(214,166,46,0.12);
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}
.hero-accent-2 { top: -100px; right: -30px; width: 400px; height: 400px; border-color: rgba(214,166,46,0.06); }
.hero-content {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2.5rem 3rem;
}
.hero-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: auto;
}
.hero-brand-logo {
  width: 54px;
  height: 54px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-brand-logo img { width: 38px; height: 38px; object-fit: contain; }
.brand-mark-lg {
  font-size: 1.2rem;
  font-weight: 1000;
  color: var(--saw-gold);
}
.brand-mark-sm {
  font-size: 1.6rem;
  font-weight: 1000;
  color: var(--saw-primary);
}
.hero-brand-text { display: flex; flex-direction: column; }
.hero-brand-text strong { font-size: 1rem; font-weight: 700; color: var(--saw-white); letter-spacing: 0.05em; }
.hero-brand-text span { font-size: 0.6rem; font-weight: 600; color: var(--saw-gold); letter-spacing: 0.12em; text-transform: uppercase; }
.hero-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
}
.hero-tagline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 1rem;
  background: rgba(214,166,46,0.1);
  border: 1px solid rgba(214,166,46,0.15);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--saw-gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  width: fit-content;
}
.hero-tagline::before { content: ''; width: 6px; height: 6px; background: var(--saw-gold); border-radius: 50%; flex-shrink: 0; }
.hero-headline {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--saw-white);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}
.hero-headline span { background: linear-gradient(135deg, var(--saw-gold), var(--saw-gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-description {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  max-width: 440px;
  margin-bottom: 2rem;
}
.hero-features { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  transition: all 0.25s ease;
  cursor: default;
}
.hero-feature:hover { background: rgba(214,166,46,0.1); border-color: rgba(214,166,46,0.2); color: var(--saw-gold-light); transform: translateY(-1px); }
.hero-security {
  position: relative;
  z-index: 4;
  display: flex;
  gap: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: auto;
}
.security-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

/* ===== RIGHT PANEL — LOGIN CARD ===== */
.login-form-panel {
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: linear-gradient(135deg, #F4F7FB, #FFFFFF);
  position: relative;
}
.login-panel-inner {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 2rem 1rem;
}
.login-form-panel::before {
  content: '';
  position: absolute;
  top: 20%;
  left: 0;
  width: 3px;
  height: 60%;
  background: linear-gradient(180deg, transparent, var(--saw-gold), transparent);
  opacity: 0.3;
  border-radius: 0 2px 2px 0;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 32px;
  box-shadow: 0 30px 80px rgba(6,27,54,0.12), 0 10px 30px rgba(6,27,54,0.06);
  border: 1px solid rgba(255,255,255,0.7);
  padding: 2.5rem 2.25rem;
  animation: cardFadeIn 0.8s ease forwards;
  position: relative;
}
@keyframes cardFadeIn { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
.login-logo-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.25rem;
  background: var(--saw-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(6,27,54,0.12);
  border: 3px solid rgba(214,166,46,0.25);
  animation: floatLogo 4s ease-in-out infinite;
  transition: box-shadow 0.3s ease;
}
.login-logo-circle:hover { box-shadow: 0 16px 50px rgba(6,27,54,0.18); }
.login-logo-circle img { max-width: 76px; max-height: 76px; object-fit: contain; }
@keyframes floatLogo { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.login-header { text-align: center; margin-bottom: 1.75rem; }
.login-header h2 { font-size: 1.5rem; font-weight: 700; color: var(--saw-text); margin-bottom: 0.25rem; }
.login-header p { font-size: 0.85rem; color: var(--saw-muted); }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--saw-text); margin-bottom: 0.45rem; }
.input-wrapper { position: relative; }
.form-control {
  width: 100%;
  height: 54px;
  padding: 0.75rem 1rem 0.75rem 1.2rem;
  border: 1.5px solid var(--saw-border);
  border-radius: 14px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--saw-text);
  background: var(--saw-white);
  transition: all 0.25s ease;
  outline: none;
}
.form-control:hover { border-color: #cdd3df; }
.form-control:focus {
  border-color: var(--saw-gold);
  box-shadow: 0 0 0 4px rgba(214,166,46,0.12);
  background: var(--saw-white);
}
.form-control::placeholder { color: #b0b8c8; font-size: 0.8125rem; }
.form-control.is-invalid { border-color: var(--saw-danger); box-shadow: 0 0 0 4px rgba(220,38,38,0.08); }
.toggle-password {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--saw-muted);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
  transition: color 0.2s ease;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.toggle-password:hover { color: var(--saw-gold); }
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.form-check { display: flex; align-items: center; gap: 0.5rem; margin: 0; }
.form-check-input {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--saw-border);
  accent-color: var(--saw-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.form-check-input:checked { background-color: var(--saw-primary); border-color: var(--saw-primary); }
.form-check-label { font-size: 0.8rem; color: var(--saw-muted); cursor: pointer; user-select: none; }
.forgot-link { font-size: 0.8rem; font-weight: 500; color: var(--saw-primary); text-decoration: none; transition: color 0.2s ease; }
.forgot-link:hover { color: var(--saw-gold); text-decoration: underline; }
.btn-login {
  width: 100%;
  height: 56px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #061B36, #0B2D52);
  color: var(--saw-white);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  box-shadow: 0 10px 28px rgba(6,27,54,0.2);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(214,166,46,0.12), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 14px 35px rgba(6,27,54,0.28), 0 0 0 3px rgba(214,166,46,0.1); }
.btn-login:hover::before { opacity: 1; }
.btn-login:active { transform: translateY(0); }
.btn-login.loading { pointer-events: none; opacity: 0.9; }
.btn-login.loading .btn-text { visibility: hidden; }
.btn-login.loading::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: var(--saw-white);
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
.alert {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: alertSlide 0.35s ease-out;
}
@keyframes alertSlide { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert-danger { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.session-status {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.login-security { text-align: center; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--saw-border); }
.login-footer { text-align: center; padding: 1rem 2rem 1.25rem; font-size: 0.6rem; color: var(--saw-muted); letter-spacing: 0.04em; font-weight: 500; opacity: 0.75; flex-shrink: 0; }
.login-security p { font-size: 0.7rem; color: var(--saw-muted); display: flex; align-items: center; justify-content: center; gap: 0.4rem; }

/* ===== RESPONSIVE LOGIN ===== */
@media (max-width: 1024px) {
  .login-hero { flex: 0 0 50%; }
  .login-form-panel { flex: 0 0 50%; }
  .hero-headline { font-size: 2rem; }
  .hero-content { padding: 2rem; }
}
@media (max-width: 820px) {
  .login-hero { display: none; }
  .login-form-panel { flex: 0 0 100%; }
  .login-panel-inner { padding: 1.5rem 1.5rem 0.5rem; }
  .login-form-panel::before { display: none; }
  .login-card { max-width: 420px; padding: 2rem 1.75rem; border-radius: 24px; }
  .login-footer { padding: 0.75rem 1.5rem 1rem; }
}
@media (max-width: 480px) {
  .login-panel-inner { padding: 0.5rem 1rem; align-items: flex-start; padding-top: 2rem; }
  .login-card { padding: 1.75rem 1.25rem; border-radius: 20px; }
  .login-logo-circle { width: 80px; height: 80px; margin-bottom: 1rem; }
  .login-logo-circle img { max-width: 60px; max-height: 60px; }
  .hero-watermark { display: none; }
  .login-header h2 { font-size: 1.2rem; }
  .form-control { height: 48px; font-size: 0.8125rem; border-radius: 12px; }
  .btn-login { height: 50px; font-size: 0.875rem; border-radius: 12px; }
}

/* ============================================
   PREMIUM CSS POLISH — Tables, Forms, Modals,
   Cards, Filters, Buttons, Badges, Empty States
   ============================================ */

/* ===== TABLE POLISH ===== */
.smart-table th:first-child { border-radius: 0; }
.smart-table thead tr th:first-child { border-radius: 0 0 0 0; }
.smart-table thead tr:first-child th:first-child { border-top-left-radius: var(--radius-md); }
.smart-table thead tr:first-child th:last-child { border-top-right-radius: var(--radius-md); }
.smart-table tbody tr:last-child td:first-child { border-bottom-left-radius: var(--radius-md); }
.smart-table tbody tr:last-child td:last-child { border-bottom-right-radius: var(--radius-md); }
.smart-table tbody tr:last-child td { border-bottom: none; }

.smart-table tbody tr:nth-child(even) td { background: #F8FAFE; }
body.dark-mode .smart-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

.smart-table tbody tr { transition: all 0.2s ease; }
.smart-table tbody tr:hover td { background: #EEF4FF !important; }
.smart-table tbody tr:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(6,27,54,0.06); }
body.dark-mode .smart-table tbody tr:hover td { background: rgba(255,255,255,0.05) !important; }

.smart-table th .sort-icon { color: var(--saw-gold); font-size: 10px; margin-left: 4px; }

.smart-table td .highlight { color: var(--saw-primary); font-weight: 700; }
.smart-table td .muted-link { color: var(--saw-muted); font-size: 0.75rem; font-weight: 500; }

.smart-table .table-checkbox {
  width: 18px; height: 18px;
  border: 1.5px solid var(--saw-border);
  border-radius: 4px;
  accent-color: var(--saw-primary);
  cursor: pointer;
}

/* Pagination polish */
.pagination { gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span { border-radius: 10px; font-size: 0.78rem; min-width: 38px; height: 38px; }
.pagination a:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pagination .active { background: var(--saw-primary); border-color: var(--saw-primary); box-shadow: 0 4px 10px rgba(6,27,54,0.15); }
.pagination .disabled { opacity: 0.35; }
.pagination .page-info { font-size: 0.75rem; color: var(--saw-muted); font-weight: 600; display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.pagination a[rel="prev"], .pagination a[rel="next"] { font-weight: 800; font-size: 0.85rem; padding: 0 14px; }

/* ===== FORM POLISH ===== */
.form-card select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  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='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
  cursor: pointer;
}
.form-card select:hover { border-color: #cdd3df; }
.form-card select option { padding: 8px; }

.form-card textarea { min-height: 100px; resize: vertical; }
.form-card textarea:focus { min-height: 120px; }

.form-card input.is-valid, .form-card select.is-valid, .form-card textarea.is-valid {
  border-color: var(--saw-success);
  box-shadow: 0 0 0 3px rgba(22,163,74,0.08);
}
.form-card input.is-invalid, .form-card select.is-invalid, .form-card textarea.is-invalid {
  border-color: var(--saw-danger);
  box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}
.form-card .field-error { font-size: 0.7rem; color: var(--saw-danger); font-weight: 500; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.form-card .field-hint { font-size: 0.7rem; color: var(--saw-muted); font-weight: 500; margin-top: 4px; }

/* Input with icon prefix */
.input-icon-wrap { position: relative; }
.input-icon-wrap .input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--saw-muted); pointer-events: none; display: flex;
}
.input-icon-wrap .input-icon .icon { width: 16px; height: 16px; }
.input-icon-wrap input { padding-left: 40px; }

/* Better labels */
.form-card label, .form-grid label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--saw-text);
  letter-spacing: 0.01em;
}
.form-card label .label-hint { font-weight: 400; color: var(--saw-muted); font-size: 0.7rem; }
.form-card label .required-star { color: var(--saw-danger); margin-left: 2px; }

/* Checkbox & radio toggle */
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--saw-primary); cursor: pointer; border-radius: 4px; }
.toggle-switch {
  position: relative; display: inline-flex; align-items: center;
  width: 44px; height: 24px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-switch .toggle-track {
  width: 100%; height: 100%;
  background: #D1D5DB; border-radius: var(--radius-full);
  transition: all 0.25s ease; cursor: pointer; position: relative;
}
.toggle-switch .toggle-track::after {
  content: ''; position: absolute; left: 3px; top: 3px;
  width: 18px; height: 18px; background: var(--saw-white);
  border-radius: 50%; transition: all 0.25s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-track { background: var(--saw-primary); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); }

/* ===== MODAL POLISH ===== */
.saw-modal { transition: opacity 0.25s ease; }
.saw-modal:not(.open) { opacity: 0; pointer-events: none; }
.saw-modal.open { opacity: 1; display: grid; }
.saw-modal { background: rgba(3,19,38,0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.saw-modal-panel { animation: modalIn 0.3s cubic-bezier(0.34,1.56,0.64,1); }
.saw-modal-panel { width: min(1040px, 94vw); height: min(840px, 90vh); }
.saw-modal.sm .saw-modal-panel { width: min(520px, 94vw); height: min(480px, 80vh); }
.saw-modal.lg .saw-modal-panel { width: min(1240px, 96vw); height: min(920px, 94vh); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(12px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.saw-modal-head { height: 60px; padding: 0 20px; }
.saw-modal-head b { font-size: 0.95rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.saw-modal-head button {
  font-size: 0.75rem; padding: 8px 14px;
  border-radius: 10px; display: flex; align-items: center; gap: 6px;
  transition: all 0.2s ease;
}
.saw-modal-head button:hover { background: rgba(255,255,255,0.15); border-color: var(--saw-gold); }

/* ===== CARDS POLISH ===== */
.card { transition: all 0.2s ease; }
.card:hover { border-color: rgba(214,166,46,0.2); box-shadow: var(--shadow); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.card-header h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--saw-primary); }
.card-header p { margin: 4px 0 0; font-size: 0.75rem; color: var(--saw-muted); }
.card-header .card-badge { font-size: 0.65rem; }
.card-body { font-size: 0.82rem; color: var(--saw-text); line-height: 1.6; }
.card-footer {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--saw-border);
  display: flex; align-items: center; gap: 10px;
}

/* Filter tags/chips */
.filter-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; background: #FFF7DC;
  border: 1px solid #F2D47A; border-radius: var(--radius-full);
  font-size: 0.65rem; font-weight: 700; color: #7A5400;
}
.filter-tag .icon { width: 14px; height: 14px; }
.filter-tag .filter-remove { cursor: pointer; opacity: 0.6; transition: opacity 0.2s ease; display: flex; }
.filter-tag .filter-remove:hover { opacity: 1; }
body.dark-mode .filter-tag { background: #2D2410; border-color: #5C4A1E; color: #F4C766; }

/* ===== FADE-UP PAGE TRANSITIONS ===== */
.content { animation: pageEnter 0.4s ease; }
@keyframes pageEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ===== BUTTON POLISH ===== */
.btn .icon { width: 16px; height: 16px; }
.btn.loading { pointer-events: none; opacity: 0.85; position: relative; }
.btn.loading .btn-text { visibility: hidden; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: var(--saw-white);
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }
.btn.loading.gold::after { border-color: rgba(6,27,54,0.2); border-top-color: var(--saw-primary); }
.btn-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn-icon-only {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ===== BADGE POLISH ===== */
.badge { gap: 4px; }
.badge .icon { width: 12px; height: 12px; }
.badge.badge-success, .badge.status-active, .badge.status-approved, .badge.status-completed, .badge.status-paid { background: #ECFDF5; color: #047857; border: 1px solid #A7F3D0; }
.badge.badge-danger, .badge.status-inactive, .badge.status-rejected, .badge.status-terminated { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.badge.badge-warning, .badge.status-pending, .badge.status-draft, .badge.status-submitted, .badge.status-reviewed { background: #FFF4D8; color: #8A5C00; border: 1px solid #F2D47A; }
.badge.badge-info { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.badge.badge-neutral { background: #F1F5F9; color: #475569; border: 1px solid #E2E8F0; }
.badge.badge-gold { background: linear-gradient(135deg, rgba(214,166,46,0.15), rgba(214,166,46,0.05)); color: #7A5400; border: 1px solid #F2D47A; }
.badge.badge-dot {
  position: relative; padding-left: 16px;
}
.badge.badge-dot::before {
  content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
  width: 6px; height: 6px; border-radius: 50%;
}
.badge.badge-dot.badge-success::before { background: var(--saw-success); }
.badge.badge-dot.badge-danger::before { background: var(--saw-danger); }
.badge.badge-dot.badge-warning::before { background: var(--saw-warning); }
.badge.badge-dot.badge-info::before { background: var(--saw-info); }
.badge.badge-dot.badge-neutral::before { background: var(--saw-muted); }

/* ===== EMPTY STATE POLISH ===== */
.smart-table .empty { padding: 56px 20px 48px; }
.smart-table .empty .empty-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 16px;
  background: #F1F5F9; margin-bottom: 14px; color: var(--saw-muted);
}
.smart-table .empty .empty-icon .icon { width: 26px; height: 26px; }
.smart-table .empty b { font-size: 1.05rem; margin-bottom: 6px; }
.smart-table .empty small { font-size: 0.78rem; margin-bottom: 18px; max-width: 340px; margin-left: auto; margin-right: auto; }
.smart-table .empty .btn { margin-top: 4px; }
body.dark-mode .smart-table .empty .empty-icon { background: #1E293B; color: #64748B; }

/* ===== REPORTS ===== */
.reports-dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 14px; }
.reports-card-hint { font-size: 0.7rem; color: var(--saw-muted); display: block; margin-top: 2px; }
.print-signature-grid { display: flex; justify-content: space-around; padding: 20px; gap: 14px; }
.print-signature-grid span { flex: 1; text-align: center; border-top: 2px solid var(--saw-primary); padding-top: 8px; font-size: 0.75rem; font-weight: 700; color: var(--saw-primary); }

/* ===== SEARCH FORM ===== */
.search-form { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.search-form .form-control { flex: 1; min-height: 46px; }
.search-result-info { color: var(--saw-muted); font-size: 0.8rem; margin-bottom: 14px; }
.search-result-info b { color: var(--saw-text); font-weight: 700; }
.search-empty-hint { color: var(--saw-muted); font-size: 0.85rem; }

/* ===== SELF SERVICE ===== */
.recurring-form select, .recurring-form input {
  width: 100%; padding: 10px 12px; margin-bottom: 10px;
  border: 1.5px solid var(--saw-border); border-radius: 12px;
  font-family: inherit; font-size: 0.8rem; background: var(--saw-white); color: var(--saw-text);
  outline: none; transition: border-color 0.2s ease;
}
.recurring-form select:focus, .recurring-form input:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1); }
.trash-record-num { display: block; color: var(--saw-muted); font-size: 0.7rem; }
.api-form input { width: 100%; padding: 10px 12px; margin-bottom: 10px; border: 1.5px solid var(--saw-border); border-radius: 12px; font-family: inherit; font-size: 0.8rem; outline: none; transition: border-color 0.2s ease; }
.api-form input:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1); }
.wizard-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.wizard-month-label { font-weight: 600; font-size: 0.85rem; display: flex; align-items: center; gap: 8px; }
.wizard-month-input { padding: 8px 12px; border: 1.5px solid var(--saw-border); border-radius: 10px; font-family: inherit; font-size: 0.8rem; outline: none; transition: border-color 0.2s ease; }
.wizard-month-input:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1); }
.wizard-employee-card { padding: 10px; border: 1px solid var(--saw-border); border-radius: var(--radius-lg); background: var(--saw-bg); transition: all 0.2s ease; }
.wizard-employee-card:hover { border-color: rgba(214,166,46,0.3); background: var(--saw-white); }
.wizard-employee-card input { flex-shrink: 0; }
.wizard-employee-info { display: flex; flex-direction: column; }
.wizard-employee-info b { display: block; font-size: 0.85rem; color: var(--saw-primary); }
.wizard-employee-info small { font-size: 0.7rem; color: var(--saw-muted); }
.dg-smart-table { margin: 0; border: none; }
.dg-action-cell { text-align: right; }
.dg-empty { padding: 2rem; text-align: center; color: var(--saw-muted); }
.dg-empty b { display: block; font-size: 0.9rem; color: var(--saw-text); }
.dg-empty small { font-size: 0.8rem; }
.ss-table-card { margin-bottom: 16px; }
.self-service-action { margin-top: 12px; }
.self-service-empty { color: var(--saw-muted); font-size: 0.85rem; }

/* ===== QUICK ACTIONS GRID ===== */
.quick-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.quick-action-link {
  display: flex; flex-direction: column; padding: 14px;
  border: 1px solid var(--saw-border); border-radius: var(--radius-lg);
  transition: all 0.2s ease; text-decoration: none;
}
.quick-action-link:hover { border-color: var(--saw-gold); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.quick-action-link b { font-size: 0.85rem; color: var(--saw-primary); font-weight: 700; }
.quick-action-link small { font-size: 0.65rem; color: var(--saw-muted); }
body.dark-mode .quick-action-link { background: #1E293B; }
body.dark-mode .quick-action-link b { color: #F1F5F9; }

/* ===== APPROVAL INLINE FORM ===== */
.approval-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.approval-form select,
.approval-form input[type="text"],
.approval-form input[type="number"] {
  padding: 6px 10px; border: 1px solid var(--saw-border); border-radius: 8px;
  font-size: 0.75rem; font-family: inherit; background: var(--saw-white);
  color: var(--saw-text); outline: none; transition: border-color 0.2s ease;
}
.approval-form select:focus,
.approval-form input[type="text"]:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 2px rgba(214,166,46,0.08); }
body.dark-mode .approval-form select,
body.dark-mode .approval-form input[type="text"] { background: #1E293B; border-color: #334155; color: #F1F5F9; }

/* ===== SHOW VIEW ===== */
.show-form-stack { display: flex; flex-direction: column; gap: 10px; }
.show-select {
  padding: 10px 12px; border: 1.5px solid var(--saw-border); border-radius: 12px;
  font-family: inherit; font-size: 0.8rem; background: var(--saw-white); color: var(--saw-text);
  outline: none; transition: border-color 0.2s ease;
}
.show-select:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1); }
.show-input {
  padding: 10px 12px; border: 1.5px solid var(--saw-border); border-radius: 12px;
  font-family: inherit; font-size: 0.8rem; background: var(--saw-white); color: var(--saw-text);
  outline: none; transition: border-color 0.2s ease;
}
.show-input:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1); }
.show-textarea {
  padding: 10px 12px; border: 1.5px solid var(--saw-border); border-radius: 12px;
  font-family: inherit; font-size: 0.8rem; min-height: 80px; resize: vertical;
  background: var(--saw-white); color: var(--saw-text); outline: none;
  transition: border-color 0.2s ease;
}
.show-textarea:focus { border-color: var(--saw-gold); box-shadow: 0 0 0 3px rgba(214,166,46,0.1); }
.show-hint { margin-top: 10px; font-size: 0.75rem; color: var(--saw-muted); }
.show-toggle-label { font-size: 0.8rem; font-weight: 600; }
.statement-type-select { min-width: 150px; }
.statement-id-select { min-width: 200px; }
.form-grid-section { margin-bottom: 18px; }
.show-empty-inline { color: var(--saw-muted); font-size: 0.8rem; }
.show-comment-body { font-size: 0.8rem; color: var(--saw-text); margin-top: 4px; display: block; }
.show-fields-table-wrap { overflow-x: auto; }
.show-fields-table th,
.show-fields-table td { padding: 8px 12px; border-bottom: 1px solid var(--saw-border); }
.show-fields-table th { background: transparent; color: var(--saw-primary); text-transform: none; letter-spacing: 0; width: 200px; font-weight: 700; }
body.dark-mode .show-select,
body.dark-mode .show-input,
body.dark-mode .show-textarea { background: #1E293B; border-color: #334155; color: #F1F5F9; }
body.dark-mode .show-fields-table th { color: #F1F5F9; }
body.dark-mode .show-comment-body { color: #E2E8F0; }

/* ===== DARK MODE EXTENSIONS ===== */
body.dark-mode .form-card select { 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='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); }
body.dark-mode .input-icon-wrap .input-icon { color: #64748B; }
body.dark-mode .form-card input.is-valid, body.dark-mode .form-card select.is-valid, body.dark-mode .form-card textarea.is-valid { box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }
body.dark-mode .form-card input.is-invalid, body.dark-mode .form-card select.is-invalid, body.dark-mode .form-card textarea.is-invalid { box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }
body.dark-mode .toggle-switch .toggle-track { background: #475569; }
body.dark-mode .saw-modal { background: rgba(0,0,0,0.7); }
body.dark-mode .smart-table tbody tr:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }

/* ===== RESPONSIVE POLISH EXTENSIONS ===== */
@media (max-width: 820px) {
  .pagination .page-info { display: none; }
  .btn-group { flex-direction: column; align-items: stretch; }
  .btn-group .btn { justify-content: center; }
}
@media (max-width: 480px) {
  .smart-table th, .smart-table td { padding: 10px 10px; font-size: 0.75rem; }
  .pagination a, .pagination span { min-width: 34px; height: 34px; font-size: 0.72rem; }
}

/* ==========================================================
   SAW ENTERPRISE UI REFINEMENTS v2.1
   Premium polish: toolbar, search, table, KPI, spacing
   ========================================================== */

/* --- Enhanced Search Field --- */
.toolbar input[name="q"] {
  min-width: 200px;
  background: var(--saw-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
  padding-left: 36px;
  transition: all 0.25s ease;
}
.toolbar input[name="q"]:focus {
  width: 260px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23D6A62E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
}
body.dark-mode .toolbar input[name="q"] {
  background-color: #1E293B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364786B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
}
body.dark-mode .toolbar input[name="q"]:focus {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23D6A62E' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 12px center no-repeat;
}

/* --- Toolbar action grouping --- */
.toolbar .tb-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.toolbar .tb-actions .actions-divider {
  width: 1px;
  height: 28px;
  background: var(--saw-border);
  margin: 0 4px;
  flex-shrink: 0;
}
.toolbar .tb-actions-group-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--saw-muted);
  margin-right: 4px;
  white-space: nowrap;
}

/* --- Refined Primary Button --- */
.btn.primary {
  background: var(--saw-primary);
  color: var(--saw-white);
  box-shadow: 0 4px 12px rgba(6,27,54,0.2);
}
.btn.primary:hover {
  background: var(--saw-secondary);
  box-shadow: 0 6px 20px rgba(6,27,54,0.3);
  transform: translateY(-2px);
}

/* --- Column Toggle Refinements --- */
.column-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.column-toggle > span {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--saw-muted);
  margin-right: 4px;
}
.column-toggle label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--saw-text);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s ease;
}
.column-toggle label:hover {
  background: var(--saw-bg);
}
.column-toggle input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--saw-primary);
  cursor: pointer;
}

/* --- Bulk Action Row Refinements --- */
.table-tools {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: var(--radius-xl);
  padding: 12px 18px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(6,27,54,0.04);
}
.table-tools form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.table-tools select {
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--saw-border);
  border-radius: 10px;
  font-size: 0.78rem;
  font-family: inherit;
  background: var(--saw-bg);
  color: var(--saw-text);
  min-height: 36px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.table-tools select:focus {
  border-color: var(--saw-gold);
  box-shadow: 0 0 0 3px rgba(214,166,46,0.08);
}
body.dark-mode .table-tools {
  background: #1E293B;
  border-color: #334155;
}
body.dark-mode .table-tools select {
  background-color: #0F172A;
  border-color: #334155;
  color: #F1F5F9;
}

/* --- Enhanced KPI Grid --- */
.kpi-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

/* --- KPI module-kpi: Premium Dashboard-style Cards --- */
.kpi.module-kpi {
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(6,27,54,0.08);
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  min-height: 130px;
  justify-content: center;
}
.kpi.module-kpi:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(6,27,54,0.15);
}
.kpi.module-kpi::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.kpi.module-kpi::before {
  content: '';
  position: absolute;
  inset: auto -40px -40px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
}
.kpi.module-kpi span {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255,255,255,0.65);
  position: relative;
  z-index: 1;
}
.kpi.module-kpi b {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}
.kpi.module-kpi small {
  font-size: 0.62rem;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

/* Tone: Navy — deep dark blue for total/primary counts */
.kpi.module-kpi.tone-navy {
  background: linear-gradient(135deg, #061B36 0%, #0B2D52 60%, #0F3A5F 100%);
  border: 1px solid rgba(255,255,255,0.06);
}
.kpi.module-kpi.tone-navy b { color: #FFFFFF; }
.kpi.module-kpi.tone-navy small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-navy::after { background: linear-gradient(90deg, #D6A62E, #F4C766); }
.kpi.module-kpi.tone-navy::before {
  background: radial-gradient(circle, rgba(214,166,46,0.12), transparent 70%);
}

/* Tone: Green — deep emerald for active/success */
.kpi.module-kpi.tone-green {
  background: linear-gradient(135deg, #064E3B 0%, #047857 55%, #059669 100%);
  border: 1px solid rgba(255,255,255,0.08);
}
.kpi.module-kpi.tone-green b { color: #FFFFFF; }
.kpi.module-kpi.tone-green small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-green::after { background: linear-gradient(90deg, #6EE7B7, #34D399); }
.kpi.module-kpi.tone-green::before {
  background: radial-gradient(circle, rgba(52,211,153,0.12), transparent 70%);
}

/* Tone: Gold — rich amber/gold for pending/warning/value */
.kpi.module-kpi.tone-gold {
  background: linear-gradient(135deg, #78350F 0%, #B8860B 50%, #D6A62E 100%);
  border: 1px solid rgba(255,255,255,0.1);
}
.kpi.module-kpi.tone-gold b { color: #FFFFFF; }
.kpi.module-kpi.tone-gold small { color: rgba(255,255,255,0.55); }
.kpi.module-kpi.tone-gold::after { background: linear-gradient(90deg, #FBBF24, #F59E0B); }
.kpi.module-kpi.tone-gold::before {
  background: radial-gradient(circle, rgba(251,191,36,0.1), transparent 70%);
}

/* Tone: Blue — deep ocean for financial/value metrics */
.kpi.module-kpi.tone-blue {
  background: linear-gradient(135deg, #1E3A5F 0%, #0B6FA4 55%, #0891B2 100%);
  border: 1px solid rgba(255,255,255,0.08);
}
.kpi.module-kpi.tone-blue b { color: #FFFFFF; }
.kpi.module-kpi.tone-blue small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-blue::after { background: linear-gradient(90deg, #7DD3FC, #38BDF8); }
.kpi.module-kpi.tone-blue::before {
  background: radial-gradient(circle, rgba(56,189,248,0.1), transparent 70%);
}

/* Tone: Red — deep crimson for errors/trashed/critical */
.kpi.module-kpi.tone-red {
  background: linear-gradient(135deg, #7F1D1D 0%, #B91C1C 55%, #DC2626 100%);
  border: 1px solid rgba(255,255,255,0.08);
}
.kpi.module-kpi.tone-red b { color: #FFFFFF; }
.kpi.module-kpi.tone-red small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-red::after { background: linear-gradient(90deg, #FCA5A5, #F87171); }
.kpi.module-kpi.tone-red::before {
  background: radial-gradient(circle, rgba(248,113,113,0.1), transparent 70%);
}

/* Tone: Amber — warm orange for due/service/metrics */
.kpi.module-kpi.tone-amber {
  background: linear-gradient(135deg, #78350F 0%, #B45309 55%, #D97706 100%);
  border: 1px solid rgba(255,255,255,0.08);
}
.kpi.module-kpi.tone-amber b { color: #FFFFFF; }
.kpi.module-kpi.tone-amber small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-amber::after { background: linear-gradient(90deg, #FCD34D, #FBBF24); }
.kpi.module-kpi.tone-amber::before {
  background: radial-gradient(circle, rgba(251,191,36,0.1), transparent 70%);
}

/* Tolerance: Purple — for special/performance metrics */
.kpi.module-kpi.tone-purple {
  background: linear-gradient(135deg, #4C1D95 0%, #6D28D9 55%, #7C3AED 100%);
  border: 1px solid rgba(255,255,255,0.08);
}
.kpi.module-kpi.tone-purple b { color: #FFFFFF; }
.kpi.module-kpi.tone-purple small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-purple::after { background: linear-gradient(90deg, #C4B5FD, #A78BFA); }
.kpi.module-kpi.tone-purple::before {
  background: radial-gradient(circle, rgba(167,139,250,0.12), transparent 70%);
}

/* Tone: Slate — neutral dark for secondary/env metrics */
.kpi.module-kpi.tone-slate {
  background: linear-gradient(135deg, #1E293B 0%, #334155 55%, #475569 100%);
  border: 1px solid rgba(255,255,255,0.06);
}
.kpi.module-kpi.tone-slate b { color: #FFFFFF; }
.kpi.module-kpi.tone-slate small { color: rgba(255,255,255,0.5); }
.kpi.module-kpi.tone-slate::after { background: linear-gradient(90deg, #94A3B8, #64748B); }
.kpi.module-kpi.tone-slate::before {
  background: radial-gradient(circle, rgba(148,163,184,0.1), transparent 70%);
}

/* Dark mode overrides */
body.dark-mode .kpi.module-kpi { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
body.dark-mode .kpi.module-kpi:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.3); }
body.dark-mode .kpi.module-kpi.tone-navy { border-color: rgba(255,255,255,0.06); }
body.dark-mode .kpi.module-kpi.tone-green { border-color: rgba(255,255,255,0.08); }
body.dark-mode .kpi.module-kpi.tone-gold { border-color: rgba(255,255,255,0.1); }
body.dark-mode .kpi.module-kpi.tone-blue { border-color: rgba(255,255,255,0.08); }
body.dark-mode .kpi.module-kpi.tone-red { border-color: rgba(255,255,255,0.08); }
body.dark-mode .kpi.module-kpi.tone-amber { border-color: rgba(255,255,255,0.08); }
body.dark-mode .kpi.module-kpi.tone-purple { border-color: rgba(255,255,255,0.08); }
body.dark-mode .kpi.module-kpi.tone-slate { border-color: rgba(255,255,255,0.06); }

/* --- Section title refinements --- */
.page-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.page-section-title h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--saw-primary);
  letter-spacing: -0.01em;
}
.page-section-title .section-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--saw-bg);
  color: var(--saw-muted);
  border: 1px solid var(--saw-border);
}

/* --- Card hover refinements --- */
.card.premium-hover {
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.card.premium-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(214,166,46,0.2);
}

/* --- Table row actions refinement --- */
.smart-table .row-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.smart-table tr:hover .row-actions {
  opacity: 1;
}
.smart-table td .row-id {
  font-size: 0.68rem;
  color: var(--saw-muted);
  font-weight: 500;
}
/* --- First column / title column enhancement --- */
.smart-table td:first-child b {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--saw-primary);
  display: block;
  line-height: 1.3;
}
.smart-table td:first-child .row-id {
  display: block;
  margin-top: 1px;
  font-size: 0.65rem;
  color: #64748B;
  font-weight: 500;
}
body.dark-mode .smart-table td:first-child b {
  color: #E2E8F0;
}
body.dark-mode .smart-table td:first-child .row-id {
  color: #94A3B8;
}
.smart-table td:first-child {
  min-width: 160px;
  padding-right: 24px;
}

/* --- Pagination info refinement --- */
.pagination-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--saw-border);
  background: linear-gradient(180deg, #F8FAFC, #fff);
}
.pagination-wrapper .pagination-info {
  font-size: 0.72rem;
  color: var(--saw-muted);
  font-weight: 600;
}
body.dark-mode .pagination-wrapper {
  background: #0F172A;
  border-top-color: #334155;
}

/* --- Filter bar status indicators --- */
.filter-active-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--saw-gold);
  background: rgba(214,166,46,0.1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(214,166,46,0.2);
}
.filter-active-indicator::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--saw-gold);
}

/* --- Enhanced Show Fields (detail pages) --- */
.show-fields-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}
.show-fields-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #EEF2F7;
  vertical-align: top;
}
.show-fields-table td:first-child {
  font-weight: 700;
  color: var(--saw-primary);
  width: 200px;
  background: #F8FAFC;
  white-space: nowrap;
}
.show-fields-table tr:last-child td {
  border-bottom: none;
}
body.dark-mode .show-fields-table td:first-child {
  background: rgba(255,255,255,0.03);
  color: #F1F5F9;
}
body.dark-mode .show-fields-table td {
  border-bottom-color: #334155;
}

/* --- Tab panel enhancements --- */
.tab-content {
  background: var(--saw-white);
  border: 1px solid var(--saw-border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  padding: 22px;
  box-shadow: 0 2px 8px rgba(6,27,54,0.04);
}
body.dark-mode .tab-content {
  background: #1E293B;
  border-color: #334155;
}

/* --- Empty state enhancement --- */
.empty-state-premium {
  text-align: center;
  padding: 48px 20px;
}
.empty-state-premium .empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--saw-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--saw-muted);
}
.empty-state-premium .empty-icon .icon {
  width: 24px;
  height: 24px;
}
.empty-state-premium b {
  display: block;
  font-size: 0.95rem;
  color: var(--saw-primary);
  margin-bottom: 6px;
}
.empty-state-premium small {
  display: block;
  color: var(--saw-muted);
  margin-bottom: 16px;
}

/* --- Responsive toolbar refinements --- */
@media (max-width: 820px) {
  .toolbar .tb-row {
    flex-direction: column;
    align-items: stretch;
  }
  .toolbar input[name="q"] {
    min-width: 0;
    width: 100%;
  }
  .toolbar input[name="q"]:focus {
    width: 100%;
  }
  .toolbar .tb-actions {
    justify-content: center;
  }
  .table-tools {
    flex-direction: column;
  }
  .table-tools form {
    width: 100%;
  }
  .table-tools select {
    flex: 1;
  }
}
/* ===== DASHBOARD GROUPED ANALYTICS ===== */
.page-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 12px;
}
.page-section-title h2 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--saw-primary);
  margin: 0;
}
.section-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--saw-muted);
  background: rgba(100,116,139,0.1);
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.analytics-card {
  border-top: 4px solid var(--saw-primary);
  border-radius: 10px;
  background: var(--saw-card-bg, #fff);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.analytics-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.analytics-card.tone-green { border-top-color: #047857; }
.analytics-card.tone-blue { border-top-color: #0B6FA4; }
.analytics-card.tone-gold { border-top-color: #D6A62E; }
.analytics-card.tone-amber { border-top-color: #D97706; }
.analytics-card.tone-navy { border-top-color: #061B36; }
.analytics-card.tone-red { border-top-color: #B91C1C; }
.analytics-card.tone-slate { border-top-color: #475569; }
.analytics-metric.tone-green b { color: #047857; }
.analytics-metric.tone-blue b { color: #0B6FA4; }
.analytics-metric.tone-gold b { color: #D6A62E; }
.analytics-metric.tone-amber b { color: #D97706; }
.analytics-metric.tone-navy b { color: #061B36; }
.analytics-metric.tone-red b { color: #B91C1C; }
.analytics-metric.tone-slate b { color: #475569; }
.analytics-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
}
.analytics-head h3 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--saw-primary);
  margin: 0;
}
.analytics-head p {
  font-size: 0.72rem;
  color: var(--saw-muted);
  margin: 2px 0 0;
}
.analytics-badge {
  background: rgba(6,27,54,0.12);
  color: #061B36;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.analytics-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}
.analytics-body.cols-2 { grid-template-columns: 1fr 1fr; }
.analytics-body.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.analytics-body.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.analytics-metric {
  background: rgba(6,27,54,0.06);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: background 0.2s;
}
.analytics-metric:hover {
  background: rgba(6,27,54,0.1);
}
.analytics-metric span {
  font-size: 0.65rem;
  color: var(--saw-muted);
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.analytics-metric b {
  font-size: 1.1rem;
  display: block;
  margin-top: 3px;
}
body.dark-mode .analytics-card {
  background: #1E293B !important;
  border-color: #334155 !important;
}
body.dark-mode .analytics-head h3,
body.dark-mode .analytics-metric b {
  color: #F1F5F9 !important;
}
body.dark-mode .analytics-head p,
body.dark-mode .analytics-metric span {
  color: #94A3B8 !important;
}
body.dark-mode .analytics-metric {
  background: rgba(255,255,255,0.04) !important;
}
body.dark-mode .analytics-metric:hover {
  background: rgba(255,255,255,0.06) !important;
}
body.dark-mode .analytics-badge {
  background: rgba(241,245,249,0.1) !important;
  color: #94A3B8 !important;
}
/* ===== DASHBOARD QUICK ACTIONS ===== */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.qa-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 10px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
}
.qa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.qa-btn .qa-icon { font-size: 1.3rem; line-height: 1; }
.qa-btn b { font-size: 0.78rem; font-weight: 700; color: #fff; line-height: 1.2; }
.qa-btn small { font-size: 0.62rem; color: rgba(255,255,255,0.75); line-height: 1.2; }
.qa-btn.tone-green { background: #047857; border-color: #047857; }
.qa-btn.tone-green:hover { background: #065f46; border-color: #065f46; }
.qa-btn.tone-gold { background: #D6A62E; border-color: #D6A62E; }
.qa-btn.tone-gold:hover { background: #b8921f; border-color: #b8921f; }
.qa-btn.tone-blue { background: #0B6FA4; border-color: #0B6FA4; }
.qa-btn.tone-blue:hover { background: #0a5a85; border-color: #0a5a85; }
.qa-btn.tone-red { background: #B91C1C; border-color: #B91C1C; }
.qa-btn.tone-red:hover { background: #991515; border-color: #991515; }
.qa-btn.tone-amber { background: #D97706; border-color: #D97706; }
.qa-btn.tone-amber:hover { background: #b86305; border-color: #b86305; }
.qa-btn.tone-navy { background: #061B36; border-color: #061B36; }
.qa-btn.tone-navy:hover { background: #0B2D52; border-color: #0B2D52; }
body.dark-mode .qa-btn { border-color: rgba(255,255,255,0.08); }
/* ===== STICKY FORM ACTION BAR ===== */
.sticky-form-bar {
  position: sticky;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--saw-border);
  margin-top: 24px;
  border-radius: 0 0 12px 12px;
}
body.dark-mode .sticky-form-bar {
  background: rgba(15,23,42,0.95);
  border-top-color: #334155;
}
.form-section {
  margin-bottom: 20px;
  padding: 20px;
  background: #F8FAFC;
  border-radius: 10px;
  border: 1px solid var(--saw-border);
}
body.dark-mode .form-section {
  background: #1E293B;
  border-color: #334155;
}
.form-section h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--saw-primary);
  margin: 0 0 4px;
}
.form-section p {
  font-size: 0.7rem;
  color: var(--saw-muted);
  margin: 0 0 14px;
}
/* ===== DASHBOARD RESPONSIVE ===== */
@media(max-width:820px) {
  .analytics-grid { grid-template-columns: 1fr !important; }
  .qa-grid { grid-template-columns: 1fr 1fr !important; }
  .dash-hero-logo { width: 50px !important; }
}
@media(max-width:480px) {
  .qa-grid { grid-template-columns: 1fr !important; }
}
/* ===== SIDEBAR ENHANCEMENTS ===== */
.sidebar-nav { scroll-behavior: smooth; }
.nav-group.closed .nav-subgroup { display: none; }
.nav-group:not(.closed) .nav-subgroup { display: flex; }
.nav-link.active,
.nav-link.active:hover {
  background: linear-gradient(135deg, rgba(214,166,46,0.2) 0%, rgba(214,166,46,0.06) 100%);
  color: var(--saw-white);
  font-weight: 700;
  box-shadow: inset 4px 0 0 var(--saw-gold), 0 0 20px rgba(214,166,46,0.08);
  transform: translateX(3px);
}
.nav-link.active .nav-icon,
.nav-link.active:hover .nav-icon {
  background: rgba(214,166,46,0.18);
  color: var(--saw-gold);
  box-shadow: 0 0 16px rgba(214,166,46,0.1);
}
.nav-link.active .nav-icon .icon,
.nav-link.active:hover .nav-icon .icon { stroke: var(--saw-gold); }
body.dark-mode .nav-link.active,
body.dark-mode .nav-link.active:hover {
  background: linear-gradient(135deg, rgba(214,166,46,0.15) 0%, rgba(214,166,46,0.04) 100%);
}
