/* SwarnaOs client portal: full-screen software layout.
   Colours come from the client's config (CSS variables), so a new client = new colours, no code change. */
:root {
  --gold: #c9a13b; --accent: #e3c067; --dark: #14100a; --ivory: #fbf7ee;
  --ink: #2a2418; --muted: #6f5f43; --line: #e8dcc0; --cream: #f6edd3; --soft: #d8c99f;
  --ok: #1e6b3b; --ok-bg: #eaf6ee; --ok-line: #7bc495; --bad: #9a3a14; --bad-bg: #fcefe8; --bad-line: #e0a07a;
  --side: 272px; --head: 84px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ivory); color: var(--ink); font-family: 'Manrope', system-ui, sans-serif; font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: 'Cormorant Garamond', Georgia, serif; margin: 0; line-height: 1.1; }
a { color: #7a5a12; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #7a5a12; outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- app frame: header + side stay fixed, only the middle scrolls ---------- */
.app { display: grid; grid-template-columns: var(--side) 1fr; grid-template-rows: var(--head) 1fr; height: 100vh; height: 100dvh; overflow: hidden; }
.brand { grid-area: 1 / 1; background: linear-gradient(145deg, #1d1710, #0b0906); border-bottom: 1px solid #3a2f12; display: flex; align-items: center; justify-content: center; padding: 0 14px; z-index: 30; }
.brand img { height: 76px; width: auto; display: block; }
/* a client's own logo sits on a light plate so dark logos stay readable on the dark panel */
.brand img.plate { height: 60px; max-width: 88%; object-fit: contain; background: var(--ivory); border-radius: 10px; padding: 6px 12px; }
.login img.plate { background: var(--ivory); border-radius: 12px; padding: 10px 16px; object-fit: contain; max-height: 110px; }
.topbar { grid-area: 1 / 2; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(90, 65, 10, .10); display: flex; align-items: center; gap: 14px; padding: 0 24px; z-index: 30; min-width: 0; }
.topbar .title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topbar .title b { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 25px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title span { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.spacer { flex: 1 1 auto; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .06em; white-space: nowrap; border: 1px solid; }
.pill.engine { background: var(--dark); border-color: #b8892b; color: var(--accent); }
.pill.safe { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.pill.warn { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: #4cd48a; display: inline-block; animation: swpulse 1.8s ease-in-out infinite; }
@keyframes swpulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(1.55); } }
.menu-btn { display: none; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); align-items: center; justify-content: center; }
.user { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 999px; background: var(--dark); border: 1px solid #b8892b; color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.user small { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.user b { font-size: 13px; line-height: 1.2; display: block; }

.side { grid-area: 2 / 1; background: linear-gradient(180deg, #1a140d, #0b0906); color: var(--cream); display: flex; flex-direction: column; gap: 12px; padding: 14px 14px 10px; overflow: hidden; min-height: 0; z-index: 25; border-right: 1px solid #3a2f12; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #5a4720 transparent; }
.nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; border-radius: 10px; color: var(--soft); font-weight: 600; font-size: 15px; border: 1px solid transparent; }
.nav a:hover { background: rgba(227, 192, 103, .08); color: var(--cream); }
.nav a.active { background: rgba(227, 192, 103, .16); border-color: rgba(227, 192, 103, .45); color: var(--accent); }
.pins { flex: none; display: flex; flex-direction: column; gap: 10px; }
.pin { border: 1px solid #b8892b; border-radius: 14px; padding: 14px; background: rgba(227, 192, 103, .07); display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.pin::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, #b8892b, #f0d68a, #b8892b); }
.pin h4 { margin: 0; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.pin .big { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 26px; font-weight: 700; line-height: 1; color: var(--cream); }
.pin .small { font-size: 12px; color: var(--soft); }
.pin .row2 { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--soft); }
.pin .row2 b { color: var(--cream); }
.pin.alert { border-color: #e0a07a; background: rgba(224, 160, 122, .12); }
.side .foot { flex: none; font-size: 11px; color: #a89a74; text-align: center; letter-spacing: .06em; }
@media (max-height: 820px) { .nav a { min-height: 40px; } .pin { padding: 10px 12px; gap: 5px; } .pin .big { font-size: 22px; } .pin .row2 { font-size: 11px; } .side .foot { display: none; } }
@media (max-height: 700px) { .pin .row2 { display: none; } .pin .small { display: none; } }
@media (max-width: 1280px) { .pill.engine { display: none; } }

.main { grid-area: 2 / 2; overflow-y: auto; overflow-x: hidden; position: relative; scroll-behavior: smooth; }
.watermark { position: fixed; top: var(--head); left: var(--side); right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 0; }
.watermark img { width: min(760px, 62%); height: auto; opacity: .10; }
.page { position: relative; z-index: 1; padding: 28px 36px 56px; display: flex; flex-direction: column; gap: 28px; width: 100%; }

/* ---------- cards ---------- */
.card { position: relative; overflow: hidden; padding: 24px; border-radius: 16px; background: rgba(255, 253, 247, .84); border: 1px solid #dcc78a; box-shadow: 0 4px 14px rgba(90, 65, 10, .10); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, #b8892b, #f0d68a, #b8892b); }
.card.dark { background: linear-gradient(145deg, #1d1710, #0b0906); border-color: #b8892b; color: var(--cream); box-shadow: 0 10px 30px rgba(60, 40, 5, .25); }
.card.dark .muted { color: var(--soft); }
.card .wm { position: absolute; right: -50px; bottom: -34px; width: 270px; opacity: .08; pointer-events: none; }
.muted { color: var(--muted); }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.sec-head .t { display: flex; align-items: center; gap: 14px; }
.sec-head .bar { width: 34px; height: 2px; background: linear-gradient(90deg, #b8892b, #f0d68a); }
.sec-head h2 { font-size: 32px; font-weight: 700; }
.sec-head .hint { font-size: 13px; color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 22px; align-items: stretch; }
.row > * { flex: 1 1 380px; }
.badge { width: 58px; height: 58px; border-radius: 999px; flex: none; background: linear-gradient(145deg, #1d1710, #0b0906); border: 2px solid #c9a13b; box-shadow: 0 0 0 4px var(--cream); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.badge.sm { width: 44px; height: 44px; box-shadow: none; }
.badge.ghost { background: rgba(227, 192, 103, .12); border: 1px solid var(--accent); box-shadow: none; }
.chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; border: 1px solid; white-space: nowrap; }
.chip.live, .chip.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.chip.soon { color: var(--muted); background: #f6efde; border-color: #e3d5ae; }
.chip.bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }
.chip.gold { color: #7a5a12; background: #f6edd3; border-color: #e6d6a8; }

/* ---------- buttons ---------- */
.btn { min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid; font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn.dark { background: linear-gradient(145deg, #1d1710, #0b0906); border-color: #b8892b; color: var(--accent); }
.btn.gold { background: var(--accent); border-color: #f0d68a; color: #2a2005; }
.btn.ghost { background: transparent; border-color: #b8892b; color: var(--accent); }
.btn.line { background: #fff; border-color: #b8892b; color: #7a5a12; }
.btn.danger { background: #fff; border-color: #c0562a; color: var(--bad); min-height: 44px; padding: 0 16px; font-size: 13px; }
.btn.danger.arm { background: var(--bad); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.refresh .count { min-width: 20px; height: 20px; border-radius: 999px; background: var(--accent); color: #2a2005; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.spin svg { animation: sw-spin .9s linear infinite; }
@keyframes sw-spin { to { transform: rotate(360deg); } }

/* ---------- home ---------- */
.hero { padding: 34px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 28px; }
.hero .txt { flex: 1 1 380px; display: flex; flex-direction: column; gap: 14px; position: relative; }
.hero .eyebrow { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.hero h1 { font-size: 48px; font-weight: 700; color: var(--cream); }
.hero p { margin: 0; font-size: 16px; color: var(--soft); max-width: 540px; }
.hero .logo { flex: 1 1 280px; display: flex; justify-content: center; position: relative; }
.hero .logo img { width: 100%; max-width: 330px; }
.hero .logo img.plate { max-width: 300px; max-height: 150px; object-fit: contain; background: var(--ivory); border-radius: 16px; padding: 18px 24px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.kpi { flex-direction: row; align-items: center; gap: 16px; padding: 20px; }
.kpi .v { font-family: 'Cormorant Garamond', Georgia, serif; font-size: 38px; font-weight: 700; line-height: 1; }
.kpi .l { font-size: 12px; color: var(--muted); }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 14px 18px; border-radius: 12px; border: 1px solid #e0a56a; background: #fcf0e0; color: #5a3407; font-weight: 600; }
.banner.stop { border-color: var(--bad-line); background: var(--bad-bg); color: #6b2208; }
.pipe { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 18px; padding-top: 4px; }
.pipe::before { content: ''; position: absolute; left: 8%; right: 8%; top: 34px; border-top: 2px dashed #c9a13b; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.step .badge { box-shadow: 0 0 0 6px #fbf7ee; width: 60px; height: 60px; }
.step b { font-size: 14px; }
.step span { font-size: 12px; color: var(--muted); }
.console { border-radius: 12px; background: #0b0906; border: 1px solid #b8892b; padding: 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.9; color: var(--soft); }
.console .h { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: .14em; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.console .g { color: #4cd48a; } .console .r { color: #ff9b73; } .console .y { color: var(--accent); }

/* ---------- tools ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }
.tool { transition: transform .2s ease, box-shadow .2s ease; }
.tool:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(90, 65, 10, .22); }
.tool .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tool .id { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.tool h3 { font-size: 27px; font-weight: 700; }
.tool p { margin: 0; color: #5e5036; font-size: 14px; min-height: 42px; }
.locked { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; min-height: 46px; }

/* ---------- security ---------- */
.checks { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--soft); }
.checks div { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { flex: none; margin-top: 2px; color: #4cd48a; }
.drop { border: 2px dashed #b8892b; border-radius: 14px; padding: 30px 18px; text-align: center; background: rgba(246, 237, 211, .5); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.drop.drag { background: rgba(227, 192, 103, .3); border-style: solid; }
.drop.off { opacity: .55; }
.result { border-radius: 12px; padding: 14px 16px; border: 1px solid; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.result.clean { background: var(--ok-bg); border-color: var(--ok-line); color: #14502b; }
.result.blocked { background: var(--bad-bg); border-color: var(--bad-line); color: #6b2208; }
.result ul { margin: 0; padding-left: 20px; }
.q-item { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 0; border-top: 1px solid #efe4c6; }
.q-item .nm { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.q-item .nm b { word-break: break-all; }
.q-item .nm span { font-size: 13px; color: var(--muted); }
.ok-line { color: var(--ok); font-weight: 600; padding: 14px 0; border-top: 1px solid #efe4c6; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 8px 6px; }
.tbl td { padding: 10px 6px; border-top: 1px solid #efe4c6; vertical-align: top; }
.log { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 10px 0; border-top: 1px solid #efe4c6; font-size: 14px; }
.log .w { color: var(--muted); min-width: 140px; }

/* ---------- misc ---------- */
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; max-width: 380px; padding: 14px 18px; border-radius: 12px; background: var(--dark); color: var(--cream); border: 1px solid #b8892b; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); font-weight: 600; }
.toast.error { border-color: var(--bad-line); }
.login { position: fixed; inset: 0; z-index: 200; background: radial-gradient(circle at 50% 30%, #2a2010, #0b0906 70%); display: flex; align-items: center; justify-content: center; padding: 20px; }
.login form { width: min(420px, 100%); background: rgba(20, 16, 10, .92); border: 1px solid #b8892b; border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 14px; color: var(--cream); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.login img { width: 240px; max-width: 100%; align-self: center; }
.login label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.login input, .field { min-height: 46px; border-radius: 10px; border: 1px solid #b8892b; background: #fff; color: var(--ink); padding: 0 14px; font-size: 16px; font-family: inherit; width: 100%; }
.login .err { color: #ff9b73; font-size: 14px; min-height: 20px; }
textarea.field { min-height: 90px; padding: 10px 14px; }
.scrim { display: none; }

@media (max-width: 900px) {
  :root { --side: 0px; }
  .app { grid-template-columns: 1fr; }
  .brand { grid-area: 1 / 1; display: none; }
  .topbar { grid-area: 1 / 1; padding: 0 14px; }
  .menu-btn { display: inline-flex; }
  .main { grid-area: 2 / 1; }
  .side { position: fixed; top: var(--head); left: 0; bottom: 0; width: 284px; transform: translateX(-100%); transition: transform .2s ease; }
  .side.open { transform: none; box-shadow: 10px 0 30px rgba(0, 0, 0, .4); }
  .scrim.show { display: block; position: fixed; inset: var(--head) 0 0 0; background: rgba(0, 0, 0, .45); z-index: 24; }
  .watermark { left: 0; }
  .page { padding: 20px 16px 48px; }
  .hero h1 { font-size: 38px; }
  .pill.engine, .pill.safe, .user div, .topbar .title span, .spacer { display: none; }
  .topbar .title { flex: 1 1 auto; }
  .topbar .title b { font-size: 22px; }
  .pipe::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .dot, .spin svg, .tool { animation: none; transition: none; } }
