:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #f1f4f9;
    --text: #172033;
    --muted: #6d778a;
    --border: #e5e9f1;
    --primary: #5065f6;
    --primary-dark: #3d4ed0;
    --success: #15966b;
    --danger: #d94d65;
    --sidebar: #11182a;
    --sidebar-muted: #919bb1;
    --shadow: 0 20px 60px rgba(31, 45, 84, .12);
    --radius: 18px;
}
html[data-theme="dark"] {
    --bg: #0e1320;
    --surface: #151c2d;
    --surface-soft: #1d2639;
    --text: #edf1fb;
    --muted: #9da8bc;
    --border: #273147;
    --sidebar: #0b101c;
    --shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.guest-body { display: grid; place-items: center; padding: 32px 18px; background:
    radial-gradient(circle at 10% 10%, rgba(80,101,246,.18), transparent 35%),
    radial-gradient(circle at 90% 85%, rgba(21,150,107,.13), transparent 30%),
    var(--bg); }
.guest-shell { width: min(100%, 470px); }
.guest-theme { position: fixed; right: 22px; top: 22px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow); padding: 34px; }
.auth-brand, .brand, .user-mini, .topbar-left, .topbar-actions { display: flex; align-items: center; }
.auth-brand { gap: 13px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.auth-brand strong, .brand strong { display: block; font-size: 18px; }
.auth-brand span, .brand span, .user-mini span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 800; background: linear-gradient(135deg, #5065f6, #7857d8); box-shadow: 0 8px 20px rgba(80,101,246,.35); }
.brand-mark.large { width: 46px; height: 46px; border-radius: 15px; font-size: 20px; }
.auth-heading { padding: 30px 0 21px; }
.auth-heading h1 { margin: 6px 0 8px; font-size: 30px; letter-spacing: -.7px; }
.auth-heading p { margin: 0; color: var(--muted); line-height: 1.55; }
.eyebrow { color: var(--primary); text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; }
.auth-form { display: grid; gap: 17px; }
.auth-form label > span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.auth-form input { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); border-radius: 12px; outline: none; transition: .2s; }
.auth-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(80,101,246,.13); background: var(--surface); }
.password-field { position: relative; }
.password-field input { padding-right: 70px; }
.password-field button { position: absolute; right: 8px; top: 7px; height: 34px; border: 0; border-radius: 8px; padding: 0 10px; background: transparent; color: var(--primary); cursor: pointer; font-size: 12px; font-weight: 700; }
.primary-button { border: 0; border-radius: 12px; min-height: 49px; display: grid; place-items: center; padding: 0 18px; color: white; font-weight: 800; cursor: pointer; background: linear-gradient(135deg, var(--primary), #715be6); box-shadow: 0 10px 25px rgba(80,101,246,.28); transition: transform .2s, box-shadow .2s; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(80,101,246,.35); }
.link-button { margin-top: 22px; }
.auth-help { text-align: center; color: var(--muted); font-size: 13px; margin: 24px 0 0; }
.auth-help a { color: var(--primary); font-weight: 700; }
.alert { padding: 13px 14px; border-radius: 11px; margin: 0 0 18px; font-size: 13px; line-height: 1.45; }
.alert-error { color: #b3344b; background: rgba(217,77,101,.1); border: 1px solid rgba(217,77,101,.22); }
.alert-success { color: #087650; background: rgba(21,150,107,.1); border: 1px solid rgba(21,150,107,.22); }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; background: var(--sidebar); color: white; z-index: 30; }
.brand { gap: 11px; padding: 0 8px 24px; }
.brand-copy span { color: var(--sidebar-muted); }
.sidebar-nav { display: grid; gap: 6px; }
.nav-item { min-height: 46px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border-radius: 12px; color: #b3bdd0; font-size: 14px; transition: .2s; }
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.09); color: white; }
.nav-item.active { box-shadow: inset 3px 0 0 #7d8cff; }
.nav-item small { margin-left: auto; font-size: 9px; color: #778198; text-transform: uppercase; }
.nav-item.disabled { cursor: default; }
.nav-icon { width: 21px; text-align: center; font-size: 17px; }
.nav-label { padding: 22px 13px 7px; color: #667188; font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding: 16px 6px 0; }
.user-mini { gap: 10px; }
.user-mini strong { display: block; font-size: 13px; }
.user-mini span { color: var(--sidebar-muted); }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: rgba(125,140,255,.17); color: #aeb8ff; font-weight: 800; }
.main-area { min-width: 0; }
.topbar { min-height: 88px; padding: 17px 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-left { gap: 14px; }
.topbar h1 { margin: 0; font-size: 20px; }
.topbar p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.topbar-actions { gap: 9px; }
.icon-button { width: 41px; height: 41px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); cursor: pointer; }
.logout-button { min-height: 41px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-weight: 700; font-size: 12px; }
.mobile-menu { display: none; }
.content-area { padding: 28px 30px 45px; }
.dashboard-grid { display: grid; gap: 24px; }
.welcome-card { min-height: 190px; border-radius: var(--radius); padding: 30px; display: flex; align-items: center; justify-content: space-between; overflow: hidden; color: white; background: linear-gradient(125deg, #4058e7, #7158d9 55%, #8b5ed0); box-shadow: 0 20px 45px rgba(64,88,231,.25); }
.welcome-card h2 { margin: 7px 0 10px; font-size: 30px; }
.welcome-card p { max-width: 620px; margin: 0; opacity: .83; line-height: 1.6; }
.welcome-card .eyebrow { color: #cdd4ff; }
.welcome-visual { width: 130px; height: 130px; border: 1px solid rgba(255,255,255,.22); border-radius: 38px; display: grid; place-items: center; transform: rotate(9deg); background: rgba(255,255,255,.1); }
.welcome-visual span { font-size: 58px; line-height: 1; }
.welcome-visual small { margin-top: -35px; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.stat-card, .panel-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 35px rgba(30,45,80,.05); }
.stat-card { display: flex; gap: 14px; align-items: center; padding: 20px; }
.stat-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--primary); background: rgba(80,101,246,.1); font-size: 20px; }
.stat-card small { color: var(--muted); }
.stat-card strong { display: block; margin: 3px 0; font-size: 25px; }
.stat-card p { margin: 0; color: var(--muted); font-size: 11px; }
.dashboard-columns { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.75fr); gap: 20px; }
.panel-card { padding: 23px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel-header h3 { margin: 4px 0 0; font-size: 18px; }
.badge { background: rgba(80,101,246,.1); color: var(--primary); border-radius: 20px; padding: 7px 10px; font-size: 10px; font-weight: 800; }
.progress-list { display: grid; gap: 8px; }
.progress-item { display: flex; gap: 13px; align-items: center; padding: 13px; border-radius: 13px; background: var(--surface-soft); }
.progress-item > span { width: 29px; height: 29px; border-radius: 9px; display: grid; place-items: center; background: var(--border); color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-item.done > span { background: rgba(21,150,107,.12); color: var(--success); }
.progress-item.current { border: 1px solid rgba(80,101,246,.24); }
.progress-item.current > span { background: rgba(80,101,246,.12); color: var(--primary); }
.progress-item strong, .quick-card strong { display: block; font-size: 13px; }
.progress-item small, .quick-card small { color: var(--muted); font-size: 11px; }
.quick-card > a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-top: 1px solid var(--border); }
.quick-card > a > span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-soft); }
.quick-card > a > div { flex: 1; }
.quick-card > a b { color: var(--muted); }
.sidebar-overlay { display: none; }
@media (max-width: 1050px) {
    .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .dashboard-columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .app-shell { display: block; }
    .sidebar { position: fixed; left: 0; top: 0; width: 270px; transform: translateX(-105%); transition: transform .25s; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; background: rgba(5,9,18,.55); z-index: 25; }
    .sidebar-open .sidebar-overlay { display: block; }
    .mobile-menu { display: block; }
    .topbar { padding: 14px 17px; }
    .topbar-actions .icon-button:nth-child(2) { display: none; }
    .logout-button { padding: 0 10px; }
    .content-area { padding: 20px 16px 35px; }
    .welcome-card { padding: 23px; }
    .welcome-card h2 { font-size: 25px; }
    .welcome-visual { display: none; }
}
@media (max-width: 520px) {
    .auth-card { padding: 25px 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .topbar p { display: none; }
    .topbar h1 { font-size: 17px; }
}

/* GuideCloud UI Kit v1 */
.page-actions{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-bottom:22px}.page-actions h2{margin:5px 0 7px;font-size:27px}.page-actions p{margin:0;color:var(--muted)}
.gc-button{min-height:42px;padding:0 15px;border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text);display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:750;font-size:13px;cursor:pointer}.gc-button-primary{background:linear-gradient(135deg,var(--primary),#715be6);border-color:transparent;color:#fff;box-shadow:0 9px 22px rgba(80,101,246,.22)}.gc-button-ghost{background:transparent}.gc-button-block{width:100%}
.gc-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:0 10px 35px rgba(30,45,80,.05)}
.gc-alert{display:flex;align-items:center;gap:11px;padding:13px 15px;border-radius:12px;margin-bottom:16px;font-size:13px}.gc-alert>span{width:24px;height:24px;display:grid;place-items:center;border-radius:8px;font-weight:900}.gc-alert>div{flex:1}.gc-alert button{border:0;background:transparent;color:inherit;font-size:18px;cursor:pointer}.gc-alert-success{background:rgba(21,150,107,.1);color:var(--success);border:1px solid rgba(21,150,107,.2)}.gc-alert-error{background:rgba(217,77,101,.1);color:var(--danger);border:1px solid rgba(217,77,101,.2)}
.filter-bar{display:grid;grid-template-columns:minmax(240px,1fr) 180px 180px auto auto;gap:10px;margin-bottom:16px}.filter-bar select,.filter-bar input,.gc-field input,.gc-field select{min-height:44px;border:1px solid var(--border);border-radius:11px;background:var(--surface);color:var(--text);padding:0 13px;outline:none}.gc-search{position:relative}.gc-search span{position:absolute;left:14px;top:12px;color:var(--muted)}.gc-search input{width:100%;padding-left:39px}
.table-card{overflow:hidden}.table-summary{display:flex;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--border)}.table-summary span{color:var(--muted);font-size:12px}.responsive-table{overflow:auto}.gc-table{width:100%;border-collapse:collapse;min-width:850px}.gc-table th{text-align:left;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.8px;padding:13px 18px;background:var(--surface-soft)}.gc-table td{padding:15px 18px;border-top:1px solid var(--border);font-size:13px}.table-user{display:flex;align-items:center;gap:11px}.table-user strong,.table-user span{display:block}.table-user span{margin-top:3px;color:var(--muted);font-size:11px}.gc-badge{display:inline-flex;padding:6px 9px;border-radius:9px;background:var(--surface-soft);color:var(--muted);font-size:10px;font-weight:800}.status-pill{display:inline-flex;padding:6px 9px;border-radius:20px;font-size:10px;font-weight:800}.status-active{background:rgba(21,150,107,.1);color:var(--success)}.status-suspended{background:rgba(217,77,101,.1);color:var(--danger)}.status-inactive{background:var(--surface-soft);color:var(--muted)}.muted{color:var(--muted)}.row-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px}.row-actions a,.row-actions button{width:32px;height:32px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);display:grid;place-items:center;cursor:pointer}.row-actions form{margin:0}.pagination{display:flex;justify-content:center;gap:6px;padding:17px;border-top:1px solid var(--border)}.pagination a{width:34px;height:34px;border-radius:9px;display:grid;place-items:center;background:var(--surface-soft);font-size:12px}.pagination a.active{background:var(--primary);color:#fff}
.empty-state{text-align:center;padding:38px;color:var(--muted)}.empty-state>span{font-size:35px}.empty-state strong{display:block;color:var(--text);margin:8px 0}.empty-state p{margin:0}
.form-card{padding:24px}.form-section+.form-section{border-top:1px solid var(--border);margin-top:26px;padding-top:26px}.section-heading{display:flex;gap:13px;margin-bottom:20px}.section-heading>span{width:35px;height:35px;border-radius:11px;background:rgba(80,101,246,.1);color:var(--primary);display:grid;place-items:center;font-size:11px;font-weight:900}.section-heading h3{margin:0 0 4px}.section-heading p{margin:0;color:var(--muted);font-size:12px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}.field-wide{grid-column:1/-1}.gc-field>span{display:block;font-size:12px;font-weight:750;margin-bottom:8px}.gc-field input,.gc-field select{width:100%}.form-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:25px;padding-top:20px;border-top:1px solid var(--border)}
.role-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.role-card{padding:21px}.role-card-top{display:flex;justify-content:space-between}.role-icon{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:rgba(80,101,246,.1);color:var(--primary);font-weight:900}.role-card h3{margin:17px 0 6px}.role-card p{color:var(--muted);font-size:12px;min-height:36px}.role-metrics{display:flex;gap:20px;padding:14px 0 18px;border-top:1px solid var(--border);font-size:11px;color:var(--muted)}.role-metrics strong{color:var(--text);font-size:16px}
.permissions-card{padding:22px}.permissions-toolbar{display:flex;justify-content:space-between;align-items:center;padding-bottom:18px;border-bottom:1px solid var(--border)}.permissions-toolbar span{display:block;color:var(--muted);font-size:11px;margin-top:3px}.permission-groups{display:grid;gap:20px;margin-top:20px}.permission-groups>section{border:1px solid var(--border);border-radius:15px;padding:17px}.permission-group-title{display:flex;gap:11px;align-items:center;margin-bottom:13px}.permission-group-title>span{width:35px;height:35px;border-radius:10px;display:grid;place-items:center;background:var(--surface-soft);font-weight:900}.permission-group-title h3,.permission-group-title p{margin:0}.permission-group-title p{color:var(--muted);font-size:10px}.permission-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.permission-list label{position:relative;display:flex;align-items:center;gap:10px;padding:12px;border-radius:11px;background:var(--surface-soft);cursor:pointer}.permission-list input{accent-color:var(--primary)}.permission-list strong,.permission-list small{display:block}.permission-list strong{font-size:11px}.permission-list small{color:var(--muted);font-size:9px}
.timeline-card{padding:23px}.gc-timeline{display:grid}.gc-timeline article{position:relative;display:grid;grid-template-columns:24px 1fr;gap:11px;padding-bottom:22px}.gc-timeline article:not(:last-child):before{content:"";position:absolute;left:6px;top:15px;bottom:0;width:1px;background:var(--border)}.timeline-dot{width:13px;height:13px;margin-top:3px;border-radius:50%;background:var(--primary);box-shadow:0 0 0 4px rgba(80,101,246,.1)}.timeline-top{display:flex;justify-content:space-between;gap:15px}.timeline-top time,.gc-timeline article span{color:var(--muted);font-size:10px}
.ui-showcase{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px}.showcase-section{padding:21px}.showcase-section h3{margin-top:0}.component-row{display:flex;flex-wrap:wrap;gap:9px;align-items:center}
.gc-modal{position:fixed;inset:0;display:none;place-items:center;z-index:100;padding:20px}.gc-modal.open{display:grid}.gc-modal-backdrop{position:absolute;inset:0;background:rgba(5,9,18,.62)}.gc-modal-panel{position:relative;width:min(100%,470px);background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:22px;box-shadow:var(--shadow)}.gc-modal-header{display:flex;justify-content:space-between}.gc-modal-header h3{margin:0}.gc-modal-header button{border:0;background:transparent;color:var(--text);font-size:22px}
.gc-toast-container{position:fixed;right:20px;bottom:20px;display:grid;gap:9px;z-index:150}.gc-toast{min-width:280px;padding:14px 16px;border-radius:12px;background:var(--sidebar);color:#fff;box-shadow:var(--shadow);animation:toast-in .25s ease}@keyframes toast-in{from{transform:translateY(15px);opacity:0}}
@media(max-width:950px){.filter-bar{grid-template-columns:1fr 1fr}.gc-search{grid-column:1/-1}.role-grid{grid-template-columns:repeat(2,1fr)}.permission-list{grid-template-columns:repeat(2,1fr)}}@media(max-width:620px){.page-actions{align-items:stretch;flex-direction:column}.filter-bar,.form-grid,.role-grid,.permission-list,.ui-showcase{grid-template-columns:1fr}.field-wide{grid-column:auto}.permissions-toolbar{align-items:flex-start;gap:12px;flex-direction:column}}
