:root {
  --primary: #176b87;
  --primary-strong: #11546b;
  --primary-dark: #0d3548;
  --primary-soft: #e7f3f6;
  --accent: #e99b4e;
  --accent-soft: #fff3e5;
  --success: #16866b;
  --success-soft: #e6f6f1;
  --warning: #aa6c1b;
  --warning-soft: #fff4df;
  --danger: #bc4b52;
  --danger-soft: #fcebec;
  --info: #3977ae;
  --background: #f5f7f9;
  --surface: #ffffff;
  --surface-soft: #f9fbfc;
  --border: #dfe6eb;
  --border-strong: #cbd6dd;
  --text: #172631;
  --muted: #70808b;
  --muted-light: #9ba8b1;
  --sidebar: #102d3c;
  --sidebar-deep: #0b2431;
  --sidebar-text: #c3d1d8;
  --shadow-xs: 0 1px 2px rgba(14, 39, 53, .04);
  --shadow-sm: 0 6px 18px rgba(14, 39, 53, .06);
  --shadow-md: 0 16px 42px rgba(14, 39, 53, .11);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar-width: 248px;
  --topbar-height: 76px;
  color-scheme: light;
}

html, body, button, input, select, textarea, table {
  font-family: Arial, Helvetica, sans-serif !important;
}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body, button, input, select, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-size: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
svg { width: 1.15em; height: 1.15em; }
h1, h2, h3, p { overflow-wrap: anywhere; }

/* Application shell */
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 0%, rgba(67, 137, 160, .2), transparent 30%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-deep) 100%);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(255, 255, 255, .05);
}

.sidebar-head {
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 15px rgba(5, 24, 34, .2); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; color: #fff; font-size: 16px; line-height: 1.2; letter-spacing: -.2px; }
.brand-copy small { display: block; margin-top: 3px; color: #8fa9b5; font-size: 10px; letter-spacing: .7px; text-transform: uppercase; }

.sidebar-nav { flex: 1; overflow: auto; padding: 18px 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.nav-group + .nav-group { margin-top: 17px; }
.nav-section { padding: 0 11px 7px; color: #718f9b; font-size: 9.5px; font-weight: 700; letter-spacing: 1.25px; text-transform: uppercase; }
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  margin: 2px 0;
  padding: 8px 11px;
  border-radius: 9px;
  color: #aec3cc;
  font-size: 13px;
  font-weight: 540;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, .07); transform: translateX(2px); }
.nav-link.active { color: #fff; background: linear-gradient(90deg, rgba(42, 125, 151, .6), rgba(42, 125, 151, .24)); box-shadow: inset 0 0 0 1px rgba(126, 199, 220, .08); }
.nav-link.active::before { content: ""; position: absolute; left: -12px; width: 3px; height: 20px; border-radius: 0 4px 4px 0; background: var(--accent); }
.nav-icon { display: grid; place-items: center; width: 20px; height: 20px; color: #82a8b7; }
.nav-link.active .nav-icon { color: #85d0e1; }
.nav-icon svg { width: 17px; height: 17px; }

.sidebar-footer { padding: 14px 16px 17px; border-top: 1px solid rgba(255, 255, 255, .07); }
.sidebar-profile { display: flex; align-items: center; gap: 9px; min-width: 0; }
.sidebar-profile > span:last-child { min-width: 0; }
.sidebar-profile strong, .sidebar-profile small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile strong { color: #e6eef1; font-size: 12px; }
.sidebar-profile small { color: #7895a1; font-size: 10px; }
.system-status { display: flex; align-items: center; gap: 7px; margin-top: 13px; color: #71919d; font-size: 9.5px; text-transform: uppercase; letter-spacing: .55px; }
.system-status i { width: 6px; height: 6px; border-radius: 50%; background: #54c99f; box-shadow: 0 0 0 3px rgba(84, 201, 159, .1); }

.main { min-height: 100vh; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .93);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 14px; }
.page-heading h1 { margin: 1px 0 0; font-size: 19px; line-height: 1.25; letter-spacing: -.35px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; color: var(--muted-light); font-size: 10px; }
.breadcrumb a:hover { color: var(--primary); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--muted); }
.icon-btn:hover { background: var(--surface-soft); color: var(--primary); }
.menu-toggle, .sidebar-close { display: none; }
.date-chip { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 600; }
.date-chip svg { width: 15px; height: 15px; color: var(--primary); }

.avatar { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(145deg, var(--primary), #2891a8); color: #fff; font-size: 12px; font-weight: 800; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.avatar-sm { width: 31px; height: 31px; flex-basis: 31px; border-radius: 9px; font-size: 11px; }
.user-menu { position: relative; }
.user-trigger { min-width: 178px; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--text); text-align: left; }
.user-trigger:hover, .user-trigger[aria-expanded="true"] { border-color: var(--border); background: var(--surface-soft); }
.user-trigger-copy { flex: 1; min-width: 0; }
.user-trigger-copy strong, .user-trigger-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger-copy strong { font-size: 11.5px; }
.user-trigger-copy small { color: var(--muted); font-size: 9.5px; }
.chevron { color: var(--muted-light); transition: transform .18s ease; }
.chevron svg { width: 14px; height: 14px; }
.user-trigger[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.user-dropdown { position: absolute; top: calc(100% + 9px); right: 0; z-index: 60; width: 218px; padding: 7px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-md); }
.user-dropdown[hidden] { display: none; }
.dropdown-user { padding: 9px 10px 11px; }
.dropdown-user strong, .dropdown-user small { display: block; }
.dropdown-user strong { font-size: 12px; }
.dropdown-user small { color: var(--muted); font-size: 10px; }
.user-dropdown a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px; color: #495a66; font-size: 11.5px; }
.user-dropdown a:hover { background: var(--surface-soft); color: var(--primary); }
.user-dropdown a svg { width: 15px; height: 15px; }
.user-dropdown .danger-link { color: var(--danger); }
.dropdown-divider { height: 1px; margin: 5px; background: var(--border); }

.content { width: 100%; max-width: 1540px; flex: 1; margin: 0 auto; padding: 24px 28px 34px; }
.app-footer { display: flex; justify-content: space-between; gap: 18px; padding: 16px 28px 21px; color: var(--muted-light); font-size: 10px; }
.app-footer span:first-child { font-weight: 700; color: var(--muted); }

/* Grid and cards */
.grid { display: grid; gap: 14px; }
.grid + .grid, .grid + .card, .card + .grid { margin-top: 14px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 3px 1px; }
.dashboard-intro .eyebrow { color: var(--primary); }
.dashboard-intro h2 { margin: 7px 0 3px; font-size: 20px; line-height: 1.25; letter-spacing: -.55px; }
.dashboard-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.card {
  position: relative;
  min-width: 0;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.card:hover { border-color: #d3dfe5; box-shadow: var(--shadow-sm); }
.card h2 { margin: 0; font-size: 14px; letter-spacing: -.15px; }
.card h3 { font-size: 13px; }
.kpi { min-height: 118px; overflow: hidden; padding: 19px; }
.kpi::after { content: ""; position: absolute; right: -28px; bottom: -42px; width: 100px; height: 100px; border-radius: 50%; background: var(--primary-soft); opacity: .55; }
.kpi-label { position: relative; z-index: 1; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.kpi-value { position: relative; z-index: 1; max-width: calc(100% - 42px); margin-top: 13px; font-size: clamp(19px, 1.7vw, 25px); line-height: 1.15; font-weight: 760; letter-spacing: -.7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-icon { position: absolute; z-index: 2; top: 16px; right: 16px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--primary-soft); color: var(--primary); }
.kpi-icon svg { width: 16px; height: 16px; }
.grid-4 .kpi:nth-child(2) .kpi-icon { color: #7653aa; background: #f0eafb; }
.grid-4 .kpi:nth-child(3) .kpi-icon { color: var(--success); background: var(--success-soft); }
.grid-4 .kpi:nth-child(4) .kpi-icon { color: var(--warning); background: var(--warning-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0 0 14px; }
.content > .section-head:not(:first-child) { margin-top: 22px; }
.section-head h2 { margin: 0; font-size: 14px; }
.section-head p { margin: 3px 0 0 !important; font-size: 11px; }

/* Buttons, badges and alerts */
.btn { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 700; line-height: 1; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 14px; height: 14px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); box-shadow: 0 5px 13px rgba(23,107,135,.16); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary-strong), var(--primary-dark)); box-shadow: 0 7px 17px rgba(23,107,135,.22); }
.btn-light { color: #43545f; background: #f4f7f8; border-color: var(--border); }
.btn-light:hover { color: var(--primary); background: #edf4f6; }
.btn-danger { color: #fff; background: linear-gradient(135deg, #c5545b, #a83e46); box-shadow: 0 6px 16px rgba(188,75,82,.18); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 99px; background: #edf1f3; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .25px; text-transform: capitalize; }
.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.alert { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; padding: 10px 12px; border: 1px solid transparent; border-radius: 9px; font-size: 11px; box-shadow: var(--shadow-xs); animation: alert-in .24s ease both; }
.alert.success { color: #126d58; background: var(--success-soft); border-color: #c9eadf; }
.alert.error { color: #9f3d44; background: var(--danger-soft); border-color: #f3d4d7; }
.alert-icon { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 7px; background: rgba(255,255,255,.65); }
.alert-icon svg { width: 13px; height: 13px; }
.alert > button { margin-left: auto; padding: 4px; border: 0; background: none; color: currentColor; opacity: .55; }
.alert > button svg { width: 13px; height: 13px; }
@keyframes alert-in { from { opacity: 0; transform: translateY(-5px); } }

/* Data tables */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 9px; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; }
.table th, .table td { padding: 11px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid #e8edf0; white-space: nowrap; }
.table th { position: sticky; top: 0; z-index: 1; background: #f7f9fa; color: #7b8992; font-size: 9px; font-weight: 750; letter-spacing: .55px; text-transform: uppercase; }
.table td { color: #40515c; font-size: 11px; }
.table td strong { color: var(--text); font-size: 11.5px; }
.table td small { color: var(--muted); font-size: 9.5px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td, .table > tr:not(:first-child):hover td { background: #fbfcfd; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label, .label-row label { color: #344651; font-size: 10.5px; font-weight: 700; }
.field small { color: var(--muted); font-size: 9.5px; }
.label-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.label-row > span { color: var(--muted-light); font-size: 9px; }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 39px;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font-size: 11.5px;
  transition: border .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 82px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #a6b1b8; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b7c6cf; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,107,135,.1); }
.actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; padding-top: 15px; border-top: 1px solid #edf1f3; }

.empty { padding: 38px 18px; text-align: center; color: var(--muted); }
.empty img { width: 110px; height: 90px; object-fit: contain; margin: 0 auto 12px; }
.empty h3 { margin: 0 0 5px; color: var(--text); }
.empty p { max-width: 360px; margin: 0 auto; font-size: 11px; }

/* Page tools and record actions */
.page-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.page-toolbar h2 { margin: 7px 0 3px; font-size: 20px; line-height: 1.2; letter-spacing: -.5px; }
.page-toolbar p { margin: 0; color: var(--muted); font-size: 11px; }
.page-toolbar .eyebrow { color: var(--primary); }
.list-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; }
.list-toolbar > input, .list-toolbar > select { min-height: 36px; padding: 7px 9px; border: 1px solid var(--border-strong); border-radius: 8px; background: #fff; color: var(--text); font-size: 10.5px; }
.search-box { position: relative; min-width: 250px; flex: 1; }
.search-box svg { position: absolute; top: 50%; left: 11px; width: 14px; height: 14px; color: var(--muted-light); transform: translateY(-50%); }
.search-box input { width: 100%; min-height: 36px; padding: 7px 11px 7px 33px; border: 1px solid var(--border-strong); border-radius: 8px; outline: 0; background: #fff; color: var(--text); font-size: 10.5px; }
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(23,107,135,.09); }
.table td > small, .table td > strong + small { display: block; margin-top: 2px; }
.actions-col { width: 1%; }
.row-actions { display: flex; align-items: center; gap: 5px; }
.row-actions form { margin: 0; }
.action-btn { padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--primary); font-size: 9.5px; font-weight: 700; }
.action-btn:hover { background: var(--primary-soft); }
.action-btn.danger { color: var(--danger); }
.action-btn.danger:hover { background: var(--danger-soft); }
.flow-banner { display: flex; align-items: center; justify-content: center; gap: 13px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.72); color: var(--muted-light); font-size: 10px; }
.flow-step { display: flex; align-items: center; gap: 7px; }
.flow-step b { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 7px; background: #edf1f3; font-size: 9px; }
.flow-step.active { color: var(--primary-strong); font-weight: 700; }
.flow-step.active b { color: #fff; background: var(--primary); }
.balance-list { display: flex; flex-direction: column; }
.balance-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.balance-item:last-child { border: 0; }
.balance-item strong, .balance-item small { display: block; }
.balance-item strong { font-size: 10.5px; }
.balance-item small { color: var(--muted); font-size: 9px; }
.balance-item b { color: var(--primary); font-size: 11px; white-space: nowrap; }
.mini-empty { padding: 28px 10px; color: var(--muted); font-size: 10.5px; text-align: center; }

/* Enterprise modal system */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 22px; }
.modal.open { display: flex; }
.nested-modal { z-index: 120; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(7,25,34,.52); backdrop-filter: blur(3px); animation: fade-in .18s ease; }
.modal-dialog { position: relative; z-index: 1; width: min(100%, 620px); max-height: calc(100vh - 44px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.5); border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(7,29,40,.25); animation: modal-in .22s ease; }
.modal-dialog.modal-lg { width: min(100%, 820px); }
.modal-dialog.modal-xl { width: min(100%, 940px); }
.modal-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg,#fff,#fbfcfd); }
.modal-head .eyebrow { color: var(--primary); }
.modal-head h2 { margin: 4px 0 0; font-size: 17px; letter-spacing: -.35px; }
.modal-body { overflow-y: auto; padding: 20px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 13px 20px; border-top: 1px solid var(--border); background: #fafbfc; }
.form-section + .form-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-section h3 { margin: 0 0 13px; color: var(--primary-dark); font-size: 11px; letter-spacing: .6px; text-transform: uppercase; }
.modal-open { overflow: hidden; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.project-picker { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 12px; border: 1px dashed #aebfc8; border-radius: 9px; background: #f8fbfc; color: var(--muted); text-align: left; }
.project-picker:hover { border-color: var(--primary); background: var(--primary-soft); }
.project-picker b { color: var(--primary); font-size: 10px; }
.browse-search { margin-bottom: 12px; }
.browse-list { max-height: 440px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.browse-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--border); background: #fff; color: var(--text); text-align: left; }
.browse-item:last-child { border-bottom: 0; }
.browse-item:hover { background: var(--primary-soft); }
.browse-item > span:last-child { text-align: right; }
.browse-item strong, .browse-item small, .browse-item b { display: block; }
.browse-item strong { font-size: 11px; }
.browse-item small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.browse-item b { color: var(--primary); font-size: 10.5px; }

/* Lovely confirmation */
.confirm-dialog { position: fixed; inset: 0; z-index: 180; display: none; align-items: center; justify-content: center; padding: 20px; }
.confirm-dialog.open { display: flex; }
.confirm-backdrop { position: absolute; inset: 0; background: rgba(7,25,34,.58); backdrop-filter: blur(4px); }
.confirm-card { position: relative; z-index: 1; width: min(100%, 410px); padding: 27px; border-radius: 17px; background: #fff; box-shadow: 0 30px 90px rgba(4,21,29,.3); text-align: center; animation: modal-in .2s ease; }
.confirm-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 15px; background: var(--danger-soft); color: var(--danger); }
.confirm-symbol svg { width: 22px; height: 22px; }
.confirm-card h2 { margin: 0 0 6px; font-size: 17px; }
.confirm-card > p { margin: 0 auto 18px; max-width: 330px; color: var(--muted); font-size: 11px; }
.confirm-reason { margin: 0 0 17px; text-align: left; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

/* Reports and settings */
.report-tabs { display: flex; gap: 5px; margin-bottom: 14px; padding: 4px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: #edf2f4; }
.report-tabs a { padding: 8px 12px; border-radius: 7px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.report-tabs a.active { color: var(--primary); background: #fff; box-shadow: var(--shadow-xs); }
.report-sheet { padding: 22px; }
.report-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.report-head strong, .report-head span { display: block; }
.report-head strong { color: var(--primary); font-size: 15px; }
.report-head span, .report-head > div:last-child { color: var(--muted); font-size: 9.5px; }
.report-count { margin-top: 10px; color: var(--muted); font-size: 9.5px; text-align: right; }
.setting-card span, .setting-card strong, .setting-card small { display: block; }
.setting-card span { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.setting-card strong { margin-top: 8px; font-size: 15px; }
.setting-card small { margin-top: 3px; color: var(--muted); }
.notice-card { display: flex; gap: 13px; margin-top: 14px; padding: 16px; border: 1px solid #d4e7ed; border-radius: 11px; background: var(--primary-soft); }
.notice-card > div:first-child { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 32px; border-radius: 9px; background: #fff; color: var(--primary); }
.notice-card strong { font-size: 11px; }
.notice-card p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.error-state { max-width: 560px; margin: 8vh auto; padding: 50px; text-align: center; }
.error-state > span { color: var(--primary); font-size: 52px; font-weight: 800; }
.error-state h2 { margin: 4px 0; font-size: 20px; }
.error-state p { margin: 0 0 20px; color: var(--muted); }

/* Login */
.login-body { min-height: 100vh; overflow-x: hidden; background: #f6f8f9; }
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(500px, 1.08fr) minmax(430px, .92fr); }
.login-art { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; padding: 30px 44px; color: #fff; background: linear-gradient(145deg, #0c2735 0%, #123e51 52%, #176b87 100%); }
.login-art::before { content: ""; position: absolute; top: -160px; right: -120px; width: 430px; height: 430px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-art::after { content: ""; position: absolute; bottom: -250px; left: -190px; width: 520px; height: 520px; border-radius: 50%; background: rgba(255,255,255,.035); }
.brand-light { position: relative; z-index: 2; }
.login-art-top { position: relative; z-index: 2; }
.login-visual { position: relative; z-index: 2; width: min(100%, 620px); margin: auto; }
.login-visual > img { position: absolute; right: -35px; top: -20px; width: min(48%, 270px); max-height: 240px; object-fit: contain; opacity: .82; filter: drop-shadow(0 24px 38px rgba(0,0,0,.14)); }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: #82c8da; font-size: 9.5px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 18px; height: 1px; background: currentColor; }
.login-visual h1 { max-width: 500px; margin: 17px 0 16px; font-size: clamp(38px, 4vw, 60px); line-height: 1.02; letter-spacing: -2.6px; }
.login-visual h1 em { color: #f1ae68; font-style: normal; }
.login-visual > p { max-width: 465px; margin: 0; color: #bed0d8; font-size: 13px; line-height: 1.7; }
.login-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 28px; color: #a8c2cd; font-size: 10px; }
.login-trust span { display: flex; align-items: center; gap: 6px; }
.login-trust svg { width: 13px; height: 13px; color: #6fd2b0; }
.login-art-footer { position: relative; z-index: 2; color: #7396a5; font-size: 9px; letter-spacing: .8px; text-transform: uppercase; }
.login-form-wrap { min-width: 0; display: flex; align-items: center; justify-content: center; padding: 40px clamp(34px, 6vw, 90px); background: radial-gradient(circle at 100% 0, #fff, transparent 38%), #f7f9fa; }
.login-box { width: 100%; max-width: 385px; }
.login-mobile-brand { display: none; }
.login-copy { margin-bottom: 27px; }
.login-copy .eyebrow { color: var(--primary); }
.login-copy h2 { margin: 12px 0 6px; color: var(--text); font-size: 29px; line-height: 1.2; letter-spacing: -1px; }
.login-copy p { margin: 0; color: var(--muted); font-size: 11.5px; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.input-shell { position: relative; display: flex; align-items: center; }
.input-shell > span { position: absolute; left: 12px; z-index: 1; color: #8b9ba5; pointer-events: none; }
.input-shell > span svg { width: 15px; height: 15px; }
.input-shell input { min-height: 44px; padding-left: 38px; padding-right: 52px; }
.input-shell button { position: absolute; right: 6px; padding: 7px; border: 0; background: transparent; color: var(--primary); font-size: 9px; font-weight: 750; }
.btn-login { min-height: 44px; margin-top: 3px; font-size: 11px; }
.btn-login span { margin-left: auto; font-size: 17px; font-weight: 400; }
.dev-credential { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 21px; padding: 9px; border: 1px dashed #cfdae0; border-radius: 8px; color: var(--muted); background: rgba(255,255,255,.6); font-size: 9px; }
.dev-credential span { margin-right: 4px; text-transform: uppercase; letter-spacing: .45px; }
.dev-credential code { color: var(--primary-strong); font-size: 10px; font-weight: 750; }
.dev-credential i { font-style: normal; color: #aab5bb; }
.login-security { margin: 17px 0 0; color: #9aa6ae; font-size: 9px; text-align: center; }

.sidebar-backdrop { display: none; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .login-page { grid-template-columns: 1fr 1fr; }
  .login-art { padding: 28px 34px; }
  .login-visual > img { opacity: .5; }
}

@media (max-width: 900px) {
  :root { --sidebar-width: 242px; }
  .sidebar { transform: translateX(-100%); transition: transform .24s ease; box-shadow: var(--shadow-md); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close, .menu-toggle { display: inline-grid; }
  .sidebar-close { border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.05); color: #bcd0d8; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(5,20,28,.45); backdrop-filter: blur(2px); }
  .sidebar-backdrop.open { display: block; }
  .main { margin-left: 0; }
  .login-page { display: block; }
  .login-art { display: none; }
  .login-form-wrap { min-height: 100vh; flex-direction: column; gap: 38px; padding: 32px 24px; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 17px; }
}

@media (max-width: 680px) {
  :root { --topbar-height: 66px; }
  .topbar { padding: 0 15px; }
  .breadcrumb, .date-chip, .user-trigger-copy, .chevron { display: none; }
  .user-trigger { min-width: auto; padding: 3px; }
  .page-heading h1 { font-size: 16px; }
  .content { padding: 17px 14px 28px; }
  .dashboard-intro { align-items: flex-start; flex-direction: column; }
  .app-footer { padding: 14px; }
  .app-footer span:last-child { display: none; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-3 > [style*="grid-column"] { grid-column: auto !important; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .card { padding: 15px; border-radius: 11px; }
  .kpi { min-height: 104px; }
  .kpi-value { font-size: 22px; }
  .section-head { align-items: flex-start; }
  .page-toolbar { align-items: flex-start; flex-direction: column; }
  .page-toolbar > .btn, .page-toolbar .quick-actions { width: 100%; }
  .list-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; min-width: 0; }
  .flow-banner { justify-content: flex-start; overflow-x: auto; }
  .flow-step { white-space: nowrap; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-dialog, .modal-dialog.modal-lg, .modal-dialog.modal-xl { width: 100%; max-height: 94vh; border-radius: 17px 17px 0 0; }
  .modal-head { min-height: 66px; padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .browse-item { align-items: flex-start; }
  .confirm-card { padding: 23px 18px; }
  .actions { flex-wrap: wrap; }
  .actions .btn { flex: 1; }
  .user-dropdown { position: fixed; top: 60px; right: 12px; }
}

@media print {
  .sidebar, .topbar, .app-footer, .actions, .btn, .page-toolbar, .report-tabs, .modal, .confirm-dialog { display: none !important; }
  .main { margin: 0; }
  .content { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .report-sheet { border: 0; padding: 0; }
  .table-wrap { overflow: visible; }
  body { background: #fff; }
}
