/* Whitesmoke Panel — calm, light, legible */
:root {
  --bg: #f5f5f5;            /* whitesmoke */
  --surface: #ffffff;
  --border: #e4e4e7;
  --text: #18181b;
  --muted: #71717a;
  --accent: #3f3f46;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.06);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; }
h1, h2 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 650; }
h2 { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
a { color: var(--primary); text-decoration: none; }
.muted { color: var(--muted); margin: .25rem 0 0; font-size: .9rem; }

/* Layout */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 24px;
  position: sticky; top: 0; height: 100vh;
}
.main { padding: 32px 40px; max-width: 1200px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: var(--text); padding: 0 8px; }
.brand-lg { font-size: 1.4rem; padding: 0; justify-content: center; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0 20%, #d4d4d8 45%, #71717a 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

/* Nav */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { color: var(--accent); padding: 8px 10px; border-radius: 8px; font-weight: 500; }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--bg); color: var(--text); box-shadow: inset 3px 0 0 var(--primary); }
.nav a.disabled { color: #a1a1aa; cursor: not-allowed; }
.nav a.disabled:hover { background: none; }
.sidebar-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); display: grid; gap: 4px; font-size: .9rem; }
.sidebar-foot form { margin-top: 8px; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-value { font-size: 2rem; font-weight: 650; margin: 8px 0 10px; font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 0; background: var(--ok); border-radius: 99px; transition: width .4s ease, background .4s; }
.meter span.warn { background: var(--warn); }
.meter span.danger { background: var(--danger); }
.empty { text-align: left; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 500; font-size: .9rem; }
.field input {
  font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.field input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); border-color: var(--primary); }

.btn { font: inherit; font-weight: 600; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--accent); }
.btn-ghost:hover { background: var(--bg); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-block { width: 100%; margin-top: 6px; }

/* Flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; border: 1px solid; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* Auth */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; padding: 32px; text-align: center; }
.auth-card .field { text-align: left; }
.auth-card > .muted { margin-bottom: 22px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar-foot { margin: 0; border: 0; }
  .main { padding: 20px; }
}

/* ---------- Step 3: websites ---------- */
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.crumb { margin: 0 0 4px; font-size: .85rem; color: var(--muted); }
.strong { font-weight: 600; color: var(--text); }
.strong:hover { color: var(--primary); }
.hint { color: var(--muted); font-weight: 400; font-size: .8rem; }

.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafafa; }
.muted-cell { color: var(--muted); }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; border: 1px solid; margin-right: 6px; }
.badge-static  { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.badge-laravel { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.badge-python  { background: #fefce8; color: #a16207; border-color: #fde68a; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.dot-ok { background: var(--ok); }
.dot-off { background: #a1a1aa; }

.form-card { max-width: 720px; }
.field select { font: inherit; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.check { display: flex; gap: 8px; align-items: center; margin: -4px 0 16px; font-size: .9rem; }
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-option { position: relative; display: block; cursor: pointer; }
.type-option input { position: absolute; opacity: 0; }
.type-option span { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; height: 100%; transition: border-color .15s, box-shadow .15s; }
.type-option small { color: var(--muted); font-weight: 400; font-size: .8rem; }
.type-option input:checked + span { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); background: #f8faff; }
.type-option input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
[data-for-type][hidden] { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 14px 0 0; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.danger-zone { border-color: #fecaca; }
.danger-zone h2 { color: var(--danger); }
.delete-form { max-width: 460px; margin-top: 10px; }
.delete-form p { margin: 0 0 14px; font-size: .9rem; }
.page-head form { margin: 0; }

@media (max-width: 760px) {
  .type-grid, .row-2 { grid-template-columns: 1fr; }
}
.card-head { display: flex; justify-content: space-between; align-items: center; }
.site-mini { list-style: none; padding: 0; margin: 12px 0 0; }
.site-mini li { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.site-mini li:last-child { border-bottom: 0; }
.site-mini .strong { margin-right: auto; }

/* ---------- 2FA / settings ---------- */
.section { margin-bottom: 16px; }
.section > p { margin: 12px 0; }
h3 { font-size: 1rem; margin: 0 0 4px; }
.small { font-size: .85rem; }
.warn-text { color: #92400e; font-size: .9rem; }
.flash-warn { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-warn a { color: #92400e; font-weight: 600; text-decoration: underline; }
.pill { font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.pill-ok { background: #dcfce7; color: #166534; }
.pill-warn { background: #fef3c7; color: #92400e; }
.grid-2.tight { margin: 16px 0 0; }
.subcard { border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.subcard .field { margin-top: 10px; }
.narrow-form { max-width: 380px; margin-top: 14px; }
.code-input { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .15em; font-size: 1.05rem; }
.auth-card .code-input { text-align: center; font-size: 1.3rem; }
.auth-card .small { margin: 14px 0 0; }
.steps { padding-left: 20px; margin: 0; display: grid; gap: 22px; }
.steps li { padding-left: 4px; }
.qr-box { margin: 12px 0; display: inline-block; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.qr-box img { display: block; }
details summary { cursor: pointer; color: var(--primary); font-size: .9rem; }
.secret { font-size: 1rem; letter-spacing: .08em; word-break: break-all; user-select: all; }
.inline-form { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.inline-form input { font: inherit; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; width: 160px; }
.codes { list-style: none; padding: 16px; margin: 16px 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 10px 40px; background: var(--bg); border-radius: 8px; }
.codes code { font-size: 1.05rem; background: none; padding: 0; }
.form-actions.left { justify-content: flex-start; border-top: 0; padding-top: 0; }
