:root { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f4f7fb; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 10% 0, #eaf1ff 0, transparent 34%), #f4f7fb; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 12px; padding: 11px 16px; background: #1b4fd8; color: #fff; cursor: pointer; font-weight: 700; }
button:hover { filter: brightness(.96); }
button:disabled { opacity: .55; cursor: wait; }
button.secondary { background: #172033; }
button.ghost { background: #edf1f7; color: #344054; }
button.danger { background: #b42318; }
.icon-btn { min-width: 44px; padding-inline: 12px; background: #edf1f7; color: #172033; }
input, select { width: 100%; border: 1px solid #d7deea; border-radius: 12px; padding: 11px 12px; background: #fff; color: inherit; }
input[type="checkbox"] { width: 18px; height: 18px; }
label { display: grid; gap: 6px; color: #475467; font-size: 13px; font-weight: 700; }
.password-field { position: relative; width: 100%; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 50%; right: 5px; width: 38px; min-width: 38px; height: 36px; padding: 0; transform: translateY(-50%); border-radius: 9px; color: #475467; background: transparent; font-size: 18px; line-height: 1; }
.password-toggle:hover { background: #edf1f7; filter: none; }
.remember-row { display: flex; align-items: center; width: fit-content; gap: 9px; cursor: pointer; }
.remember-row input { margin: 0; }
h1, h2 { margin: 0; }
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 20px; }
p { margin: 6px 0 0; color: #667085; }
.hidden { display: none !important; }
.app { width: min(1500px, 100%); margin: 0 auto; padding: 24px; }
.card { background: rgba(255,255,255,.96); border: 1px solid #e4e9f1; border-radius: 18px; box-shadow: 0 10px 30px rgba(25,35,60,.06); }
.login-card { width: min(430px, calc(100vw - 32px)); margin: 10vh auto; padding: 30px; text-align: center; }
.login-card form { display: grid; gap: 16px; margin-top: 24px; text-align: left; }
.brand-mark { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, #1b4fd8, #3d7eff); font-weight: 900; }
.error { min-height: 22px; margin-top: 14px; color: #b42318; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.eyebrow { margin-bottom: 5px; color: #1b4fd8; font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; margin-bottom: 14px; }
.profile-strip div { display: grid; gap: 5px; padding: 15px 18px; background: #fff; }
.profile-strip span { color: #667085; font-size: 12px; }
.profile-strip strong { font-size: 15px; }
.toolbar { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr; gap: 12px; padding: 16px; margin-bottom: 12px; }
.bulkbar { display: flex; align-items: center; gap: 9px; padding: 12px 16px; margin-bottom: 12px; }
.bulkbar span { margin-right: auto; color: #475467; font-weight: 700; }
.operation-status { position: sticky; top: 12px; z-index: 15; width: fit-content; margin: 0 auto 12px; padding: 11px 16px; border-radius: 999px; color: #fff; background: #172033; box-shadow: 0 12px 32px rgba(15,23,42,.25); }
.operation-status::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 9px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; vertical-align: -2px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.table-wrap { overflow: auto; }
table { width: 100%; min-width: 1250px; border-collapse: collapse; }
th, td { padding: 12px 13px; border-bottom: 1px solid #edf0f5; text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 2; background: #f9fbfe; color: #667085; font-size: 12px; }
tbody tr:hover td { background: #f7faff; }
.object-name { font-weight: 800; }
.muted { color: #667085; font-size: 12px; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: #edf1f7; color: #475467; font-size: 12px; font-weight: 800; white-space: nowrap; }
.badge.ok { color: #027a48; background: #ecfdf3; }
.badge.warn { color: #b54708; background: #fff6e6; }
.badge.error { color: #b42318; background: #fef3f2; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { padding: 7px 10px; font-size: 12px; }
.empty { padding: 42px; color: #667085; text-align: center; }
.admin-grid { display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.form-card, .list-card, .discovery-card { padding: 18px; }
.form-card { display: grid; gap: 13px; }
.stack { display: grid; gap: 9px; margin-top: 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; border: 1px solid #e8ecf3; border-radius: 13px; }
.list-row strong, .list-row small { display: block; }
.list-row small { margin-top: 3px; color: #667085; }
.discovery-card { display: grid; gap: 16px; }
.discovery-controls { display: grid; grid-template-columns: 1.2fr 1fr auto auto; gap: 10px; align-items: end; }
.candidate-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.candidate { display: grid; gap: 10px; padding: 15px; border: 1px solid #dfe6f0; border-radius: 15px; background: #fbfcff; }
.candidate-head { display: flex; justify-content: space-between; gap: 10px; }
.candidate-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; color: #475467; font-size: 13px; }
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,17,31,.5); }
.modal-card { position: relative; width: min(760px, calc(100vw - 30px)); max-height: calc(100vh - 36px); overflow: auto; padding: 20px; }
.modal-card header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.copy-grid { display: grid; gap: 8px; }
.copy-row { display: grid; grid-template-columns: minmax(170px,.8fr) 1.4fr auto; gap: 9px; align-items: center; padding: 10px; border: 1px solid #e7ebf2; border-radius: 12px; }
.copy-row code { overflow-wrap: anywhere; }
.warning-box { margin-top: 14px; padding: 12px; border-radius: 12px; color: #92400e; background: #fff7ed; }
html[data-theme="dark"] { color-scheme: dark; background: #0d1422; color: #e7ecf7; }
html[data-theme="dark"] body { background: radial-gradient(circle at 10% 0, #142748 0, transparent 34%), #0d1422; }
html[data-theme="dark"] .card, html[data-theme="dark"] .profile-strip div { background: #141e30; border-color: #283650; }
html[data-theme="dark"] input, html[data-theme="dark"] select { background: #0e1727; border-color: #34435f; }
html[data-theme="dark"] p, html[data-theme="dark"] .muted, html[data-theme="dark"] label, html[data-theme="dark"] .bulkbar span { color: #a8b3c7; }
html[data-theme="dark"] th { background: #101a2b; color: #b8c3d7; }
html[data-theme="dark"] th, html[data-theme="dark"] td { border-color: #293750; }
html[data-theme="dark"] tbody tr:hover td, html[data-theme="dark"] .candidate { background: #19263b; }
html[data-theme="dark"] .candidate, html[data-theme="dark"] .list-row, html[data-theme="dark"] .copy-row { border-color: #30405d; }
html[data-theme="dark"] button.ghost, html[data-theme="dark"] .icon-btn { background: #253149; color: #e7ecf7; }
html[data-theme="dark"] .password-toggle { color: #c6d0e1; }
html[data-theme="dark"] .password-toggle:hover { background: #253149; }
@media (max-width: 900px) {
  .app { padding: 14px; }
  .topbar, .modal-card header { display: grid; }
  .profile-strip, .toolbar, .admin-grid, .discovery-controls { grid-template-columns: 1fr; }
  .bulkbar { align-items: stretch; flex-direction: column; }
  .copy-row { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .operation-status::before { animation-duration: 2s; } }
