/* OwnAudit — design system v2
   Distinct, professional, deliberately not generic.
   Typography: Inter (UI) + JetBrains Mono (data/code/numbers).
   Color: deep mint primary, dark blue accent, warm coral for highlights.
*/

/* --- Fonts --- */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: local("Inter"), local("Inter-Variable");
}

/* --- Tokens --- */
:root {
  /* Mint — primary, deeper than before */
  --primary:        #0a4f4d;
  --primary-dark:   #073d3b;
  --primary-light:  #1a6e6c;
  --primary-soft:   #d6e7e6;
  --primary-faint:  #ecf4f3;

  /* Dark blue — secondary, for contrast on dark surfaces */
  --accent:         #122a3a;
  --accent-dark:    #0a1c28;
  --accent-light:   #2a4a64;

  /* Coral — for "active"/"attention" moments */
  --coral:          #c65a3a;
  --coral-faint:    #f6e3da;
  --coral-soft:     #d68b6a;

  /* Amber — for warnings within the data viz */
  --amber:          #b07d1a;
  --amber-faint:    #f5ead0;

  /* Neutrals */
  --bg:             #fafbfb;
  --bg-elev:        #ffffff;
  --bg-tint:        #f3f5f4;
  --surface:        #ffffff;
  --surface-2:      #fafbfb;
  --border:         #e3e6e5;
  --border-strong:  #c9d0cd;
  --border-soft:    #eef0ef;
  --text:           #1a2120;
  --text-muted:     #5a6664;
  --text-faint:     #8a9492;
  --text-inverse:   #ffffff;

  /* Status */
  --success:        #1f6f5a;
  --success-faint:  #dceee7;
  --warning:        #a36800;
  --warning-faint:  #f5e6c4;
  --danger:         #a83a30;
  --danger-faint:   #f3d8d3;
  --info:           #1f4d7a;
  --info-faint:     #d8e5f1;

  /* Typography */
  --font-ui:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono:  "JetBrains Mono", "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
  --font-serif: "Iowan Old Style", "Charter", "Georgia", "Cambria", serif;

  --fs-xs:   11px;
  --fs-sm:   12.5px;
  --fs-base: 13.5px;
  --fs-md:   14.5px;
  --fs-lg:   17px;
  --fs-xl:   22px;
  --fs-2xl:  30px;

  --tracking-tight: -0.02em;
  --tracking:       -0.005em;
  --tracking-wide:  0.04em;
  --tracking-eyebrow: 0.14em;

  --radius-sm: 3px;
  --radius:    5px;
  --radius-lg: 8px;
  --radius-xl: 14px;

  --shadow-xs: 0 1px 1px rgba(20, 30, 28, 0.04);
  --shadow-sm: 0 1px 2px rgba(20, 30, 28, 0.05), 0 1px 1px rgba(20, 30, 28, 0.03);
  --shadow-md: 0 4px 14px -2px rgba(20, 30, 28, 0.08), 0 2px 4px -1px rgba(20, 30, 28, 0.04);
  --shadow-lg: 0 12px 32px -4px rgba(20, 30, 28, 0.10), 0 4px 12px -2px rgba(20, 30, 28, 0.05);

  --layout-sidebar: 252px;
  --layout-topbar:  58px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--primary); text-decoration: none; transition: color 0.12s; }
a:hover { color: var(--primary-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3, h4 {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: var(--tracking-tight);
  line-height: 1.25;
}
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); font-weight: 600; }

p { margin: 0 0 10px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

code, pre { font-family: var(--font-mono); font-size: var(--fs-sm); }
pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
}

/* --- Layout --- */
.app {
  display: grid;
  grid-template-columns: var(--layout-sidebar) 1fr;
  grid-template-rows: var(--layout-topbar) 1fr;
  grid-template-areas: "side topbar" "side main";
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  grid-area: side;
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}
.brand {
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand .mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15);
}
.brand .mark::after {
  content: "";
  position: absolute;
  inset: 6px 6px auto auto;
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--primary);
}
.brand .name {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1;
}
.brand .tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin-top: 3px;
  text-transform: uppercase;
}

.brand-progress {
  padding: 12px 22px 18px;
  border-bottom: 1px solid var(--border-soft);
}
.brand-progress .label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
  font-family: var(--font-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand-progress .label .count { color: var(--primary); font-family: var(--font-mono); font-weight: 600; }
.brand-progress .ring {
  height: 4px;
  background: var(--bg-tint);
  border-radius: 2px;
  overflow: hidden;
}
.brand-progress .ring .fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  border-radius: 2px;
}

.sidebar nav {
  padding: 12px 14px 12px;
  flex: 1;
  overflow-y: auto;
}
.sidebar nav .group {
  margin-top: 14px;
}
.sidebar nav .group:first-child { margin-top: 4px; }
.sidebar nav .group-title {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 4px 10px 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sidebar nav .group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  color: var(--text-muted);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  position: relative;
  transition: background 0.12s, color 0.12s, padding 0.12s;
}
.sidebar nav a:hover {
  background: var(--bg-tint);
  color: var(--text);
  text-decoration: none;
}
.sidebar nav a.active {
  background: var(--primary-faint);
  color: var(--primary-dark);
  font-weight: 600;
}
.sidebar nav a.active::before {
  content: "";
  position: absolute;
  left: -14px; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.sidebar nav a.sub {
  padding-left: 32px;
  font-size: var(--fs-sm);
  font-weight: 400;
}
.sidebar nav a.sub::before {
  content: "·";
  position: absolute;
  left: 22px;
  color: var(--text-faint);
}
.sidebar nav a svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.sidebar nav a.active svg { opacity: 1; }

.sidebar .footer {
  padding: 12px 22px;
  border-top: 1px solid var(--border-soft);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  background: var(--surface-2);
}
.sidebar .footer .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 2px var(--success-faint);
}

/* --- Topbar --- */
.topbar {
  grid-area: topbar;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  font-size: var(--fs-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .crumbs {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-sm);
}
.topbar .crumbs .sep { color: var(--text-faint); }
.topbar .crumbs .here {
  color: var(--text);
  font-weight: 600;
}
.topbar .right {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
}
.topbar .env {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-faint);
  background: var(--bg-tint);
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 10px;
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.user-chip .name { color: var(--text); font-weight: 600; }
.user-chip .role {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-faint);
  padding: 1px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.05em;
}
.topbar button.logout {
  background: none;
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.topbar button.logout:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-faint);
}

/* --- Main --- */
.main {
  grid-area: main;
  padding: 28px 36px 60px;
  overflow-y: auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 20px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 4px; }
.page-head .sub {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin: 0;
  max-width: 720px;
}
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* --- Cards --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}
.card .card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
}
.card .card-head h3 { margin: 0; font-size: var(--fs-md); letter-spacing: var(--tracking); }
.card .card-head h3 .accent { color: var(--primary); }
.card .card-head .meta { color: var(--text-muted); font-size: var(--fs-xs); font-family: var(--font-mono); }
.card .card-body { padding: 18px; }
.card .card-body.tight { padding: 0; }
.card.card-elev:hover { box-shadow: var(--shadow-md); }

/* --- Stat tiles --- */
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stat::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  opacity: 0.4;
  transition: opacity 0.2s;
}
.stat:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.stat:hover::after { opacity: 1; }
.stat .label {
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.stat .label .badge { margin-left: auto; }
.stat .value {
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-top: 2px;
}
.stat .delta { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }
.stat .icon {
  position: absolute;
  top: 14px; right: 14px;
  width: 22px; height: 22px;
  color: var(--primary);
  opacity: 0.4;
}

.stat-link { text-decoration: none; color: inherit; display: block; }
.stat-link:hover { text-decoration: none; }

/* --- Grid --- */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

/* --- Tables --- */
.tbl-wrap { overflow-x: auto; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
table.tbl th, table.tbl td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
table.tbl thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border);
}
table.tbl tbody tr { transition: background 0.1s; }
table.tbl tbody tr:hover { background: var(--bg-tint); }
table.tbl .actions-col { white-space: nowrap; text-align: right; }
table.tbl td.mono, table.tbl td .mono { font-family: var(--font-mono); font-size: 11.5px; }
table.tbl td strong { font-weight: 600; color: var(--text); }

/* --- Forms --- */
.form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.form-row label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row input[type="url"],
.form-row input[type="number"],
.form-row input[type="date"],
.form-row input[type="tel"],
.form-row select,
.form-row textarea {
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.form-row input.mono, .form-row textarea.mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-faint);
}
.form-row textarea { min-height: 80px; resize: vertical; font-family: var(--font-ui); }
.form-row .help { color: var(--text-faint); font-size: var(--fs-xs); }
.form-row .help.error { color: var(--danger); }
.form-row.has-error input, .form-row.has-error select, .form-row.has-error textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-faint);
}
.form-row .req { color: var(--danger); }
.form-row.row { flex-direction: row; align-items: center; gap: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
  transition: all 0.12s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-tint); border-color: var(--text-faint); text-decoration: none; }
.btn svg { width: 14px; height: 14px; }
.btn.primary {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
  box-shadow: 0 1px 0 var(--primary-dark) inset, var(--shadow-xs);
}
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { color: var(--danger); border-color: var(--border); }
.btn.danger:hover { background: var(--danger-faint); border-color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg-tint); }
.btn.sm { padding: 3px 8px; font-size: var(--fs-xs); border-radius: 3px; }
.btn.lg { padding: 10px 20px; font-size: var(--fs-md); }

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-tint);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--font-ui);
}
.badge.mint { background: var(--primary-faint); color: var(--primary-dark); border-color: var(--primary-soft); }
.badge.blue { background: var(--info-faint); color: var(--info); border-color: var(--info); }
.badge.success { background: var(--success-faint); color: var(--success); border-color: var(--success); }
.badge.warning { background: var(--warning-faint); color: var(--warning); border-color: var(--warning); }
.badge.danger { background: var(--danger-faint); color: var(--danger); border-color: var(--danger); }
.badge.dot::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  background: currentColor;
  border-radius: 50%;
  margin-right: 2px;
}
.shared-flag {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--coral-faint);
  color: var(--coral);
  border: 1px solid var(--coral-soft);
  border-radius: 3px;
  cursor: help;
}

/* --- Flashes --- */
.flashes { margin-bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.flash {
  padding: 11px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  font-size: var(--fs-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash::before {
  content: "";
  width: 4px; height: 18px;
  border-radius: 2px;
  background: var(--info);
}
.flash.success { background: var(--success-faint); border-color: var(--success); color: var(--success); }
.flash.success::before { background: var(--success); }
.flash.danger { background: var(--danger-faint); border-color: var(--danger); color: var(--danger); }
.flash.danger::before { background: var(--danger); }
.flash.warning { background: var(--warning-faint); border-color: var(--warning); color: var(--warning); }
.flash.warning::before { background: var(--warning); }
.flash.info { background: var(--info-faint); border-color: var(--info); color: var(--info); }
.flash.info::before { background: var(--info); }

/* --- Auth screen --- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 0% 0%, var(--primary-faint) 0%, transparent 40%),
    radial-gradient(circle at 100% 100%, var(--coral-faint) 0%, transparent 40%),
    var(--bg);
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px 32px;
  position: relative;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--coral));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.auth-card .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.auth-card .logo .mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  position: relative;
}
.auth-card .logo .mark::after {
  content: "";
  position: absolute;
  inset: 7px 7px auto auto;
  width: 6px; height: 6px;
  background: var(--coral);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--primary);
}
.auth-card .logo h1 {
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.02em;
}
.auth-card .subtitle {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
}
.auth-card .btn { width: 100%; justify-content: center; padding: 10px; font-size: var(--fs-md); }
.auth-card .footnote {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  margin-top: 22px;
  text-align: center;
  letter-spacing: 0.04em;
}

/* --- Helpers --- */
.flex { display: flex; align-items: center; gap: 8px; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }

.pwd-cell { font-family: var(--font-mono); letter-spacing: 0.05em; }
.pwd-cell .mask { color: var(--text-faint); }
.pwd-cell .real { color: var(--text); }
.pwd-cell button {
  background: none;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--text-muted);
  font-family: var(--font-ui);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.12s;
}
.pwd-cell button:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-faint); }

/* --- Progress / bars --- */
.bar {
  background: var(--bg-tint);
  border: 1px solid var(--border);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.bar .fill {
  display: block;
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}
.bar.warning .fill { background: var(--warning); }
.bar.danger .fill { background: var(--danger); }

/* --- K/V compact rows (dashboard) --- */
.kv {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: var(--fs-sm);
}
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--text-muted); }
.kv .v { color: var(--text); font-weight: 600; font-family: var(--font-mono); }

/* --- Quick cards (dashboard) --- */
.quick-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.quick-card::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.2s;
}
.quick-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.quick-card:hover::after { width: 100%; }
.quick-card .qc-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-faint);
  color: var(--primary);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.quick-card h3 { margin: 0 0 3px; font-size: var(--fs-md); }
.quick-card p { margin: 0; font-size: var(--fs-xs); color: var(--text-muted); }

/* --- Credentials page specific --- */
.filter-bar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filter-bar .form-row label { font-size: 9.5px; }
.cred-grid { display: grid; gap: 14px; }
.cred-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s;
}
.cred-card:hover { box-shadow: var(--shadow-md); }
.cred-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--border-soft);
}
.cred-card-head h3 { margin: 0 0 2px; font-size: var(--fs-md); }
.cred-card-head h3 a { color: var(--accent); }
.cred-card-head h3 a:hover { color: var(--primary); }
.cred-card-head .muted { font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 4px; }
.cred-envs { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .cred-envs { grid-template-columns: 1fr; } }
.cred-env {
  padding: 12px 18px 16px;
  border-right: 1px solid var(--border-soft);
}
.cred-env:last-child { border-right: 0; }
.cred-env-head { margin-bottom: 10px; }
.cred-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed var(--border-soft);
}
.cred-row:first-of-type { border-top: 0; }
.cred-label { font-weight: 600; color: var(--text); font-size: var(--fs-sm); }
.cred-url { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); color: var(--primary); margin-top: 2px; font-family: var(--font-mono); }
.cred-row-data { display: flex; flex-direction: column; gap: 3px; min-width: 180px; }
.cred-user { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); }
.cred-pwd { font-size: var(--fs-sm); }
.cred-row-actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.cred-row-actions .btn { padding: 3px 6px; }
.cred-notes { color: var(--text-muted); font-size: var(--fs-xs); margin-top: 4px; padding-left: 10px; border-left: 2px solid var(--primary-faint); }

/* --- Empty state --- */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty .empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-faint);
  color: var(--primary);
  border-radius: 50%;
  opacity: 0.7;
}
.empty h3 { color: var(--text-muted); margin: 0 0 6px; font-size: var(--fs-md); }
.empty p { margin: 0 0 14px; font-size: var(--fs-sm); }