:root {
  --ink: #10211b;
  --muted: #66756f;
  --line: #dde5e1;
  --paper: #f5f7f6;
  --card: #ffffff;
  --green: #16a86b;
  --green-dark: #087449;
  --green-soft: #e5f8ef;
  --nav: #091a14;
  --red: #c64646;
  --amber: #bd7a14;
  --shadow: 0 16px 45px rgba(18, 51, 39, .08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 14px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 29px); letter-spacing: -.035em; }
h2 { margin-bottom: 7px; font-size: 18px; letter-spacing: -.02em; }
small { color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.full { width: 100%; }
.eyebrow { margin-bottom: 6px; color: #789087; font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 16px 18px; color: #d9e7e1; background: var(--nav); z-index: 10; }
.brand { display: inline-flex; align-items: center; gap: 11px; padding: 0 10px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; color: #062016; background: #43dc94; border-radius: 12px; font-size: 20px; font-weight: 900; box-shadow: inset 0 -4px 10px rgba(0,0,0,.12); }
.brand strong, .brand small { display: block; }
.brand strong { color: #fff; font-size: 16px; }
.brand small { margin-top: 2px; color: #7f9d91; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.nav { display: grid; gap: 6px; margin-top: 38px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 43px; padding: 0 13px; color: #8fac9f; border-radius: 12px; font-weight: 650; transition: .18s ease; }
.nav-link span { width: 20px; color: #6e8f81; font-size: 16px; text-align: center; }
.nav-link:hover { color: #e9fff5; background: rgba(255,255,255,.05); }
.nav-link.active { color: #071f15; background: #58df9d; box-shadow: 0 9px 24px rgba(59, 219, 145, .16); }
.nav-link.active span { color: #071f15; }
.sidebar-foot { margin-top: auto; display: grid; gap: 13px; }
.connection { display: flex; align-items: center; gap: 9px; padding: 11px; color: #9ab5aa; font-size: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 12px; }
.connection i, .live-dot { width: 8px; height: 8px; background: #3de08f; border-radius: 50%; box-shadow: 0 0 0 5px rgba(61,224,143,.11); }

.main { min-width: 0; }
.topbar { min-height: 94px; display: flex; align-items: center; gap: 18px; padding: 17px clamp(20px, 4vw, 48px); background: rgba(245,247,246,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.topbar .eyebrow { margin: 0 0 3px; }
.profile-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; }
.profile-chip > span { width: 38px; height: 38px; display: grid; place-items: center; color: #12643f; background: #dbf4e7; border-radius: 12px; }
.profile-chip small { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; }
.menu-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 11px; }
.content { padding: 28px clamp(18px, 4vw, 48px) 60px; }

.hero-strip { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; padding: 14px 18px; background: linear-gradient(100deg, #e5f8ee, #f4fbf8); border: 1px solid #ccebdc; border-radius: 15px; }
.hero-strip > div { display: flex; align-items: center; gap: 11px; }
.hero-strip small { padding-left: 8px; border-left: 1px solid #bed9cc; }
.text-link { color: var(--green-dark); font-size: 12px; font-weight: 800; }
.icon-link { width: 34px; height: 34px; display: grid; place-items: center; color: var(--green-dark); background: var(--green-soft); border-radius: 10px; font-size: 20px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { min-height: 136px; display: flex; gap: 15px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(20,54,40,.04); }
.stat-icon { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; }
.stat-icon.green { color: #08794a; background: #dff8eb; }.stat-icon.cyan { color: #08748d; background: #def5fa; }.stat-icon.amber { color: #9a620c; background: #fff0d2; }.stat-icon.violet { color: #6855a5; background: #ece7fc; }
.stat-card small { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; }
.stat-card strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.stat-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }

.dashboard-grid, .settings-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; margin-top: 16px; }
.settings-grid { grid-template-columns: 1fr 1fr; }
.card { padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(20,54,40,.04); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-head h2 { margin-bottom: 0; }
.pill { padding: 6px 9px; color: #168457; background: var(--green-soft); border-radius: 99px; font-size: 10px; font-weight: 800; }
.bar-chart { height: 178px; display: flex; align-items: flex-end; gap: 11px; padding-top: 16px; border-bottom: 1px solid var(--line); }
.bar-slot { flex: 1; height: 100%; display: flex; align-items: center; justify-content: flex-end; flex-direction: column; gap: 6px; }
.bar { width: min(28px, 72%); min-height: 6px; background: linear-gradient(#54dda0, #13a96b); border-radius: 7px 7px 2px 2px; }
.bar-slot small { font-size: 9px; }.bar.h-0{height:4%}.bar.h-1{height:10%}.bar.h-2{height:20%}.bar.h-3{height:30%}.bar.h-4{height:40%}.bar.h-5{height:50%}.bar.h-6{height:60%}.bar.h-7{height:70%}.bar.h-8{height:80%}.bar.h-9{height:90%}.bar.h-10{height:100%}
.empty-chart { width: 100%; align-self: center; color: var(--muted); text-align: center; }
.health-list { display: grid; gap: 4px; }
.health-list > div { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid #edf1ef; }
.health-list > div:last-child { border: 0; }
.health-list p { flex: 1; margin: 0; }
.health-list p small { display: block; margin-top: 3px; }
.app-avatar { width: 36px; height: 36px; display: grid; place-items: center; color: #0d6d43; background: #e2f7ec; border-radius: 11px; font-size: 11px; font-weight: 900; }
.app-avatar.large { width: 47px; height: 47px; font-size: 14px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.status-dot::before { content: ""; width: 7px; height: 7px; background: #91a09a; border-radius: 50%; }
.status-dot.ok::before { background: #19b774; }.status-dot.off::before { background: #929d99; }.status-dot.warn::before { background: #e09a2c; }

.table-card { margin-top: 16px; padding: 0; overflow: hidden; }
.table-card .card-head { margin: 0; padding: 22px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 11px 18px; color: #7e8d87; background: #f8faf9; font-size: 9px; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
td { padding: 14px 18px; border-top: 1px solid #edf1ef; font-size: 12px; }
.status { display: inline-block; padding: 5px 8px; color: #52625c; background: #eef1f0; border-radius: 99px; font-size: 9px; font-weight: 850; text-transform: uppercase; }
.status.delivered,.status.read,.status.received { color: #0d7649; background: #e3f7ed; }.status.accepted,.status.sent,.status.sending { color: #256c96; background: #e5f2fa; }.status.failed,.status.configuration_error { color: #a83c3c; background: #fbe7e7; }
.error-detail { display: block; max-width: 180px; margin-top: 4px; color: var(--red); overflow: hidden; text-overflow: ellipsis; }
.empty-row { padding: 40px; color: var(--muted); text-align: center; }

.primary-button, .ghost-button, .close-button, .copy-code, .code-line button, .secret-line button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 14px; border: 0; border-radius: 10px; cursor: pointer; font-weight: 750; transition: .18s ease; }
.primary-button { color: #062518; background: #43d992; box-shadow: 0 8px 22px rgba(48, 190, 124, .16); }
.primary-button:hover { background: #34cc85; transform: translateY(-1px); }
.ghost-button { color: #566660; background: transparent; border: 1px solid #d9e2de; }
.sidebar .ghost-button { color: #91aa9f; border-color: rgba(255,255,255,.1); }
.ghost-button:hover { color: var(--ink); background: #f4f7f6; }.ghost-button.danger { color: var(--red); }
.split-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; }
.split-head p { margin: 0; color: var(--muted); }

.app-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.app-card { padding: 21px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 28px rgba(20,54,40,.04); }
.app-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.app-card h2 { margin-bottom: 3px; }
.app-card dl, .details-card dl { display: grid; gap: 11px; margin: 20px 0; }
.app-card dl div, .details-card dl div { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-bottom: 10px; border-bottom: 1px solid #edf1ef; }
.app-card dt, .details-card dt { color: var(--muted); font-size: 11px; }.app-card dd, .details-card dd { margin: 0; font-size: 11px; font-weight: 700; text-align: right; }
.card-actions { display: flex; gap: 8px; padding-top: 4px; }
.secret-reveal { margin-bottom: 18px; padding: 20px; color: #defaed; background: linear-gradient(110deg, #0b3e2b, #0e5a3a); border-radius: var(--radius); box-shadow: var(--shadow); }
.secret-reveal p { margin-bottom: 0; color: #9acdb5; }.secret-reveal h2 { color: #fff; }
.secret-line, .code-line { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 9px 9px 9px 13px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; }
.secret-line code, .code-line code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.secret-line button, .code-line button { color: #09291b; background: #59e29f; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 60px 30px; color: var(--muted); background: #fff; border: 1px dashed #cfdad5; border-radius: var(--radius); text-align: center; }
.empty-state.wide { grid-column: 1 / -1; }.empty-state > span { font-size: 27px; }.empty-state h2 { color: var(--ink); margin: 0; }.empty-state p { margin: 0 0 10px; }
.empty-state.compact { padding: 30px 15px; }

.modal-layer { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 14px; background: rgba(4,20,14,.65); backdrop-filter: blur(4px); }
.modal { width: min(480px, 100%); max-height: calc(100vh - 28px); margin: 0; padding: 25px; background: #fff; border: 0; border-radius: 20px; box-shadow: 0 28px 90px rgba(5,27,18,.3); overflow-y: auto; }
.modal-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 23px; }
.close-button { width: 35px; min-height: 35px; padding: 0; color: #6d7c76; background: #eef2f0; font-size: 22px; }
label { display: grid; gap: 7px; margin-bottom: 16px; color: #50615a; font-size: 11px; font-weight: 750; }
input, select { width: 100%; min-height: 43px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #d5dfdb; border-radius: 10px; outline: 0; }
input:focus, select:focus { border-color: #24ad71; box-shadow: 0 0 0 3px rgba(36,173,113,.11); }
.form-note { display: block; color: #84928c; font-size: 10px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.flash { margin-bottom: 16px; padding: 12px 14px; color: #11633f; background: #e4f7ed; border: 1px solid #c8e9d8; border-radius: 11px; font-size: 12px; }
.flash.error { color: #9d3a3a; background: #fbeaea; border-color: #efcece; }

.filters { display: flex; gap: 8px; }.filters select { width: 150px; min-height: 38px; }
.config-list { display: grid; gap: 4px; }
.config-list > div { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1px solid #edf1ef; }
.config-list > div:last-child { border: 0; }.config-list p { flex: 1; margin: 0; }.config-list small { display: block; margin-top: 3px; font-size: 9px; }.config-list > div > span:last-child { color: var(--muted); font-size: 10px; font-weight: 750; }
.config-check { width: 28px; height: 28px; display: grid; place-items: center; color: #9b6410; background: #fff0d4; border-radius: 9px; font-weight: 900; }.config-check.ready { color: #087549; background: var(--green-soft); }
.webhook-card { display: flex; flex-direction: column; justify-content: space-between; background: #0c251c; color: #e8f8f0; }
.webhook-card p { color: #8fb1a3; }.webhook-card .code-line { background: rgba(255,255,255,.06); }

.docs-layout { display: grid; grid-template-columns: 190px minmax(0, 760px); gap: 34px; align-items: start; }
.docs-nav { position: sticky; top: 22px; display: grid; gap: 5px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.docs-nav a { padding: 9px 10px; color: #65756f; border-radius: 8px; font-size: 11px; font-weight: 700; }.docs-nav a:hover { color: #0c7147; background: #eaf8f1; }
.docs-content { display: grid; gap: 14px; }.docs-content section { position: relative; padding: 25px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }.docs-content p { color: var(--muted); line-height: 1.65; }
code { font-family: "SFMono-Regular", Consolas, monospace; }
pre { margin: 16px 0 0; padding: 18px; color: #d9f5e8; background: #0c251c; border-radius: 12px; overflow-x: auto; font-size: 11px; line-height: 1.65; }
.callout { padding: 12px 14px; color: #1b6f4d; background: #ebf8f2; border-left: 3px solid #32c080; border-radius: 0 9px 9px 0; }
.method { display: inline-block; margin-bottom: 10px; padding: 5px 7px; color: #08794a; background: #e2f7ec; border-radius: 6px; font-size: 9px; font-weight: 900; }
.copy-code { margin-top: 9px; color: #426057; background: #eef3f1; font-size: 10px; min-height: 31px; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #071a13; }
.login-panel { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 6vw, 76px); overflow: hidden; }
.login-panel::before { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; bottom: -220px; background: radial-gradient(circle, rgba(49,224,142,.22), transparent 68%); border: 1px solid rgba(87,224,160,.11); border-radius: 50%; }
.login-brand { padding: 0; }.login-copy { position: relative; max-width: 650px; padding: 90px 0; }.login-copy h1 { max-width: 620px; color: #f2fff9; font-size: clamp(40px, 5.4vw, 73px); line-height: .98; letter-spacing: -.055em; }.login-copy > p:last-child { max-width: 540px; margin-top: 25px; color: #8eb1a2; font-size: 16px; line-height: 1.7; }
.login-points { display: flex; flex-wrap: wrap; gap: 8px; }.login-points span { padding: 8px 11px; color: #9cc8b5; border: 1px solid rgba(255,255,255,.1); border-radius: 99px; font-size: 10px; }
.login-form-wrap { display: grid; place-items: center; padding: 28px; background: #f3f6f4; border-radius: 32px 0 0 32px; }
.login-card { width: min(420px, 100%); padding: 38px; background: #fff; border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }.login-card h2 { margin: 0; font-size: 28px; }.login-card > .muted { margin: 7px 0 28px; }.login-card .primary-button { margin-top: 7px; min-height: 46px; }.login-card .form-note { margin-top: 18px; text-align: center; }

@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); }.app-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }.sidebar { position: fixed; left: -270px; width: 248px; transition: left .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.22); }.sidebar.open { left: 0; }.menu-button { display: block; }.profile-chip div { display: none; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }.login-page { grid-template-columns: 1fr; }.login-panel { min-height: 42vh; }.login-copy { padding: 65px 0 35px; }.login-copy h1 { font-size: 43px; }.login-points { display: none; }.login-form-wrap { border-radius: 26px 26px 0 0; }.docs-layout { grid-template-columns: 1fr; }.docs-nav { position: static; display: flex; overflow-x: auto; }
}
@media (max-width: 600px) {
  .topbar { min-height: 78px; padding: 12px 16px; }.content { padding: 18px 14px 42px; }.stats-grid, .app-grid { grid-template-columns: 1fr; }.hero-strip, .split-head, .stacked-mobile { align-items: flex-start; flex-direction: column; }.hero-strip > div { flex-wrap: wrap; }.hero-strip small { width: 100%; padding: 0; border: 0; }.filters { width: 100%; flex-wrap: wrap; }.filters select { flex: 1; }.card { padding: 17px; }.table-card { padding: 0; }.login-panel { padding: 28px 24px; }.login-copy h1 { font-size: 38px; }.login-form-wrap { padding: 20px 14px; }.login-card { padding: 27px 22px; }.secret-line { align-items: stretch; flex-direction: column; }.card-actions { flex-wrap: wrap; }
}

