/* =====================================================================
   Mochan Labs admin - one small design system for every admin page.
   Loaded after each page's own <style>, so it replaces the old dark theme.
   Styling only: markup and behaviour are untouched.
   ===================================================================== */
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url("/admin/fonts/figtree-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 500; font-display: swap; src: url("/admin/fonts/figtree-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-display: swap; src: url("/admin/fonts/figtree-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url("/admin/fonts/figtree-latin-700-normal.woff2") format("woff2"); }

/* Moving between admin pages cross-fades instead of flashing; the sidebar and
   top bar stay put (Chrome / Edge / Safari). */
@view-transition { navigation: auto; }
.sidebar { view-transition-name: sidebar; }
.topbar { view-transition-name: topbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.14s; }

:root {
  --bg: #f7f7f5;
  --sidebar-bg: #ffffff;
  --card: #ffffff;
  --card-solid: #ffffff;
  --surface: #f4f4f1;
  --accent: #2b59ff;
  --accent-soft: #e8edff;
  --accent-deep: #1b3fc4;
  --purple: #1b3fc4;
  --green: #15803d;
  --red: #dc2626;
  --grad: linear-gradient(#2b59ff, #2b59ff);
  --text: #0a0a0a;
  --muted: rgba(10, 10, 10, 0.58);
  --faint: rgba(10, 10, 10, 0.4);
  --border: rgba(10, 10, 10, 0.09);
  --line-strong: rgba(10, 10, 10, 0.16);
  --radius: 12px;
  --sidebar-w: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body, button, input, select, textarea { font-family: "Figtree", system-ui, sans-serif !important; }
body { background: var(--bg); color: var(--text); line-height: 1.5; }
::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: rgba(10, 10, 10, 0.16) transparent; }
h1, h2, h3, h4 { font-family: "Figtree", system-ui, sans-serif !important; letter-spacing: -0.015em; }
a { color: inherit; }

/* ---------------------------------------------------------------------
   Shell: sidebar + top bar
   --------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--sidebar-bg); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; font-size: 0.95rem; font-weight: 600; letter-spacing: 0; border: 0; }
.sidebar-logo img { width: 28px !important; height: 31px !important; }
.sidebar-logo strong { color: var(--accent); font-weight: 600; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.nav-section { padding: 0 12px; }
.nav-section-title { padding: 18px 10px 6px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; margin-bottom: 1px;
  border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; text-decoration: none;
  font-size: 0.9rem; font-weight: 500; color: rgba(10, 10, 10, 0.66); transition: background-color 0.15s, color 0.15s;
}
.nav-item i { width: 16px; text-align: center; font-size: 0.82rem; color: var(--faint); transition: color 0.15s; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item:hover i { color: var(--text); }
.nav-item.active { background: var(--surface); color: var(--text); font-weight: 600; }
.nav-item.active i { color: var(--accent); }
.nav-item.logout-btn { color: var(--muted); }
.nav-item.logout-btn:hover { background: rgba(220, 38, 38, 0.07); color: var(--red); }
.nav-item.logout-btn:hover i { color: var(--red); }
.sidebar-footer { padding: 10px 12px 14px; border-top: 1px solid var(--border); }

.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between;
  height: 58px; padding: 0 32px; background: rgba(247, 247, 245, 0.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-user { display: flex; align-items: center; gap: 8px; padding: 0; background: none; border: 0; font-size: 0.88rem; font-weight: 500; color: var(--muted); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: #fff; display: grid; place-items: center; font-size: 0.72rem; font-weight: 600; }
.menu-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.1rem; cursor: pointer; }
.page-content { padding: 28px 32px 56px; flex: 1; width: 100%; max-width: 1400px; }
.page-content.shell-content { display: block; }

/* ---------------------------------------------------------------------
   Surfaces
   --------------------------------------------------------------------- */
.stat-card, .section-card, .form-card, .preview-card, .inv-list-card, .section, .invoice-section,
.transactions-section, .transactions-list, .modal-content, .form-content, .login-box {
  background: var(--card); border: 1px solid var(--border) !important; border-radius: var(--radius) !important; box-shadow: none !important;
}
.section, .invoice-section, .transactions-section, .form-card { padding: 24px; }
.section-card { overflow: hidden; }
.section-card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.section-card-header h3 { font-size: 0.95rem; font-weight: 600; }
.section-title, .form-card-title {
  display: flex; align-items: center; gap: 9px; margin: 0 0 20px; padding: 0; border: 0;
  font-size: 1rem; font-weight: 600; color: var(--text); letter-spacing: -0.015em;
}
.section-title i, .form-card-title i { color: var(--faint); font-size: 0.85rem; }

/* Stat tiles */
.stats-row, .stats { display: grid; gap: 14px; margin-bottom: 22px; }
.stat-card { padding: 20px 22px; }
.stat-card-info h4, .stat-label { margin: 0 0 6px; font-size: 0.82rem; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
.stat-card-info .val, .stat-value { font-size: 1.8rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-card-icon { width: 36px; height: 36px; border-radius: 9px; font-size: 0.9rem; background: var(--surface) !important; color: var(--muted) !important; }
.section .stats-row { grid-template-columns: repeat(3, 1fr); margin-bottom: 24px; }
.section .stats-row .stat-card { text-align: left; padding: 16px 18px; background: var(--surface); border-color: transparent !important; }
.section .stats-row .stat-value { color: var(--text); font-size: 1.6rem; }
.stats .stat-card:nth-child(1) .stat-value { color: var(--green); }
.stats .stat-card:nth-child(2) .stat-value { color: var(--red); }

/* ---------------------------------------------------------------------
   Buttons: primary = ink, secondary = outline, quiet = soft
   --------------------------------------------------------------------- */
button, .btn, a.btn { font-size: 0.86rem; }
.btn, .btn-action, .btn-sm, .btn-add-line, .btn-login {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px; padding: 0 14px; border-radius: 8px !important; border: 1px solid transparent;
  font-weight: 500; line-height: 1; box-shadow: none !important; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.btn, .btn-download, .btn-login { background: var(--text); color: #fff; border-color: var(--text); }
.btn:hover, .btn-download:hover, .btn-login:hover { background: #2a2a2a; border-color: #2a2a2a; transform: none; opacity: 1; }
.btn:disabled, .btn-login:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-download { background: var(--text) !important; }
.btn-secondary, .btn[style*="background"], a.btn {
  background: #fff !important; color: var(--text) !important; border: 1px solid var(--line-strong) !important;
}
.btn-secondary:hover, .btn[style*="background"]:hover, a.btn:hover { background: var(--surface) !important; border-color: var(--text) !important; }
.btn-danger { background: #fff; color: var(--red); border-color: rgba(220, 38, 38, 0.3); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.06); border-color: var(--red); }
.btn-action { flex: 1; min-width: 130px; min-height: 40px; }
.btn-save { background: #fff !important; color: var(--text) !important; border: 1px solid var(--line-strong) !important; }
.btn-save:hover { background: var(--surface) !important; border-color: var(--text) !important; }
.btn-clear, .btn-sm-red { background: #fff !important; color: var(--red) !important; border: 1px solid rgba(220, 38, 38, 0.28) !important; }
.btn-clear:hover, .btn-sm-red:hover { background: rgba(220, 38, 38, 0.06) !important; }
.btn-add-line, .btn-sm-blue { background: var(--surface) !important; color: var(--text) !important; border: 1px solid transparent !important; }
.btn-add-line:hover, .btn-sm-blue:hover { background: #ebebe7 !important; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 0.8rem; flex: 1; }
.btn-remove-line { width: 32px; height: 32px; border-radius: 8px !important; background: transparent !important; border: 1px solid transparent !important; color: var(--faint) !important; display: grid; place-items: center; }
.btn-remove-line:hover { background: rgba(220, 38, 38, 0.07) !important; color: var(--red) !important; }
.icon-btn { background: none; border: 0; border-radius: 8px; width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0; color: var(--faint); font-size: 0.88rem; cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.icon-btn:hover { background: var(--surface); color: var(--text); transform: none !important; }
.icon-btn.permanent-delete-btn:hover, .icon-btn[style*="red"]:hover { background: rgba(220, 38, 38, 0.07); color: var(--red) !important; }
.close-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: none; border: 0; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.close-btn:hover { background: var(--surface); color: var(--text); }
.btn-clear i, .btn-save i { font-size: 0.8rem; }

/* Destructive confirm buttons keep their red */
.btn[style*="var(--red)"] { background: var(--red) !important; color: #fff !important; border-color: var(--red) !important; }
.btn[style*="var(--red)"]:hover { background: #b91c1c !important; border-color: #b91c1c !important; }
.btn[style*="#ffa500"], .btn[style*="var(--green)"] { background: var(--surface) !important; color: var(--text) !important; border: 1px solid transparent !important; }
.btn[style*="#ffa500"]:hover, .btn[style*="var(--green)"]:hover { background: #ebebe7 !important; border-color: transparent !important; }
.btn[type="submit"][style*="var(--green)"] { background: var(--text) !important; color: #fff !important; }
.btn[type="submit"][style*="var(--green)"]:hover { background: #2a2a2a !important; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-group, .fg { margin-bottom: 16px; }
label, .fg label, .form-group label { display: block; margin: 0 0 6px; font-size: 0.8rem; font-weight: 500; color: rgba(10, 10, 10, 0.72); }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; min-height: 40px; padding: 9px 12px !important; background: #fff !important; color: var(--text) !important;
  border: 1px solid var(--line-strong) !important; border-radius: 8px !important; font-size: 0.9rem !important; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 80px; resize: vertical; }
input::placeholder, textarea::placeholder { color: rgba(10, 10, 10, 0.32); }
input:focus, select:focus, textarea:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgb(43 89 255 / 0.12) !important; }
input[type="file"] { width: 100%; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; background: #fff; font-size: 0.85rem; }
select option { background: #fff; color: var(--text); }
.form-row, .form-row2, .form-row3 { display: grid; gap: 16px; }
.form-row, .form-row2 { grid-template-columns: 1fr 1fr; }
.form-row3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group.error input, .form-group.error select, .form-group.error textarea { border-color: var(--red) !important; background: rgba(220, 38, 38, 0.03) !important; }
.form-group.error label, .error-message { color: var(--red); }
.form-validation-summary, .login-error { border: 1px solid rgba(220, 38, 38, 0.25); background: rgba(220, 38, 38, 0.05); color: var(--red); border-radius: 8px; padding: 12px 14px; }
.line-item input, .total-discount-input { min-height: 38px; }
.line-item .amount-field { background: var(--surface) !important; color: var(--text) !important; }
.drop-zone { border: 1px dashed var(--line-strong); border-radius: 8px; padding: 12px; text-align: center; color: var(--muted); background: var(--surface); }
.drop-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------------
   Tables and lists
   --------------------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 22px; background: transparent !important; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--border); text-align: left; }
td { padding: 15px 22px; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface) !important; }
.badge { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge-green { background: rgba(21, 128, 61, 0.1); color: var(--green); }
.badge-amber { background: rgba(180, 83, 9, 0.1); color: #b45309; }
.badge-red { background: rgba(220, 38, 38, 0.08); color: var(--red); }
.badge-blue { background: var(--accent-soft); color: var(--accent); }
.empty-state { padding: 56px 24px; text-align: center; color: var(--faint); }
.empty-state i { display: block; margin-bottom: 12px; font-size: 1.5rem; opacity: 0.5; }

/* Row-style lists (employees, transactions, invoice picker) */
.employee-item, .transaction-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 4px; margin: 0; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: transparent !important; transition: background-color 0.15s;
}
.employee-item { justify-content: space-between; }
.employee-item:last-child, .transaction-item:last-child { border-bottom: 0; }
.employee-item:hover, .transaction-item:hover { background: var(--surface) !important; border-color: var(--border); }
.employee-item[style*="opacity"], .transaction-item[style*="opacity"] { background: transparent !important; border-color: var(--border) !important; }
.employee-name, .transaction-desc { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.employee-meta, .transaction-meta { margin-top: 2px; font-size: 0.82rem; line-height: 1.5; color: var(--muted); }
.employee-actions, .transaction-actions { display: flex; gap: 2px; }
.transaction-amount { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 4px; }
.credit { color: var(--green); }
.debit { color: var(--red); }
.drag-handle { color: var(--faint); }
.transactions-list { padding: 4px 16px; }
.invoice-section .transactions-list, .transactions-section .transactions-list { border: 0 !important; padding: 0; }
.line-items { background: var(--surface) !important; border: 0; border-radius: 10px; padding: 14px; }
.line-item { background: #fff !important; border: 1px solid var(--border) !important; border-radius: 8px; padding: 10px 12px; }
.line-item:hover { border-color: var(--line-strong) !important; }
.line-item-amount { font-variant-numeric: tabular-nums; }
.invoice-preview { background: var(--surface); border: 0; border-radius: 10px; }
.preview-row { border-color: var(--border); }
.preview-total { color: var(--text); }

/* ---------------------------------------------------------------------
   Dashboard pieces
   --------------------------------------------------------------------- */
.stats-row { grid-template-columns: repeat(4, 1fr); }
.inv-page { gap: 20px; }
.inv-list-grid { gap: 14px; }
.inv-list-card { padding: 20px; transition: border-color 0.15s; }
.inv-list-card:hover { border-color: var(--line-strong) !important; transform: none; }
.inv-list-card-num { font-size: 0.95rem; font-weight: 600; }
.inv-list-card-amount { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.02em; }
.total-row.grand span:last-child { background: none; -webkit-text-fill-color: var(--text); color: var(--text); }
.preview-card { overflow: hidden; }
.preview-header { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.preview-header h4 { font-size: 0.82rem; font-weight: 500; color: var(--muted); }
.inv-badge .inv-label { background: none; -webkit-text-fill-color: var(--accent); color: var(--accent); }
.inv-divider { background: var(--accent); }
.inv-footer-bar { background: var(--accent); }

/* Employees: form sections as quiet, divided blocks instead of tinted boxes */
[style*="border-left: 4px"] {
  background: transparent !important; border: 0 !important; border-top: 1px solid var(--border) !important; border-radius: 0 !important;
  padding: 22px 0 6px !important; margin: 0 !important;
}
[style*="border-left: 4px"]:first-of-type { border-top: 0 !important; padding-top: 4px !important; }
[style*="border-left: 4px"] h3, [style*="border-left: 4px"] h4 {
  margin: 0 0 16px !important; font-size: 0.95rem !important; font-weight: 600 !important; color: var(--text) !important; letter-spacing: -0.01em;
}
[style*="border-left: 4px"] h3 i, [style*="border-left: 4px"] h4 i { color: var(--faint) !important; font-size: 0.85rem; }
#identityListContainer, #positionHistoryContainer { background: var(--surface) !important; border: 0 !important; border-radius: 10px !important; }

/* ---------------------------------------------------------------------
   Modals + toasts
   --------------------------------------------------------------------- */
.modal, .form-modal { background: rgba(10, 10, 10, 0.42) !important; backdrop-filter: blur(2px); }
.modal-content, .form-content { padding: 26px; border-radius: 14px !important; box-shadow: 0 30px 80px -30px rgb(10 10 10 / 0.4) !important; }
.modal-header, .form-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.modal-header h2, .form-header h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.letter-options { display: grid; gap: 10px; }
.letter-option { padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: #fff !important; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.letter-option:hover { border-color: var(--text); background: var(--surface) !important; }
.letter-option-title { display: flex; align-items: center; gap: 9px; font-size: 0.95rem; font-weight: 600; }
.letter-option-title i { color: var(--accent); font-size: 0.9rem; }
.letter-option-desc { margin-top: 2px; font-size: 0.82rem; color: var(--muted); }
.toast { padding: 12px 18px; border-radius: 10px; font-size: 0.88rem; font-weight: 500; background: #fff; color: var(--text); border: 1px solid var(--line-strong); box-shadow: 0 14px 40px -16px rgb(10 10 10 / 0.3); }
.toast.success { border-color: rgba(21, 128, 61, 0.4); color: var(--green); }
.toast.info { border-color: rgb(43 89 255 / 0.4); color: var(--accent); }
.toast.error { border-color: rgba(220, 38, 38, 0.4); color: var(--red); }

/* ---------------------------------------------------------------------
   Standalone pages inside the shell (transactions / employees / invoices)
   --------------------------------------------------------------------- */
.app .container { max-width: none; margin: 0; padding: 0; }
.app .header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 0 22px !important; padding: 0; background: none; border: 0; }
.app .header img, .app .header h1 { display: none; }
.app .header > div:first-child { display: block; }
.app .header p { margin: 0; font-size: 0.95rem; color: var(--muted); }
.header-right, .header .controls { display: flex; gap: 8px; flex-wrap: wrap; }
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.controls label { margin: 0; font-size: 0.82rem; color: var(--muted); }
.controls input, .controls select { width: auto; min-height: 36px; padding: 6px 10px !important; }
.main-content { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 1200px) { .main-content { grid-template-columns: 1fr; } }
/* Add Transaction: fields flow in order */
#transactionForm { grid-template-columns: repeat(3, 1fr); }
#transactionForm .form-group { grid-column: auto !important; }
#transactionForm button[type="submit"] { grid-column: 1 / -1 !important; }
.login-screen { background: var(--bg) !important; }

/* ---------------------------------------------------------------------
   Login input icons keep their room
   --------------------------------------------------------------------- */
.input-wrap input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { padding-left: 38px !important; padding-right: 40px !important; }

/* ---------------------------------------------------------------------
   Smaller screens
   --------------------------------------------------------------------- */
@media (max-width: 1200px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; box-shadow: 0 0 40px rgb(10 10 10 / 0.15); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: block; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 18px 16px 40px; }
  .stats-row, .section .stats-row { grid-template-columns: 1fr; }
  .form-row, .form-row2, .form-row3, #transactionForm { grid-template-columns: 1fr; }
  .app .header { flex-direction: column; align-items: flex-start; }
  .section, .invoice-section, .transactions-section, .form-card { padding: 18px; }
}

/* =====================================================================
   Projects (registry + licensing). Prefix: pj-
   ===================================================================== */
#view { max-width: 1200px; }
.pj-head, .pj-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.pj-head h1 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.pj-head p { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }
.pj-bar { align-items: center; margin-bottom: 16px; }
.pj-bar h2 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.pj-muted { color: var(--muted); }
.pj-warn { color: #b45309; }
.pj-pad { padding: 18px 22px; }
.pj-center { text-align: center; }
.pj-text { margin: 0 0 6px; color: rgba(10, 10, 10, 0.75); font-size: 0.92rem; }

/* Project tiles */
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.pj-tile {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; text-align: left; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pj-tile:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: 0 14px 30px -22px rgb(10 10 10 / 0.35); }
.pj-tile-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.pj-tile h3 { margin: 0; font-size: 1.1rem; font-weight: 600; letter-spacing: -0.015em; }
.pj-tile p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.pj-tile-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--muted); }
.pj-tile-foot b { color: var(--text); font-weight: 600; }
.pj-tile-new { align-items: center; justify-content: center; gap: 10px; min-height: 190px; border-style: dashed; background: transparent; color: var(--muted); font-size: 0.92rem; font-weight: 500; }
.pj-tile-new i { font-size: 1.1rem; }
.pj-tile-new:hover { color: var(--text); background: #fff; }

.pj-icon { display: inline-grid; place-items: center; flex: none; border-radius: 12px; color: #fff; font-weight: 600; overflow: hidden; background: var(--surface); }
.pj-icon img { width: 100%; height: 100%; object-fit: cover; }

.pj-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; background: var(--surface); color: var(--muted); white-space: nowrap; }
.pj-live, .pj-active { background: rgba(21, 128, 61, 0.1); color: var(--green); }
.pj-expiring { background: rgba(180, 83, 9, 0.1); color: #b45309; }
.pj-expired { background: var(--surface); color: var(--muted); }
.pj-revoked { background: rgba(220, 38, 38, 0.08); color: var(--red); }
.pj-planned { background: var(--surface); color: var(--muted); }

/* Breadcrumbs, project header, tabs */
.pj-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font-size: 0.85rem; color: var(--muted); }
.pj-crumbs a { color: var(--muted); text-decoration: none; }
.pj-crumbs a:hover { color: var(--text); }
.pj-crumbs i { font-size: 0.6rem; opacity: 0.6; }
.pj-crumbs span[aria-current] { color: var(--text); font-weight: 500; }
.pj-app-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.pj-app-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.pj-app-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pj-app-title h1 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.pj-app-id p { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.pj-tabs { display: flex; gap: 4px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.pj-tabs a, .pj-tabs span { position: relative; padding: 10px 14px; font-size: 0.9rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.pj-tabs a:hover { color: var(--text); }
.pj-tabs a.active { color: var(--text); font-weight: 600; }
.pj-tabs a.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--text); border-radius: 2px; }
.pj-tabs .soon { cursor: default; opacity: 0.55; }
.pj-tabs .soon em { margin-left: 6px; padding: 1px 7px; font-style: normal; font-size: 0.68rem; border-radius: 999px; background: var(--surface); }

/* Stat tiles, cards */
.pj-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.pj-stat { padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.pj-stat-label { font-size: 0.8rem; color: var(--muted); }
.pj-stat-value { margin-top: 4px; font-size: 1.7rem; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; }
.pj-stat-value.good { color: var(--green); }
.pj-stat-value.warn { color: #b45309; }
.pj-card { margin-bottom: 18px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.pj-card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.pj-card-head h3 { margin: 0; font-size: 0.95rem; font-weight: 600; }
.pj-card-head a { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.pj-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.pj-two .pj-card { margin-bottom: 0; }
.pj-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 22px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; font-size: 0.92rem; }
.pj-row:last-child { border-bottom: 0; }
.pj-row:hover { background: var(--surface); }
.pj-row small, .pj-event small, .pj-table small, .pj-facts small { display: block; margin-top: 1px; color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.pj-panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.pj-panel { padding: 18px 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.pj-panel h4 { margin: 0 0 4px; font-size: 0.95rem; }
.pj-panel p { margin: 0 0 12px; color: var(--muted); font-size: 0.85rem; }

/* Activity feed */
.pj-feed { padding: 8px 22px 14px; }
.pj-event { position: relative; display: flex; gap: 12px; padding: 9px 0; font-size: 0.9rem; }
.pj-event:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 22px; bottom: -8px; width: 1px; background: var(--border); }
.pj-dot { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--line-strong); }

/* Filters + table */
.pj-filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pj-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-pills button { padding: 6px 13px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font-size: 0.84rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: all 0.15s; }
.pj-pills button:hover { color: var(--text); border-color: var(--line-strong); }
.pj-pills button.active { background: var(--text); border-color: var(--text); color: #fff; }
.pj-search { position: relative; }
.pj-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 0.8rem; color: var(--faint); pointer-events: none; }
.pj-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width: 260px; padding-left: 34px !important; }
.pj-table-wrap { overflow-x: auto; }
.pj-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.pj-table th { padding: 11px 18px; text-align: left; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--border); white-space: nowrap; }
.pj-table td { padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pj-table tbody tr:last-child td { border-bottom: 0; }
.pj-table tbody tr[data-id] { cursor: pointer; }
.pj-table tbody tr:hover td { background: var(--surface) !important; }
.pj-table .pj-right { text-align: right; }
.pj-table .pj-none { padding: 40px; text-align: center; color: var(--muted); }
.pj-gone td { opacity: 0.55; }
.pj-link { font-weight: 600; color: var(--text); text-decoration: none; }
.pj-link:hover { color: var(--accent); }
.pj-key { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 0.82rem; letter-spacing: 0.02em; }
.pj-copy { border: 0; background: none; padding: 4px 6px; border-radius: 6px; color: var(--faint); cursor: pointer; font-size: 0.8rem; }
.pj-copy:hover { background: var(--surface); color: var(--text); }
.pj-sm { min-height: 30px !important; padding: 0 11px !important; font-size: 0.8rem !important; }

/* License page */
.pj-keycard { padding: 22px; }
.pj-keyhead { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pj-eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.pj-bigkey { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.pj-bigkey span { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 1.6rem; font-weight: 600; letter-spacing: 0.04em; user-select: all; }
.pj-keyactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; margin: 22px 0 0; padding-top: 20px; border-top: 1px solid var(--border); }
.pj-facts dt { font-size: 0.78rem; color: var(--muted); }
.pj-facts dd { margin: 3px 0 0; font-weight: 500; }
.pj-notes { margin: 18px 0 0; padding: 12px 14px; background: var(--surface); border-radius: 8px; font-size: 0.88rem; color: rgba(10, 10, 10, 0.75); }
.pj-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 13px 16px; border-radius: 10px; font-size: 0.9rem; font-weight: 500; }
.pj-banner.good { background: rgba(21, 128, 61, 0.08); color: var(--green); border: 1px solid rgba(21, 128, 61, 0.25); }

/* Empty + loading */
.pj-empty { padding: 56px 24px; text-align: center; background: #fff; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.pj-empty i { font-size: 1.6rem; color: var(--faint); }
.pj-empty h3 { margin: 12px 0 4px; font-size: 1rem; font-weight: 600; }
.pj-empty p { margin: 0 auto; max-width: 420px; color: var(--muted); font-size: 0.9rem; }
.pj-loading { display: flex; justify-content: center; gap: 6px; padding: 80px 0; }
.pj-loading span { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); animation: pjBounce 1s infinite ease-in-out; }
.pj-loading span:nth-child(2) { animation-delay: 0.15s; }
.pj-loading span:nth-child(3) { animation-delay: 0.3s; }
@keyframes pjBounce { 0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* Modal + form fields */
.pj-overlay { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; background: rgba(10, 10, 10, 0.42); backdrop-filter: blur(2px); animation: pjFade 0.15s; }
.pj-modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 14px; box-shadow: 0 30px 80px -30px rgb(10 10 10 / 0.4); animation: pjRise 0.18s; }
.pj-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 0; }
.pj-modal-head h3 { margin: 0; font-size: 1.1rem; font-weight: 600; }
.pj-modal-body { padding: 18px 24px 4px; }
.pj-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 22px; }
.pj-form-error { min-height: 0; margin: 0; padding: 0 24px; color: var(--red); font-size: 0.85rem; }
.pj-field { margin-bottom: 16px; }
.pj-field > label { display: block; margin-bottom: 6px; font-size: 0.8rem; font-weight: 500; color: rgba(10, 10, 10, 0.72); }
.pj-field > label em { font-style: normal; font-weight: 400; color: var(--faint); }
.pj-field small { display: block; margin-top: 6px; color: var(--muted); font-size: 0.78rem; }
.pj-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pj-segment { display: inline-flex; padding: 3px; background: var(--surface); border-radius: 9px; gap: 2px; }
.pj-segment label { margin: 0; cursor: pointer; }
.pj-segment input { position: absolute; opacity: 0; pointer-events: none; }
.pj-segment span { display: block; padding: 7px 14px; border-radius: 7px; font-size: 0.85rem; font-weight: 500; color: var(--muted); transition: all 0.15s; }
.pj-segment input:checked + span { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgb(10 10 10 / 0.12); }
.pj-segment input:focus-visible + span { outline: 2px solid var(--accent); }
.pj-custom { margin-top: 10px; }
.pj-swatches { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.pj-swatches button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.pj-swatches button.active { box-shadow: 0 0 0 2px var(--text); }
.pj-iconrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pj-iconrow input[type="file"] { flex: 1; min-width: 180px; }
.pj-check { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 0.82rem; cursor: pointer; }
.btn-danger-solid { background: var(--red) !important; border-color: var(--red) !important; color: #fff !important; }
.btn-danger-solid:hover { background: #b91c1c !important; border-color: #b91c1c !important; }
@keyframes pjFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pjRise { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

/* Toasts */
.pj-toasts { position: fixed; right: 20px; bottom: 20px; z-index: 400; display: flex; flex-direction: column; gap: 8px; }
.pj-toast { padding: 12px 16px; background: var(--text); color: #fff; border-radius: 10px; font-size: 0.88rem; font-weight: 500; box-shadow: 0 14px 40px -16px rgb(10 10 10 / 0.5); animation: pjRise 0.2s; transition: opacity 0.25s; }
.pj-toast.error { background: var(--red); }
.pj-toast.out { opacity: 0; }

@media (max-width: 900px) {
  .pj-stats { grid-template-columns: repeat(2, 1fr); }
  .pj-two { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .pj-head, .pj-app-head, .pj-bar { flex-direction: column; align-items: flex-start; }
  .pj-search input:not([type="checkbox"]):not([type="radio"]):not([type="file"]) { width: 100%; }
  .pj-search { width: 100%; }
  .pj-cols { grid-template-columns: 1fr; }
  .pj-bigkey span { font-size: 1.15rem; }
}
