@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito-Italic-Variable.ttf") format("truetype");
  font-style: italic;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --navy: #18324b;
  --navy-2: #264c69;
  --blue: #268fc7;
  --blue-deep: #1679b1;
  --blue-light: #e9f6fd;
  --sky: #dff1fb;
  --lavender: #eeeafa;
  --peach: #fff0e7;
  --mint: #e7f6ef;
  --ink: #203044;
  --muted: #718196;
  --line: #dfe8ef;
  --soft: #f7f9fc;
  --paper: rgba(255, 255, 255, .9);
  --white: #fff;
  --green: #247b61;
  --green-bg: #e8f7f0;
  --amber: #986a18;
  --amber-bg: #fff6df;
  --red: #b84e48;
  --red-bg: #fff0ed;
  --shadow: 0 18px 48px rgba(58, 83, 107, .09);
  --shadow-soft: 0 9px 28px rgba(58, 83, 107, .07);
  --radius: 20px;
  --font: "Nunito", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.55;
  background:
    radial-gradient(circle at 87% 7%, rgba(223, 241, 251, .82), transparent 25rem),
    radial-gradient(circle at 18% 92%, rgba(238, 234, 250, .54), transparent 27rem),
    #f7f8fb;
}
a { color: var(--blue-deep); text-decoration: none; }
a:hover { color: #0b679b; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 252px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  padding: 28px 18px 20px;
  background: rgba(252, 253, 255, .92);
  border-right: 1px solid rgba(207, 220, 231, .75);
  box-shadow: 12px 0 42px rgba(48, 76, 101, .055);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 92px;
  padding: 2px 11px 24px;
  color: var(--navy);
}
.brand:hover { color: var(--navy); }
.brand img { width: 146px; height: auto; }
.brand span {
  color: #327da7;
  background: var(--blue-light);
  border: 1px solid #d1ebf8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.main-nav { display: flex; flex-direction: column; gap: 6px; }
.main-nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 10px 13px;
  color: #62768a;
  border-radius: 14px;
  font-weight: 750;
  font-size: .94rem;
  transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.main-nav a:hover {
  color: var(--navy);
  background: #f1f6fa;
  transform: translateX(2px);
}
.main-nav a.active {
  color: #176f9f;
  background: linear-gradient(115deg, #e5f5fd 0%, #f0edfb 100%);
  box-shadow: inset 0 0 0 1px rgba(112, 180, 216, .16), 0 8px 22px rgba(62, 125, 164, .09);
}
.main-nav a.active::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 8px;
  background: linear-gradient(var(--blue), #8c7dcc);
}
.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  color: currentColor;
  background: rgba(230, 239, 246, .72);
  border-radius: 10px;
}
.main-nav a.active .nav-icon { background: rgba(255, 255, 255, .75); }
.nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-footer {
  margin-top: auto;
  padding: 18px 8px 0;
  display: flex;
  align-items: center;
  border-top: 1px solid var(--line);
}
.sidebar-footer > a:first-child { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--navy); flex: 1; }
.sidebar-footer strong, .sidebar-footer small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 125px; }
.sidebar-footer strong { font-size: .86rem; }
.sidebar-footer small { color: #8292a3; font-size: .72rem; }
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #8176c5);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(38, 143, 199, .2);
  font-weight: 900;
}
.logout-link { color: #8c9cac; font-size: 1.2rem; padding: 8px; }
.main-area { margin-left: 252px; width: calc(100% - 252px); min-height: 100vh; }
.content { width: min(1460px, 100%); margin: 0 auto; padding: 38px 44px 90px; }
.mobile-header { display: none; }

.page-head {
  isolation: isolate;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 24px;
  padding: 28px 30px;
  border: 1px solid rgba(199, 221, 235, .8);
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(233, 246, 253, .96), rgba(250, 247, 253, .94) 62%, rgba(255, 240, 231, .72));
  box-shadow: var(--shadow-soft);
}
.page-head::after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 12%;
  top: -75px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .46);
  box-shadow: 96px 83px 0 rgba(226, 239, 250, .35);
}
.page-head h1 {
  color: var(--navy);
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  margin: 4px 0 7px;
  font-weight: 850;
}
.page-head p, .panel-head p { margin: 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--blue-deep); font-size: .71rem; font-weight: 900; }
.back-link { display: inline-flex; align-items: center; margin-bottom: 12px; color: var(--muted); font-size: .87rem; font-weight: 700; }

.button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  padding: 10px 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.25;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}
.button.primary { color: #fff; background: linear-gradient(135deg, #2d98cf, #1781bd); box-shadow: 0 10px 24px rgba(34, 139, 194, .23); }
.button.primary:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 13px 28px rgba(34, 139, 194, .29); }
.button.secondary { color: var(--navy); background: rgba(255, 255, 255, .84); border: 1px solid #d9e5ed; box-shadow: 0 4px 12px rgba(39, 69, 95, .035); }
.button.secondary:hover { color: var(--navy); border-color: #b8d1e1; background: #fff; transform: translateY(-1px); }
.button.danger { color: var(--red); background: var(--red-bg); border: 1px solid #f5d0cc; }
.button.small { min-height: 34px; padding: 7px 12px; border-radius: 10px; font-size: .82rem; }
.button.full { width: 100%; }
.button-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.text-link { font-weight: 800; }

.panel {
  margin-bottom: 22px;
  padding: 26px;
  background: var(--paper);
  border: 1px solid rgba(213, 225, 234, .78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel.flush { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.panel-head h2, .smtp-status h2 { color: var(--navy); font-size: 1.09rem; margin: 0 0 3px; font-weight: 850; }
.panel-head p, .smtp-status p { font-size: .86rem; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 24px; }
.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  padding: 22px;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(214, 226, 235, .7);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.metric-card:hover, .metric-card:focus-visible { transform: translateY(-2px); border-color: #bcd9e8; box-shadow: 0 16px 35px rgba(41, 76, 103, .12); outline: 0; }
.metric-card::after { content: ""; position: absolute; right: -25px; bottom: -36px; width: 102px; height: 102px; border-radius: 50%; background: var(--metric-wash, var(--sky)); opacity: .75; }
.metric-card:nth-child(1) { --metric-wash: var(--sky); }
.metric-card:nth-child(2) { --metric-wash: var(--mint); }
.metric-card:nth-child(3) { --metric-wash: var(--peach); }
.metric-card:nth-child(4) { --metric-wash: #e4f4ee; }
.metric-card:nth-child(5) { --metric-wash: var(--lavender); }
.metrics .metric-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 13px; border-radius: 11px; color: var(--navy-2); background: var(--metric-wash, var(--sky)); font-size: 1rem; font-weight: 900; }
.metrics span { display: block; color: var(--muted); font-size: .78rem; font-weight: 800; }
.metrics strong { display: block; color: var(--navy); font-size: 1.62rem; line-height: 1.2; margin: 7px 0 4px; letter-spacing: -.025em; font-weight: 900; }
.metrics small { color: #8b99a8; font-size: .72rem; }
.metrics .metric-placeholder { color: #9bacb8; font-size: 1rem; letter-spacing: .01em; }
.metric-card [hidden] { display: none; }
.metric-card.revealed { border-color: #c9e3ee; }

.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th { padding: 13px 17px; color: #6c7f91; background: linear-gradient(180deg, #f8fafc, #f3f7fa); border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; text-transform: uppercase; letter-spacing: .065em; font-size: .67rem; font-weight: 900; }
td { padding: 15px 17px; border-bottom: 1px solid #edf2f5; font-size: .88rem; vertical-align: middle; }
tbody tr { transition: background .15s ease; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(236, 247, 252, .55); }
.right { text-align: right; }
.strong { font-weight: 800; }
.check { width: 42px; text-align: center; }
.doc-number { color: var(--navy); white-space: nowrap; font-weight: 900; }
.block { display: block; }
.muted { color: var(--muted); }
.preserve-lines { white-space: pre-line; margin-top: 4px; }
.large-text { color: var(--navy); font-size: 1.12rem; }
.actions { text-align: right; white-space: nowrap; }
.actions a { margin-left: 12px; font-size: .8rem; font-weight: 800; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; white-space: nowrap; font-size: .7rem; font-weight: 900; }
.badge.success { color: var(--green); background: var(--green-bg); }
.badge.warning { color: var(--amber); background: var(--amber-bg); }
.badge.info { color: #176f9f; background: var(--blue-light); }
.badge.neutral { color: #6e7890; background: #f0eff6; }
.badge.danger { color: var(--red); background: var(--red-bg); }

.selection-bar { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 17px; border-bottom: 1px solid var(--line); background: rgba(252, 253, 255, .9); }
.selection-bar label { display: flex; align-items: center; gap: 8px; flex-direction: row; font-size: .82rem; font-weight: 800; }
.selection-bar > div { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: .8rem; }
.filter-bar { display: flex; gap: 10px; margin: 0 0 18px; padding: 12px; align-items: center; background: rgba(255, 255, 255, .64); border: 1px solid rgba(216, 228, 237, .72); border-radius: 17px; box-shadow: 0 7px 22px rgba(48, 76, 101, .045); }
.filter-bar select { width: auto; min-width: 160px; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 17px; color: var(--muted); border-top: 1px solid var(--line); font-size: .8rem; }
.pagination > :last-child { justify-self: end; }
.search-field { position: relative; flex: 1; max-width: 500px; }
.search-field span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #8798a8; font-size: 1rem; }
.search-field input { padding-left: 37px; }

.form-grid { display: grid; gap: 17px; }
.columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
label { display: flex; flex-direction: column; gap: 7px; color: #506276; font-size: .78rem; font-weight: 800; }
input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .95);
  border: 1px solid #cedce6;
  border-radius: 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover, select:hover, textarea:hover { border-color: #b9cedd; }
input:focus, select:focus, textarea:focus { border-color: #65afd5; background: #fff; box-shadow: 0 0 0 4px rgba(38, 143, 199, .11); }
input[readonly], select[data-locked="true"] { color: #607183; background: #f4f6f8; }
textarea { resize: vertical; line-height: 1.48; }
label small, .field-hint { color: #8795a4; font-weight: 500; }
.readout { padding: 9px 0; }
.readout span, .readout strong { display: block; }
.readout span { color: #6f8193; font-size: .78rem; }
.readout strong { color: var(--navy); margin-top: 5px; }
.checkbox-card { flex-direction: row; align-items: flex-start; padding: 14px; background: linear-gradient(135deg, #f7fafc, #f8f6fc); border: 1px solid var(--line); border-radius: 14px; }
.checkbox-card input { width: auto; margin-top: 4px; }
.checkbox-card span, .checkbox-card strong, .checkbox-card small { display: block; }
.stack > * + * { margin-top: 15px; }
.stack-lg > * + * { margin-top: 22px; }
.narrow-form { max-width: 570px; }
.code-input { font-family: "Cascadia Code", Consolas, monospace; font-size: .82rem; }
.token-list { margin-top: 12px; color: var(--muted); font-size: .78rem; }
.token-list code { display: inline-block; margin: 2px; padding: 3px 7px; color: #285d7c; background: #ebf4f9; border-radius: 6px; }

.invoice-editor { padding-bottom: 24px; }
.item-editor-head, .item-row { display: grid; grid-template-columns: minmax(460px, 1fr) 78px 90px 110px 100px 28px; gap: 8px; align-items: center; }
.item-editor-head { padding: 0 0 10px; color: #718497; text-transform: uppercase; font-size: .64rem; font-weight: 900; letter-spacing: .06em; }
.item-row { margin: 0 -7px; padding: 9px 7px; border-top: 1px solid #edf1f4; border-radius: 12px; transition: background .15s; }
.item-row:hover { background: rgba(242, 248, 252, .72); }
.item-main { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(210px, 1.2fr); gap: 8px; }
.item-row input, .item-row textarea { min-height: 38px; padding: 8px 10px; font-size: .82rem; }
.item-row textarea { height: 38px; resize: vertical; }
.item-total { display: block; padding: 10px 3px; color: var(--navy); text-align: right; font-weight: 900; }
.remove-row { border: 0; background: transparent; color: #a1adba; font-size: 1.35rem; line-height: 1; padding: 8px 5px; }
.remove-row:hover { color: var(--red); }
.autocomplete-wrap { position: relative; }
.suggestions { display: none; position: absolute; z-index: 20; top: calc(100% + 5px); left: 0; right: 0; max-height: 280px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 42px rgba(31, 63, 89, .17); }
.suggestions.open { display: block; }
.suggestion { display: block; width: 100%; padding: 11px 13px; border: 0; border-bottom: 1px solid #edf1f4; background: #fff; text-align: left; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover { background: #f2f9fc; }
.suggestion strong, .suggestion small { display: block; }
.suggestion small { color: var(--muted); margin-top: 2px; }
.suggestion .suggestion-meta { color: #8494a3; font-size: .68rem; margin-top: 5px; }
.editor-summary { width: min(460px, 100%); margin: 22px 0 0 auto; padding: 14px 18px; background: linear-gradient(135deg, #f7fbfd, #faf8fd); border-radius: 16px; }
.editor-summary > div, .totals-view > div { display: flex; justify-content: space-between; padding: 7px 0; color: #657587; }
.editor-summary .grand, .totals-view .grand { margin-top: 5px; padding-top: 13px; color: var(--navy); border-top: 2px solid #77b8d9; font-size: 1.1rem; }
.sticky-actions { position: sticky; z-index: 15; bottom: 16px; display: flex; justify-content: flex-end; gap: 9px; padding: 11px; background: rgba(255, 255, 255, .9); border: 1px solid rgba(207, 221, 231, .86); border-radius: 16px; box-shadow: 0 13px 34px rgba(40, 70, 95, .13); backdrop-filter: blur(12px); }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.definition-list { margin: 0; }
.definition-list > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid #edf1f4; }
.definition-list > div:last-child { border-bottom: 0; }
.definition-list dt { color: var(--muted); }
.definition-list dd { margin: 0; text-align: right; font-weight: 800; }
.definition-list.compact { margin-top: 12px; }
.totals-view { width: min(430px, 100%); margin: 20px 24px 24px auto; padding: 13px 17px; background: #f8fafc; border-radius: 15px; }
.page-actions { display: flex; gap: 9px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.page-actions form { margin: 0; }

.empty-state { position: relative; text-align: center; padding: 52px 25px 58px; color: var(--muted); }
.empty-state::before { content: ""; display: block; width: 62px; height: 62px; margin: 0 auto 17px; border-radius: 22px; background: linear-gradient(135deg, var(--sky), var(--lavender)); box-shadow: inset 0 0 0 1px rgba(129, 155, 183, .08), 0 9px 22px rgba(63, 100, 128, .08); }
.empty-state::after { content: ""; position: absolute; top: 72px; left: 50%; width: 21px; height: 26px; transform: translate(-50%, -50%); border: 2px solid #6f9fbc; border-radius: 4px; box-shadow: 6px 5px 0 -4px #6f9fbc; }
.empty-state strong { display: block; color: var(--navy); font-size: 1.1rem; font-weight: 900; }
.empty-state p { margin: 7px 0 18px; }

.alert { margin-bottom: 17px; padding: 13px 16px; border: 1px solid transparent; border-radius: 14px; }
.alert.success { color: #1a684f; background: var(--green-bg); border-color: #c5e8da; }
.alert.warning { color: #795510; background: var(--amber-bg); border-color: #f1dda8; }
.alert.danger { color: var(--red); background: var(--red-bg); border-color: #f3ccc7; }
.notice-banner { margin-bottom: 18px; padding: 11px 15px; color: #315d77; background: rgba(232, 246, 253, .88); border: 1px solid #c9e6f4; border-radius: 14px; font-size: .84rem; }
.notice-banner a { font-weight: 900; }
.callout-soft { margin: 16px 0 0; padding: 12px 14px; color: #456779; background: #f2f9fc; border: 1px solid #d8ebf4; border-radius: 14px; }
.credential-panel { padding: 17px; background: linear-gradient(135deg, #f5fbfd, #faf8fd); border: 1px solid #dcebf2; border-radius: 17px; }
.credential-panel h3 { margin: 0; color: var(--navy); font-size: 1rem; }
.credential-panel > div:first-child p { margin: 4px 0 14px; color: var(--muted); font-size: .8rem; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-switch label { display: block; cursor: pointer; }
.mode-switch input { position: absolute; width: 0; opacity: 0; }
.mode-switch span { display: block; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.mode-switch strong, .mode-switch small { display: block; }
.mode-switch small { margin-top: 3px; color: var(--muted); }
.mode-switch input:checked + span { background: linear-gradient(135deg, #f6fbfe, #f8f5fc); border-color: #77b8d9; box-shadow: 0 0 0 4px rgba(38, 143, 199, .09); }
.hidden { display: none !important; }
.admin-split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 20px; align-items: start; }
.user-form { position: sticky; top: 20px; }
.client-access-panel { padding-bottom: 12px; }
.client-access-search { width: min(360px, 100%); flex: 0 1 360px; }
.client-access-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.client-access-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 70px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(248, 251, 253, .78); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.client-access-row:hover { border-color: #b9dbe9; background: #fff; transform: translateY(-1px); }
.client-access-row:has(input:checked) { border-color: #91cbe2; background: linear-gradient(135deg, #f0faff, #f8f7ff); box-shadow: inset 3px 0 0 var(--blue); }
.client-access-row input { width: auto; }
.client-access-name, .client-access-meta { min-width: 0; }
.client-access-name strong, .client-access-name small, .client-access-meta strong, .client-access-meta small { display: block; }
.client-access-name strong { color: var(--navy); }
.client-access-name small, .client-access-meta small { color: var(--muted); margin-top: 2px; }
.client-access-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-access-meta { text-align: right; font-size: .82rem; }
.client-access-empty { padding: 34px; text-align: center; color: var(--muted); }
.smtp-status { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.smtp-status h2, .smtp-status p { margin: 0; }

.migration-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(290px, .65fr); gap: 20px; align-items: start; }
.migration-step { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 13px 0; border-bottom: 1px solid #edf1f4; }
.migration-step:last-child { border-bottom: 0; }
.migration-step > span { display: grid; place-items: center; width: 34px; height: 34px; color: #217ead; background: var(--blue-light); border-radius: 11px; font-weight: 900; }
.migration-step strong, .migration-step small { display: block; }
.migration-step small { margin-top: 2px; color: var(--muted); }
.file-field { padding: 13px; background: #f8fbfd; border: 1px dashed #bcd4e2; border-radius: 15px; }
.file-field input[type="file"] { padding: 9px; background: #fff; }
.import-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 0; }
.import-summary div { padding: 13px; background: #f7fafc; border-radius: 13px; text-align: center; }
.import-summary strong, .import-summary span { display: block; }
.import-summary strong { color: var(--navy); font-size: 1.3rem; }
.import-summary span { color: var(--muted); font-size: .72rem; }

.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 17% 16%, #e1f3fb 0, transparent 30%), radial-gradient(circle at 86% 88%, #eeeafa 0, transparent 34%), linear-gradient(135deg, #f8fafc, #f6f3f8); }
.auth-card { width: min(440px, 100%); padding: 40px; background: rgba(255, 255, 255, .93); border: 1px solid rgba(203, 218, 229, .8); border-radius: 27px; box-shadow: 0 28px 80px rgba(52, 78, 103, .14); backdrop-filter: blur(18px); }
.auth-card.install-card { width: min(610px, 100%); }
.auth-logo { width: 172px; height: auto; margin-bottom: 25px; }
.auth-card h1 { margin: 4px 0 7px; color: var(--navy); font-size: 2.05rem; letter-spacing: -.035em; font-weight: 900; }
.auth-card > .muted { margin: 0 0 23px; }
.subtle-link { display: block; margin-top: 18px; color: #7c8d9c; text-align: center; font-size: .78rem; }
.requirements { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 21px 0; font-size: .8rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; }
.status-dot.ok { background: #28a77d; }
.status-dot.bad { background: #d75853; }
code { padding: 2px 6px; background: #edf3f7; border-radius: 5px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); }
.sidebar-backdrop { display: none; }

@media (max-width: 1100px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .item-editor-head { display: none; }
  .item-row { grid-template-columns: 1fr 1fr 1fr 1fr 34px; }
  .item-main { grid-column: 1 / -1; }
  .item-row .item-unit { grid-column: 1; }
  .item-total { align-self: center; }
  .admin-split, .migration-grid { grid-template-columns: 1fr; }
  .client-access-list { grid-template-columns: 1fr; }
  .user-form { position: static; }
}

@media (max-width: 800px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-backdrop { display: block; }
  .main-area { margin-left: 0; width: 100%; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; height: 68px; padding: 0 18px; background: rgba(255, 255, 255, .88); border-bottom: 1px solid var(--line); backdrop-filter: blur(13px); }
  .mobile-header img { width: 118px; }
  .icon-button { border: 0; background: transparent; color: var(--navy); font-size: 1.35rem; }
  .content { padding: 24px 17px 80px; }
  .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(21, 42, 60, .38); backdrop-filter: blur(2px); }
  .page-head { align-items: flex-start; padding: 24px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .columns-3 { grid-template-columns: 1fr 1fr; }
  .filter-bar { flex-wrap: wrap; }
  .search-field { max-width: none; min-width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .mode-switch { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .page-head { display: block; padding: 22px 20px; border-radius: 20px; }
  .page-head > .button, .page-head > .button-row { margin-top: 17px; }
  .page-head h1 { font-size: 2rem; }
  .metrics { grid-template-columns: 1fr; }
  .metric-card { min-height: 132px; }
  .columns-2, .columns-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .panel { padding: 20px; border-radius: 18px; }
  .panel.flush { padding: 0; }
  .item-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; }
  .item-row .item-unit { grid-column: auto; }
  .item-main { grid-template-columns: 1fr; }
  .item-total { grid-column: 1 / 4; }
  .requirements { grid-template-columns: 1fr; }
  .auth-card { padding: 31px 24px; }
  .sticky-actions { bottom: 8px; }
  .selection-bar { align-items: flex-start; }
  .selection-bar > div { align-items: flex-end; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .import-summary { grid-template-columns: 1fr; }
}
