@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/Poppins-500.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/Poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/Poppins-700.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/Poppins-800.woff2") format("woff2");
}

:root {
  --pearl-black: #0a0a0a;
  --pearl-black-soft: #1a1a1a;
  --pearl-black-elevated: #22221f;
  --pearl-white: #f7f6f3;
  --pearl-surface: #ffffff;
  --surface-muted: #f4f2ec;
  --row-hover: #fbf7ea;
  --gold: #c9a227;
  --gold-bright: #e8b923;
  --gold-light: #f5d77e;
  --border: #e5e2da;
  --text: #1a1a1a;
  --text-muted: #6b6660;
  --danger: #b3392c;
  --success: #2f7d4f;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(10, 10, 10, 0.08);
  --gold-glow: 0 0 0 3px rgba(201, 162, 39, 0.22);
  --font-display: "Poppins", "Segoe UI", Roboto, Arial, sans-serif;

  --sidebar-bg: #ffffff;
  --sidebar-text: #1a1a1a;
  --sidebar-text-muted: #6b6660;
  --sidebar-border: #e5e2da;
  --sidebar-hover-bg: rgba(201, 162, 39, 0.14);
  --sidebar-hover-color: #0a0a0a;
}

[data-theme="dark"] {
  --pearl-white: #121212;
  --pearl-surface: #1c1c1c;
  --surface-muted: #262622;
  --row-hover: #262016;
  --border: #333230;
  --text: #f0efec;
  --text-muted: #a8a29b;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);

  --sidebar-bg: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
  --sidebar-text: #cdc9c2;
  --sidebar-text-muted: #9a958c;
  --sidebar-border: rgba(201, 162, 39, 0.25);
  --sidebar-hover-bg: rgba(201, 162, 39, 0.12);
  --sidebar-hover-color: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--pearl-white);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}

.hidden { display: none !important; }

.brand-mark {
  width: 100%;
  max-width: 176px;
  height: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-dot { color: var(--gold-bright); }

.tagline {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--gold-light);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

/* --- Shell layout: sidebar + main --- */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.2s ease, background 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-brand .brand-text h1 { font-size: 18px; color: var(--sidebar-text); white-space: nowrap; }
.sidebar-brand .tagline { font-size: 10px; white-space: nowrap; }

.side-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.side-nav .nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--sidebar-text);
  padding: 10px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.side-nav .nav-icon {
  display: inline-flex;
  color: var(--gold);
  flex-shrink: 0;
}
.side-nav .nav-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

.side-nav .nav-btn:hover:not(:disabled) { background: var(--sidebar-hover-bg); color: var(--sidebar-hover-color); }

.side-nav .nav-btn.active {
  background: var(--gold);
  color: var(--pearl-black);
  font-weight: 700;
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.45);
}

.side-nav .nav-btn.active .nav-icon { color: var(--pearl-black); }

.side-nav .nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.nav-group { display: flex; flex-direction: column; }

.nav-group-toggle { width: 100%; }
.nav-group-toggle .nav-label { flex: 1; }
.nav-group-toggle.active-group { color: var(--gold); font-weight: 700; }
.nav-group-toggle.active-group .nav-icon { color: var(--gold); }

.nav-chevron {
  display: inline-flex;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.nav-chevron svg { width: 15px; height: 15px; stroke: currentColor; fill: none; }
.nav-group.open .nav-chevron { transform: rotate(180deg); }

.nav-subnav {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
}
.nav-group.open .nav-subnav { max-height: 240px; }

.nav-subnav-btn { padding-left: 42px; font-size: 13px; }

.nav-sub-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex-shrink: 0;
}
.nav-subnav-btn.active .nav-sub-dot { opacity: 1; }

.sidebar-footer {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--pearl-black);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.user-name { font-size: 13px; font-weight: 700; color: var(--sidebar-text); white-space: nowrap; }
.user-role { font-size: 11px; color: var(--gold); white-space: nowrap; }

.logout-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--sidebar-text); border-color: var(--sidebar-border); }
.logout-btn:hover { background: var(--sidebar-hover-bg); }
.logout-icon { width: 16px; height: 16px; stroke: currentColor; fill: none; flex-shrink: 0; }
.logout-label { white-space: nowrap; }

/* --- Sidebar collapsed state --- */
.sidebar.collapsed { width: 76px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-meta,
.sidebar.collapsed .logout-label,
.sidebar.collapsed .nav-chevron,
.sidebar.collapsed .nav-subnav { display: none; }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: 22px 10px; }
.sidebar.collapsed .brand-mark {
  width: 40px;
  height: 40px;
  max-width: none;
  object-fit: cover;
  object-position: left center;
  border-radius: 8px;
}
.sidebar.collapsed .side-nav .nav-btn { justify-content: center; padding: 10px; }
.sidebar.collapsed .user-chip { justify-content: center; }
.sidebar.collapsed .logout-btn { padding: 10px; }

.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: var(--pearl-surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
  z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; white-space: nowrap; }

.icon-btn-plain {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.icon-btn-plain:hover { background: rgba(201, 162, 39, 0.12); color: var(--gold); }
.icon-btn-plain svg { width: 19px; height: 19px; stroke: currentColor; fill: none; }

.topbar-search {
  position: relative;
  flex: 1;
  max-width: 380px;
  display: flex;
  align-items: center;
  background: var(--pearl-white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar-search:focus-within { border-color: var(--gold); box-shadow: var(--gold-glow); }
.topbar-search svg { width: 16px; height: 16px; stroke: var(--text-muted); fill: none; flex-shrink: 0; }
.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  padding: 9px 10px;
  font-size: 13.5px;
  color: var(--text);
  width: 100%;
}

.topbar-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  z-index: 50;
}
.search-result-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}
.search-result-item:hover { background: rgba(201, 162, 39, 0.12); color: var(--gold); }
.search-result-empty { padding: 10px 14px; font-size: 13px; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }

.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--pearl-white);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}
.theme-toggle:hover { background: rgba(201, 162, 39, 0.12); transform: translateY(-1px); }
.theme-toggle svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.topbar-profile {
  display: flex; align-items: center; gap: 10px;
  background: none; border: none; padding: 4px 6px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s;
}
.topbar-profile:hover { background: var(--row-hover); }
.topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--pearl-black);
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  overflow: hidden;
}
.topbar-avatar img, .user-avatar img, .profile-avatar-preview img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.topbar-profile-meta { line-height: 1.3; text-align: left; }
.topbar-profile-name { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.topbar-profile-role { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

@media (max-width: 760px) {
  .topbar-search { display: none; }
  .topbar-profile-meta { display: none; }
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(10, 10, 10, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-panel {
  background: var(--pearl-surface);
  border-radius: 12px;
  width: 380px;
  max-width: 90vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.modal-header h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--border);
}
.profile-avatar-row { display: flex; align-items: center; gap: 16px; }
.profile-avatar-preview {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gold); color: var(--pearl-black);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 22px; flex-shrink: 0; overflow: hidden;
}

.app-root { padding: 24px 28px 60px; max-width: 1280px; margin: 0 auto; width: 100%; }

/* --- Login screen --- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #1a1a1a 0%, #0a0a0a 70%);
  padding: 24px;
}

.login-shell {
  display: flex;
  width: 100%;
  max-width: 960px;
  min-height: 580px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: loginFadeIn 0.5s ease;
}

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

.login-brand-panel {
  flex: 1 1 46%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 15%, rgba(201, 162, 39, 0.22) 0%, transparent 50%),
    linear-gradient(165deg, #1a1a1a 0%, #0a0a0a 100%);
  color: #fff;
  padding: 56px 44px;
  display: flex;
  align-items: center;
}
.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(201, 162, 39, 0.14) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: 0.6;
  z-index: 0;
}

.login-glow {
  position: absolute;
  top: -90px;
  left: -70px;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(201, 162, 39, 0.28) 0%, transparent 70%);
  filter: blur(6px);
  z-index: 0;
  animation: loginGlow 6s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes loginGlow {
  from { transform: scale(1); opacity: 0.65; }
  to { transform: scale(1.18); opacity: 1; }
}

.login-watermark {
  position: absolute;
  right: -70px;
  bottom: -70px;
  width: 320px;
  height: 320px;
  opacity: 0.07;
  transform: rotate(-6deg);
  z-index: 0;
  pointer-events: none;
}
.login-watermark img { width: 100%; height: 100%; object-fit: contain; }

.login-brand-content { position: relative; z-index: 1; }

.login-brand-panel .login-mark { margin: 0 0 14px; }
.login-brand-panel .login-subtitle { text-align: left; color: #fff; }
.login-brand-panel .login-tagline { text-align: left; color: var(--gold-light); margin-bottom: 0; }

.login-divider {
  width: 46px;
  height: 3px;
  border-radius: 2px;
  margin: 30px 0 26px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
}

.login-highlights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-highlights li { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: #cdc9c2; }

.login-highlight-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(201, 162, 39, 0.14);
  border: 1px solid rgba(201, 162, 39, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.2s;
}
.login-highlights li:hover .login-highlight-icon { background: rgba(201, 162, 39, 0.26); transform: translateY(-1px); }
.login-highlight-icon svg { width: 17px; height: 17px; stroke: var(--gold-bright); fill: none; }

.login-form-panel {
  flex: 1 1 54%;
  background: var(--pearl-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 48px;
}

.login-form-wrap { width: 100%; max-width: 340px; }

.login-form-wrap h1 { margin: 0 0 6px; font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--text); }
.login-form-sub { margin: 0 0 28px; color: var(--text-muted); font-size: 13.5px; }

.login-mark { display: block; width: 190px; height: auto; filter: drop-shadow(0 0 10px rgba(201, 162, 39, 0.3)); }

.login-subtitle {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.login-tagline { color: var(--text-muted); margin-bottom: 26px; letter-spacing: 1px; text-transform: uppercase; font-size: 11px; }

.login-form { text-align: left; display: flex; flex-direction: column; gap: 18px; }

.input-icon-wrap { position: relative; display: flex; align-items: center; }
.input-icon-wrap .input-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  pointer-events: none;
}
.field .input-icon-wrap input { padding-left: 38px; }

.toggle-password {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.toggle-password:hover { color: var(--gold); background: rgba(201, 162, 39, 0.1); }
.toggle-password svg { width: 17px; height: 17px; stroke: currentColor; fill: none; }

.login-btn { width: 100%; margin-top: 4px; padding: 12px; font-size: 15px; }

.login-error {
  color: var(--danger);
  background: #fbe6e2;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  margin: -6px 0 0;
}

.login-footer { margin: 28px 0 0; text-align: center; font-size: 11.5px; color: var(--text-muted); }

@media (max-width: 820px) {
  .login-shell { flex-direction: column; min-height: auto; max-width: 420px; }
  .login-brand-panel { padding: 36px 32px 28px; }
  .login-highlights { display: none; }
  .login-form-panel { padding: 36px 32px 40px; }
}

.panel {
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--gold);
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.meta-line { font-size: 13px; color: var(--text-muted); }
.meta-line strong { color: var(--text); }

fieldset.section {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px 20px;
  margin: 0 0 18px;
}

fieldset.section legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1.35;
  min-height: 32px;
}

.field input, .field select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--pearl-surface);
  color: var(--text);
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: var(--gold-glow);
}

.field input.invalid { border-color: var(--danger); background: #fdf1ef; }

.phone-input {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--pearl-surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.phone-input:focus-within { border-color: var(--gold); box-shadow: var(--gold-glow); }

.phone-code {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--surface-muted);
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}

.phone-input input {
  border: none;
  border-radius: 0;
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  font-size: 14px;
  background: transparent;
}
.phone-input input:focus { outline: none; box-shadow: none; }

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.toolbar .field { flex: 1; min-width: 200px; margin-bottom: 0; }

.search-box { position: relative; display: flex; align-items: center; }
.search-box input { padding-right: 42px; }
.search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.search-btn:hover { color: var(--gold); background: rgba(201, 162, 39, 0.12); }
.search-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 20px;
  background: #f6ecc9;
  color: #8a6d1a;
}

.badge.badge-danger { background: #fbe6e2; color: var(--danger); }
.badge.badge-ok { background: var(--pearl-black); color: var(--gold-bright); }

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  background: #e5f2e9;
  border: 1px solid rgba(47, 125, 79, 0.25);
  color: var(--success);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: none;
  transition: background 0.15s;
}
.pdf-link:hover { background: #d7ecdd; }
.pdf-link svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex-shrink: 0; }

.row-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(1px); }

.icon-btn-print { background: #ede9fe; color: #6d5bd0; }
.icon-btn-print:hover { background: #ddd6fe; box-shadow: 0 3px 8px rgba(109, 91, 208, 0.28); }

.icon-btn-delete { background: #fde8e8; color: #d9484f; }
.icon-btn-delete:hover { background: #fbd5d5; box-shadow: 0 3px 8px rgba(217, 72, 79, 0.28); }

.icon-btn-approve { background: #e3f6e9; color: #1f9d55; }
.icon-btn-approve:hover { background: #cdf0da; box-shadow: 0 3px 8px rgba(31, 157, 85, 0.28); }

button.btn {
  background: var(--pearl-black);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.08);
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}

button.btn:hover:not(:disabled) {
  background: var(--pearl-black-soft);
  box-shadow: 0 3px 10px rgba(10, 10, 10, 0.18);
  transform: translateY(-1px);
}
button.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 2px rgba(10, 10, 10, 0.1); }

button.btn-gold {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: var(--pearl-black);
  box-shadow: 0 1px 3px rgba(201, 162, 39, 0.35);
}
button.btn-gold:hover:not(:disabled) {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-bright) 100%);
  box-shadow: 0 4px 14px rgba(201, 162, 39, 0.5);
  transform: translateY(-1px);
}
button.btn-gold:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 1px 4px rgba(201, 162, 39, 0.35); }

button.btn-outline {
  background: var(--pearl-surface);
  color: var(--text);
  border: 1.5px solid var(--gold);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04);
}
button.btn-outline:hover:not(:disabled) {
  background: var(--row-hover);
  border-color: var(--gold-bright);
  box-shadow: 0 3px 10px rgba(201, 162, 39, 0.22);
  transform: translateY(-1px);
}
button.btn-outline:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }

button.btn-danger {
  background: var(--pearl-surface);
  color: var(--danger);
  border: 1.5px solid rgba(179, 57, 44, 0.45);
  box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04);
}
button.btn-danger:hover:not(:disabled) {
  background: #fbe9e7;
  border-color: var(--danger);
  box-shadow: 0 3px 10px rgba(179, 57, 44, 0.2);
  transform: translateY(-1px);
}
button.btn-danger:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }

button.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: var(--pearl-black);
  color: var(--gold-light);
  position: sticky;
  top: 0;
}

table.data-table thead th:first-child { border-top-left-radius: 6px; }
table.data-table thead th:last-child { border-top-right-radius: 6px; }

table.data-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

table.data-table tbody tr:hover { background: var(--row-hover); }
table.data-table tbody tr.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 24px;
}

.table-scroll {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.table-scroll.cln-table-wrap, .table-scroll.not-table-wrap { overflow-x: auto; }

table.cln-table, table.not-table {
  font-size: 12.5px;
}
table.cln-table th, table.cln-table td,
table.not-table th, table.not-table td {
  padding: 8px 8px;
  white-space: nowrap;
}

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.report-chart-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  background: var(--pearl-surface);
}
.report-chart-card h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.report-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.report-tab {
  background: var(--surface-muted);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.report-tab:hover { border-color: var(--gold); color: var(--text); }
.report-tab.active {
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 100%);
  color: var(--pearl-black);
  border-color: var(--gold);
}

.summary-row {
  display: flex;
  gap: 28px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.summary-item { font-size: 14px; color: var(--text); }
.summary-item strong { font-family: var(--font-display); color: var(--gold); font-size: 18px; margin-left: 6px; }

.finance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.finance-tile {
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.finance-tile-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.finance-tile-icon svg { width: 19px; height: 19px; stroke: currentColor; fill: none; }

.finance-tile-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 3px; }
.finance-tile-value { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--text); }

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-card {
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
  border-top: 3px solid var(--gold);
}

.info-card .value { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }
.info-card .label { font-size: 13px; color: var(--text-muted); font-weight: 600; }

/* --- Dashboard: header row --- */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}

.dash-header h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.dash-header p { margin: 0; color: var(--text-muted); font-size: 13.5px; }

/* --- Dashboard: top widget row (hero + KPIs + donut) --- */
.dash-top-row {
  display: grid;
  grid-template-columns: 1fr 2.2fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
  align-items: stretch;
}

.dash-top-row > * { min-width: 0; }

@media (max-width: 900px) {
  .dash-top-row, .dash-split { grid-template-columns: 1fr; }
}

.hero-card {
  background: linear-gradient(160deg, var(--pearl-black-soft) 0%, var(--pearl-black) 100%);
  border-radius: var(--radius);
  border-top: 3px solid var(--gold);
  box-shadow: var(--shadow);
  padding: 22px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hero-card h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.hero-card p { margin: 0; font-size: 12.5px; color: #cdc9c2; line-height: 1.5; }
.hero-card a { color: var(--gold-bright); font-weight: 700; font-size: 12.5px; text-decoration: underline; }

.ring-wrap { position: relative; width: 100%; max-width: 108px; aspect-ratio: 1 / 1; margin: 10px auto 4px; }
.ring-wrap canvas { width: 100% !important; height: 100% !important; }
.ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  color: var(--gold-bright);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  min-width: 0;
}

.kpi-grid > * { min-width: 0; }

.kpi-card {
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  border-top: 3px solid var(--gold);
  display: flex;
  flex-direction: column;
}

.kpi-top { display: flex; align-items: center; gap: 10px; }

.kpi-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; }

.kpi-icon-gold { background: rgba(201, 162, 39, 0.16); color: var(--gold); }
.kpi-icon-blue { background: rgba(59, 130, 246, 0.14); color: #3b82f6; }
.kpi-icon-green { background: rgba(47, 125, 79, 0.14); color: var(--success); }
.kpi-icon-orange { background: rgba(217, 119, 6, 0.14); color: #d97706; }
.kpi-icon-red { background: rgba(179, 57, 44, 0.14); color: var(--danger); }

.kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.kpi-value { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text); }

.kpi-spark { position: relative; height: 34px; margin: 8px 0 2px; overflow: hidden; }

.kpi-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.kpi-foot a { color: var(--gold); font-weight: 700; text-decoration: none; }
.kpi-foot a:hover { text-decoration: underline; }

.delta { font-weight: 700; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--text-muted); }

.donut-card {
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.donut-card h3 { margin: 0 0 10px; font-family: var(--font-display); font-size: 15px; font-weight: 700; color: var(--text); }

.donut-wrap { position: relative; width: 100%; max-width: 190px; aspect-ratio: 1 / 1; margin: 0 auto; }
.donut-total {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-total .label { font-size: 11px; color: var(--text-muted); }
.donut-total .value { font-family: var(--font-display); font-size: 20px; font-weight: 800; color: var(--text); }

.legend-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.legend-row { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.legend-name { display: flex; align-items: center; color: var(--text-muted); }
.legend-count { font-weight: 700; color: var(--text); }

/* --- Dashboard: two-column section split --- */
.dash-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  align-items: start;
}

.people-list { display: flex; flex-direction: column; }
.people-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}
.people-row:last-child { border-bottom: none; }

.people-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--pearl-black);
  font-weight: 800;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.people-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.people-sub { font-size: 12px; color: var(--text-muted); }
.people-amount { margin-left: auto; font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 14px; }

.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stat-row:last-child { border-bottom: none; }
.stat-row .label { display: flex; align-items: center; font-size: 13px; color: var(--text-muted); }
.stat-row .count { font-family: var(--font-display); font-weight: 800; font-size: 16px; color: var(--text); }

.chart-tall { position: relative; width: 100%; min-width: 0; height: 320px; }

/* --- Dashboard: stat cards (big number + delta + mini chart/comparison) --- */
.stat-row-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
  margin-bottom: 20px;
  align-items: stretch;
}
.stat-row-grid > * { min-width: 0; }

@media (max-width: 900px) {
  .stat-row-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--pearl-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.stat-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
.stat-card-label { font-size: 13.5px; font-weight: 700; color: var(--text); }

.delta-pill { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.delta-pill.up { background: #e5f2e9; color: var(--success); }
.delta-pill.down { background: #fbe6e2; color: var(--danger); }
.delta-pill.flat { background: var(--surface-muted); color: var(--text-muted); }

.stat-card-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--text); margin: 6px 0 4px; }

.stat-card-chart-mini { position: relative; height: 110px; margin: 8px 0 2px; overflow: hidden; }

.stat-card-footer { display: flex; border-top: 1px solid var(--border); margin-top: 14px; padding-top: 14px; gap: 12px; }
.stat-card-cell { flex: 1; }
.cell-value { font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--text); }
.cell-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.stat-card-compare { border-top: 1px solid var(--border); margin-top: auto; padding-top: 12px; font-size: 13px; color: var(--text-muted); }
.stat-card-compare strong { color: var(--text); }

.toast-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  transition: opacity 0.18s ease;
}
.toast-overlay.hidden { opacity: 0; pointer-events: none; }

.toast-modal {
  background: var(--pearl-surface);
  color: var(--text);
  border-radius: 18px;
  padding: 34px 42px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-width: 260px;
  max-width: 380px;
  text-align: center;
  transform: scale(0.9) translateY(6px);
  transition: transform 0.18s ease;
}
.toast-overlay.hidden .toast-modal { transform: scale(0.9) translateY(6px); }
.toast-overlay:not(.hidden) .toast-modal { transform: scale(1) translateY(0); }

.toast-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast-icon svg { width: 32px; height: 32px; stroke-width: 2.5; stroke: currentColor; fill: none; }
.toast-icon.success { background: rgba(47, 125, 79, 0.14); color: var(--success); }
.toast-icon.error { background: rgba(179, 57, 44, 0.14); color: var(--danger); }
.toast-icon.confirm-icon { background: rgba(201, 162, 39, 0.16); color: var(--gold); }

.toast-message { font-size: 15.5px; font-weight: 600; line-height: 1.45; }

.confirm-actions { display: flex; gap: 12px; margin-top: 4px; }
.confirm-actions .btn { padding: 10px 22px; }
