:root {
    color-scheme: light;
    --ink: #172532;
    --muted: #72808c;
    --line: #e4e9ed;
    --paper: #f4f6f7;
    --white: #ffffff;
    --navy: #102535;
    --teal: #36b7a1;
    --teal-dark: #198e7c;
    --shadow: 0 18px 55px rgb(16 37 53 / 9%);
    font-family: 'Aptos', 'Segoe UI', sans-serif;
    color: var(--ink);
    background: var(--paper);
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.login-page { background: linear-gradient(135deg, #eaf0f1 0%, #f6f7f5 50%, #e4ecec 100%); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(310px, .92fr) 1.08fr; }
.login-intro { min-height: 100vh; padding: clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; color: #f5f8f8; background: linear-gradient(155deg, #102535 0%, #173b4c 65%, #14534f 100%); }
.login-intro::after { content: ''; position: absolute; width: 420px; height: 420px; right: -210px; bottom: 8%; border: 1px solid rgb(77 199 173 / 22%); border-radius: 50%; box-shadow: 0 0 0 42px rgb(77 199 173 / 5%), 0 0 0 88px rgb(77 199 173 / 4%); pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: 11px; width: fit-content; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 39px; aspect-ratio: 1; border-radius: 11px; color: var(--navy); background: var(--teal); font: 800 21px 'Manrope', sans-serif; }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font: 800 17px 'Manrope', sans-serif; }
.brand small { margin-top: 4px; font-size: 9px; font-weight: 700; letter-spacing: 2.4px; opacity: .65; }
.intro-copy { position: relative; z-index: 1; max-width: 510px; margin: auto 0; padding: 56px 0; animation: rise-in .55s ease-out both; }
.eyebrow { margin: 0 0 12px; color: var(--teal-dark); font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }
.login-intro .eyebrow { color: #62d2bb; }
.intro-copy h1 { margin: 0; font: 700 clamp(36px, 5vw, 62px)/1.12 'Manrope', sans-serif; }
.intro-copy h1 span { color: #70d4bf; }
.intro-copy > p:last-child { max-width: 370px; margin: 22px 0 0; color: #c2d1d5; font-size: 15px; line-height: 1.75; }
.intro-foot { display: flex; align-items: center; gap: 9px; color: #c3d1d4; font-size: 12px; }
.status-dot { display: inline-block; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgb(54 183 161 / 13%); }
.login-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 28px 22px; }
.login-card { width: min(100%, 420px); padding: 42px 42px 32px; border: 1px solid rgb(255 255 255 / 85%); border-radius: 9px; background: rgb(255 255 255 / 90%); box-shadow: 0 24px 70px rgb(22 43 58 / 12%); animation: rise-in .55s .08s ease-out both; }
.login-card-heading { margin-bottom: 28px; }
.login-card-heading h2 { margin: 0; font: 700 28px 'Manrope', sans-serif; }
.login-card-heading > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.login-form { display: grid; gap: 10px; }
.login-form label, .user-form label { margin-top: 7px; color: #354653; font-size: 12px; font-weight: 700; }
.login-form input, .user-form input, .user-form select { width: 100%; min-width: 0; height: 45px; padding: 0 13px; border: 1px solid #dce3e7; border-radius: 5px; outline: none; color: var(--ink); background: #fbfcfc; font-size: 13px; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease; }
.login-form input:focus, .user-form input:focus, .user-form select:focus { border-color: var(--teal-dark); background: var(--white); box-shadow: 0 0 0 3px rgb(54 183 161 / 14%); transform: translateY(-1px); }
.login-form input::placeholder, .user-form input::placeholder { color: #a4afb6; }
.password-label-row { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; }
.password-field { position: relative; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; top: 0; right: 0; width: 45px; height: 45px; display: grid; place-items: center; border: 0; color: #71818b; background: transparent; }
.password-toggle svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.password-toggle:hover { color: var(--teal-dark); }
.primary-button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; padding: 0 18px; border: 0; border-radius: 5px; color: #fff; background: var(--navy); font-size: 13px; font-weight: 700; transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.primary-button:hover { background: #1a4353; box-shadow: 0 7px 18px rgb(16 37 53 / 17%); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .78; }
.spinner { display: none; width: 15px; height: 15px; border: 2px solid rgb(255 255 255 / 38%); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .spinner { display: inline-block; }
.login-error, .form-feedback { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 15px; padding: 11px 12px; border: 1px solid #f1c6bd; border-radius: 5px; color: #8b3928; background: #fff4f1; font-size: 12px; line-height: 1.5; }
.login-error > span { display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 17px; border-radius: 50%; color: #fff; background: #bd604c; font-size: 11px; font-weight: 700; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 25px 0 0; color: #87939b; font-size: 11px; }
.login-security span { color: var(--teal-dark); }
.login-footer { width: min(100%, 420px); margin-top: 23px; color: #8a969d; text-align: center; font-size: 11px; }

.app-shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); background: var(--paper); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 16px 18px; color: #d9e3e6; background: var(--navy); }
.sidebar .brand { padding: 0 9px 34px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 22px; }
.sidebar-nav-group { display: grid; align-content: start; gap: 3px; }
.sidebar-label { margin: 0 0 7px; padding: 0 11px; color: #8fa4ad; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.side-link { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 11px; border-radius: 5px; color: #c7d3d6; text-decoration: none; font-size: 13px; }
.side-link:hover, .side-link.is-active { color: #fff; background: #1b3b4c; }
.side-link.is-active { box-shadow: inset 3px 0 0 var(--teal); }
.nav-icon { width: 18px; color: #6bd0b9; text-align: center; font-size: 18px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 15px 5px 0; border-top: 1px solid rgb(255 255 255 / 10%); }
.avatar { display: grid; place-items: center; width: 34px; aspect-ratio: 1; flex: 0 0 34px; border-radius: 50%; color: #153345; background: #9edfd2; font-size: 13px; font-weight: 700; }
.user-summary { min-width: 0; flex: 1; }
.user-summary strong, .user-summary small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-summary strong { color: #f4f7f7; font-size: 11px; }
.user-summary small { margin-top: 4px; color: #94a8af; font-size: 10px; }
.sidebar-footer form { margin: 0; }
.icon-button { width: 30px; height: 30px; border: 1px solid rgb(255 255 255 / 13%); border-radius: 5px; color: #d9e3e6; background: transparent; }
.icon-button:hover { color: var(--teal); border-color: var(--teal); }
.main-content { min-width: 0; padding: 0 clamp(22px, 4vw, 56px) 24px; }
.topbar { height: 61px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e7e9; }
.breadcrumb { color: #75838b; font-size: 11px; }
.breadcrumb span { padding: 0 7px; color: #b1bcc1; }
.topbar-user { display: flex; align-items: center; gap: 9px; color: #465963; font-size: 11px; font-weight: 700; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 34px 0 24px; }
.page-heading .eyebrow { margin-bottom: 7px; }
.page-heading h1 { margin: 0; font: 700 30px 'Manrope', sans-serif; }
.heading-copy { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.total-chip { display: flex; align-items: baseline; gap: 6px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 5px; color: #53636c; background: #fff; font-size: 11px; }
.total-chip strong { color: var(--navy); font: 700 16px 'Manrope', sans-serif; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, .8fr); align-items: start; gap: 20px; }
.panel-section { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; box-shadow: 0 4px 15px rgb(20 42 55 / 3%); }
.section-heading { min-height: 73px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid #edf0f1; }
.section-heading h2 { margin: 0; font: 700 15px 'Manrope', sans-serif; }
.section-heading p { margin: 5px 0 0; color: #8a969c; font-size: 10px; }
.section-count { color: #74828a; font-size: 10px; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.search-form { display: flex; align-items: center; gap: 5px; }
.search-form input { width: min(190px, 28vw); height: 34px; padding: 0 10px; border: 1px solid #dce3e7; border-radius: 4px; outline: 0; color: var(--ink); background: #fbfcfc; font-size: 11px; }
.search-form input:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgb(54 183 161 / 12%); }
.search-form button { width: 34px; height: 34px; border: 1px solid #dce3e7; border-radius: 4px; color: var(--navy); background: #fff; font-size: 19px; line-height: 1; }
.search-form button:hover { border-color: var(--teal-dark); color: var(--teal-dark); }
.search-form a { color: #64747c; font-size: 10px; text-decoration: none; }
.search-form a:hover { color: var(--teal-dark); text-decoration: underline; }
.inline-success { margin: 0; padding: 9px 18px; border-bottom: 1px solid #cce9df; color: #176c61; background: #edfaf6; font-size: 11px; }
.table-wrap { width: 100%; overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; text-align: left; }
.users-table th { height: 39px; padding: 0 13px; color: #809098; background: #fafbfb; font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; white-space: nowrap; }
.users-table td { height: 52px; padding: 8px 13px; border-top: 1px solid #edf0f1; color: #53636c; font-size: 11px; }
.users-table tr:first-child td { border-top: 0; }
.person-name { color: #263945; font-weight: 600; }
.matricula-cell { min-width: 110px; }
.date-cell { color: #829098 !important; white-space: nowrap; }
.role-badge { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 12px; font-size: 9px; font-weight: 700; }
.role-op { color: #884c19; background: #fff1d7; }
.role-lider { color: #176c61; background: #dff5ef; }
.role-user { color: #3c5d87; background: #e7effb; }
.empty-state { padding: 28px !important; color: #8a969c !important; text-align: center; }
.danger-button { min-height: 28px; padding: 0 8px; border: 1px solid #edc5bc; border-radius: 4px; color: #9b4939; background: #fff; font-size: 10px; font-weight: 600; }
.danger-button:hover { border-color: #bd604c; color: #fff; background: #bd604c; }
.muted-action { color: #9aa5aa; font-size: 10px; }
.pagination { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 0 14px; border-top: 1px solid #edf0f1; color: #7b8990; font-size: 10px; }
.pagination a { color: #225b5b; font-weight: 600; text-decoration: none; }
.pagination a:hover { text-decoration: underline; }
.disabled-page { color: #b3bdc1; }
.secondary-button { min-height: 28px; margin-right: 5px; padding: 0 8px; border: 1px solid #c9dedb; border-radius: 4px; color: #236b62; background: #fff; font-size: 10px; font-weight: 600; white-space: nowrap; }
.secondary-button:hover { border-color: #5db6a6; background: #effaf7; }
.users-table td form { display: inline-block; margin: 0; }
.user-dialog { width: min(440px, calc(100% - 28px)); padding: 0; border: 1px solid #dfe6e8; border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 25px 80px rgb(11 29 42 / 24%); }
.user-dialog::backdrop { background: rgb(11 29 42 / 46%); backdrop-filter: blur(3px); }
.dialog-form { display: grid; gap: 9px; padding: 23px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 3px; }
.dialog-heading .eyebrow { margin-bottom: 5px; }
.dialog-heading h2 { margin: 0; font: 700 20px 'Manrope', sans-serif; }
.dialog-close { color: #657680; font-size: 21px; }
.dialog-copy { margin: 0 0 5px; color: #708089; font-size: 12px; line-height: 1.6; }
.dialog-copy strong { color: #334955; }
.dialog-form label { margin-top: 4px; color: #354653; font-size: 11px; font-weight: 700; }
.dialog-form input:not([type="hidden"]) { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #dce3e7; border-radius: 4px; outline: 0; background: #fbfcfc; }
.dialog-form input:focus { border-color: var(--teal-dark); box-shadow: 0 0 0 3px rgb(54 183 161 / 12%); }
.dialog-error { margin: 0; color: #9b4939; font-size: 11px; }
.dialog-error[hidden] { display: none; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.dialog-actions .primary-button { min-height: 38px; margin: 0; font-size: 11px; }
.text-button { padding: 8px; border: 0; color: #63747d; background: transparent; font-size: 11px; font-weight: 600; }
.text-button:hover { color: var(--teal-dark); }
.back-to-login { margin: 12px 0 0; text-align: center; }
.password-layout .login-card { animation: rise-in .55s ease-out both; }
.create-section { padding-bottom: 19px; }
.create-section .section-heading { margin-bottom: 18px; }
.create-section .eyebrow { margin: 0 0 4px; font-size: 9px; }
.form-symbol { display: grid; place-items: center; width: 30px; aspect-ratio: 1; border-radius: 5px; color: #147c6c; background: #e2f5ef; font-size: 20px; }
.user-form { display: grid; gap: 8px; padding: 0 18px; }
.user-form label { margin-top: 4px; font-size: 11px; }
.user-form input, .user-form select { height: 39px; font-size: 11px; }
.user-form select { appearance: auto; }
.label-hint { float: right; color: #98a3a8; font-size: 9px; font-weight: 400; }
.permission-note { margin: 1px 0 3px; color: #7b898f; font-size: 10px; line-height: 1.5; }
.user-form .primary-button { width: 100%; min-height: 41px; margin-top: 5px; font-size: 11px; }
.form-feedback { margin: 0 18px 15px; }
.form-feedback.success { border-color: #b9e1d6; color: #1a695d; background: #edfaf6; }
.form-feedback[hidden] { display: none; }
.page-footer { padding-top: 23px; color: #98a3a8; text-align: right; font-size: 10px; }
.page-footer span { padding: 0 5px; color: var(--teal-dark); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1040px) { .workspace-grid { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    .login-layout { grid-template-columns: 1fr; }
    .login-intro { min-height: 225px; padding: 24px; }
    .intro-copy { padding: 35px 0 23px; }
    .intro-copy h1 { font-size: 35px; }
    .intro-copy > p:last-child { margin-top: 10px; font-size: 12px; }
    .intro-foot { display: none; }
    .login-main { min-height: auto; justify-content: flex-start; padding: 25px 17px 20px; }
    .login-card { padding: 30px 23px 24px; }
    .app-shell { display: block; }
    .sidebar { position: sticky; z-index: 8; top: 0; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0; padding: 10px 16px 0; box-shadow: 0 5px 14px rgb(16 37 53 / 10%); }
    .sidebar .brand { order: 0; padding: 0 0 10px; }
    .sidebar-nav { order: 2; flex: 0 0 calc(100% + 32px); width: calc(100% + 32px); flex-direction: row; align-items: stretch; gap: 8px; margin: 0 -16px; padding: 7px 16px 8px; overflow-x: auto; overscroll-behavior-x: contain; border-top: 1px solid rgb(255 255 255 / 12%); scrollbar-width: thin; scrollbar-color: #496473 transparent; }
    .sidebar-nav-group { display: flex; flex: 0 0 auto; align-items: center; gap: 5px; }
    .sidebar-nav-group + .sidebar-nav-group { margin-left: 5px; padding-left: 9px; border-left: 1px solid rgb(255 255 255 / 15%); }
    .sidebar-label { display: none; }
    .side-link { display: flex; flex: 0 0 auto; min-height: 36px; gap: 7px; padding: 0 10px; border: 1px solid rgb(255 255 255 / 8%); font-size: 10px; white-space: nowrap; }
    .side-link.is-active { border-color: rgb(54 183 161 / 35%); }
    .nav-icon { width: 15px; font-size: 15px; }
    .sidebar-footer { order: 1; margin: 0 0 10px auto; padding: 0; border: 0; }
    .sidebar-footer .user-summary { display: block; width: min(34vw, 132px); max-width: 132px; flex: 0 1 132px; }
    .main-content { padding: 0 16px 20px; }
    .topbar { height: 49px; }
    .page-heading { padding: 25px 0 18px; }
    .page-heading h1 { font-size: 26px; }
    .workspace-grid { gap: 14px; }
    .section-heading { padding: 13px; }
    .users-table th, .users-table td { padding-right: 10px; padding-left: 10px; }
    .search-form input { width: min(145px, 36vw); }
}
@media (max-width: 420px) { .login-card { padding-right: 19px; padding-left: 19px; } .page-heading { align-items: center; } .total-chip { padding: 7px 8px; } .section-count { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }