/* Same look as the KONNECT+ (Konnect Access) platform: light only, navy #1F263E sidebar,
   navy #364A6F primary, #FCFCFC content, #E6E4F0 borders, Poppins. */
:root {
  --bg: #fcfcfc; --card: #ffffff; --text: #353844; --head: #364a6f; --muted: #949494; --line: #e6e4f0;
  --side: #1f263e; --side-text: rgba(255, 255, 255, .6); --side-active: rgba(255, 255, 255, .08); --side-group: rgba(255, 255, 255, .35);
  --accent: #364a6f; --accent-hover: #2a3d5c; --link: #448df2; --accent-soft: #eef2f8; --gold: #f3bb80;
  --danger: #f56c89; --danger-text: #d93025; --warn: #dba362; --warn-text: #a8722f; --ok: #22c55e; --ok-text: #15803d;
  --warn-bg: #fdf3e6; --danger-bg: #fdecec; --ok-bg: #e7f8ee; --code: #1f263e; --code-text: #dbe4f5;
  --radius: 12px; --shadow: 0 1px 2px rgba(54, 74, 111, .05), 0 4px 14px rgba(54, 74, 111, .05);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.5 Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
h1, h2, h3 { color: var(--head); font-weight: 500; }
a { color: var(--link); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error-text { color: var(--danger-text); min-height: 1.2em; font-size: 13px; }
code, pre, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }

/* login: same as the KONNECT+ platform login (photo background + glass card) */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .1), rgba(0, 0, 0, .1)), url(login-bg.jpg) center / cover no-repeat, #ffffff; }
.login-card { width: 100%; max-width: 891px; min-height: 589px; background: rgba(255, 255, 255, .32);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 20px; padding: 60px 40px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 8px 32px rgba(31, 38, 135, .37); }
.login-logo { margin-bottom: 20px; }
.login-logo img { display: block; width: 340px; max-width: 80vw; height: auto; }
.login-card h1 { font-size: 28px; line-height: 42px; font-weight: 500; color: var(--head); margin: 0 0 40px; text-align: center; }
.login-card form { width: 100%; max-width: 532px; }
.login-card label { font-size: 16px; font-weight: 400; color: var(--text); margin-bottom: 24px; }
.login-card input { height: 44px; margin-top: 3px; background: transparent; border: 1px solid rgba(54, 74, 111, .36); border-radius: 8px; padding: 9px 16px; font-size: 16px; color: var(--text); }
.login-card input:focus { outline: none; border-color: var(--head); background: rgba(255, 255, 255, .1); }
.login-submit { display: block; width: 326px; max-width: 100%; height: 39px; margin: 40px auto 0; background: var(--head); color: #fff; border: 0; border-radius: 8px; font: 400 16px/24px Poppins, sans-serif; cursor: pointer; }
.login-submit:hover { opacity: .9; }
.login-foot { margin-top: 30px; font-size: 12px; color: var(--head); opacity: .7; text-align: center; }

/* layout: KONNECT+ platform chrome */
.app { display: flex; min-height: 100%; }
.side { width: 220px; background: var(--side); color: var(--side-text); padding: 32px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0; scrollbar-width: none; }
.side::-webkit-scrollbar { display: none; }
.brand { margin-bottom: 30px; text-align: center; }
.brand img { display: inline-block; width: 100%; max-width: 184px; height: auto; }
nav .group { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--side-group); margin: 18px 6px 6px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: 15px; transition: color .2s; }
nav a:hover { color: #fff; }
nav a.active { color: #fff; font-weight: 500; background: var(--side-active); }
nav a svg { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 1.5; }
nav .badge { margin-left: auto; background: #e32828; color: #fff; border-radius: 10px; padding: 0 7px; font-size: 11px; }
.side-foot { margin-top: auto; padding: 18px 6px 0; font-size: 12px; display: flex; justify-content: space-between; color: var(--side-group); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 0 24px; height: 92px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top h1 { font-size: 18px; line-height: 27px; margin: 0; font-weight: 500; color: var(--head); }
.top .sub { font-size: 14px; color: var(--muted); line-height: 21px; }
.top-right { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.view { padding: 24px; max-width: 1320px; width: 100%; }
.top .menu { display: none; }

/* bits */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 20px; font-size: 12px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); border-color: transparent; font-weight: 600; }
.pill.ok { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; }
.pill.bad { background: var(--danger-bg); color: var(--danger-text); border-color: transparent; }
.pending { position: sticky; top: 92px; z-index: 4; background: linear-gradient(90deg, #dba362, #efbc85); color: #3b2a12; padding: 10px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pending .btn { background: #fff; color: var(--warn-text); border-color: #fff; }

.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 18px 20px; margin-bottom: 18px; }
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .spacer { flex: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 18px; }
.stat { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px 18px; }
.stat .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.stat .v { font-size: 24px; font-weight: 600; margin-top: 4px; color: var(--head); }
.stat .s { font-size: 12px; color: var(--muted); }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--head); padding: 8px 16px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger-text); }
.btn.ghost { background: transparent; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; margin-top: 8px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { border: 0; background: transparent; cursor: pointer; padding: 4px; border-radius: 6px; color: var(--muted); display: inline-flex; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.err td { background: var(--danger-bg); }
tr.off td { opacity: .5; }
.tag { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; margin: 1px 2px 1px 0; font-size: 12px; }
.act-accept { color: var(--ok-text); font-weight: 600; }
.act-drop, .act-reject { color: var(--danger-text); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 26px; }

/* forms */
label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 12px; }
label .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--text); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(54,74,111,.18); border-color: var(--accent); }
input[type=checkbox] { display: inline; width: auto; margin: 0 6px 0 0; }
.check { display: flex; align-items: center; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.multi { border: 1px solid var(--line); border-radius: 7px; padding: 6px 10px; margin-top: 4px; max-height: 150px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 400; }
.multi label { margin: 0; font-weight: 400; display: flex; align-items: center; }
.objlist { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; margin-top: 4px; }
.objlist .orow { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) 32px; gap: 8px; align-items: end; margin-bottom: 8px; }
.objlist .orow label { margin: 0; font-weight: 400; font-size: 12px; }

/* issues */
.issues { list-style: none; padding: 0; margin: 0 0 14px; }
.issues li { padding: 7px 10px; border-radius: 7px; margin-bottom: 6px; font-size: 13px; display: flex; gap: 8px; }
.issues li.error { background: var(--danger-bg); color: var(--danger-text); }
.issues li.warning { background: var(--warn-bg); color: var(--warn-text); }
.issues .path { font-family: ui-monospace, Consolas, monospace; opacity: .8; }

pre.code { background: var(--code); color: var(--code-text); padding: 14px 16px; border-radius: 8px; overflow: auto; max-height: 70vh; margin: 0; white-space: pre; }
.diff .add { color: #5fd38d; } .diff .del { color: #ff7b7b; } .diff .hunk { color: #6fb6ff; }
.tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--card); color: var(--muted); padding: 6px 12px; border-radius: 7px; cursor: pointer; font: inherit; }
.tabs button.on { background: var(--head); color: #fff; border-color: var(--head); }

/* modal + toast */
.modal { position: fixed; inset: 0; background: rgba(23, 35, 59, .6); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal-card { background: var(--card); border-radius: 12px; width: 100%; max-width: 720px; max-height: 90vh; overflow-y: auto; padding: 22px 24px; }
.modal-card h3 { margin: 0 0 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--side); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 30; max-width: 420px; }
.toast.bad { background: var(--danger-text); }

.steps { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.steps span { padding: 4px 12px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.steps span.on { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 860px) {
  .side { position: fixed; left: -240px; z-index: 15; transition: left .2s; }
  .side.open { left: 0; }
  .top .menu { display: inline-flex; }
  .top { padding: 0 16px; height: 64px; }
  .pending { top: 64px; }
  .login-card { padding: 40px 20px; min-height: 0; }
  .view { padding: 16px; }
  #mode-pill { display: none; }
}
