:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --ink: #17171b;
    --muted: #6e6e73;
    --line: #e7e7eb;
    --blue: #2475ff;
    --navy: #111827;
    --shadow: 0 18px 50px rgba(22, 28, 45, .08);
}
* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); }
body { margin: 0; background: var(--bg); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px 20px; background: rgba(255,255,255,.92); border-right: 1px solid var(--line); display: flex; flex-direction: column; backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.03em; font-size: 19px; }
.brand-mark, .mobile-logo { width: 35px; height: 35px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #111827, #2563eb); box-shadow: 0 9px 24px rgba(37,99,235,.25); }
.nav { display: grid; gap: 6px; margin-top: 46px; }
.nav-link { min-height: 44px; display: flex; gap: 13px; align-items: center; padding: 0 13px; border-radius: 12px; color: #626268; font-size: 14px; font-weight: 600; }
.nav-link.active { color: #fff; background: var(--navy); box-shadow: 0 10px 25px rgba(17,24,39,.16); }
.nav-link.disabled { opacity: .48; }
.sidebar-user { margin-top: auto; padding: 14px 10px 2px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #e8efff; color: #245ccd; font-weight: 800; }
.sidebar-user-copy { min-width: 0; flex: 1; display: grid; }
.sidebar-user-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.sidebar-user-copy span { color: var(--muted); font-size: 11px; }
.logout-button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.main { width: 100%; max-width: 1460px; margin: 0 auto; padding: 32px 44px 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.topbar h1 { margin: 3px 0 0; font-size: 30px; letter-spacing: -.045em; }
.eyebrow { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.topbar-badge, .count-badge { padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 650; }
.welcome-card { min-height: 225px; padding: 38px 40px; border-radius: 28px; overflow: hidden; position: relative; color: #fff; background: linear-gradient(130deg, #111827 0%, #17233d 58%, #1f4d97 100%); display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow); }
.welcome-card h2 { margin: 22px 0 9px; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.055em; }
.welcome-card p { margin: 0; max-width: 610px; color: #c8d2e4; font-size: 16px; line-height: 1.6; }
.pill { display: inline-flex; padding: 7px 11px; border-radius: 999px; background: #edf3ff; color: #245ccd; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.pill-dark { color: #dce9ff; background: rgba(255,255,255,.11); }
.cycle-symbol { width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; display: grid; grid-template-columns: 1fr 1fr; place-items: center; transform: rotate(12deg); background: rgba(255,255,255,.035); }
.cycle-symbol span { font-size: 9px; letter-spacing: .12em; font-weight: 800; color: #c8d7ef; }
.metric-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 14px; }
.metric-card { min-height: 110px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; display: flex; align-items: center; gap: 15px; box-shadow: 0 8px 28px rgba(22,28,45,.035); }
.metric-card div { display: grid; gap: 4px; }
.metric-card strong { font-size: 27px; letter-spacing: -.04em; }
.metric-card div span { color: var(--muted); font-size: 12px; }
.metric-icon { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-weight: 800; }
.metric-icon.blue { color: #1d62d5; background: #eaf2ff; }
.metric-icon.purple { color: #7c3ed0; background: #f1eaff; }
.metric-icon.green { color: #17845c; background: #e5f8f0; }
.metric-icon.orange { color: #bd6618; background: #fff0e1; }
.metric-icon.slate { color: #445067; background: #edf0f5; }
.content-card { padding: 27px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 10px 35px rgba(22,28,45,.04); }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 19px; }
.section-heading h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.03em; }
.program-row { padding: 15px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.program-type { width: 43px; height: 43px; border-radius: 13px; display: grid; place-items: center; color: #245ccd; background: #edf3ff; font-size: 11px; font-weight: 850; }
.program-copy { flex: 1; min-width: 0; display: grid; gap: 5px; }
.program-copy strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.program-copy span { color: var(--muted); font-size: 12px; }
.status { padding: 6px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-ativo { color: #147453; background: #e5f8f0; }
.status-pausado { color: #a45a15; background: #fff0e1; }
.status-concluido { color: #4f5665; background: #eef0f4; }
.empty-state { padding: 40px 20px; border-top: 1px solid var(--line); text-align: center; }
.empty-state > span { font-size: 34px; color: #aeb4c0; }
.empty-state h3 { margin: 12px 0 5px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 13px; }
.login-body { min-height: 100vh; background: #fff; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(480px,1.15fr) minmax(430px,.85fr); }
.login-story { position: relative; overflow: hidden; padding: 46px 7vw; color: #fff; background: radial-gradient(circle at 82% 16%, #2d65b7 0, transparent 25%), linear-gradient(145deg, #0d1424, #162642 65%, #193b70); display: flex; flex-direction: column; }
.brand-light { color: #fff; }
.login-message { margin: auto 0; max-width: 700px; }
.login-message h1 { margin: 24px 0 18px; font-size: clamp(44px, 5vw, 76px); line-height: .98; letter-spacing: -.065em; }
.login-message p { max-width: 590px; color: #c5d1e5; font-size: 17px; line-height: 1.65; }
.pdca-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pdca-row span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #cbd7e9; font-size: 11px; }
.pdca-row b { color: #fff; }
.login-panel { padding: 40px; display: grid; place-items: center; background: #fbfbfc; }
.login-card { width: 100%; max-width: 390px; }
.login-heading { margin-bottom: 34px; }
.login-heading h2 { margin: 0; font-size: 38px; letter-spacing: -.05em; }
.login-heading p { margin: 9px 0 0; color: var(--muted); }
.mobile-logo { display: none; margin-bottom: 22px; }
.login-card label { display: block; margin: 18px 0 7px; color: #44444a; font-size: 12px; font-weight: 750; }
.login-card input { width: 100%; height: 50px; padding: 0 15px; border: 1px solid #dadade; border-radius: 13px; outline: none; background: #fff; transition: .2s; }
.login-card input:focus { border-color: #6d9cf4; box-shadow: 0 0 0 4px rgba(36,117,255,.1); }
.primary-button { width: 100%; height: 51px; margin-top: 24px; border: 0; border-radius: 13px; color: #fff; background: var(--navy); font-weight: 750; cursor: pointer; box-shadow: 0 12px 25px rgba(17,24,39,.18); }
.alert { padding: 12px 14px; border-radius: 12px; color: #9c2929; background: #fff0f0; font-size: 13px; }
.privacy-copy { margin-top: 22px; color: #96969d; text-align: center; font-size: 11px; }
@media (max-width: 1100px) {
    .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .cycle-symbol { width: 150px; height: 150px; }
}
@media (max-width: 820px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 15px 18px; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; }
    .sidebar .nav, .sidebar-user-copy, .avatar { display: none; }
    .sidebar-user { margin: 0 0 0 auto; padding: 0; border: 0; }
    .main { padding: 24px 18px 45px; }
    .topbar-badge { display: none; }
    .welcome-card { min-height: 0; padding: 30px 25px; }
    .cycle-symbol { display: none; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .login-shell { display: block; }
    .login-story { display: none; }
    .login-panel { min-height: 100vh; padding: 28px 22px; }
    .mobile-logo { display: grid; }
}
@media (max-width: 480px) {
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .metric-card { min-height: 96px; padding: 15px; gap: 10px; }
    .metric-card strong { font-size: 22px; }
    .metric-icon { width: 34px; height: 34px; }
    .program-row { align-items: flex-start; }
    .status { margin-left: auto; }
}

.flash-success { margin: -8px 0 20px; padding: 13px 16px; border: 1px solid #bdebd8; border-radius: 13px; color: #116b4b; background: #eafaf3; font-size: 13px; font-weight: 650; }
.page-actions { margin: -4px 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.page-actions p { margin: 0; color: var(--muted); }
.primary-link, .secondary-link, .danger-button { min-height: 40px; padding: 0 15px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 750; cursor: pointer; }
.primary-link { color: #fff; background: var(--navy); }
.secondary-link { border: 1px solid var(--line); background: #fff; color: #4e4e55; }
.danger-button { border: 1px solid #ffd3d3; background: #fff4f4; color: #a52b2b; }
.icon-link { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.form-card { padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 21px; }
.field { display: grid; gap: 7px; }
.field.span-2 { grid-column: span 2; }
.field label { color: #48484f; font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea { width: 100%; padding: 0 14px; border: 1px solid #dcdce1; border-radius: 12px; outline: none; background: #fff; }
.field input, .field select { height: 47px; }
.field textarea { padding-top: 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #75a1f1; box-shadow: 0 0 0 4px rgba(36,117,255,.09); }
.field-error { color: #ad2c2c; }
.form-actions { margin-top: 28px; padding-top: 21px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.primary-button.compact { width: auto; min-width: 155px; height: 42px; margin: 0; padding: 0 18px; }
.detail-hero { margin-bottom: 20px; padding: 30px; border-radius: 24px; color: #fff; background: linear-gradient(130deg,#111827,#244a86); display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.detail-hero h2 { margin: 17px 0 8px; font-size: 30px; letter-spacing: -.04em; }
.detail-hero p { margin: 0; max-width: 720px; color: #cad5e7; line-height: 1.6; }
.detail-actions { display: flex; gap: 9px; }
.detail-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 18px; align-items: start; }
.person-row { padding: 14px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.text-danger { border: 0; background: transparent; color: #b52f2f; cursor: pointer; font-size: 12px; font-weight: 700; }
.compact-empty { padding: 25px 10px; }
.program-meta { margin: 26px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 14px; }
.program-meta div { display: flex; justify-content: space-between; gap: 15px; }
.program-meta dt { color: var(--muted); font-size: 12px; }
.program-meta dd { margin: 0; text-align: right; font-size: 12px; font-weight: 700; }
@media (max-width: 820px) {
    .page-actions, .detail-hero { align-items: stretch; flex-direction: column; }
    .detail-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .field.span-2 { grid-column: span 1; }
    .detail-actions { flex-wrap: wrap; }
}
