:root {
  color-scheme: light;
  --ink: #111b34;
  --muted: #66718c;
  --paper: #f4f7fc;
  --card: #ffffff;
  --line: #dbe3f0;
  --green: #2457e6;
  --mint: #dce8ff;
  --coral: #50a7ff;
  --shadow: 0 18px 45px rgba(28, 57, 120, .10);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 244px; padding: 32px 22px; background: #0b1530; color: white; display: flex; flex-direction: column; z-index: 3; }
.brand { color: white; text-decoration: none; display: flex; align-items: center; gap: 12px; font-size: 23px; font-weight: 800; letter-spacing: -.03em; margin: 0 8px 44px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--coral); color: var(--ink); }
nav { display: grid; gap: 8px; }
.nav-link { color: #bcc8c2; text-decoration: none; padding: 12px 14px; border-radius: 10px; font-size: 14px; font-weight: 650; }
.nav-link:hover, .nav-link.active { color: white; background: rgba(255,255,255,.1); }
.security-note { margin-top: auto; padding: 16px; display: grid; gap: 6px; background: rgba(127,171,255,.12); border: 1px solid rgba(127,171,255,.18); border-radius: 14px; font-size: 12px; line-height: 1.45; color: #bdcae4; }
.security-note strong { color: #e4edff; }
.user-card { margin-top: 12px; display: grid; gap: 8px; color: #bfcbea; font-size: 11px; overflow-wrap: anywhere; }
.user-card button, .text-button { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-weight: 750; padding: 0; text-align: left; }
.user-card button:hover { color: white; }
main { margin-left: 244px; min-height: 100vh; padding: 34px clamp(24px, 5vw, 72px) 70px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.05em; margin-bottom: 0; }
h2 { font-size: 19px; letter-spacing: -.025em; }
.eyebrow { color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 7px; }
.primary, .secondary, .danger, .icon-button { border: 0; cursor: pointer; border-radius: 11px; font-weight: 750; }
.primary { color: white; background: var(--green); padding: 12px 18px; box-shadow: 0 8px 20px rgba(36,87,230,.22); }
.primary:hover { background: #1946c7; }
.secondary { color: var(--green); background: var(--mint); padding: 11px 16px; }
.danger { color: #a72532; background: #fde8eb; padding: 11px 16px; }
.danger:hover { background: #f9d9de; }
.hidden { display: none !important; }
.auth-screen { min-height: 100vh; padding: 30px 18px; display: grid; place-items: center; background: radial-gradient(circle at 78% 10%, #d7e8ff 0, transparent 35%), linear-gradient(145deg, #f8faff, #eaf1ff); }
.auth-card { width: min(440px, 100%); padding: clamp(28px, 6vw, 48px); background: rgba(255,255,255,.94); border: 1px solid #d6e1f3; border-radius: 26px; box-shadow: 0 28px 80px rgba(31,63,132,.16); }
.auth-brand { color: var(--ink); margin: 0 0 38px; }
.auth-card h1 { font-size: clamp(33px, 8vw, 48px); line-height: 1; margin-bottom: 18px; }
.auth-copy { color: var(--muted); line-height: 1.65; margin-bottom: 28px; }
.auth-submit { width: 100%; margin-top: 8px; }
.text-button { width: 100%; color: var(--green); text-align: center; margin-top: 18px; }
.text-button.subtle { color: var(--muted); margin-top: 11px; font-weight: 600; }
.auth-safety { color: var(--muted); font-size: 11px; text-align: center; margin: 30px 0 0; }
.form-message { min-height: 18px; margin: 8px 0 0; color: #a72532; font-size: 12px; }
.app-shell { min-height: 100vh; }
.view { display: none; }
.view.active { display: block; animation: appear .28s ease; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.welcome-card { position: relative; overflow: hidden; min-height: 230px; padding: clamp(30px, 5vw, 58px); background: var(--green); color: white; border-radius: 24px; display: flex; align-items: center; box-shadow: var(--shadow); }
.welcome-card > div:first-child { position: relative; z-index: 1; max-width: 610px; }
.welcome-card h2 { font-size: clamp(30px, 5vw, 52px); line-height: 1; letter-spacing: -.055em; margin-bottom: 18px; }
.welcome-card p:last-child { color: #e1eaff; max-width: 530px; margin-bottom: 0; }
.orb { position: absolute; right: -70px; top: -95px; width: 310px; height: 310px; border-radius: 50%; background: var(--coral); opacity: .92; }
.orb::after { content: ""; position: absolute; inset: 70px; border: 2px solid rgba(20,33,29,.25); border-radius: 50%; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 22px 0; }
.stat, .panel, .account-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.stat { padding: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat strong { display: block; font-size: 28px; margin-top: 9px; letter-spacing: -.04em; }
.grid-two { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; }
.panel { padding: 24px; }
.panel-title, .list-row, .renewal, .log-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-title { margin-bottom: 16px; }
.panel-title h2 { margin: 0; }
.panel-title a { color: var(--green); font-size: 12px; font-weight: 750; text-decoration: none; }
.panel-title-actions { display: flex; align-items: center; gap: 14px; }
.compact { padding: 9px 13px; font-size: 12px; }
.list-row, .renewal { padding: 14px 0; border-top: 1px solid var(--line); }
.renewal-actions { display: flex; align-items: center; gap: 12px; }
.renewal-actions button { border: 0; background: var(--mint); color: var(--green); border-radius: 8px; padding: 7px 9px; cursor: pointer; font-size: 11px; font-weight: 750; }
.row-main { display: grid; gap: 4px; }
.row-main span, .muted { color: var(--muted); font-size: 12px; }
.badge { background: var(--mint); color: var(--green); border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 750; white-space: nowrap; }
.toolbar { display: flex; gap: 12px; margin-bottom: 22px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading p { color: var(--muted); margin: 0; }
input, select, textarea { width: 100%; padding: 12px 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,87,230,.12); }
textarea { resize: vertical; min-height: 90px; }
.toolbar input { flex: 1; }
.toolbar select { width: 210px; }
.filter-context { color: var(--green); background: var(--mint); border-radius: 10px; padding: 10px 13px; font-size: 12px; font-weight: 700; margin: -10px 0 18px; }
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.project-card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); cursor: pointer; transition: transform .18s ease, border-color .18s ease; }
.project-card:hover { transform: translateY(-2px); border-color: #aebfe0; }
.project-color { position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--project-color); }
.project-card p { color: var(--muted); min-height: 42px; line-height: 1.5; }
.project-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.project-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.project-card button { border: 0; background: var(--mint); color: var(--green); border-radius: 8px; padding: 8px 10px; cursor: pointer; font-weight: 750; }
.account-card { padding: 21px; }
.account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-badges { display: flex; align-items: flex-end; flex-direction: column; gap: 6px; }
.vault-state { border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.vault-state.linked { color: #1745b8; background: #dce8ff; }
.vault-state.pending { color: #8a5200; background: #fff2d9; }
.account-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--mint); color: var(--green); font-weight: 850; font-size: 18px; }
.account-card h2 { margin: 17px 0 6px; }
.account-card p { color: var(--muted); font-size: 13px; min-height: 20px; }
.account-card .account-note { margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.project-tag { display: inline-block; min-height: 0 !important; margin: 12px 0 0; padding: 5px 9px; background: #edf2fb; color: var(--green) !important; border-radius: 999px; font-size: 11px !important; font-weight: 750; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.account-actions a, .account-actions button { text-decoration: none; flex: 1; text-align: center; padding: 9px; border: 0; border-radius: 9px; background: #edf2fb; color: var(--ink); font-size: 12px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.account-actions a:hover, .account-actions button:hover { background: var(--mint); color: var(--green); }
.vault-ok { color: var(--green); font-size: 11px; font-weight: 750; }
.data-warning { color: #9a5b00; background: #fff2d9; border-radius: 8px; padding: 7px 9px; font-size: 11px; font-weight: 750; margin-top: 12px; }
.account-identity { margin: 14px 0; padding: 12px; background: #f4f7fc; border-radius: 10px; display: grid; gap: 5px; }
.account-identity span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.account-identity strong { font-size: 13px; overflow-wrap: anywhere; }
.account-identity.suggested { border: 1px dashed #9db5e5; background: #f8faff; }
.vault-suggestion { margin: 13px 0; padding: 13px; border: 1px dashed #9db5e5; border-radius: 11px; background: #f4f7fc; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.vault-suggestion div { display: grid; gap: 5px; min-width: 0; }
.vault-suggestion span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.vault-suggestion strong { font-size: 12px; overflow-wrap: anywhere; }
.vault-suggestion button { flex: 0 0 auto; }
.vault-heading { margin-bottom: 14px; }
.timeline { margin-top: 26px; border-left: 2px solid var(--line); padding-left: 26px; display: grid; gap: 18px; }
.log-actions { display: flex; gap: 10px; }
.connection-status { color: var(--muted); font-size: 12px; margin: 12px 0 0; }
.timeline article { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 20px; }
.timeline article::before { content: ""; position: absolute; left: -34px; top: 24px; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); border: 3px solid var(--paper); }
.timeline time { color: var(--muted); font-size: 11px; }
.timeline h2 { margin: 7px 0; }
.timeline p { color: var(--muted); font-size: 13px; margin-bottom: 0; line-height: 1.6; }
code { background: #e7edf8; border-radius: 5px; padding: 2px 5px; }
dialog { width: min(590px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 20px; color: var(--ink); background: var(--card); box-shadow: 0 30px 90px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(14,27,23,.65); backdrop-filter: blur(3px); }
form { padding: 28px; }
.dialog-title { display: flex; justify-content: space-between; margin-bottom: 20px; }
.dialog-title h2 { font-size: 25px; margin: 0; }
.icon-button { width: 36px; height: 36px; background: #e8eef8; font-size: 22px; }
label { display: grid; gap: 7px; margin: 13px 0; color: var(--muted); font-size: 12px; font-weight: 700; }
.check-label { grid-template-columns: auto 1fr; align-items: center; justify-content: start; }
.check-label input { width: 17px; height: 17px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.dialog-actions-split { align-items: center; }
.dialog-spacer { flex: 1; }
.empty { color: var(--muted); padding: 30px; text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 1000px) { .stats { grid-template-columns: 1fr 1fr; } .account-grid, .project-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .sidebar { position: static; width: auto; padding: 16px; }
  .brand { margin: 0 0 14px; }
  nav { display: flex; overflow-x: auto; }
  .nav-link { white-space: nowrap; }
  .security-note { display: none; }
  main { margin-left: 0; padding: 24px 16px 50px; }
  .grid-two, .account-grid, .project-grid { grid-template-columns: 1fr; }
  .orb { opacity: .35; }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .topbar { align-items: flex-end; } .topbar .primary { padding: 11px; } .toolbar, .log-header { align-items: stretch; flex-direction: column; } .toolbar select { width: 100%; } .form-row { grid-template-columns: 1fr; } }
