:root {
  --ink: #20243b;
  --muted: #7b819a;
  --line: #e9eaf1;
  --paper: #ffffff;
  --canvas: #f7f8fc;
  --violet: #5b5ce2;
  --violet-dark: #4546ba;
  --violet-soft: #eeefff;
  --green: #1c9b72;
  --green-soft: #e8f7f0;
  --amber: #bd7a18;
  --amber-soft: #fff4df;
  --red: #c45362;
  --red-soft: #fff0f2;
  --shadow: 0 18px 60px rgba(35, 38, 73, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.eyebrow, .section-label { color: var(--violet); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 800; }
.field-hint { color: var(--muted); float: right; font-size: 11px; font-weight: 400; }

.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 10% 0%, #eceeff 0, transparent 33%), var(--canvas); }
.auth-card { width: min(100%, 430px); background: var(--paper); padding: 42px; border: 1px solid rgba(233,234,241,.9); border-radius: 24px; box-shadow: var(--shadow); }
.setup-card { width: min(100%, 620px); }
.brand-lockup { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: -.04em; margin-bottom: 44px; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--violet); border-radius: 10px; font-weight: 900; box-shadow: 0 7px 16px rgba(91,92,226,.25); }
.auth-card h1 { font-size: 28px; line-height: 1.14; letter-spacing: -.05em; margin: 8px 0 12px; }
.auth-card p { margin: 0 0 28px; }
.stack-form, .form-section { display: grid; gap: 16px; }
.form-section { gap: 14px; padding-top: 22px; margin-top: 6px; border-top: 1px solid var(--line); }
.section-label { margin-bottom: 2px; }
label { color: #4d526e; font-size: 12px; font-weight: 700; }
input, select { width: 100%; margin-top: 7px; border: 1px solid #dedfeb; border-radius: 10px; color: var(--ink); background: #fff; outline: none; padding: 12px 13px; transition: border .2s, box-shadow .2s; }
input:focus, select:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(91,92,226,.12); }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.button { border: 0; border-radius: 10px; padding: 12px 16px; color: var(--ink); background: #f0f1f7; font-weight: 750; transition: .2s ease; }
.button:hover { transform: translateY(-1px); filter: brightness(.98); }
.button.primary { color: #fff; background: var(--violet); box-shadow: 0 8px 18px rgba(91,92,226,.18); }
.button.subtle { color: var(--violet-dark); background: var(--violet-soft); }
.button.danger { color: var(--red); background: var(--red-soft); }
.button.full { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.notice { border-radius: 10px; padding: 11px 13px; font-size: 13px; margin: 14px 0; }
.notice.error { color: #a73c4b; background: var(--red-soft); }
.notice.success { color: #16805d; background: var(--green-soft); }
.notice a { font-weight: 800; text-decoration: underline; margin-left: 5px; }

.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 244px; flex: 0 0 244px; display: flex; flex-direction: column; padding: 28px 18px; background: #fff; border-right: 1px solid var(--line); }
.sidebar .brand-lockup { margin: 0 12px 52px; }
.nav-label { color: #a2a6b9; text-transform: uppercase; letter-spacing: .11em; font-size: 10px; font-weight: 800; padding: 0 13px; margin: 0 0 10px; }
.nav { display: grid; gap: 5px; }
.nav a { display: flex; align-items: center; gap: 12px; color: #747991; padding: 11px 13px; border-radius: 10px; font-weight: 650; }
.nav a:hover, .nav a.active { color: var(--violet-dark); background: var(--violet-soft); }
.nav-icon { width: 18px; text-align: center; font-size: 16px; }
.sidebar-bottom { margin-top: auto; padding: 17px 12px 0; border-top: 1px solid var(--line); }
.user-mini { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; color: #fff; border-radius: 50%; font-size: 12px; font-weight: 800; }
.avatar.large { width: 42px; height: 42px; flex-basis: 42px; }
.user-mini-name { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini-role { color: var(--muted); font-size: 11px; }
.logout { display: block; color: var(--muted); font-size: 12px; margin-top: 16px; }
.logout:hover { color: var(--red); }
.content { min-width: 0; flex: 1; padding: 30px 42px 50px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 42px; }
.topbar-title h1 { font-size: 27px; letter-spacing: -.05em; margin: 0; }
.topbar-title p { color: var(--muted); margin: 5px 0 0; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.search { min-width: 220px; position: relative; }
.search input { margin: 0; padding: 10px 13px 10px 35px; border: 0; background: #fff; border-radius: 10px; }
.search span { position: absolute; left: 13px; top: 9px; color: #a5a9bc; }
.top-avatar { display: flex; align-items: center; gap: 9px; }
.top-avatar .name { font-size: 12px; font-weight: 750; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 15px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat { padding: 19px 20px; }
.stat-top { display: flex; justify-content: space-between; align-items: start; color: var(--muted); font-size: 12px; }
.stat-icon { width: 28px; height: 28px; display: grid; place-items: center; color: var(--violet); background: var(--violet-soft); border-radius: 8px; }
.stat strong { display: block; font-size: 26px; letter-spacing: -.04em; margin-top: 16px; }
.stat small { color: var(--green); font-size: 11px; font-weight: 750; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 14px; margin: 0; }
.panel-head a { color: var(--violet); font-size: 12px; font-weight: 750; }
.empty-state { padding: 42px 25px; text-align: center; }
.empty-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; color: var(--violet); background: var(--violet-soft); border-radius: 14px; font-size: 21px; }
.empty-state strong { display: block; font-size: 15px; }
.empty-state p { color: var(--muted); max-width: 350px; margin: 7px auto 18px; }
.activity { display: grid; gap: 0; }
.activity-item { display: grid; grid-template-columns: 9px 1fr auto; align-items: start; gap: 12px; padding: 15px 21px; border-bottom: 1px solid var(--line); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--violet); }
.activity-item p { margin: 0; font-size: 12px; }
.activity-item time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.activity-item small { color: var(--muted); display: block; margin-top: 3px; }
.progress-card { padding: 21px; }
.progress-card h2 { font-size: 14px; margin: 0 0 18px; }
.progress-row { margin: 16px 0; }
.progress-label { display: flex; justify-content: space-between; color: #656a83; font-size: 12px; margin-bottom: 7px; }
.progress-track { height: 7px; background: #f0f1f6; border-radius: 5px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--violet); }
.progress-bar.green { background: #50b48e; }
.progress-bar.amber { background: #e4aa52; }

.page-header { display: flex; justify-content: space-between; align-items: end; margin-bottom: 24px; }
.page-header h2 { font-size: 21px; letter-spacing: -.04em; margin: 0; }
.page-header p { color: var(--muted); margin: 4px 0 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 19px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
td { font-size: 12px; }
tr:last-child td { border-bottom: 0; }
.person { display: flex; align-items: center; gap: 10px; }
.person strong { display: block; font-size: 12px; }
.person small { display: block; color: var(--muted); margin-top: 2px; }
.pill { display: inline-flex; padding: 4px 8px; border-radius: 99px; color: #6b7189; background: #f2f3f7; font-size: 10px; font-weight: 800; }
.pill.green { color: var(--green); background: var(--green-soft); }
.pill.red { color: var(--red); background: var(--red-soft); }
.pill.violet { color: var(--violet-dark); background: var(--violet-soft); }
.icon-button { border: 0; background: transparent; color: var(--muted); padding: 6px; border-radius: 7px; }
.icon-button:hover { color: var(--violet); background: var(--violet-soft); }
.settings-layout { display: grid; grid-template-columns: 190px minmax(0, 650px); gap: 24px; align-items: start; }
.settings-nav { padding: 8px; }
.settings-nav a { display: block; color: var(--muted); padding: 10px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.settings-nav a.active, .settings-nav a:hover { color: var(--violet-dark); background: var(--violet-soft); }
.settings-form { padding: 24px; display: grid; gap: 18px; }
.settings-form h3 { margin: 0; font-size: 15px; }
.settings-form .form-section { margin-top: 2px; }

@media (max-width: 950px) { .sidebar { width: 205px; flex-basis: 205px; } .content { padding: 25px; } .stats-grid { grid-template-columns: repeat(2, 1fr); } .dashboard-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .app-shell { display: block; } .sidebar { width: auto; padding: 16px; border-right: 0; border-bottom: 1px solid var(--line); } .sidebar .brand-lockup { margin: 0 0 15px; } .nav-label, .sidebar-bottom { display: none; } .nav { display: flex; overflow-x: auto; } .nav a { white-space: nowrap; } .content { padding: 24px 16px 40px; } .topbar { align-items: flex-start; margin-bottom: 30px; } .topbar-actions { display: none; } .stats-grid { gap: 10px; } .stat { padding: 15px; } .stat strong { font-size: 22px; } .settings-layout { grid-template-columns: 1fr; } .settings-nav { display: flex; overflow-x: auto; } .settings-nav a { white-space: nowrap; } }
@media (max-width: 480px) { .auth-card { padding: 28px 22px; } .form-grid.two { grid-template-columns: 1fr; } .topbar-title h1 { font-size: 23px; } }
