/* gestx Console - brand: navy #081627/#0B1F33, green #0E9F6E/#10B981, teal #0E6E8C, mint #A7F3D0, error #DC2626 */
:root {
  --navy: #081627; --navy-2: #0B1F33; --green: #0E9F6E; --green-2: #10B981; --teal: #0E6E8C; --mint: #A7F3D0; --error: #DC2626;
  --bg: #F4F7F9; --card: #FFFFFF; --line: #E2E8EE; --text: #0B1F33; --muted: #5B6B7C; --radius: 12px;
  --shadow: 0 1px 2px rgba(8,22,39,.06), 0 6px 20px rgba(8,22,39,.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; color: var(--text); background: var(--bg); }
h1, h2, h3, .brand, .kpi-value { font-family: Sora, Manrope, sans-serif; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
h2 { font-size: 17px; margin: 0; font-weight: 600; }
h3 { font-size: 14px; margin: 18px 0 8px; font-weight: 600; color: var(--navy-2); }
a { color: var(--teal); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; color: #fff; }
.brand b { font-weight: 700; color: var(--mint); }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--green), var(--teal)); color: #fff; font-weight: 700; font-size: 14px; }
.brand-large { font-size: 20px; color: var(--navy); }
.brand-large b { color: var(--green); }

/* login */
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, var(--navy-2), var(--navy) 60%); }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.login-card .muted { margin: 8px 0 18px; }

/* layout */
.app { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #C9D6E2; display: flex; flex-direction: column; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: 26px; flex: 1; }
.sidebar nav a { color: #C9D6E2; text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.sidebar nav a:hover { background: var(--navy-2); color: #fff; }
.sidebar nav a.active { background: rgba(16,185,129,.14); color: var(--mint); box-shadow: inset 3px 0 0 var(--green-2); }
.sidebar-foot { border-top: 1px solid rgba(255,255,255,.08); padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.whoami { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar { display: none; }
.main { padding: 26px 30px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }

/* cards & kpi */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: 26px; font-weight: 600; margin-top: 6px; color: var(--navy); }
.kpi-accent { border-top: 3px solid var(--green); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* buttons */
.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 9px; padding: 9px 16px; cursor: pointer; background: #fff; color: var(--navy-2); border-color: var(--line); }
.btn:hover { border-color: #C5D0DA; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: #0B8A60; border-color: #0B8A60; }
.btn-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-danger { background: #fff; border-color: #F3C4C4; color: var(--error); }
.btn-danger:hover { background: #FEF2F2; }
.btn-ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.18); }
.btn-small { padding: 6px 10px; font-size: 12.5px; }
.btn-block { width: 100%; margin-top: 8px; }
.icon-btn { background: transparent; border: 0; font-size: 22px; cursor: pointer; color: inherit; line-height: 1; padding: 4px 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* forms */
label { display: block; font-weight: 600; font-size: 12.5px; color: var(--navy-2); margin-bottom: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400; color: var(--text); background: #fff; border: 1px solid #CBD5DF; border-radius: 8px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
input[readonly] { background: #F4F7F9; color: var(--muted); }
input.invalid, select.invalid { border-color: var(--error); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: auto; margin: 0; accent-color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }
.form-error { color: var(--error); background: #FEF2F2; border: 1px solid #FBD5D5; border-radius: 8px; padding: 9px 11px; margin: 4px 0 10px; }
.notice { background: #ECFDF5; border: 1px solid var(--mint); border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; }
.warning { background: #FFFBEB; border: 1px solid #FDE68A; border-radius: 8px; padding: 10px 12px; margin: 8px 0 12px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; margin: 0; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid #EEF2F5; vertical-align: middle; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #F7FBF9; }
.cell-title { font-weight: 600; color: var(--navy); }
.cell-sub { color: var(--muted); font-size: 12px; }

/* badges & chips */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #EEF2F5; color: var(--navy-2); white-space: nowrap; }
.badge-active { background: #D1FAE5; color: #065F46; }
.badge-trial { background: #E0F2FE; color: var(--teal); }
.badge-suspended, .badge-cancelled, .badge-failed, .badge-off { background: #FEE2E2; color: #991B1B; }
.badge-running { background: #FEF3C7; color: #92400E; }
.chip { display: inline-block; padding: 2px 8px; margin: 1px 3px 1px 0; border-radius: 6px; font-size: 11.5px; background: rgba(14,110,140,.10); color: var(--teal); font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #CBD5DF; }
.dot-ok { background: var(--green-2); }
.dot-ko { background: var(--error); }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { font: inherit; font-weight: 600; background: none; border: 0; padding: 10px 12px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--green); border-bottom-color: var(--green); }

/* price box */
.price-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 14px 16px; }
.price-box .total { font-family: Sora, sans-serif; font-size: 24px; color: var(--mint); }
.price-line { display: flex; justify-content: space-between; font-size: 13px; color: #C9D6E2; padding: 2px 0; }
.module-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.module-option { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 600; margin: 0; }
.module-option input { width: auto; margin: 0; accent-color: var(--green); }
.module-option span.price { margin-left: auto; color: var(--muted); font-weight: 500; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(8,22,39,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 50; }
.modal-card { background: var(--card); border-radius: 16px; width: 100%; max-width: 760px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

/* toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--navy); color: #fff; padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; border-left: 4px solid var(--green-2); }
.toast-error { border-left-color: var(--error); }

.steps { background: #0B1F33; color: #C9D6E2; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; font-size: 12px; max-height: 220px; overflow: auto; }
.secret-box { font-family: ui-monospace, monospace; background: #F4F7F9; border: 1px dashed var(--teal); border-radius: 8px; padding: 10px; word-break: break-all; }
.qr { background: #fff; padding: 8px; display: inline-block; border: 1px solid var(--line); border-radius: 8px; }

/* responsive */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .topbar { display: flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; padding: 10px 12px; position: sticky; top: 0; z-index: 30; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .main { padding: 18px 14px 50px; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }
  .modal { padding: 0; }
  .modal-card { border-radius: 0; min-height: 100vh; }
  table.responsive thead { display: none; }
  table.responsive tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; background: #fff; padding: 6px 4px; }
  table.responsive td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 6px 10px; text-align: right; }
  table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; text-align: left; }
  .toolbar input, .toolbar select { width: 100%; }
}
