:root {
  --ink: #102b3a;
  --ink-2: #173f51;
  --cyan: #16c8d4;
  --cyan-dark: #087b88;
  --paper: #f8f5ef;
  --card: #fffefd;
  --line: #d9e2e3;
  --muted: #61717a;
  --green: #1e9c64;
  --yellow: #d99b16;
  --red: #d24b4b;
  --shadow: 0 18px 55px rgba(16, 43, 58, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 90% 5%, rgba(22, 200, 212, .12), transparent 28rem), var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.topbar { min-height: 76px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 22px; color: white; background: linear-gradient(110deg, #0d2534, #12384a 70%, #0c5360); box-shadow: 0 8px 30px rgba(6, 29, 40, .16); }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 2px solid var(--cyan); border-radius: 50%; box-shadow: inset 0 0 0 6px rgba(22, 200, 212, .12); font-weight: 900; color: var(--cyan); }
.brand strong { display: block; letter-spacing: .11em; font-size: 17px; }
.brand small { display: block; margin-top: 2px; color: #b9d1da; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.top-actions span { color: #d6e5e9; font-size: 13px; }

.shell { width: min(1480px, 100%); margin: 0 auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { padding: 28px 18px; border-right: 1px solid var(--line); background: rgba(255, 254, 253, .78); backdrop-filter: blur(12px); }
.sidebar h2 { margin: 0 10px 18px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.nav-button { width: 100%; margin: 3px 0; padding: 12px 13px; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 12px; text-align: left; color: var(--ink); background: transparent; }
.nav-button:hover { background: #edf6f5; }
.nav-button.active { color: #062c36; background: #d9f5f3; box-shadow: inset 3px 0 var(--cyan-dark); font-weight: 750; }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #bcd5d8; border-radius: 9px; background: white; font-size: 14px; }
.main { min-width: 0; padding: 34px clamp(20px, 4vw, 56px) 70px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--cyan-dark); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; }
h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.05; letter-spacing: -.04em; }
h2 { margin: 0; letter-spacing: -.02em; }
p { color: var(--muted); }
.lead { max-width: 780px; margin: 12px 0 0; font-size: 17px; line-height: 1.6; }

.hero { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 44px); border-radius: 24px; color: white; background: linear-gradient(125deg, #102b3a, #164b5d); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; width: 280px; height: 280px; right: -60px; top: -110px; border: 46px solid rgba(22, 200, 212, .22); border-radius: 50%; }
.hero h1 { max-width: 720px; }
.hero p { max-width: 720px; color: #d3e5e9; }
.hero .button { margin-top: 10px; }

.grid { display: grid; gap: 18px; }
.split-grid { grid-template-columns: minmax(320px, .85fr) minmax(0, 1.15fr); }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0 30px; }
.card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: 0 9px 28px rgba(16, 43, 58, .055); }
.kpi small { display: block; color: var(--muted); }
.kpi strong { display: block; margin-top: 10px; font-size: 30px; }
.section { margin-top: 30px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 14px; }
.section-head p { margin: 4px 0 0; }
.module-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.demo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.admin-stack { display: grid; gap: 22px; }
.editor-card, .ticket-detail { scroll-margin-top: 24px; }
.editor-card h3 { margin: 26px 0 12px; }
details.card { padding: 0; overflow: hidden; }
details.card summary { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: "+"; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: var(--cyan-dark); background: #e7f8f7; font-size: 20px; }
details.card[open] summary::after { content: "–"; }
details.card summary span { margin-left: auto; color: var(--muted); font-size: 12px; }
.details-body { padding: 22px; border-top: 1px solid var(--line); background: #fbfdfc; }
.inline-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inline-form select, td select { min-height: 34px; padding: 6px 9px; border: 1px solid #bfcfd3; border-radius: 9px; color: var(--ink); background: white; }
.message-list { max-height: 520px; margin: 18px 0; padding: 4px; display: grid; gap: 10px; overflow: auto; }
.message { padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: #f8fbfb; }
.message.internal { border-color: #e5d5a4; background: #fff8e5; }
.message > div { display: flex; justify-content: space-between; gap: 12px; }
.message small { color: var(--muted); }
.message p { margin: 10px 0 0; color: var(--ink); line-height: 1.55; }
.demo-card { display: flex; flex-direction: column; gap: 12px; }
.demo-card h3, .demo-card p { margin: 0; }
.demo-card .button { margin-top: auto; }
.demo-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.release-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.release-card h3 { margin: 12px 0 4px; }
.release-card p { margin: 0; }
.filter-row { margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button { min-height: 36px; padding: 7px 13px; border: 1px solid #bdd0d5; border-radius: 999px; color: var(--ink); background: white; font-weight: 720; }
.filter-button:hover, .filter-button.active { border-color: var(--cyan-dark); color: #06323a; background: #d9f5f3; }
.delivery-notice { margin-bottom: 18px; }
.empty-delivery { margin-bottom: 22px; padding: 24px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 24px; border: 1px solid #b9d9d8; border-radius: 18px; background: linear-gradient(125deg, #f8fffe, #eaf8f7); }
.empty-delivery h2 { margin-bottom: 8px; }
.empty-delivery p { margin: 0; line-height: 1.6; }
.empty-delivery ul { margin: 0; padding-left: 20px; color: #31515d; line-height: 1.7; }
.provider-card { display: flex; flex-direction: column; gap: 12px; }
.provider-card h3, .provider-card p { margin: 0; }
.provider-card p { line-height: 1.55; }
.provider-head, .provider-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.provider-note { padding: 12px; display: grid; gap: 5px; border-radius: 11px; color: #31515d; background: #f1f6f6; font-size: 13px; line-height: 1.5; }
.provider-actions { margin-top: auto; padding-top: 6px; }
.module-card { position: relative; display: flex; flex-direction: column; gap: 14px; }
.module-card h3 { margin: 0; padding-right: 40px; font-size: 17px; }
.module-card p { margin: 0; min-height: 42px; font-size: 14px; line-height: 1.5; }
.module-state { display: flex; align-items: center; gap: 8px; font-weight: 750; font-size: 13px; }
.traffic-light { position: absolute; right: 20px; top: 20px; width: 18px; height: 18px; border-radius: 50%; box-shadow: 0 0 0 5px rgba(0, 0, 0, .045), inset 0 -2px 3px rgba(0, 0, 0, .16); }
.traffic-light.green { background: var(--green); box-shadow: 0 0 0 5px rgba(30, 156, 100, .12), 0 0 18px rgba(30, 156, 100, .32); }
.traffic-light.yellow { background: var(--yellow); box-shadow: 0 0 0 5px rgba(217, 155, 22, .12), 0 0 18px rgba(217, 155, 22, .26); }
.traffic-light.red { background: var(--red); box-shadow: 0 0 0 5px rgba(210, 75, 75, .11); }
.module-foot { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.price { font-weight: 800; }
.price small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; }

.button { min-height: 42px; padding: 10px 16px; border: 0; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 760; color: #062c36; background: var(--cyan); box-shadow: 0 6px 15px rgba(22, 200, 212, .18); }
.button:hover { background: #2dd7df; transform: translateY(-1px); }
.button.secondary { border: 1px solid #bdd0d5; color: var(--ink); background: white; box-shadow: none; }
.button.ghost { color: inherit; background: transparent; box-shadow: none; }
.button.danger { color: #8d2020; background: #fff0ef; box-shadow: none; }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 12px; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #edf2f3; }
.status.green { color: #126941; background: #e3f7ec; }
.status.yellow { color: #815b0d; background: #fff5d9; }
.status.red { color: #942f2f; background: #fdeaea; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 14px; border-bottom: 1px solid #e7edef; text-align: left; vertical-align: top; white-space: nowrap; }
th { color: #dcecef; background: var(--ink); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
tbody tr:last-child td { border-bottom: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #bfcfd3; border-radius: 10px; color: var(--ink); background: white; outline: none; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan-dark); box-shadow: 0 0 0 3px rgba(22, 200, 212, .14); }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check { padding: 9px 10px; display: flex; align-items: start; gap: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfc; font-size: 12px; }
.check input { margin-top: 2px; accent-color: var(--cyan-dark); }
.notice { padding: 14px 16px; border-left: 4px solid var(--cyan-dark); border-radius: 8px; color: #284a58; background: #eaf8f7; }
.notice.error { border-color: var(--red); color: #7e2b2b; background: #fff0ef; }
.notice.success { border-color: var(--green); color: #176541; background: #e8f8ef; }
.empty { padding: 32px; text-align: center; border: 1px dashed #b9cacc; border-radius: 16px; background: rgba(255, 255, 255, .55); }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, .85fr) minmax(520px, 1.15fr); background: var(--paper); }
.auth-story { position: relative; overflow: hidden; padding: clamp(36px, 7vw, 90px); display: flex; flex-direction: column; justify-content: space-between; color: white; background: linear-gradient(145deg, #0d2635, #164d5e); }
.auth-story::before, .auth-story::after { content: ""; position: absolute; border: 60px solid rgba(22, 200, 212, .13); border-radius: 50%; }
.auth-story::before { width: 380px; height: 380px; right: -210px; top: -130px; }
.auth-story::after { width: 230px; height: 230px; left: -150px; bottom: -100px; }
.auth-story > * { position: relative; z-index: 1; }
.auth-story h1 { max-width: 590px; font-size: clamp(36px, 5vw, 68px); }
.auth-story p { max-width: 560px; color: #cee2e7; font-size: 17px; line-height: 1.65; }
.benefits { display: grid; gap: 10px; margin-top: 30px; }
.benefit { display: flex; align-items: center; gap: 10px; color: #e7f2f4; }
.benefit b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: #06323a; background: var(--cyan); }
.auth-panel { padding: clamp(28px, 7vw, 90px); display: grid; place-items: center; }
.auth-card { width: min(500px, 100%); padding: clamp(24px, 5vw, 44px); border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); }
.auth-tabs { padding: 4px; display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; background: #edf2f2; }
.auth-tabs button { padding: 10px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 750; }
.auth-tabs button.active { color: var(--ink); background: white; box-shadow: 0 4px 14px rgba(16, 43, 58, .08); }
.auth-card form { margin-top: 24px; }
.auth-card .button { width: 100%; margin-top: 6px; }
.fineprint { font-size: 11px; line-height: 1.5; color: var(--muted); }
.license-key { padding: 15px; border: 1px dashed var(--cyan-dark); border-radius: 10px; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: #073a45; background: #e8fbfa; }

@media (max-width: 1050px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .provider-grid { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 410px; }
}

@media (max-width: 760px) {
  .topbar { min-height: 68px; padding: 0 16px; }
  .brand small, .top-actions span { display: none; }
  .shell { display: block; }
  .sidebar { position: sticky; top: 0; z-index: 5; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
  .sidebar h2 { display: none; }
  .nav-button { flex: 0 0 auto; width: auto; padding: 9px 11px; }
  .nav-button .nav-icon { display: none; }
  .main { padding: 24px 16px 60px; }
  .page-head { display: block; }
  .kpis, .module-grid, .form-grid, .check-grid, .split-grid, .empty-delivery { grid-template-columns: 1fr; }
  .demo-grid { grid-template-columns: 1fr; }
  details.card summary { align-items: flex-start; }
  details.card summary span { display: none; }
  .inline-form { align-items: stretch; }
  .inline-form select, .inline-form .button { width: 100%; }
  .message > div, .release-card { display: grid; }
  .field.full { grid-column: auto; }
  .auth-story { min-height: 360px; padding: 38px 24px; }
  .auth-panel { padding: 24px 14px; }
}
