:root {
  --page: #eef4f8;
  --panel: #ffffff;
  --panel-2: #f8fbff;
  --ink: #111827;
  --muted: #667085;
  --soft: #edf4f9;
  --line: #d8e4ee;
  --line-strong: #c5d5e3;
  --nav: #0b1726;
  --nav-2: #10263d;
  --blue: #1f6fff;
  --cyan: #0aa6b5;
  --green: #15915f;
  --amber: #d78a09;
  --rose: #db3d57;
  --violet: #6d5bd7;
  --shadow: 0 18px 42px rgba(17, 24, 39, 0.11);
  --shadow-soft: 0 8px 24px rgba(17, 24, 39, 0.08);
  --ring: 0 0 0 4px rgba(31, 111, 255, 0.13);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(31, 111, 255, 0.09), transparent 300px),
    linear-gradient(90deg, rgba(10, 166, 181, 0.04), transparent 44%),
    var(--page);
  color: var(--ink);
  text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(13, 71, 107, 0.96), rgba(8, 50, 77, 1)),
    var(--nav);
  color: #fff;
  overflow-y: auto;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 44px;
  height: 44px;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.brand-mark::before {
  content: "";
  width: 32px;
  height: 40px;
  border-radius: 64% 64% 64% 8px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #05c2ff, #1665f5);
  box-shadow: 0 10px 24px rgba(0, 166, 214, 0.35);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 18px;
  border-left: 3px solid rgba(255, 255, 255, 0.85);
  border-bottom: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 0 0 0 14px;
  transform: rotate(-18deg);
  margin-top: 7px;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  object-fit: contain;
  padding: 4px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.nav-section-title {
  margin: 18px 10px 8px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.79);
  background: transparent;
  text-align: left;
  font-weight: 700;
  font-size: 14px;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-card {
  margin: 18px 8px 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-card strong {
  display: block;
  font-size: 13px;
}

.sidebar-card span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  min-height: 70px;
  padding: 14px 24px;
  background: rgba(244, 248, 252, 0.86);
  border-bottom: 1px solid rgba(219, 231, 243, 0.82);
  backdrop-filter: blur(18px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu {
  display: none;
}

.page-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-title {
  margin: 3px 0 0;
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1.1;
  letter-spacing: 0;
}

.search-box {
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  min-width: 0;
}

.date-pill,
.user-pill {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.date-pill svg,
.user-pill svg {
  width: 17px;
  height: 17px;
  color: var(--blue);
}

.content {
  padding: 22px 24px 38px;
}

.system-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #f8d580;
  border-radius: var(--radius);
  color: #7a4c06;
  background: #fff7df;
  font-weight: 800;
  font-size: 13px;
}

.system-banner svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

.loading-screen h1 {
  margin: 0;
  font-size: 28px;
}

.loading-screen p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  background:
    linear-gradient(135deg, rgba(20, 99, 255, 0.08), rgba(0, 166, 214, 0.06)),
    var(--page);
}

.login-hero {
  display: grid;
  align-content: space-between;
  gap: 28px;
  padding: clamp(28px, 6vw, 76px);
  background:
    linear-gradient(180deg, rgba(8, 50, 77, 0.94), rgba(13, 71, 107, 0.96)),
    var(--nav);
  color: #fff;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-brand h1,
.login-copy h2,
.login-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-brand p,
.login-copy p,
.login-card p {
  margin: 6px 0 0;
}

.login-brand p,
.login-copy p {
  color: rgba(255, 255, 255, 0.72);
}

.login-logo {
  width: 58px;
  height: 58px;
}

.login-copy h2 {
  max-width: 650px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.02;
}

.login-copy p {
  max-width: 580px;
  font-size: 17px;
  line-height: 1.6;
}

.login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card h2 {
  font-size: 28px;
}

.login-card p,
.login-help {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.login-error {
  padding: 11px 12px;
  border: 1px solid #ffc1c9;
  border-radius: var(--radius);
  color: #9a2434;
  background: #fff0f2;
  font-weight: 800;
  font-size: 13px;
}

.logo-uploader {
  display: grid;
  grid-template-columns: auto minmax(220px, 420px) minmax(180px, 1fr);
  align-items: center;
  gap: 14px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fbff;
}

.logo-preview {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.logo-preview .brand-mark,
.profile-logo {
  width: 54px;
  height: 54px;
}

.logo-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.view {
  display: grid;
  gap: 16px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-title h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.toolbar-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.stat-card,
.panel,
.form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(19, 35, 61, 0.05);
}

.stat-card {
  min-height: 112px;
  display: flex;
  gap: 12px;
  padding: 16px;
  align-items: flex-start;
  overflow: hidden;
}

.stat-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #fff;
  flex: 0 0 auto;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(20px, 2.1vw, 28px);
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: 0;
}

.panel-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.panel-body {
  padding: 16px;
}

.chart-wrap {
  width: 100%;
  min-height: 260px;
}

.sparkline {
  width: 100%;
  height: 260px;
}

.chart-axis {
  stroke: #dce8f4;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--blue);
  stroke-width: 3;
}

.chart-area {
  fill: rgba(20, 99, 255, 0.12);
}

.chart-dot {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
}

.bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(110px, 2fr) auto;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}

.bar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.bar-track {
  height: 10px;
  background: var(--soft);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #f8fbff;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

.cell-title {
  display: grid;
  gap: 3px;
}

.cell-title strong {
  font-size: 13px;
}

.cell-title span {
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.green {
  color: #087044;
  background: #dff7ea;
}

.badge.amber {
  color: #94600a;
  background: #fff3d7;
}

.badge.rose {
  color: #a33142;
  background: #ffe4e8;
}

.badge.blue {
  color: #0c50c7;
  background: #e4efff;
}

.badge.gray {
  color: #52627a;
  background: #edf2f7;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.btn.success {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.btn.warn {
  border-color: var(--amber);
  background: var(--amber);
  color: #fff;
}

.btn.danger {
  border-color: var(--rose);
  background: var(--rose);
  color: #fff;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: nowrap;
}

.form-panel {
  padding: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(20, 99, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.12);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.summary-item span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
}

.summary-item strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.mini-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  flex: 0 0 auto;
}

.mini-icon svg {
  width: 18px;
  height: 18px;
}

.soft-blue {
  background: #e8f1ff;
  color: var(--blue);
}

.soft-green {
  background: #e4f8ee;
  color: var(--green);
}

.soft-amber {
  background: #fff4db;
  color: var(--amber);
}

.soft-rose {
  background: #ffe8ec;
  color: var(--rose);
}

.soft-violet {
  background: #eee9ff;
  color: var(--violet);
}

.split-detail {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 16px;
}

.profile-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.avatar {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 900;
  font-size: 24px;
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}

.detail-row span {
  color: var(--muted);
  font-weight: 700;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
}

.settings-tabs {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 16px;
}

.tab-list {
  display: grid;
  gap: 6px;
  align-content: start;
}

.tab-button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  text-align: left;
  padding: 9px 12px;
}

.tab-button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(11, 23, 38, 0.54);
}

.modal-card {
  width: min(920px, 100%);
  max-height: min(92vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-card.small {
  width: min(560px, 100%);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  border-bottom: 0;
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  overflow: auto;
  padding: 16px;
}

.invoice-paper {
  color: var(--ink);
  background: #fff;
}

.invoice-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--ink);
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.invoice-brand h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.invoice-brand p,
.invoice-meta p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.invoice-meta {
  text-align: right;
}

.invoice-meta strong {
  font-size: 22px;
  color: var(--blue);
}

.invoice-boxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.invoice-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.invoice-box h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.invoice-total {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.invoice-total table {
  width: 320px;
  min-width: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #10233b;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: 0.2s ease;
  font-weight: 700;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.overlay {
  display: none;
}

/* Premium production skin */
.app-shell {
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  padding: 20px 16px;
  background:
    linear-gradient(180deg, rgba(16, 38, 61, 0.98), rgba(7, 20, 34, 1)),
    var(--nav);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 42px rgba(15, 23, 42, 0.18);
  scrollbar-width: none;
  -ms-overflow-style: none;
  overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.brand {
  padding: 10px 10px 20px;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-mark::before {
  width: 31px;
  height: 39px;
  background: linear-gradient(135deg, #23d0ff, #1f6fff 68%, #49d18d);
  box-shadow: 0 14px 28px rgba(35, 208, 255, 0.25);
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.brand h1 {
  font-size: 17px;
  font-weight: 900;
}

.brand p {
  color: rgba(255, 255, 255, 0.62);
  font-weight: 700;
}

.nav-section-title {
  margin: 22px 10px 9px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
}

.nav-item {
  position: relative;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.73);
  font-size: 13px;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.nav-item::before {
  content: "";
  width: 3px;
  height: 20px;
  position: absolute;
  left: 0;
  border-radius: 0 999px 999px 0;
  background: transparent;
}

.nav-item:hover {
  transform: translateX(2px);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.08);
}

.nav-item.active {
  color: #fff;
  border-color: rgba(35, 208, 255, 0.18);
  background: linear-gradient(90deg, rgba(31, 111, 255, 0.24), rgba(10, 166, 181, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-item.active::before {
  background: #23d0ff;
}

.sidebar-card {
  margin-top: 22px;
  padding: 14px;
  border-color: rgba(35, 208, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(31, 111, 255, 0.18), rgba(21, 145, 95, 0.12)),
    rgba(255, 255, 255, 0.06);
}

.sidebar-card strong {
  font-size: 18px;
}

.topbar {
  min-height: 76px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.83);
  border-bottom: 1px solid rgba(216, 228, 238, 0.88);
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.page-kicker {
  color: #7b8794;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.page-title {
  margin-top: 5px;
  color: #101828;
  font-weight: 900;
}

.search-box,
.date-pill,
.user-pill {
  min-height: 44px;
  border-color: rgba(197, 213, 227, 0.86);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.045);
}

.content {
  max-width: 1680px;
  margin: 0 auto;
  padding: 26px 28px 44px;
}

.view {
  gap: 18px;
}

.toolbar {
  align-items: center;
  padding: 4px 2px;
}

.toolbar-title h2 {
  color: #101828;
  font-size: 22px;
  font-weight: 900;
}

.toolbar-title p {
  margin-top: 6px;
  color: #667085;
  font-weight: 600;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "copy actions"
    "metrics metrics";
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(16, 38, 61, 0.98), rgba(7, 20, 34, 1) 58%, rgba(13, 63, 79, 0.98)),
    var(--nav);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.16);
  overflow: hidden;
}

.hero-copy {
  grid-area: copy;
  min-width: 0;
}

.hero-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 10px;
  border: 1px solid rgba(35, 208, 255, 0.25);
  border-radius: 999px;
  color: #bdefff;
  background: rgba(35, 208, 255, 0.08);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-copy h2 {
  margin: 12px 0 0;
  font-size: clamp(26px, 3.1vw, 42px);
  line-height: 1.04;
  font-weight: 900;
}

.hero-copy p {
  max-width: 720px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 600;
  line-height: 1.55;
}

.hero-actions {
  grid-area: actions;
  display: flex;
  align-items: start;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-actions .btn:not(.primary) {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.hero-metrics {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.hero-metrics .summary-item {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.hero-metrics .summary-item span,
.hero-metrics .summary-item strong {
  color: #fff;
}

.stat-card,
.panel,
.form-panel,
.profile-card,
.summary-item,
.login-card,
.modal-card {
  border-color: rgba(197, 213, 227, 0.86);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.stat-card,
.panel,
.form-panel {
  position: relative;
}

.stat-card {
  min-height: 122px;
  padding: 18px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-card h3 {
  font-size: 11px;
  color: #7b8794;
}

.stat-card strong {
  margin-top: 10px;
  color: #101828;
  font-weight: 900;
}

.stat-icon,
.mini-icon {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 10px 20px rgba(17, 24, 39, 0.11);
}

.panel {
  overflow: hidden;
}

.panel-header {
  min-height: 64px;
  padding: 17px 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.panel-header h3 {
  color: #101828;
  font-size: 17px;
  font-weight: 900;
}

.panel-header span {
  color: #7b8794;
  font-weight: 800;
}

.panel-body,
.form-panel {
  padding: 18px;
}

.chart-axis {
  stroke: #e4edf5;
}

.chart-line {
  stroke: #1f6fff;
  stroke-width: 3.5;
}

.chart-area {
  fill: rgba(31, 111, 255, 0.1);
}

.chart-dot {
  stroke: #1f6fff;
}

.bar-track {
  height: 11px;
  background: #e8f0f7;
}

.bar-fill {
  background: linear-gradient(90deg, #0aa6b5, #1f6fff);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th {
  background: #f3f7fb;
  color: #667085;
  font-size: 10px;
}

td {
  background: #fff;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover td {
  background: #f9fcff;
}

.cell-title strong {
  color: #101828;
  font-weight: 900;
}

.badge {
  min-height: 25px;
  padding: 5px 10px;
  font-size: 11px;
}

.btn,
.icon-btn,
.tab-button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.btn {
  min-height: 42px;
  padding: 10px 14px;
  border-color: rgba(197, 213, 227, 0.92);
  background: #fff;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.045);
}

.btn:hover,
.icon-btn:hover,
.tab-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 24, 39, 0.08);
}

.btn.primary {
  border-color: #1f6fff;
  background: linear-gradient(135deg, #1f6fff, #0aa6b5);
}

.btn.success {
  border-color: #15915f;
  background: linear-gradient(135deg, #15915f, #17a77b);
}

.btn.warn {
  border-color: #d78a09;
  background: linear-gradient(135deg, #d78a09, #f2a91f);
}

.btn.danger {
  border-color: #db3d57;
  background: linear-gradient(135deg, #db3d57, #ee6278);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-color: rgba(197, 213, 227, 0.92);
  color: #1f6fff;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.045);
}

.field label {
  color: #5d6978;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  border-color: rgba(197, 213, 227, 0.92);
  background: #fbfdff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(31, 111, 255, 0.74);
  box-shadow: var(--ring);
  background: #fff;
}

.summary-strip {
  gap: 12px;
}

.summary-item {
  min-height: 82px;
  padding: 14px;
}

.summary-item span {
  color: #667085;
  font-size: 11px;
  text-transform: uppercase;
}

.summary-item strong {
  color: #101828;
  font-size: 19px;
  font-weight: 900;
}

.profile-card {
  padding: 18px;
}

.avatar {
  background: linear-gradient(135deg, #1f6fff, #0aa6b5 62%, #15915f);
  box-shadow: 0 14px 28px rgba(31, 111, 255, 0.22);
}

.detail-row {
  border-bottom-color: rgba(197, 213, 227, 0.78);
}

.detail-row strong {
  color: #101828;
}

.settings-tabs {
  grid-template-columns: 210px minmax(0, 1fr);
}

.tab-button {
  min-height: 44px;
  border-color: rgba(197, 213, 227, 0.92);
}

.tab-button.active {
  border-color: #1f6fff;
  background: linear-gradient(135deg, #1f6fff, #0aa6b5);
}

.modal-backdrop {
  background: rgba(10, 19, 32, 0.64);
  backdrop-filter: blur(8px);
}

.modal-card {
  border: 1px solid rgba(255, 255, 255, 0.34);
}

.modal-head,
.modal-foot {
  background: #fbfdff;
}

.invoice-top {
  border-bottom-color: #111827;
}

.toast {
  background: #111827;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.22);
}

.login-page {
  background:
    linear-gradient(135deg, rgba(31, 111, 255, 0.07), transparent 46%),
    linear-gradient(315deg, rgba(21, 145, 95, 0.06), transparent 42%),
    #eef4f8;
}

.login-hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(16, 38, 61, 0.98), rgba(7, 20, 34, 1) 58%, rgba(13, 63, 79, 0.98)),
    var(--nav);
}

.login-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.35;
  pointer-events: none;
}

.login-hero > * {
  position: relative;
  z-index: 1;
}

.login-copy h2 {
  font-weight: 900;
}

.login-copy p {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.login-metrics .summary-item {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.login-metrics .summary-item span,
.login-metrics .summary-item strong {
  color: #fff;
}

.login-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent),
    transparent;
}

.login-card {
  padding: 28px;
  border-color: rgba(197, 213, 227, 0.95);
  box-shadow: 0 24px 64px rgba(17, 24, 39, 0.14);
}

.login-card h2 {
  font-weight: 900;
}

.logo-uploader {
  background: linear-gradient(180deg, #fbfdff, #f4f8fc);
}

.invoice-table-wrap {
  width: 100%;
  overflow: visible;
}

.invoice-paper table {
  min-width: 0;
  table-layout: fixed;
}

.invoice-lines {
  width: 100%;
}

.invoice-lines th,
.invoice-lines td {
  padding: 8px 10px;
  white-space: normal;
  word-break: normal;
}

.invoice-lines th:nth-child(1),
.invoice-lines td:nth-child(1) {
  width: 8%;
}

.invoice-lines th:nth-child(2),
.invoice-lines td:nth-child(2) {
  width: 20%;
}

.invoice-lines th:nth-child(3),
.invoice-lines td:nth-child(3) {
  width: 13%;
}

.invoice-lines th:nth-child(4),
.invoice-lines td:nth-child(4),
.invoice-lines th:nth-child(5),
.invoice-lines td:nth-child(5) {
  width: 14%;
}

.invoice-lines th:nth-child(6),
.invoice-lines td:nth-child(6) {
  width: 31%;
}

.invoice-total table,
.invoice-total td,
.invoice-total th,
.invoice-total tr {
  border: 0 !important;
  background: transparent !important;
}

.invoice-total td {
  padding: 7px 0;
}

input[type="date"],
input[type="month"] {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 1240px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .login-page {
    grid-template-columns: 1fr;
  }

  .login-hero {
    min-height: auto;
    padding: 28px 20px;
  }

  .login-metrics {
    grid-template-columns: 1fr;
  }

  .logo-uploader {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "actions"
      "metrics";
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 286px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 15;
    background: rgba(11, 23, 38, 0.36);
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 12px 14px;
  }

  .topbar-right .search-box,
  .topbar-right .date-pill {
    display: none;
  }

  .content {
    padding: 16px 14px 30px;
  }

  .grid-2,
  .split-detail,
  .settings-tabs {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .summary-strip,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .stats-grid,
  .summary-strip,
  .grid-3,
  .form-grid,
  .form-grid.three,
  .form-grid.four,
  .invoice-boxes {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: stretch;
  }

  .form-panel {
    padding: 14px;
    overflow: hidden;
  }

  .field {
    min-width: 0;
  }

  .field input,
  .field select,
  .field textarea {
    min-width: 0;
    font-size: 16px;
  }

  .field input[type="date"],
  .field input[type="month"] {
    min-height: 46px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    gap: 8px;
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
  }

  .topbar-right {
    gap: 6px;
    justify-content: space-between;
  }

  .user-pill {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-right .btn {
    min-height: 38px;
    padding: 8px 10px;
  }

  .toolbar-actions,
  .toolbar-actions .btn,
  .form-actions .btn {
    width: 100%;
  }

  .btn {
    min-width: 0;
    white-space: normal;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .invoice-top {
    flex-direction: column;
  }

  .invoice-meta {
    text-align: left;
  }

  .modal-backdrop {
    padding: 10px;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm;
  }

  html,
  body {
    background: #fff;
    width: 210mm;
    min-width: 0;
  }

  .app-shell,
  .toast,
  .modal-head .icon-btn,
  .modal-foot {
    display: none !important;
  }

  #modal-root,
  .modal-backdrop,
  .modal-card,
  .modal-body {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-height: none !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
  }

  .modal-card {
    border-radius: 0 !important;
  }

  .invoice-paper {
    width: 100% !important;
    color: #111827 !important;
    font-size: 8.2px !important;
    line-height: 1.12 !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .invoice-top {
    gap: 10px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #111827 !important;
  }

  .invoice-brand {
    gap: 8px !important;
  }

  .invoice-brand .brand-mark,
  .invoice-brand .brand-logo {
    width: 32px !important;
    height: 32px !important;
  }

  .invoice-brand h2 {
    font-size: 14px !important;
  }

  .invoice-brand p,
  .invoice-meta p,
  .invoice-box p {
    margin: 1px 0 0 !important;
    font-size: 7.8px !important;
  }

  .invoice-meta strong {
    font-size: 14px !important;
  }

  .invoice-boxes {
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    margin: 6px 0 !important;
  }

  .invoice-box {
    padding: 5px 6px !important;
    border: 1px solid #d7e2ec !important;
  }

  .invoice-box h4 {
    margin-bottom: 3px !important;
    font-size: 7.5px !important;
  }

  .invoice-table-wrap {
    overflow: visible !important;
  }

  .invoice-paper table,
  .invoice-lines {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }

  .invoice-lines th,
  .invoice-lines td {
    padding: 2.4px 4px !important;
    border-bottom: 1px solid #d7e2ec !important;
    font-size: 7.5px !important;
    line-height: 1.06 !important;
    background: #fff !important;
  }

  .invoice-lines th {
    color: #111827 !important;
    background: #f4f7fa !important;
  }

  .invoice-total {
    margin-top: 5px !important;
  }

  .invoice-total table {
    width: 46mm !important;
    margin-left: auto !important;
  }

  .invoice-total td {
    padding: 2.5px 0 !important;
    border: 0 !important;
    font-size: 8px !important;
  }
}
