/* ── NexoDomo Admin — polished light theme ───────────────────────────────── */
:root {
  --navy: #0b1830;
  --navy-2: #0e1f3d;
  --navy-hover: #16294a;
  --blue: #2f5bff;
  --blue-2: #1e40e8;
  --blue-hover: #2447e6;
  --blue-soft: #eef2ff;
  --violet: #7c3aed; --violet-soft: #f1ecfe;
  --bg: #f5f7fc;
  --card: #ffffff;
  --border: #e8ecf4;
  --border-2: #eff2f8;
  --text: #0f1729;
  --text-sec: #586079;
  --muted: #9aa3b8;
  --green: #15924b; --green-soft: #e6f6ed;
  --amber: #c9760a; --amber-soft: #fdf1de;
  --red: #e23b3b;   --red-soft: #fdebeb;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
  --shadow: 0 6px 18px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.04);
  --shadow-lg: 0 28px 70px rgba(11,24,48,.32), 0 8px 20px rgba(11,24,48,.16);
  --ring: 0 0 0 4px rgba(47,91,255,.14);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; letter-spacing: -.1px; }

/* ── Icons (inline line-SVG) ── */
.ico { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.ico-empty { width: 30px; height: 30px; stroke-width: 1.6; }
.ico-inline { width: 14px; height: 14px; vertical-align: -2px; }
.cell-icon { display: inline-flex; align-items: center; gap: 7px; color: var(--text-sec); }
.cell-icon .ico-inline { color: var(--blue); }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
a { color: inherit; text-decoration: none; cursor: pointer; }
code { background: #eef1f6; padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ── Brand ── */
.brand-logo { font-size: 25px; font-weight: 800; letter-spacing: -.5px; color: var(--navy); }
.brand-logo span { color: var(--blue); }
.brand-tag { font-size: 10.5px; letter-spacing: 2.5px; color: var(--muted); text-transform: uppercase; margin-top: 5px; font-weight: 600; }
.brand-badge { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--blue), var(--blue-2)); box-shadow: 0 10px 22px rgba(47,91,255,.35); }
.brand-badge-sm { width: 46px; height: 46px; border-radius: 14px; margin: 0 0 18px; }

/* ── Login: split layout ── */
.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }

/* Brand panel (left) */
.login-brand { position: relative; overflow: hidden; color: #fff; padding: 48px 52px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(120% 80% at 100% 0%, #2747b8 0%, rgba(39,71,184,0) 55%),
    radial-gradient(120% 90% at 0% 100%, #1b2f6b 0%, rgba(27,47,107,0) 55%),
    linear-gradient(155deg, #102a52 0%, #0a1830 60%, #0a1428 100%);
  background-color: #0a1830; }
.login-brand .orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.login-brand .orb-1 { width: 360px; height: 360px; background: #2f5bff; top: -90px; right: -60px; }
.login-brand .orb-2 { width: 300px; height: 300px; background: #1da0ff; bottom: -80px; left: -40px; opacity: .4; }
.login-brand .grid-overlay { position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(80% 70% at 50% 40%, #000 30%, transparent 80%); }
.lb-top, .lb-mid, .lb-foot { position: relative; z-index: 1; }
.lb-top { display: flex; align-items: center; gap: 12px; }
.lb-badge { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.lb-word { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.lb-word span { color: #7aa6ff; }
.lb-mid h1 { font-size: 34px; line-height: 1.18; font-weight: 800; letter-spacing: -1px; max-width: 12ch; }
.lb-features { list-style: none; margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.lb-features li { display: flex; align-items: center; gap: 13px; font-size: 14.5px; color: rgba(255,255,255,.82); }
.lb-features svg { width: 16px; height: 16px; flex-shrink: 0; color: #fff; padding: 6px; box-sizing: content-box;
  background: rgba(122,166,255,.22); border: 1px solid rgba(122,166,255,.35); border-radius: 9px; }
.lb-foot { font-size: 12px; color: rgba(255,255,255,.5); letter-spacing: .3px; }

/* Form panel (right) */
.login-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--card); }
.login-lang { position: absolute; top: 22px; right: 26px; }
.login-form-inner { width: 100%; max-width: 360px; }
.login-form-inner h2 { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.login-form-inner > p.muted { margin: 5px 0 26px; color: var(--text-sec); font-size: 14.5px; }
.login-form-inner label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-sec); margin: 16px 0 7px; }

/* inputs with leading icon */
.input-wrap { position: relative; }
.input-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.login-form-inner input { width: 100%; padding: 13px 14px 13px 42px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 14.5px; font-family: inherit; background: #fbfcfe; transition: border-color .15s, box-shadow .15s, background .15s; }
.login-form-inner input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: var(--ring); }
.btn-block { width: 100%; margin-top: 24px; }

@media (max-width: 920px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
}
.btn-google { background: #fff; color: var(--text); border: 1px solid var(--border); margin-top: 14px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-google:hover { background: #f8fafc; border-color: #d7deea; }
.btn-google:disabled { opacity: .55; cursor: not-allowed; }
.login-or { display: flex; align-items: center; gap: 12px; margin: 20px 0 2px; color: var(--muted); font-size: 12px; }
.login-or::before, .login-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.form-error { background: var(--red-soft); color: var(--red); padding: 10px 13px; border-radius: 10px; font-size: 13px; margin-top: 14px; }
.form-warning { background: var(--amber-soft); color: var(--amber); padding: 10px 13px; border-radius: 10px; font-size: 12px; margin-top: 16px; }

/* ── App shell ── */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 258px; color: #aeb9cf; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; padding: 20px 14px;
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(47,91,255,.18) 0%, rgba(47,91,255,0) 60%),
    linear-gradient(180deg, #0d1d3b 0%, #0a1730 55%, #081020 100%);
  border-right: 1px solid rgba(255,255,255,.05); }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 22px; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.sb-badge { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--blue), var(--blue-2)); box-shadow: 0 6px 14px rgba(47,91,255,.4); }
.sb-name { font-size: 18px; font-weight: 800; letter-spacing: -.3px; color: #fff; line-height: 1.1; }
.sb-name span { color: #6ea0ff; }
.sidebar-brand small { display: block; font-size: 9.5px; letter-spacing: 1.8px; color: #6f7d97; font-weight: 600; margin-top: 2px; text-transform: uppercase; }
.nav { flex: 1; overflow-y: auto; padding-top: 6px; }
.nav-group { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: #56627e; padding: 18px 12px 7px; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #aeb9cf;
  font-size: 13.5px; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; position: relative; }
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; color: #7e8aa6; transition: color .15s; }
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item:hover .nav-ico { color: #b9c6e3; }
.nav-item.active { background: rgba(47,91,255,.16); color: #fff; }
.nav-item.active .nav-ico { color: #7aa6ff; }
.nav-item.active::before { content: ''; position: absolute; left: -14px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); box-shadow: 0 0 12px rgba(47,91,255,.8); }
.nav-logout { margin-top: 8px; color: #8794ad; border-top: 1px solid rgba(255,255,255,.06); border-radius: 10px; padding-top: 14px; }
.nav-logout .nav-ico { color: #7e8aa6; }
.nav-logout:hover { background: rgba(226,59,59,.14); color: #ff9a9a; }
.nav-logout:hover .nav-ico { color: #ff9a9a; }
.nav-badge { margin-left: auto; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700;
  min-width: 19px; height: 19px; padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(226,59,59,.4); }

.main { flex: 1; margin-left: 258px; display: flex; flex-direction: column; min-height: 100vh; }
.topbar { height: 68px; background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px; position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.admin-email { font-size: 13px; color: var(--text-sec); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(140deg, var(--blue), var(--blue-2));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; box-shadow: 0 4px 10px rgba(47,91,255,.35); }
.view { padding: 30px; max-width: 1280px; }

/* ── Language select ── */
.lang-select { appearance: none; -webkit-appearance: none; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 30px 8px 13px; font-size: 13px; font-weight: 600; color: var(--text-sec);
  font-family: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397a1b6' stroke-width='3'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }
.lang-select:hover { border-color: #d7deea; }
.lang-select:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 17px; border-radius: 11px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: background .15s, border-color .15s, transform .08s, box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(140deg, var(--blue), var(--blue-2)); color: #fff; box-shadow: 0 6px 16px rgba(47,91,255,.3); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(47,91,255,.42); }
.btn-ghost { background: var(--card); color: var(--text-sec); border-color: var(--border); }
.btn-ghost:hover { background: #f8fafc; border-color: #d7deea; color: var(--text); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #c92f2f; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 9px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── Page header ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; gap: 16px; }
.page-head h1 { font-size: 23px; font-weight: 800; letter-spacing: -.4px; }
.page-head p { color: var(--text-sec); margin-top: 5px; font-size: 13.5px; }

/* ── Stat cards ── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 20px 22px;
  box-shadow: var(--shadow-sm); transition: transform .14s ease, box-shadow .18s ease, border-color .15s; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--tone, var(--blue)); opacity: .9; }
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.stat-card .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-card .value { font-size: 33px; font-weight: 800; margin-top: 10px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.stat-card .icon { position: absolute; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; background: var(--tone-soft, var(--blue-soft)); color: var(--tone, var(--blue)); }
.stat-card .icon .ico { width: 21px; height: 21px; }
.stat-card.tone-blue   { --tone: var(--blue);   --tone-soft: var(--blue-soft); }
.stat-card.tone-violet { --tone: var(--violet); --tone-soft: var(--violet-soft); }
.stat-card.tone-green  { --tone: var(--green);  --tone-soft: var(--green-soft); }
.stat-card.tone-amber  { --tone: var(--amber);  --tone-soft: var(--amber-soft); }
.stat-card.is-alert { border-color: rgba(201,118,10,.45); }
.stat-card.is-alert .value { color: var(--amber); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.2px; }

/* ── Table ── */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  font-weight: 700; padding: 13px 18px; border-bottom: 1px solid var(--border); background: #fafbfd; }
td { padding: 15px 18px; border-bottom: 1px solid var(--border-2); font-size: 13.5px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: #f7f9ff; }
.cell-strong { font-weight: 600; }
.cell-sub { color: var(--muted); font-size: 12.5px; }

/* ── Pills ── */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 30px; font-size: 11.5px; font-weight: 600; }
.pill-green { background: var(--green-soft); color: var(--green); }
.pill-amber { background: var(--amber-soft); color: var(--amber); }
.pill-red { background: var(--red-soft); color: var(--red); }
.pill-blue { background: var(--blue-soft); color: var(--blue); }
.pill-gray { background: #eef1f6; color: var(--text-sec); }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ── Forms / modal ── */
.overlay { position: fixed; inset: 0; background: rgba(11,24,48,.5); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 500; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); animation: pop .18s cubic-bezier(.2,.8,.3,1.1); }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-head .x { font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; transition: color .15s; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-sec); margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: inherit; background: #fbfcfe; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: var(--ring); }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.field-row { display: flex; gap: 14px; } .field-row .field { flex: 1; }
.check-list { border: 1px solid var(--border); border-radius: 11px; padding: 8px; max-height: 210px; overflow-y: auto; background: #fbfcfe; }
.check-item { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 8px; font-size: 13.5px; cursor: pointer; }
.check-item:hover { background: #eef2fb; }
.check-item input { width: auto; accent-color: var(--blue); }

/* ── Misc ── */
.empty { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty .big { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  background: var(--blue-soft); color: var(--blue); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--blue);
  border-radius: 50%; animation: spin .7s linear infinite; margin: 48px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--navy);
  color: #fff; padding: 13px 22px; border-radius: 30px; font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg);
  opacity: 0; transition: all .3s cubic-bezier(.175,.885,.32,1.275); z-index: 600; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--red); } .toast.success { background: var(--green); }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border-2); font-size: 13.5px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--muted); } .kv .v { font-weight: 600; text-align: right; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.code-box { background: var(--blue-soft); border: 1px dashed rgba(47,91,255,.45); border-radius: 12px; padding: 16px; text-align: center; margin: 10px 0; }
.code-box .pw { font-size: 23px; font-weight: 800; letter-spacing: 2px; color: var(--blue); font-family: ui-monospace, monospace; }
