/* ============================================================================
   RKR NETWORKS — ID PORTAL DESIGN SYSTEM
   Vanilla CSS. No build, no CDN. Enterprise SaaS dashboard.
   Brand: teal #008080 · dark teal #044D4D · ink #182828
   ========================================================================== */

/* ------------------------------ Reset ----------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1,h2,h3,h4,h5,p,figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
[hidden] { display: none !important; }

/* ------------------------------ Tokens ---------------------------------- */
:root {
  --teal:        #008080;
  --teal-600:    #0A6E6E;
  --teal-700:    #055C5C;
  --teal-800:    #044D4D;
  --teal-900:    #033A3A;
  --teal-tint:   #E9F4F4;
  --teal-tint-2: #D4EAEA;
  --accent:      #12B5A5;   /* brighter interactive teal */

  --ink:      #182828;
  --ink-2:    #33484A;
  --muted:    #5F7577;
  --faint:    #8A9EA0;

  --bg:       #F4F7F7;
  --surface:  #FFFFFF;
  --surface-2:#F9FBFB;
  --line:     #E1E9E9;
  --line-2:   #EDF2F2;

  --gold:     #C9A44C;
  --green:    #1E9E6A;  --green-bg: #E6F5EE;
  --amber:    #C58A17;  --amber-bg: #FBF1DC;
  --red:      #C6483C;  --red-bg:   #FBE7E4;
  --blue:     #2C6FB0;  --blue-bg:  #E7F0F9;
  --slate:    #5F7577;  --slate-bg: #EDF1F1;
  --violet:   #6B4FBB;  --violet-bg:#EEE9F9;

  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(24,40,40,.06);
  --shadow-sm: 0 1px 3px rgba(24,40,40,.07), 0 1px 2px rgba(24,40,40,.04);
  --shadow-md: 0 6px 18px -6px rgba(20,50,50,.16), 0 2px 6px rgba(20,50,50,.06);
  --shadow-lg: 0 24px 50px -18px rgba(10,45,45,.32), 0 8px 20px -12px rgba(10,45,45,.20);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --sidebar-w: 250px;
  --topbar-h: 62px;
}

/* ------------------------------ Base ------------------------------------ */
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

/* ------------------------------ Boot ------------------------------------ */
.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; color: var(--muted);
}
.boot-mark { filter: drop-shadow(0 6px 14px rgba(4,77,77,.28)); }
.boot-spin {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid var(--teal-tint-2); border-top-color: var(--teal);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================================
   AUTH / LOGIN
   ========================================================================== */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  background: var(--bg);
}
.auth-aside {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(64,224,208,.22), transparent 60%),
    linear-gradient(150deg, var(--teal-900), var(--teal-800) 45%, #06615F 100%);
  color: #EAF6F6;
  padding: 56px 60px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.auth-aside .topo-field { position: absolute; inset: 0; opacity: .5; pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.auth-brand .wm { font-weight: 800; letter-spacing: -.01em; font-size: 20px; }
.auth-brand .wm small { display: block; font-weight: 500; font-size: 11px; letter-spacing: .22em; color: rgba(234,246,246,.65); }
.auth-hero { position: relative; z-index: 2; max-width: 30ch; }
.auth-hero h1 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.08; letter-spacing: -.02em; font-weight: 800; }
.auth-hero p { margin-top: 16px; color: rgba(234,246,246,.8); font-size: 15px; }
.auth-foot { position: relative; z-index: 2; font-size: 12px; color: rgba(234,246,246,.6); font-family: var(--mono); letter-spacing: .04em; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px; }
.auth-card {
  width: 100%; max-width: 380px;
}
.auth-card .field-mark { display: none; }
.auth-card h2 { font-size: 24px; letter-spacing: -.02em; font-weight: 750; }
.auth-card .sub { color: var(--muted); margin-top: 6px; margin-bottom: 26px; font-size: 14px; }

/* ============================================================================
   APP SHELL
   ========================================================================== */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "brand topbar" "side main";
  min-height: 100vh;
}

/* --- Brand corner --- */
.brandcell {
  grid-area: brand;
  display: flex; align-items: center; gap: 11px;
  padding: 0 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.brandcell .wm { font-weight: 800; letter-spacing: -.01em; font-size: 16px; color: var(--ink); }
.brandcell .wm small { display: block; font-family: var(--mono); font-weight: 600; font-size: 9.5px; letter-spacing: .2em; color: var(--teal); }

/* --- Topbar --- */
.topbar {
  grid-area: topbar;
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar .crumbs { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar .crumbs strong { color: var(--ink); font-weight: 650; }
.topbar .crumbs .sep { color: var(--faint); }
.topbar .spacer { flex: 1; }

.iconbtn {
  width: 38px; height: 38px; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted);
  border: 1px solid transparent; transition: .15s;
}
.iconbtn:hover { background: var(--teal-tint); color: var(--teal-800); }

/* user menu */
.usermenu { position: relative; }
.usermenu > button {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  transition: .15s;
}
.usermenu > button:hover { border-color: var(--teal-tint-2); background: var(--surface-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff;
  background: linear-gradient(140deg, var(--teal), var(--teal-800));
}
.usermenu .who { text-align: left; line-height: 1.15; }
.usermenu .who b { font-size: 13px; font-weight: 650; display: block; }
.usermenu .who span { font-size: 11px; color: var(--muted); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 40;
  min-width: 216px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 8px; animation: pop .12s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dropdown .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.dropdown .dd-head b { display: block; font-size: 13px; }
.dropdown .dd-head span { font-size: 12px; color: var(--muted); }
.dropdown button {
  width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px;
  font-size: 13.5px; color: var(--ink-2); display: flex; align-items: center; gap: 9px;
}
.dropdown button:hover { background: var(--teal-tint); color: var(--teal-800); }

/* --- Sidebar --- */
.sidebar {
  grid-area: side;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 14px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
}
.nav-group { margin-top: 14px; }
.nav-group:first-child { margin-top: 0; }
.nav-group > .lbl { padding: 6px 12px 8px; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-size: 14px; font-weight: 550;
  transition: .13s; position: relative;
}
.navlink:hover { background: var(--surface-2); color: var(--ink); }
.navlink.active { background: var(--teal-tint); color: var(--teal-800); font-weight: 650; }
.navlink.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--teal);
}
.navlink .ico { width: 18px; height: 18px; flex: none; }
.navlink .count { margin-left: auto; font-size: 11px; font-weight: 700; color: #fff; background: var(--teal); padding: 1px 7px; border-radius: 999px; font-family: var(--mono); }
.sidebar .grow { flex: 1; }
.side-card {
  margin-top: 10px; padding: 14px; border-radius: 12px;
  background: linear-gradient(155deg, var(--teal-800), var(--teal-900));
  color: #E6F4F4;
}
.side-card b { font-size: 13px; display: block; }
.side-card p { font-size: 12px; color: rgba(230,244,244,.75); margin-top: 3px; margin-bottom: 10px; }

/* --- Main --- */
.main { grid-area: main; overflow-y: auto; }
.page { max-width: 1180px; margin: 0 auto; padding: 26px 30px 64px; }
.page-head { display: flex; align-items: flex-end; gap: 18px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .titles h1 { font-size: 24px; letter-spacing: -.02em; font-weight: 750; }
.page-head .titles p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600; letter-spacing: -.005em;
  border: 1px solid transparent; transition: .15s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn .ico { width: 17px; height: 17px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: var(--shadow-xs); }
.btn-primary:hover:not(:disabled) { background: var(--teal-700); }
.btn-primary:active { background: var(--teal-800); }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--teal-tint-2); background: var(--surface-2); color: var(--teal-800); }
.btn-subtle { background: var(--teal-tint); color: var(--teal-800); }
.btn-subtle:hover:not(:disabled) { background: var(--teal-tint-2); }
.btn-danger { background: var(--surface); border-color: var(--red-bg); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(.94); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after {
  content: ""; position: absolute; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; animation: spin .6s linear infinite;
}
.btn-ghost.loading::after, .btn-subtle.loading::after { border-color: rgba(4,77,77,.35); border-top-color: var(--teal); }

/* ============================================================================
   FORMS
   ========================================================================== */
.field { margin-bottom: 15px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; font-family: var(--mono); }
.field .hint.err { color: var(--red); font-family: var(--sans); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 13px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font-size: 14px; transition: .15s;
}
.textarea { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,128,128,.14);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235F7577' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.input-wrap { position: relative; }
.input-wrap .pfx {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 13px; color: var(--teal-700); pointer-events: none;
}
.input-wrap .input { padding-left: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.filedrop {
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px;
  display: flex; align-items: center; gap: 13px; background: var(--surface-2);
  transition: .15s; cursor: pointer;
}
.filedrop:hover { border-color: var(--teal-tint-2); background: var(--teal-tint); }
.filedrop .ph { width: 46px; height: 46px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--teal); flex: none; overflow: hidden; }
.filedrop .ph img { width: 100%; height: 100%; object-fit: cover; }
.filedrop .txt b { font-size: 13.5px; }
.filedrop .txt span { font-size: 12px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line);
  position: relative; transition: .16s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: .16s;
}
.switch input:checked + .track { background: var(--teal); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(0,128,128,.2); }

/* ============================================================================
   CARDS / PANELS
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 12px;
}
.card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.card-head .sub { font-size: 12.5px; color: var(--muted); }
.card-head .spacer { flex: 1; }

/* KPI tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kpi .ico-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.kpi .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.kpi .val { font-size: 30px; font-weight: 780; letter-spacing: -.03em; line-height: 1; font-family: var(--mono); }
.kpi .foot { font-size: 12px; color: var(--faint); margin-top: 8px; }
.kpi .foot b { color: var(--teal-700); font-weight: 700; }
.kpi.accent { background: linear-gradient(155deg, var(--teal-800), var(--teal-900)); border-color: transparent; color: #EAF6F6; }
.kpi.accent .lbl { color: rgba(234,246,246,.8); }
.kpi.accent .foot { color: rgba(234,246,246,.65); }
.kpi.accent .foot b { color: #fff; }

/* pool meter */
.meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,.18); overflow: hidden; margin-top: 12px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #40E0D0, #8AF0E4); }
.kpi:not(.accent) .meter { background: var(--teal-tint-2); }
.kpi:not(.accent) .meter > i { background: linear-gradient(90deg, var(--teal), var(--teal-600)); }

/* ============================================================================
   TABLES
   ========================================================================== */
.table-wrap { overflow-x: auto; }
table.tbl { min-width: 620px; }
.tbl thead th {
  text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.tbl tbody td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); font-size: 13.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover { background: var(--teal-tint); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .nm { font-weight: 650; color: var(--ink); }
.tbl .sub { font-size: 12px; color: var(--muted); }
.cell-id { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.cell-person { display: flex; align-items: center; gap: 10px; }
.cell-person .avatar { width: 32px; height: 32px; font-size: 12px; }

/* ============================================================================
   PILLS / BADGES / CHIPS
   ========================================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 650;
  letter-spacing: .01em; white-space: nowrap; line-height: 1.5;
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-draft   { color: var(--slate); background: var(--slate-bg); }
.pill-pending { color: var(--amber); background: var(--amber-bg); }
.pill-approved{ color: var(--green); background: var(--green-bg); }
.pill-issued  { color: var(--blue);  background: var(--blue-bg); }
.pill-rejected{ color: var(--red);   background: var(--red-bg); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 7px; font-size: 11.5px; font-weight: 650;
  font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase;
  border: 1px solid; line-height: 1.6;
}
.chip .sw { width: 8px; height: 8px; border-radius: 2px; }
.chip-role { color: var(--ink-2); border-color: var(--line); background: var(--surface-2); }

.tag { display: inline-flex; padding: 2px 8px; border-radius: 6px; font-size: 11px; font-weight: 650; background: var(--teal-tint); color: var(--teal-800); }
.tag-gold { background: #F7EFD6; color: #8A6D1E; }

/* ============================================================================
   TABS
   ========================================================================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: .13s;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--teal-800); border-bottom-color: var(--teal); }
.tab .n { font-size: 11px; font-family: var(--mono); background: var(--surface-2); border: 1px solid var(--line); padding: 0 6px; border-radius: 999px; }
.tab.active .n { background: var(--teal-tint); border-color: var(--teal-tint-2); color: var(--teal-800); }

/* ============================================================================
   BUILDER (new card)
   ========================================================================== */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px); gap: 24px; align-items: start; }
.builder .preview-col { position: sticky; top: 20px; }
.preview-stage {
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(0,128,128,.06), transparent 70%),
    var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.card-faces { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.card-face { width: 190px; }
.card-face .svg-hold {
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-md);
  background: #0c1a1a; aspect-ratio: 60 / 91.6;
}
.card-face .svg-hold svg { width: 100%; height: 100%; }
.card-face .cap { text-align: center; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-top: 9px; }
.preview-note { margin-top: 16px; padding: 11px 13px; border-radius: 10px; background: var(--teal-tint); color: var(--teal-800); font-size: 12px; display: flex; gap: 8px; align-items: flex-start; }
.preview-note svg { flex: none; margin-top: 1px; }

.form-section { margin-bottom: 22px; }
.form-section > .sec-lbl { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.form-section > .sec-lbl .n { width: 20px; height: 20px; border-radius: 6px; background: var(--teal-tint); color: var(--teal-800); font-family: var(--mono); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.form-section > .sec-lbl b { font-size: 13px; }

/* theme swatch picker */
.theme-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.theme-opt { cursor: pointer; text-align: center; }
.theme-opt .sw { height: 34px; border-radius: 8px; border: 2px solid transparent; box-shadow: var(--shadow-xs); transition: .13s; }
.theme-opt.on .sw { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,128,128,.16); }
.theme-opt .nm { font-size: 9.5px; color: var(--muted); margin-top: 4px; font-family: var(--mono); letter-spacing: .04em; }

/* ============================================================================
   PACKAGE DETAIL
   ========================================================================== */
.detail-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
.detail-preview { position: sticky; top: 20px; }
.big-faces { display: grid; gap: 16px; }
.big-face { border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md); background: #0c1a1a; aspect-ratio: 60 / 91.6; position: relative; }
.big-face img { width: 100%; height: 100%; object-fit: contain; }
.big-face .lbl { position: absolute; top: 10px; left: 10px; font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; background: rgba(0,0,0,.4); color: #fff; padding: 3px 8px; border-radius: 6px; backdrop-filter: blur(4px); }
.face-skel { position: absolute; inset: 0; background: linear-gradient(100deg, #0c1a1a 30%, #14302f 50%, #0c1a1a 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line-2); border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); }
.meta-list .m { background: var(--surface); padding: 12px 14px; }
.meta-list .m .k { font-size: 11px; color: var(--muted); font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.meta-list .m .v { font-size: 13.5px; font-weight: 600; margin-top: 3px; }
.meta-list .m.full { grid-column: 1 / -1; }

.actionbar { display: flex; gap: 10px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--line-2); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.dl-row { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 9px;
  border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--surface); transition: .13s;
}
.dl-chip:hover { border-color: var(--teal-tint-2); background: var(--teal-tint); color: var(--teal-800); }

/* Audit timeline */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item .dot {
  position: absolute; left: -26px; top: 1px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center;
}
.tl-item .dot svg { width: 11px; height: 11px; }
.tl-item.ok .dot { border-color: var(--green); color: var(--green); }
.tl-item.no .dot { border-color: var(--red); color: var(--red); }
.tl-item.go .dot { border-color: var(--teal); color: var(--teal); }
.tl-item .act { font-size: 13.5px; font-weight: 650; }
.tl-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-item .note { margin-top: 7px; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; font-size: 13px; color: var(--ink-2); }

/* ============================================================================
   TOPOLOGY LIBRARY
   ========================================================================== */
.topo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.topo-tile {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px; box-shadow: var(--shadow-xs); transition: .14s;
}
.topo-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.topo-tile .viz { border-radius: 8px; overflow: hidden; background: #071717; aspect-ratio: 56 / 34; }
.topo-tile .viz svg { width: 100%; height: 100%; }
.topo-tile .cap { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 6px; }
.topo-tile .cap .nm { font-size: 12px; font-weight: 650; }
.topo-tile .cap .ix { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.topo-tile .who { font-size: 10.5px; color: var(--muted); margin-top: 3px; font-family: var(--mono); }
.topo-tile.used { opacity: .96; }
.topo-tile.used .viz { filter: grayscale(.55) brightness(.82); }
.topo-tile.used .cap .nm::after { content: "· in use"; color: var(--amber); font-weight: 600; font-size: 10px; margin-left: 4px; }

/* ============================================================================
   MODALS
   ========================================================================== */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: rgba(15,35,35,.44);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px;
  animation: fade .14s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; animation: rise .18s cubic-bezier(.2,.7,.3,1);
}
.modal.wide { max-width: 560px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.modal-head p { color: var(--muted); font-size: 13.5px; margin-top: 5px; }
.modal-body { padding: 18px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================================
   TOASTS
   ========================================================================== */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: 11px; box-shadow: var(--shadow-lg); animation: slidein .2s ease;
}
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } }
.toast.out { animation: slideout .2s ease forwards; }
@keyframes slideout { to { opacity: 0; transform: translateX(20px); } }
.toast.ok { border-left-color: var(--green); }
.toast.err { border-left-color: var(--red); }
.toast .t-ico { flex: none; margin-top: 1px; }
.toast.ok .t-ico { color: var(--green); }
.toast.err .t-ico { color: var(--red); }
.toast .t-body b { font-size: 13.5px; display: block; }
.toast .t-body span { font-size: 12.5px; color: var(--muted); }

/* ============================================================================
   EMPTY / LOADING STATES
   ========================================================================== */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .ico { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: var(--teal-tint); color: var(--teal); display: grid; place-items: center; }
.empty b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { font-size: 13.5px; max-width: 34ch; margin: 0 auto 16px; }

.skel { background: linear-gradient(100deg, var(--line-2) 30%, #F3F7F7 50%, var(--line-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
.skel-row { height: 46px; margin-bottom: 1px; }

.center-load { display: grid; place-items: center; padding: 70px 0; gap: 14px; color: var(--muted); }
.center-load .boot-spin { width: 30px; height: 30px; }

/* ============================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .builder { grid-template-columns: 1fr; }
  .builder .preview-col { position: static; order: -1; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-preview { position: static; }
  .big-faces { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-w: 0px; }
  .shell { grid-template-columns: 1fr; grid-template-areas: "topbar" "main"; }
  .brandcell { display: none; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 90;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.nav-open .sidebar { transform: none; }
  .nav-scrim { position: fixed; inset: 0; z-index: 80; background: rgba(15,35,35,.4); display: none; }
  body.nav-open .nav-scrim { display: block; }
  .menu-toggle { display: grid !important; }
  .page { padding: 20px 16px 56px; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (min-width: 861px) { .menu-toggle { display: none; } .nav-scrim { display: none; } }
@media (max-width: 560px) {
  .field-row, .field-row-3, .meta-list { grid-template-columns: 1fr; }
  .big-faces { grid-template-columns: 1fr; }
  .theme-picker { grid-template-columns: repeat(4, 1fr); }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
}

/* focus-visible accessibility */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---- Lanyard designer embed ---- */
.lanyard-embed { border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm, 0 1px 3px rgba(16,32,32,.08)); background: #eef3f4; }
.lanyard-frame { display: block; width: 100%; height: calc(100vh - 188px); min-height: 600px; border: 0; background: #f4f7f8; }
