:root {
    color-scheme: light;
    --ink: #17212f;
    --muted: #697586;
    --line: #e8e9ee;
    --surface: #fff;
    --soft: #f7f7fa;
    --blue: #4f46e5;
    --blue-dark: #4338ca;
    --blue-soft: #eeedfd;
    --green: #2e8666;
    --shadow: none;
    --sidebar-width: 244px;
}

body {
    background: #f7f8fa;
    color: var(--ink);
    font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -.01em;
    -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid #827aeb; outline-offset: 3px; }
.ui-icon { display: inline-block; flex: 0 0 auto; vertical-align: middle; }
.skip-link { position: fixed; left: 18px; top: -80px; z-index: 100; padding: 10px 15px; border-radius: 7px; background: var(--ink); color: #fff; font-size: 14px; }
.skip-link:focus { top: 12px; }
.admin-shell { min-height: 100dvh; background: #f7f8fa; }
.admin-shell.nav-open::after { display: none; content: none; }

.sidebar {
    inset: 0 auto 0 0;
    z-index: 30;
    display: flex;
    width: var(--sidebar-width);
    height: 100dvh;
    flex: 0 0 var(--sidebar-width);
    flex-direction: column;
    padding: 27px 15px 17px;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: #fff;
    color: #626c7b;
    box-shadow: none;
}
.sidebar-brand-row { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-brand { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 0 9px; }
.sidebar-brand strong { display: block; color: #192233; font-size: 17px; font-weight: 720; letter-spacing: -.055em; line-height: 1.25; }
.sidebar-brand small { display: block; margin-top: 4px; color: #6b7280; font-size: 11px; font-weight: 450; letter-spacing: .015em; }
.brand-mark { display: inline-flex; width: 35px; height: 35px; flex: 0 0 35px; align-items: center; justify-content: center; border-radius: 10px; background: #eeedfd; color: var(--blue); box-shadow: none; }
.brand-period { color: var(--blue); }
.workspace-switcher { display: flex; flex: 0 0 auto; flex-direction: row; align-items: center; gap: 9px; margin: 29px 3px 20px; padding: 12px 10px; border: 1px solid #e8e9ef; border-radius: 8px; background: #fafafb; box-shadow: none; }
.workspace-switcher:hover { border-color: #d8d5f4; background: #f7f6fd; }
.workspace-symbol { display: grid; width: 30px; height: 32px; flex: 0 0 30px; place-items: center; border: 1px solid #e4e4ed; border-radius: 7px; background: #fff; color: #6e688f; }
.workspace-switcher-copy { min-width: 0; flex: 1; }
.workspace-switcher-copy > small { display: block; margin-bottom: 3px; color: #6b7280; font-size: 9px; font-weight: 650; letter-spacing: .085em; }
.workspace-switcher-copy > strong { display: block; overflow: hidden; color: #41495b; font-size: 12px; font-weight: 650; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.workspace-switcher-arrow { color: #979bab; }
.sidebar-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 3px; margin: 0 -3px; padding: 0 3px 14px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #dedee7 transparent; scrollbar-width: thin; }
.nav-label { flex: 0 0 auto; padding: 5px 12px 7px; color: #6b7280; font-size: 10px; font-weight: 650; letter-spacing: .08em; }
.nav-label-spaced { margin-top: 18px; }
.nav-link { display: flex; min-height: 39px; flex: 0 0 auto; align-items: center; gap: 11px; padding: 9px 12px; border: 0; border-radius: 7px; background: transparent; color: #626b7a; font-size: 13px; font-weight: 500; line-height: 1.4; box-shadow: none; transition: background-color .15s ease, color .15s ease; }
.nav-link > .ui-icon { width: 18px; height: 18px; color: #9297a4; }
.nav-link > span { min-width: 0; }
.nav-link:hover { transform: none; background: #f7f7fa; color: #353c4e; }
.nav-link.active { background: #eeedfd; color: #5549d7; font-weight: 650; box-shadow: none; }
.nav-link.active > .ui-icon { color: #6558e3; }
.nav-link .nav-external-icon { width: 13px; height: 13px; margin-left: auto; color: #a3a3b3; }
.sidebar-footer { flex: 0 0 auto; margin-top: 0; padding: 16px 8px 0; border-top: 1px solid var(--line); }
.sidebar-access-note { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; color: #9ca1af; }
.sidebar-access-note > .ui-icon { color: #9892b3; }
.sidebar-access-note > span { display: block; color: #626b7a; font-size: 11px; font-weight: 600; line-height: 1.5; }
.sidebar-access-note small { display: block; margin-top: 1px; color: #6b7280; font-size: 10px; font-weight: 400; }
.logout-link { display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 0; border: 0; background: transparent; color: #6b7280; font-size: 12px; line-height: 1.5; text-align: left; }
.logout-link:hover { color: #4d46b5; }
.sidebar-close, .sidebar-backdrop { display: none; }
.sidebar-backdrop[hidden] { display: none; }

.admin-content { width: calc(100% - var(--sidebar-width)); min-width: 0; min-height: 100dvh; margin-left: var(--sidebar-width); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 76px; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 36px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: none; backdrop-filter: none; }
.topbar-start { display: flex; min-width: 0; align-items: center; gap: 13px; }
.workspace-breadcrumb { display: flex; min-width: 0; align-items: center; gap: 11px; color: #b0b3bd; font-size: 12px; }
.workspace-breadcrumb > a { color: #6b7280; }
.workspace-breadcrumb > a:hover { color: var(--blue); }
.workspace-breadcrumb > span[aria-current] { overflow: hidden; color: #535b6b; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.topbar-user .avatar { display: flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid #e4e2f1; border-radius: 50%; background: #f2f0fa; color: #7a6da1; font-size: 12px; font-weight: 650; }
.topbar-user-copy { min-width: 0; }
.topbar-user strong { max-width: 180px; overflow: hidden; color: #596071; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.topbar-user small { margin-top: 2px; color: #6b7280; font-size: 10px; }
.mobile-menu-toggle { display: none; }
.content-panel { width: 100%; max-width: 1470px; margin: 0 auto; padding: 31px 36px 60px; }
.content-panel:focus { outline: none; }

.page-heading { align-items: flex-start; gap: 20px; margin-bottom: 26px; }
.page-heading h1, .page-heading h2 { margin: 5px 0 8px; color: var(--ink); font-size: 28px; font-weight: 650; letter-spacing: -.045em; line-height: 1.25; }
.page-heading p { max-width: 760px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.eyebrow-dark { color: #6b7280; font-size: 10px; font-weight: 650; letter-spacing: .1em; }
.button { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 1px solid #4f46e5; border-radius: 7px; background: var(--blue); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.4; box-shadow: none; transition: background-color .15s ease, border-color .15s ease; }
.button:hover { transform: none; filter: none; background: #4338ca; border-color: #4338ca; box-shadow: none; }
.button.secondary { background: #fff; border-color: #e5e6ec; color: #656c7b; box-shadow: none; }
.button.secondary:hover { background: #f9f9fc; border-color: #d6d4ea; color: #5147c4; }
.button .ui-icon { width: 16px; height: 16px; }
.panel-card, .stat-card, .feature-card, .table-wrap { border: 1px solid #e8e9ee; border-radius: 10px; background: #fff; box-shadow: none; }
.panel-card { padding: 23px; }
.panel-card h3 { margin-bottom: 5px; color: #3e475a; font-size: 16px; font-weight: 600; letter-spacing: -.025em; }
.panel-card > p { color: #6b7280; font-size: 13px; line-height: 1.8; }
.stat-card::after { display: none; content: none; }
.stat-card { padding: 20px; }
.stat-label { color: #6b7280; font-size: 12px; }
.stat-value { margin-top: 12px; color: #293245; font-size: 30px; font-weight: 600; letter-spacing: -.055em; }
.stat-caption { color: #6b7280; font-size: 11px; }
.data-table th { background: #fcfcfd; color: #6b7280; font-size: 10px; font-weight: 600; letter-spacing: .035em; }
.data-table td { color: #636c7e; font-size: 13px; }
.data-table th, .data-table td { padding: 15px 18px; border-color: #eeeff3; }
.data-table tbody tr:hover { background: #fafafe; }
.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 5px; background: #edf7f1; color: #347451; font-size: 10px; font-weight: 550; letter-spacing: 0; white-space: nowrap; }
.status-pill.off { background: #f2f3f6; color: #6b7280; }
.notice { margin-bottom: 18px; padding: 13px 15px; border: 1px solid #efdfbc; border-radius: 8px; background: #fffaf0; color: #8a6a2c; font-size: 13px; line-height: 1.8; box-shadow: none; }
.notice.success { border-color: #d4e9dc; background: #f1faf5; color: #5d8c70; }
.muted { color: var(--muted); font-size: 13px; line-height: 1.8; }
.empty-state { border: 1px dashed #e0e2eb; border-radius: 10px; background: #fff; color: #6b7280; box-shadow: none; }
.training-form label, .settings-form label, .profile-form label, .prompt-form label, .workshop-form label { color: #667085; font-size: 12px; font-weight: 550; }
.training-form input:not([type="checkbox"]), .training-form textarea, .training-form select, .settings-form input:not([type="checkbox"]), .settings-form textarea, .settings-form select, .profile-form input:not([type="checkbox"]), .profile-form textarea, .profile-form select, .prompt-form input, .prompt-form textarea, .workshop-form input, .workshop-form textarea { min-height: 42px; border-color: #e3e5ed; border-radius: 7px; background: #fff; color: #596375; font-size: 14px; }
.training-form input:focus, .training-form textarea:focus, .training-form select:focus, .settings-form input:focus, .settings-form textarea:focus, .settings-form select:focus, .profile-form input:focus, .profile-form textarea:focus, .profile-form select:focus, .prompt-form input:focus, .prompt-form textarea:focus, .workshop-form input:focus, .workshop-form textarea:focus { border-color: #b6b0ed; box-shadow: none; outline: 2px solid #eeedfb; outline-offset: 1px; }
.check-row input, .profile-check input { accent-color: var(--blue); }

.auth-body { min-height: 100dvh; background: #fff; }
.auth-shell { display: grid; min-height: 100dvh; grid-template-columns: minmax(0,1fr) minmax(0,1.06fr); }
.auth-brand-panel { display: flex; min-height: 100dvh; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 45px clamp(35px,4.5vw,70px) 31px; border-right: 1px solid #e7e8ef; background: #f2f3f8; }
.auth-brand { display: inline-flex; align-items: center; gap: 10px; color: #222b3f; font-size: 20px; font-weight: 700; letter-spacing: -.055em; }
.auth-brand .brand-mark { width: 38px; height: 38px; flex-basis: 38px; border: 1px solid #dedcf1; background: #fff; border-radius: 11px; }
.auth-brand-story { width: 100%; max-width: 455px; padding: 50px 0 35px; }
.auth-eyebrow { color: #6b7280; font-size: 10px; font-weight: 650; letter-spacing: .08em; line-height: 1.8; }
.auth-brand-story h2 { margin: 18px 0 21px; color: #2a3346; font-size: clamp(40px,4.3vw,62px); font-weight: 620; letter-spacing: -.065em; line-height: 1.15; }
.auth-brand-story h2 > span { color: #72758e; }
.auth-brand-story > p { max-width: 345px; margin-bottom: 0; color: #697586; font-size: 14px; line-height: 1.9; }
.auth-workspace-visual { max-width: 425px; margin-top: 32px; overflow: hidden; border: 1px solid #dfe0ea; border-radius: 11px; background: #fff; }
.auth-visual-toolbar { display: flex; height: 31px; align-items: center; gap: 4px; padding: 0 12px; border-bottom: 1px solid #eeedf4; background: #fafafd; }
.auth-visual-toolbar > span { width: 4px; height: 4px; border: 1px solid #d8d7e7; border-radius: 50%; }
.auth-visual-toolbar > i { width: 85px; height: 4px; margin: 0 auto; border-radius: 4px; background: #e9e8f2; }
.auth-visual-body { display: flex; min-height: 186px; }
.auth-visual-navigation { display: flex; width: 51px; flex-shrink: 0; flex-direction: column; align-items: center; gap: 20px; padding: 20px 0; border-right: 1px solid #efedf6; color: #c4c2d5; }
.auth-visual-navigation > .ui-icon:first-child { color: #8a83d5; }
.auth-visual-content { min-width: 0; flex: 1; padding: 18px 19px; }
.auth-visual-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.auth-visual-heading > span { width: 92px; height: 6px; border-radius: 4px; background: #dcdae9; }
.auth-visual-heading > i { width: 36px; height: 11px; border-radius: 3px; background: #eeecfc; }
.auth-visual-cards { display: flex; gap: 9px; }
.auth-visual-cards > div { display: grid; flex: 1; grid-template-columns: 26px 1fr; align-items: center; gap: 7px; padding: 11px 9px; border: 1px solid #ecebf3; border-radius: 6px; color: #a7a1ce; }
.auth-visual-cards .ui-icon { grid-row: span 2; }
.auth-visual-cards span, .auth-visual-cards i { display: block; height: 4px; border-radius: 3px; background: #e7e5f1; }
.auth-visual-cards i { width: 65%; background: #f0eff7; }
.auth-visual-message { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 10px; border: 1px solid #eeedf5; border-radius: 6px; background: #fbfafe; color: #b6b0d4; }
.auth-visual-message > span { display: grid; width: 25px; height: 25px; flex-shrink: 0; place-items: center; border-radius: 7px; background: #eeecfa; }
.auth-visual-message > div { display: grid; flex: 1; gap: 4px; }
.auth-visual-message i { width: 75%; height: 3px; border-radius: 3px; background: #e5e2f0; }
.auth-visual-message i:nth-child(2) { width: 90%; }
.auth-visual-message i:nth-child(3) { width: 58%; }
.auth-brand-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #6b7280; font-size: 9px; letter-spacing: .08em; }
.auth-brand-footer i { width: 3px; height: 3px; border-radius: 50%; background: #c1becf; }
.auth-form-panel { display: flex; min-width: 0; min-height: 100dvh; flex-direction: column; align-items: center; justify-content: center; padding: 60px 40px; background: #fff; }
.auth-card { width: min(100%,390px); max-width: 390px; margin: auto 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.auth-card:focus { outline: none; }
.auth-card > .auth-eyebrow { display: block; margin-bottom: 14px; color: #6b7280; }
.auth-card h1 { margin: 0 0 13px; color: #252d3e; font-size: 31px; font-weight: 650; letter-spacing: -.05em; line-height: 1.3; }
.auth-card .auth-intro { margin-bottom: 30px; color: #697586; font-size: 14px; line-height: 1.8; }
.auth-form { display: flex; flex-direction: column; }
.auth-card .auth-form label { margin: 0 0 9px; color: #667085; font-size: 12px; font-weight: 550; }
.auth-card .auth-form input { min-height: 46px; margin: 0 0 21px; padding: 11px 13px; border: 1px solid #e1e4ec; border-radius: 7px; background: #fff; color: #566074; font-size: 14px; }
.auth-card .auth-form input:focus-visible { border-color: #b0aaea; outline: 2px solid #eeedfb; outline-offset: 1px; }
.auth-card .auth-form button { display: flex; min-height: 46px; align-items: center; justify-content: center; gap: 13px; margin-top: 5px; padding: 12px 16px; border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: #fff; font-size: 13px; font-weight: 550; box-shadow: none; }
.auth-card .auth-form button:hover { border-color: #4338ca; background: #4338ca; }
.auth-card .auth-form button .ui-icon { width: 17px; height: 17px; }
.auth-help { margin: 23px 0 20px; color: #697586; font-size: 12px; line-height: 1.9; }
.auth-back { display: inline-flex; align-items: center; gap: 7px; color: #6b7280; font-size: 12px; }
.auth-back:hover { color: #6558bf; }
.auth-back .ui-icon { width: 14px; height: 14px; transform: rotate(180deg); }
.auth-shell-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 34px 0 0; color: #6b7280; font-size: 12px; }
.auth-card > .notice { font-size: 12px; }

@media (max-width: 1100px) {
    .topbar { padding-right: 25px; padding-left: 25px; }
    .content-panel { padding-right: 25px; padding-left: 25px; }
    .auth-brand-panel { padding-right: 35px; padding-left: 35px; }
    .auth-brand-story h2 { font-size: 46px; }
}

@media (max-width: 760px) {
    .sidebar { z-index: 60; display: flex; width: 264px; max-width: calc(100vw - 48px); height: 100dvh; visibility: hidden; transform: translateX(-100%); transition: none; }
    .admin-shell.nav-open .sidebar { z-index: 60; visibility: visible; transform: translateX(0); }
    .sidebar-close { display: inline-flex; width: 31px; height: 31px; flex: 0 0 31px; align-items: center; justify-content: center; padding: 0; border: 1px solid #ebeaf3; border-radius: 7px; background: #fff; color: #a4a0b7; }
    .sidebar-close .ui-icon { width: 17px; height: 17px; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 55; display: block; width: 100%; height: 100dvh; padding: 0; border: 0; background: #17212f66; }
    .sidebar-backdrop[hidden] { display: none; }
    .staff-nav-open { overflow: hidden; }
    .admin-content { width: 100%; margin-left: 0; }
    .topbar { min-height: 68px; align-items: center; gap: 12px; padding: 14px 19px; }
    .mobile-menu-toggle { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; align-items: center; justify-content: center; margin: 0; padding: 0; border: 1px solid #e6e6ed; border-radius: 7px; background: #fff; color: #85819c; }
    .mobile-menu-toggle .ui-icon { width: 18px; height: 18px; }
    .workspace-breadcrumb { gap: 8px; font-size: 11px; }
    .workspace-breadcrumb > span[aria-current] { max-width: 180px; }
    .admin-body .topbar-user .topbar-user-copy { display: block; }
    .topbar-user strong { max-width: 105px; font-size: 11px; }
    .topbar-user small { font-size: 10px; }
    .topbar-user .avatar { width: 30px; height: 30px; font-size: 11px; }
    .content-panel { padding: 24px 19px 42px; }
    .page-heading { gap: 14px; }
    .page-heading h1, .page-heading h2 { font-size: 25px; }
    .page-heading p { font-size: 12px; }
    .panel-card { padding: 19px; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand-panel { min-height: auto; padding: 28px 28px 30px; border-right: 0; border-bottom: 1px solid #e7e8ef; }
    .auth-brand { font-size: 18px; }
    .auth-brand-story { max-width: 540px; padding: 30px 0 0; }
    .auth-brand-story > .auth-eyebrow, .auth-brand-story h2, .auth-brand-story > p, .auth-workspace-visual, .auth-brand-footer { display: none; }
    .auth-brand-story { display: none; }
    .auth-form-panel { min-height: calc(100dvh - 99px); padding: 48px 27px 24px; }
    .auth-card { width: min(100%,390px); max-width: 390px; }
    .auth-card h1 { font-size: 29px; }
    .auth-card .auth-form input { font-size: 16px; }
    .auth-shell-note { margin-top: 45px; }
}

@media (max-width: 420px) {
    .topbar { padding-right: 15px; padding-left: 15px; }
    .workspace-breadcrumb > a, .workspace-breadcrumb > span:not([aria-current]) { display: none; }
    .workspace-breadcrumb > span[aria-current] { max-width: 150px; }
    .admin-body .topbar-user .topbar-user-copy { display: none; }
    .content-panel { padding-right: 15px; padding-left: 15px; }
}

@media (prefers-reduced-motion: reduce) {
    .sidebar, .nav-link, .button { transition: none; }
}
