:root {
  --logo-bg: #130b54;
  --bg-deep: #090522;
  --bg-panel: rgba(18, 12, 62, 0.78);
  --bg-panel-strong: rgba(23, 15, 78, 0.94);
  --surface: rgba(255, 255, 255, 0.075);
  --surface-strong: rgba(255, 255, 255, 0.12);
  --line: rgba(166, 143, 255, 0.22);
  --line-strong: rgba(255, 221, 124, 0.34);
  --text: #f8f7ff;
  --text-soft: #d7d1f7;
  --muted: #a9a1cf;
  --violet: #8f68ff;
  --violet-deep: #5d35d4;
  --gold: #ffdc74;
  --gold-hot: #ffe89b;
  --cyan: #68d9ff;
  --danger: #ff4d6d;
  --ok: #39e58f;
  --warning: #ffbd55;
  --shadow: 0 20px 54px rgba(2, 0, 20, 0.34);
  --glow: 0 0 0 1px rgba(255, 255, 255, 0.025);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--logo-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 84% 8%, rgba(143, 104, 255, 0.18), transparent 30%),
    linear-gradient(135deg, var(--logo-bg) 0%, #100848 48%, var(--bg-deep) 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.38), transparent 72%);
}

body::after {
  content: none;
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px 1fr;
  min-height: 100vh;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 78% 18%, rgba(143, 104, 255, 0.2), transparent 30%),
    radial-gradient(circle at 18% 78%, rgba(255, 220, 116, 0.08), transparent 26%),
    linear-gradient(135deg, var(--logo-bg), var(--bg-deep));
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at center, #000 0 44%, transparent 78%);
}

.login-screen.hidden {
  display: none;
}

.login-layout {
  position: relative;
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(360px, 0.72fr);
  gap: 20px;
  align-items: center;
}

.login-intro,
.login-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(13, 8, 48, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-intro {
  min-height: 500px;
  display: grid;
  place-items: center;
  padding: 42px;
  overflow: hidden;
}

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

.login-intro-content {
  width: min(100%, 520px);
  transform: translateY(-62px);
  display: grid;
  justify-items: center;
  text-align: center;
}

.login-intro .eyebrow,
.login-intro h1,
.login-stats {
  width: 100%;
}

.login-intro .eyebrow {
  text-align: center;
}

.login-intro::after {
  content: "";
  width: 220px;
  height: 220px;
  position: absolute;
  right: 10%;
  bottom: 18%;
  border: 1px solid rgba(255, 220, 116, 0.14);
  border-radius: 8px;
  transform: rotate(10deg);
}

.login-intro img {
  width: 330px;
  max-width: 100%;
  display: block;
  margin: 0 auto -46px;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.25));
}

.login-intro h1 {
  max-width: 520px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.04;
  margin-top: 8px;
  text-align: center;
}

.login-description {
  width: min(100%, 470px);
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.6;
  margin: 16px auto 0;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.login-stats article {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.login-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-stats strong {
  display: block;
  color: var(--gold-hot);
  margin-top: 8px;
  font-size: 20px;
}

.login-card {
  align-self: center;
  padding: 32px;
}

.login-card h1 {
  font-size: 34px;
  margin-bottom: 22px;
}

.login-card h2 {
  font-size: 32px;
  margin-bottom: 22px;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form .primary {
  margin-top: 4px;
}

.login-error {
  min-height: 18px;
  color: #ffb2c0;
  font-size: 13px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%),
    rgba(12, 7, 48, 0.88);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 18px 0 48px rgba(5, 1, 28, 0.32);
}

.sidebar::after {
  content: none;
}

.brand {
  min-height: 104px;
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.brand img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.2));
}

.nav,
.sidebar-actions {
  display: grid;
  gap: 8px;
}

.sidebar-profile {
  margin-top: auto;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-profile > div {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.profile-icon {
  width: 34px;
  height: 34px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 220, 116, 0.28));
}

.sidebar-profile section {
  min-width: 0;
}

.sidebar-profile span,
.sidebar-profile small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile span {
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
}

.sidebar-profile small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-profile button {
  grid-column: 1 / -1;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  font-size: 13px;
  font-weight: 760;
}

.sidebar-profile button:hover {
  color: var(--text);
  border-color: rgba(255, 220, 116, 0.28);
}

.nav-item,
.ghost,
.primary,
.danger,
.text-button,
.file-button {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 16px;
  letter-spacing: 0;
  position: relative;
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.ghost::before,
.primary::before,
.danger::before,
.file-button::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), transparent 52%);
  opacity: 0.72;
}

.nav-item {
  color: rgba(248, 247, 255, 0.72);
  background: transparent;
  text-align: left;
  border: 1px solid transparent;
  font-weight: 720;
}

.nav-item.active,
.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.085);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 3px 0 0 var(--gold);
}

.primary {
  color: #fff;
  border-color: rgba(255, 220, 116, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 220, 116, 0.14), transparent 38%),
    linear-gradient(135deg, #7f57f4, #5630c7);
  box-shadow: 0 14px 28px rgba(45, 24, 132, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.primary:hover,
.ghost:hover,
.danger:hover,
.file-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 220, 116, 0.34);
}

.ghost,
.file-button {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035)),
    rgba(8, 5, 32, 0.46);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 760;
}

.sidebar .ghost,
.sidebar .file-button {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.danger {
  color: #fff;
  border-color: rgba(255, 120, 145, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 44%),
    linear-gradient(135deg, #d84561, #9f2640);
  box-shadow: 0 14px 28px rgba(159, 38, 64, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-weight: 800;
}

.text-button {
  color: var(--gold);
  background: transparent;
  padding: 0;
  border: 0;
  min-height: auto;
  font-weight: 800;
  overflow: visible;
}

.file-button {
  display: grid;
  place-items: center;
}

.file-button input {
  display: none;
}

.main {
  padding: 32px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: center;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: rgba(11, 7, 43, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(2, 0, 20, 0.24);
  backdrop-filter: blur(18px);
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 850;
  margin: 0 0 5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  color: var(--text);
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
}

h2 {
  color: var(--text);
  font-size: 17px;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  gap: 12px;
  width: min(640px, 58vw);
}

.topbar-actions input {
  flex: 1;
}

.ai-import-button {
  border-color: rgba(104, 217, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(104, 217, 255, 0.12), rgba(143, 104, 255, 0.11)),
    rgba(8, 5, 32, 0.48);
  box-shadow: none;
}

input,
select,
textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(7, 4, 30, 0.58);
  color: var(--text);
  min-height: 46px;
  padding: 12px 14px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--cyan) 50%),
    linear-gradient(135deg, var(--cyan) 50%, transparent 50%),
    linear-gradient(135deg, rgba(87, 225, 255, 0.12), rgba(157, 108, 255, 0.12));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 42px;
}

input::placeholder,
textarea::placeholder {
  color: rgba(215, 209, 247, 0.48);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(255, 220, 116, 0.46);
  box-shadow: 0 0 0 3px rgba(255, 220, 116, 0.08);
  background: rgba(9, 5, 36, 0.78);
}

select option {
  color: var(--text);
  background: #130b54;
  font-weight: 700;
}

.native-select-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.client-picker {
  position: relative;
  min-width: 0;
}

.client-picker-button {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(104, 217, 255, 0.06), rgba(143, 104, 255, 0.1)),
    rgba(7, 4, 30, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 8px 14px;
  text-align: left;
}

.client-picker-button::after {
  content: "";
  justify-self: center;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.client-picker.open .client-picker-button::after {
  transform: rotate(225deg) translate(-2px, -1px);
}

.client-picker-button span,
.client-picker-menu span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.client-picker-button strong,
.client-picker-menu strong {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin-top: 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-picker-button strong {
  display: none;
}

.client-picker-menu {
  position: absolute;
  z-index: 20;
  inset: calc(100% + 8px) 0 auto;
  display: none;
  padding: 7px;
  background: rgba(9, 5, 36, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(2, 0, 20, 0.48);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.client-picker.open .client-picker-menu {
  display: grid;
  gap: 6px;
}

.client-picker-menu button {
  min-width: 0;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  padding: 10px;
  text-align: left;
}

.client-picker-menu button:hover,
.client-picker-menu button.active {
  border-color: rgba(255, 220, 116, 0.24);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 3px 0 0 var(--gold);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.metrics article,
.panel {
  background: rgba(13, 8, 48, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  box-shadow: var(--shadow), var(--glow);
  backdrop-filter: blur(18px);
}

.metrics article {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
}

.metrics article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(104, 217, 255, 0.58));
}

.metrics article::after {
  content: none;
}

.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metrics strong {
  display: block;
  color: var(--text);
  font-size: 28px;
  margin-top: 9px;
  letter-spacing: 0;
}

.split,
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr);
  gap: 20px;
}

.dashboard-recent-only {
  grid-template-columns: minmax(0, 1fr);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 20px;
  margin-top: 20px;
}

.dashboard-wide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.dashboard-wide-compact {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.clients-workspace {
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.3fr);
}

.panel {
  padding: 20px;
}

.panel-head,
.line-head,
.toolbar,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.toolbar {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px;
  background: rgba(11, 7, 43, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  box-shadow: 0 14px 38px rgba(2, 0, 20, 0.2);
  backdrop-filter: blur(18px);
}

.toolbar select {
  width: 190px;
}

.toolbar .file-button {
  width: auto;
}

.import-status {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.list,
.invoice-list,
.client-list,
.status-summary,
.compact-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.compact-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.compact-row div {
  min-width: 0;
}

.compact-row strong,
.compact-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-row strong {
  color: var(--text);
  font-size: 14px;
}

.compact-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.compact-row b {
  color: var(--gold-hot);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.snapshot-grid article {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.snapshot-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.snapshot-grid strong {
  display: block;
  color: var(--text);
  margin-top: 8px;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-bars {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.pipeline-row strong,
.pipeline-row span {
  display: block;
}

.pipeline-row strong {
  color: var(--text);
  font-size: 14px;
}

.pipeline-row span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.pipeline-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
}

.pipeline-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--cyan));
}

.monthly-trend {
  min-height: 190px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  margin-top: 16px;
}

.trend-column {
  display: grid;
  gap: 8px;
  min-width: 0;
  text-align: center;
}

.trend-column div {
  height: 120px;
  display: flex;
  align-items: end;
  justify-content: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.trend-column i {
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(104, 217, 255, 0.82), rgba(143, 104, 255, 0.72));
}

.trend-column strong {
  color: var(--text-soft);
  font-size: 12px;
}

.trend-column span {
  color: var(--muted);
  font-size: 11px;
}

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

.health-item {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.health-item span,
.health-item strong {
  display: block;
}

.health-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.health-item strong {
  color: var(--text);
  margin-top: 9px;
  font-size: 22px;
}

.health-item.good strong {
  color: var(--ok);
}

.health-item.warn strong {
  color: var(--warning);
}

.health-item.danger strong {
  color: #ffb2c0;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.invoice-card,
.client-card,
.summary-row {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.invoice-card,
.client-card {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.invoice-card:hover,
.client-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.072);
  box-shadow: 0 14px 26px rgba(2, 0, 20, 0.18);
}

.invoice-card {
  display: grid;
  gap: 8px;
}

.invoice-card strong,
.invoice-card span,
.invoice-card .muted,
.client-card strong,
.client-card .muted {
  min-width: 0;
}

.invoice-card.active,
.client-card.active {
  border-color: rgba(255, 220, 116, 0.34);
  background: rgba(255, 255, 255, 0.078);
  box-shadow: inset 3px 0 0 var(--gold), 0 14px 26px rgba(2, 0, 20, 0.18);
}

.card-top,
.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.card-top > :first-child,
.invoice-card > .muted,
.client-card > .muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text);
  background: rgba(143, 104, 255, 0.16);
  border: 1px solid rgba(143, 104, 255, 0.24);
  font-weight: 800;
}

.badge.Paid {
  color: #bfffdc;
  background: rgba(57, 229, 143, 0.14);
  border-color: rgba(57, 229, 143, 0.34);
}

.badge.Overdue {
  color: #ffe1a8;
  background: rgba(255, 189, 85, 0.16);
  border-color: rgba(255, 189, 85, 0.36);
}

.badge.Cancelled {
  color: #ffd0d9;
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.34);
}

.invoice-form,
.client-form,
.settings-form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.form-grid label {
  min-width: 0;
}

.line-head {
  padding-top: 4px;
}

.line-items {
  display: grid;
  gap: 8px;
}

.line-item-header {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 110px 118px 38px;
  gap: 12px;
  color: rgba(104, 217, 255, 0.82);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0 12px 3px;
}

.line-item-header span:nth-child(2),
.line-item-header span:nth-child(3),
.line-item-header span:nth-child(4) {
  text-align: right;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 90px 110px 118px 38px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.line-row:focus-within {
  border-color: rgba(255, 220, 116, 0.34);
  box-shadow: 0 0 0 3px rgba(255, 220, 116, 0.075);
}

.line-row input {
  min-width: 0;
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(5, 3, 24, 0.48);
}

.line-row input[name="quantity"],
.line-row input[name="rate"] {
  text-align: right;
}

.line-total {
  text-align: right;
  color: var(--gold-hot);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon {
  min-height: 38px;
  border-radius: 8px;
  padding: 0;
}

.totals-grid {
  display: grid;
  grid-template-columns: 150px 150px 1fr;
  gap: 14px;
  align-items: start;
}

.totals {
  display: grid;
  gap: 8px;
  justify-self: end;
  min-width: 280px;
  padding: 14px;
  background: rgba(5, 3, 24, 0.58);
  color: var(--text);
  border: 1px solid rgba(255, 220, 116, 0.22);
  border-radius: 8px;
  box-shadow: 0 16px 34px rgba(2, 0, 20, 0.22);
}

.totals p {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}

.totals p:last-child {
  border-bottom: 0;
  color: var(--gold-hot);
  font-size: 18px;
  padding-bottom: 0;
}

.client-card {
  cursor: pointer;
}

.settings-panel {
  max-width: 860px;
}

.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  border: 1px dashed rgba(166, 143, 255, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

@media print {
  .sidebar,
  .topbar,
  .toolbar,
  .invoice-list-panel,
  .form-actions {
    display: none !important;
  }

  .app-shell,
  .workspace {
    display: block;
  }

  body {
    background: #fff;
    color: #111;
  }

  .main,
  .panel {
    padding: 0;
    border: 0;
    box-shadow: none;
    background: #fff;
    color: #111;
  }
}

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

  .login-intro {
    min-height: auto;
    gap: 28px;
  }

  .login-intro-content {
    transform: none;
  }

  .login-intro h1 {
    font-size: 38px;
  }

  .login-description {
    font-size: 14px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .sidebar::after {
    display: none;
  }

  .brand {
    min-height: auto;
  }

  .brand img {
    max-width: 300px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .metrics,
  .split,
  .dashboard-grid,
  .dashboard-wide,
  .dashboard-wide-compact,
  .workspace,
  .form-grid,
  .totals-grid {
    grid-template-columns: 1fr;
  }

  .health-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .line-row {
    grid-template-columns: 1fr 1fr;
  }

  .line-item-header {
    display: none;
  }

  .line-total {
    text-align: left;
  }

  .totals {
    justify-self: stretch;
    min-width: 0;
  }
}
