* { box-sizing: border-box; }
:root {
  --bg: #121415;
  --panel: #202224;
  --panel-2: #2a2c30;
  --panel-3: #36383d;
  --line: #3b3e43;
  --text: #f4f6f7;
  --muted: #a8adb5;
  --green: #30b768;
  --green-2: #19d06d;
  --blue: #2f55ca;
  --orange: #d96f2e;
  --red: #d33b3b;
}
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--green-2); text-decoration: none; }
.topbar {
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  background: #222326;
  border-bottom: 1px solid #2d2f33;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .28);
}
.brand {
  width: 42px;
  height: 42px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: #26382f;
}
.brand span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--green);
  color: white;
  font-weight: 800;
}
.main-nav { display: flex; align-items: center; gap: 8px; height: 100%; }
.main-nav > a, .main-nav summary {
  color: var(--text);
  padding: 18px 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.main-nav details { position: relative; height: 100%; }
.main-nav details[open] summary, .main-nav > a:hover { color: var(--green-2); }
.menu-panel {
  position: absolute;
  top: 54px;
  left: 0;
  min-width: 260px;
  padding: 16px;
  background: #242529;
  border: 1px solid #303238;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .42);
}
.menu-panel.mega {
  display: grid;
  grid-template-columns: repeat(3, minmax(190px, 1fr));
  gap: 28px;
  width: 760px;
}
.menu-panel a, .menu-panel span {
  display: block;
  color: #d9dde2;
  padding: 10px 12px;
  border-radius: 4px;
}
.menu-panel a:hover { background: #414149; color: var(--green-2); }
.menu-panel strong { display: block; padding: 8px 12px; }
.global-search {
  margin-left: auto;
  width: min(400px, 28vw);
  padding: 10px 16px;
  color: var(--muted);
  background: #141519;
  border-radius: 8px;
}
.user-box { display: flex; align-items: center; gap: 10px; }
.user-box span {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #08090a;
}
.user-box button {
  color: var(--muted);
  border: 0;
  background: transparent;
  cursor: pointer;
}
.quickbar {
  position: fixed;
  top: 54px;
  bottom: 0;
  left: 0;
  width: 248px;
  padding: 28px 18px;
  background: #1e2023;
  border-right: 1px solid #2b2d31;
}
.profile {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px 12px;
  margin-bottom: 30px;
}
.profile span {
  grid-row: span 2;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #d7f7df;
  color: var(--green);
  font-weight: 800;
}
.profile small { color: var(--muted); overflow-wrap: anywhere; }
.quickbar nav strong { display: block; margin-bottom: 16px; }
.quickbar nav a {
  display: block;
  color: var(--text);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #17181b;
  border: 1px solid #3a3d43;
  border-radius: 6px;
}
.content { margin-left: 248px; padding: 78px 24px 32px; min-height: 100vh; }
.login-content { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(420px, 100%); }
.login-shell {
  width: min(980px, 100%);
  min-height: 560px;
  display: grid;
  grid-template-columns: 1.1fr 420px;
  overflow: hidden;
  border: 1px solid #2f3338;
  border-radius: 12px;
  background: #1d1f22;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
  background:
    linear-gradient(140deg, rgba(48,183,104,.22), transparent 48%),
    radial-gradient(circle at 20% 20%, rgba(25,208,109,.22), transparent 30%),
    #17191b;
}
.login-brand span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 18px;
  background: var(--green);
  color: white;
  font-weight: 900;
  font-size: 20px;
}
.login-brand h1 { font-size: 42px; margin-bottom: 14px; }
.login-brand p { max-width: 420px; color: #c3c8cf; font-size: 16px; line-height: 1.55; }
.login-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 44px;
  background: #24262a;
}
.login-card h2 { font-size: 24px; margin-bottom: 12px; }
.login-card .primary { margin-top: 8px; width: 100%; }
.alert {
  padding: 12px;
  border: 1px solid #6b3a20;
  border-radius: 8px;
  background: #321f16;
  color: #ffca9f;
}
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.page-head.compact { margin-bottom: 14px; }
.breadcrumb { color: var(--green-2); font-weight: 700; }
h1 { margin: 0; font-size: 24px; line-height: 1.2; }
h2 { margin: 0 0 16px; font-size: 17px; }
.panel, .data-panel, .form-section {
  background: var(--panel);
  border: 1px solid #292c30;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 18px;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.cards article { background: var(--panel); border: 1px solid #292c30; border-radius: 8px; padding: 18px; }
.cards strong { display: block; font-size: 30px; color: var(--green-2); }
.cards span { color: var(--muted); }
.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 18px;
}
.filterbar { display: flex; gap: 10px; margin-bottom: 10px; }
.filterbar input { max-width: 430px; }
.action-rail {
  min-height: calc(100vh - 120px);
  padding: 18px;
  background: #222326;
  border-left: 1px solid #2f3237;
}
.action-rail a {
  display: block;
  color: #e4e8ec;
  padding: 12px 0;
  border-bottom: 1px solid #373a40;
}
.action-rail .muted { color: #777d86; }
.action-rail b { color: var(--green-2); font-size: 18px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: #eef3f5; font-size: 12px; }
.bling-table tr:not(:first-child) { background: #242628; }
.bling-table tr:not(:first-child):hover { background: #2d3034; }
.bling-table input[type="checkbox"] { width: 16px; height: 16px; }
.status-chip {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 14px;
  color: white;
  font-size: 12px;
  font-weight: 800;
}
.status-chip.issued { background: var(--blue); }
.status-chip.ready, .status-chip.draft { background: var(--orange); }
.status-chip.error, .status-chip.canceled { background: var(--red); }
input, select, textarea {
  width: 100%;
  border: 1px solid #46494f;
  border-radius: 7px;
  padding: 10px 12px;
  font: inherit;
  background: #37393d;
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 0;
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}
input:disabled { color: #c4c8ce; background: #3f4148; }
textarea { min-height: 96px; resize: vertical; }
label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.grid-form p, .form-grid p, .line-item p { margin: 0; }
.form-grid { display: grid; gap: 14px 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.line-item {
  display: grid;
  grid-template-columns: 38px minmax(260px, 1fr) 120px 140px 140px;
  gap: 8px;
  align-items: end;
}
.line-item > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #3a3d42;
  font-weight: 800;
}
.primary, .link-button {
  display: inline-block;
  border: 0;
  border-radius: 7px;
  background: var(--green);
  color: white;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}
.ghost-button, .icon-button {
  display: inline-block;
  border: 1px solid var(--green);
  border-radius: 7px;
  background: transparent;
  color: var(--green-2);
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
}
.actions { display: flex; gap: 14px; align-items: center; }
.sticky-actions { min-width: 320px; justify-content: flex-end; }
.badge { border-radius: 999px; background: #193c2b; color: var(--green-2); padding: 7px 12px; font-weight: 800; }
code { background: #111316; color: var(--green-2); padding: 3px 6px; border-radius: 4px; }
@media (max-width: 1000px) {
  .quickbar { display: none; }
  .content { margin-left: 0; }
  .workspace-grid { grid-template-columns: 1fr; }
  .action-rail { min-height: auto; border-left: 0; border-radius: 8px; }
  .cols-3, .cols-4, .cols-5, .cols-6, .line-item { grid-template-columns: 1fr 1fr; }
  .span-2 { grid-column: span 2; }
}
@media (max-width: 680px) {
  .topbar { position: static; height: auto; flex-wrap: wrap; padding: 10px; }
  .main-nav { flex-wrap: wrap; }
  .global-search { width: 100%; }
  .content { padding: 18px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 32px; }
  .login-card { padding: 28px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .cols-2, .cols-3, .cols-4, .cols-5, .cols-6, .line-item { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
