:root {
    --ink: #12292c;
    --muted: #6b7c80;
    --teal: #006a70;
    --teal-dark: #073a40;
    --teal-soft: #e8f4f2;
    --gold: #d99a24;
    --green: #2f9b62;
    --red: #c9483d;
    --blue: #2563eb;
    --line: #dbe7e5;
    --soft: #f3f7f6;
    --paper: #ffffff;
    --shadow: 0 20px 60px rgba(13, 48, 52, .11);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(217, 154, 36, .10), transparent 28%),
        linear-gradient(135deg, #f7faf9 0%, #eef6f4 100%);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 292px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    color: white;
    background:
        linear-gradient(180deg, rgba(3, 51, 57, .97), rgba(4, 39, 44, .98)),
        url("../../assets/img/logo-novaris.jpeg") center 92% / 210px auto no-repeat;
    border-right: 1px solid rgba(255, 255, 255, .12);
}

.system-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 76px;
    margin-bottom: 22px;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .08);
}

.system-brand img,
.login-card img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 18px;
    border: 2px solid rgba(217, 154, 36, .8);
}

.system-brand strong,
.system-brand small {
    display: block;
}

.system-brand strong {
    font-size: 18px;
}

.system-brand small {
    color: rgba(255, 255, 255, .72);
    font-size: 12px;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.side-nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 15px 12px 42px;
    border-radius: 15px;
    color: rgba(255, 255, 255, .86);
    font-weight: 800;
    transition: background .18s ease, transform .18s ease, color .18s ease;
}

.side-nav a::before {
    content: "";
    position: absolute;
    left: 17px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(217, 154, 36, .72);
}

.side-nav a:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, .11);
    color: white;
}

.side-nav a.is-active {
    color: white;
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 3px 0 0 var(--gold);
}

.main-panel {
    min-width: 0;
    padding: 30px clamp(22px, 3vw, 44px);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
    margin: -30px calc(clamp(22px, 3vw, 44px) * -1) 24px;
    padding: 24px clamp(22px, 3vw, 44px);
    background: rgba(247, 250, 249, .88);
    border-bottom: 1px solid rgba(219, 231, 229, .85);
    backdrop-filter: blur(16px);
}

.topbar p,
.eyebrow {
    margin: 0 0 5px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1;
}

.page-subtitle {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 750;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px 9px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: white;
    box-shadow: 0 10px 28px rgba(13, 48, 52, .08);
}

.topbar-user span {
    font-weight: 900;
}

.topbar-user a {
    padding: 10px 15px;
    border-radius: 999px;
    color: white;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    font-weight: 900;
}

.grid-cards,
.dashboard-grid,
.module-grid,
.two-columns,
.catalog-lists {
    display: grid;
    gap: 18px;
}

.grid-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 22px;
}

.dashboard-grid {
    grid-template-columns: 1.2fr 1fr 1fr;
    margin-bottom: 22px;
}

.module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-lists {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-panel,
.quick-actions {
    display: grid;
    gap: 16px;
    margin-bottom: 22px;
}

.workflow-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workflow-panel div,
.quick-actions a,
.setup-warning {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 12px 36px rgba(13, 48, 52, .07);
}

.workflow-panel div {
    padding: 18px;
}

.workflow-panel span {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-bottom: 12px;
    border-radius: 12px;
    color: white;
    background: var(--teal);
    font-weight: 950;
}

.workflow-panel strong,
.quick-actions strong {
    display: block;
    font-size: 17px;
}

.workflow-panel p,
.quick-actions span,
.setup-warning p {
    margin: 6px 0 0;
    color: var(--muted);
    font-weight: 700;
}

.quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-actions a {
    padding: 18px;
    transition: transform .16s ease, border-color .16s ease;
}

.quick-actions a:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 106, 112, .35);
}

.setup-warning {
    margin-bottom: 16px;
    padding: 16px;
    border-color: rgba(217, 154, 36, .38);
    background: #fff8e8;
}

.setup-warning strong {
    color: #8a5a0d;
}

.stat-card,
.panel {
    border: 1px solid rgba(219, 231, 229, .92);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
}

.stat-card {
    position: relative;
    overflow: hidden;
    min-height: 132px;
    padding: 22px;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: -34px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: rgba(0, 106, 112, .08);
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1;
}

.panel {
    padding: 24px;
    margin-bottom: 22px;
}

.form-panel {
    max-width: 1180px;
}

.module-grid .panel {
    margin-bottom: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
}

.panel-header h2,
.panel h2 {
    margin: 0 0 16px;
    font-size: 22px;
    line-height: 1.1;
}

.panel-header h2 {
    margin-bottom: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.form-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.smart-form {
    grid-template-columns: minmax(260px, 1.4fr) minmax(220px, .6fr);
}

.compact-form {
    margin-top: 12px;
}

label {
    display: grid;
    gap: 7px;
    color: #315357;
    font-size: 13px;
    font-weight: 900;
    min-width: 0;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-height: 45px;
    padding: 11px 13px;
    border: 1px solid #c8dbd8;
    border-radius: 13px;
    color: var(--ink);
    background: #fbfdfc;
    font: inherit;
    font-weight: 650;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 106, 112, .58);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 106, 112, .10);
}

textarea {
    resize: vertical;
    min-height: 96px;
}

select[multiple] {
    min-height: 132px;
    overflow: auto;
}

.field-block {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.field-block > strong {
    color: #315357;
    font-size: 13px;
    font-weight: 950;
}

.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    max-height: 220px;
    overflow: auto;
    padding: 12px;
    border: 1px solid #c8dbd8;
    border-radius: 16px;
    background: #fbfdfc;
}

.check-grid label,
.permission-box label {
    min-width: 0;
}

.check-grid label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: white;
    color: var(--ink);
    font-size: 13px;
}

.check-grid input,
.permission-box input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    min-height: 16px;
    padding: 0;
}

.full,
.compact-form button {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 45px;
    padding: 11px 18px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 950;
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.btn-primary {
    color: white;
    background: linear-gradient(135deg, var(--teal), var(--teal-dark));
    box-shadow: 0 14px 28px rgba(0, 106, 112, .18);
}

.btn-secondary {
    color: var(--teal-dark);
    background: var(--teal-soft);
}

.btn-danger {
    color: white;
    background: var(--red);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
    transform: translateY(-1px);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th,
td {
    padding: 14px 13px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

th {
    color: #537175;
    background: #f7fbfa;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

tr:last-child td {
    border-bottom: 0;
}

.audit-meta {
    display: block;
    max-width: 520px;
    margin-top: 7px;
    color: var(--muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.table-note {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.45;
}

.student-photo-preview {
    width: 112px;
    height: 132px;
    object-fit: cover;
    border: 3px solid rgba(0, 107, 112, .25);
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow-soft);
    display: block;
    margin: 10px 0;
}

.photo-upload-box {
    min-height: 100%;
}

.photo-upload-box span {
    display: block;
    margin: 8px 0 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.photo-upload-box input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px dashed rgba(0, 107, 112, .34);
    border-radius: 16px;
    background: rgba(255, 255, 255, .74);
    cursor: pointer;
}

.student-photo-empty {
    width: 112px;
    height: 132px;
    display: grid;
    place-items: center;
    margin: 10px 0;
    border: 1px dashed rgba(0, 107, 112, .35);
    border-radius: 16px;
    color: var(--muted);
    background: rgba(240, 249, 247, .75);
    font-weight: 900;
}

.edit-context {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid rgba(217, 154, 36, .25);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 247, 226, .95), rgba(240, 249, 247, .85));
    color: #17383c;
    font-weight: 850;
}

.edit-context strong {
    flex: 0 0 auto;
    padding: 7px 11px;
    border-radius: 999px;
    color: #503400;
    background: rgba(217, 154, 36, .24);
    font-size: 12px;
    text-transform: uppercase;
}

.edit-context span {
    color: var(--muted);
    line-height: 1.35;
}

.enrollment-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.enrollment-form label,
.enrollment-form .field-block:not(.section-title) {
    min-width: 0;
}

.enrollment-form .section-title {
    margin-top: 8px;
    padding: 14px 16px;
    border: 1px solid rgba(112, 151, 148, .22);
    border-left: 5px solid var(--gold);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, .94), rgba(235, 248, 246, .78));
    box-shadow: 0 12px 28px rgba(7, 45, 50, .06);
}

.enrollment-form .section-title:first-of-type {
    margin-top: 0;
}

.enrollment-form .section-title > strong {
    color: #073b40;
    font-size: 14px;
}

.enrollment-form .photo-upload-box {
    grid-column: span 1;
    grid-row: span 2;
    padding: 14px;
    border: 1px solid rgba(112, 151, 148, .28);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(238, 249, 247, .78));
    box-shadow: 0 16px 34px rgba(7, 45, 50, .08);
}

.enrollment-form .photo-upload-box > strong {
    color: #073b40;
}

.enrollment-form .student-photo-preview,
.enrollment-form .student-photo-empty {
    width: 100%;
    max-width: 178px;
    height: 198px;
    margin: 10px auto;
    border-radius: 18px;
}

.enrollment-form .student-photo-preview {
    object-fit: cover;
}

.enrollment-form textarea {
    min-height: 86px;
}

.enrollment-form .actions.full {
    position: sticky;
    bottom: 16px;
    z-index: 5;
    justify-content: flex-end;
    padding: 14px;
    border: 1px solid rgba(112, 151, 148, .22);
    border-radius: 22px;
    background: rgba(247, 252, 251, .88);
    box-shadow: 0 16px 40px rgba(7, 45, 50, .10);
    backdrop-filter: blur(10px);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: 999px;
    color: var(--teal-dark);
    background: var(--teal-soft);
    font-size: 12px;
    font-weight: 950;
}

.badge-red {
    color: #8f1f1a;
    background: #ffe5e3;
}

.badge-green {
    color: #236c38;
    background: #e4f6e9;
}

.badge-yellow {
    color: #7a4a00;
    background: #fff0cf;
}

.badge-blue {
    color: #174d7a;
    background: #dff0ff;
}

.attendance-summary {
    margin-bottom: 22px;
}

.scanner-shell {
    display: grid;
    grid-template-columns: minmax(320px, 1.05fr) minmax(280px, .95fr);
    gap: 22px;
    align-items: start;
}

.scanner-card,
.scan-result {
    border: 1px solid rgba(112, 151, 148, .22);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255,255,255,.92), rgba(237,249,247,.78));
    box-shadow: 0 22px 50px rgba(7, 45, 50, .10);
}

.scanner-card {
    padding: 22px;
}

.scanner-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.scanner-head span {
    color: var(--gold);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.scanner-head h2 {
    margin: 4px 0;
    color: var(--ink);
    font-size: 28px;
}

.scanner-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 760;
}

.scanner-camera {
    position: relative;
    overflow: hidden;
    display: grid;
    place-items: center;
    min-height: 420px;
    border: 1px solid rgba(0, 107, 112, .22);
    border-radius: 26px;
    background:
        linear-gradient(135deg, rgba(5, 56, 62, .94), rgba(0, 107, 112, .84)),
        #05383e;
}

.scanner-camera video {
    width: 100%;
    height: 100%;
    min-height: 420px;
    object-fit: cover;
}

.scan-frame {
    position: absolute;
    width: min(72%, 320px);
    aspect-ratio: 1;
    border: 4px solid rgba(255, 255, 255, .9);
    border-radius: 28px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, .22);
}

.scan-frame::after {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 50%;
    height: 3px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 18px rgba(217, 154, 36, .95);
}

.scanner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.manual-scan {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: end;
}

.scan-result {
    min-height: 260px;
    padding: 22px;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 216px;
    text-align: center;
    color: var(--muted);
}

.empty-state strong {
    display: block;
    color: var(--ink);
    font-size: 22px;
}

.result-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border-radius: 24px;
    background: #f4fbfa;
    border: 1px solid rgba(112, 151, 148, .24);
}

.result-card img {
    width: 96px;
    height: 112px;
    border-radius: 20px;
    object-fit: cover;
    background: white;
    border: 3px solid white;
    box-shadow: 0 14px 28px rgba(7, 45, 50, .16);
}

.result-card span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    color: white;
    background: var(--teal);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.result-card.is-out span {
    background: #174d7a;
}

.result-card.is-error span {
    background: #b7372f;
}

.result-card h3 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 24px;
}

.result-card p,
.result-card small {
    display: block;
    margin: 0;
    color: var(--muted);
    font-weight: 800;
}

.result-card strong {
    display: block;
    margin: 10px 0 4px;
    color: var(--teal-dark);
    font-size: 34px;
    line-height: 1;
}

.scan-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(5, 47, 53, .58);
    backdrop-filter: blur(8px);
}

.scan-modal[hidden] {
    display: none;
}

.scan-modal-card {
    position: relative;
    width: min(560px, 100%);
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(236, 248, 246, .96));
    box-shadow: 0 28px 80px rgba(0, 0, 0, .28);
}

.scan-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    min-height: 34px;
    padding: 6px 10px;
    border: 0;
    border-radius: 999px;
    color: #315357;
    background: rgba(232, 246, 244, .95);
    font-weight: 900;
    cursor: pointer;
}

.scan-confirm {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 18px;
    align-items: start;
}

.scan-confirm img {
    width: 130px;
    height: 154px;
    object-fit: cover;
    border: 4px solid white;
    border-radius: 24px;
    background: white;
    box-shadow: 0 18px 32px rgba(7, 45, 50, .16);
}

.scan-confirm span {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 7px 11px;
    border-radius: 999px;
    color: white;
    background: var(--teal);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.scan-confirm h3 {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 28px;
    line-height: 1.06;
}

.scan-confirm p {
    margin: 0 0 12px;
    color: var(--muted);
    font-weight: 850;
}

.scan-confirm dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 0;
}

.scan-confirm dl div {
    padding: 10px;
    border: 1px solid rgba(112, 151, 148, .22);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
}

.scan-confirm dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
}

.scan-confirm dd {
    margin: 3px 0 0;
    color: var(--ink);
    font-weight: 900;
}

.scan-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.chart-list {
    display: grid;
    gap: 14px;
}

.chart-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 8px 12px;
    align-items: center;
}

.chart-row.compact-row {
    grid-template-columns: 1fr;
}

.chart-row strong,
.chart-row span {
    font-size: 13px;
}

.chart-row span {
    color: var(--muted);
    font-weight: 800;
}

.bar {
    grid-column: 1 / -1;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8f1ef;
}

.bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--teal), var(--gold));
}

.bar-red i {
    background: linear-gradient(90deg, #d85c52, #f0aa4f);
}

.mini-bars {
    min-height: 220px;
    display: flex;
    align-items: end;
    gap: 8px;
    padding-top: 16px;
}

.mini-bar {
    flex: 1;
    min-width: 22px;
    height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 8px;
}

.mini-bar i {
    display: block;
    min-height: 8px;
    border-radius: 999px 999px 5px 5px;
    background: linear-gradient(180deg, var(--gold), var(--teal));
}

.mini-bar span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.catalog-lists h3 {
    margin: 0 0 10px;
}

.catalog-lists p {
    margin: 0 0 9px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdfc;
}

.muted-copy {
    color: var(--muted);
    font-weight: 750;
    line-height: 1.6;
}

.executive-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 22px;
    padding: 26px;
    border: 1px solid rgba(217, 154, 36, .35);
    border-radius: 24px;
    color: white;
    background:
        linear-gradient(135deg, rgba(4, 51, 57, .96), rgba(0, 106, 112, .9)),
        url("../../assets/img/logo-novaris.jpeg") right 28px center / 170px auto no-repeat;
    box-shadow: var(--shadow);
}

.executive-hero h2 {
    max-width: 760px;
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.02;
}

.executive-hero span {
    display: block;
    max-width: 720px;
    color: rgba(255, 255, 255, .78);
    font-weight: 800;
}

.executive-score {
    display: grid;
    align-content: center;
    gap: 7px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    backdrop-filter: blur(12px);
}

.executive-score small,
.stat-card small {
    color: var(--muted);
    font-weight: 900;
}

.executive-score small,
.executive-score span {
    color: rgba(255, 255, 255, .78);
}

.executive-score strong {
    font-size: 34px;
}

.stat-card small {
    display: block;
    margin-top: 10px;
}

.accent-card {
    border-color: rgba(217, 154, 36, .45);
    background: linear-gradient(135deg, #fff, #fff8ea);
}

.danger-card {
    border-color: rgba(201, 72, 61, .24);
    background: linear-gradient(135deg, #fff, #fff3f2);
}

.money-card {
    border-color: rgba(47, 155, 98, .28);
    background: linear-gradient(135deg, #fff, #f0fbf4);
}

.executive-grid {
    grid-template-columns: 1.45fr 1fr 1fr;
}

.wide-panel {
    min-height: 320px;
}

.tall-bars {
    min-height: 210px;
}

.mini-bar {
    position: relative;
}

.mini-bar b {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--teal-dark);
    font-size: 12px;
}

.activity-list {
    display: grid;
    gap: 12px;
}

.activity-list div {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfdfc;
}

.activity-list span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.activity-list strong,
.activity-list p {
    display: block;
    margin: 0;
}

.activity-list p {
    margin-top: 4px;
    color: var(--muted);
    font-weight: 750;
}

.permission-box {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fbfa;
}

.permission-box h3,
.permission-box p {
    grid-column: 1 / -1;
    margin: 0;
}

.permission-box p {
    color: var(--muted);
    font-weight: 750;
}

.permission-box div {
    display: grid;
    gap: 9px;
    align-content: start;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
}

.permission-box label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: auto;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 13px;
}

.permission-users {
    display: grid;
    gap: 16px;
}

.permission-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.alert {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 900;
}

.alert-success {
    color: #236c38;
    background: #e4f6e9;
}

.alert-error {
    color: #8f1f1a;
    background: #ffe5e3;
}

button:disabled,
select:disabled,
input:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.report-filter {
    border-top: 5px solid var(--gold);
}

.print-page {
    background: #f1f5f4;
}

.print-sheet {
    width: min(1120px, calc(100% - 32px));
    margin: 24px auto;
    padding: 28px;
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow);
}

.print-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--line);
}

.print-header img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 16px;
}

.print-header div {
    flex: 1;
}

.print-header p {
    margin: 0 0 4px;
    color: var(--gold);
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.print-header h1 {
    margin: 0;
}

.print-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.print-summary div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f8fbfa;
}

.print-summary strong,
.print-summary span {
    display: block;
}

.print-summary strong {
    font-size: 22px;
}

.print-summary span {
    color: var(--muted);
    font-weight: 800;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        linear-gradient(120deg, rgba(0, 63, 70, .88), rgba(0, 97, 106, .76)),
        url("../../assets/img/hero-academia-novaris.png") center/cover;
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    border-radius: 24px;
    background: white;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .22);
}

.login-card img {
    margin-bottom: 18px;
}

.login-card h1 {
    margin: 0;
    font-size: 32px;
}

.login-card p:not(.eyebrow) {
    color: var(--muted);
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        background: linear-gradient(135deg, #062f35, #073a40);
    }

    .side-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .system-brand {
        margin-bottom: 14px;
    }

    .grid-cards,
    .form-grid,
    .dashboard-grid,
    .module-grid,
    .catalog-lists,
    .permission-box,
    .workflow-panel,
    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .main-panel {
        padding: 18px;
    }

    .topbar {
        position: static;
        align-items: flex-start;
        flex-direction: column;
        margin: -18px -18px 18px;
        padding: 20px 18px;
    }

    .topbar-user {
        width: 100%;
        justify-content: space-between;
    }

    .grid-cards,
    .form-grid,
    .form-stack,
    .side-nav,
    .dashboard-grid,
    .module-grid,
    .two-columns,
    .catalog-lists,
    .permission-box,
    .workflow-panel,
    .quick-actions,
    .print-summary {
        grid-template-columns: 1fr;
    }

    .side-nav a {
        min-height: 42px;
    }
}

@media print {
    body {
        background: white !important;
    }

    .no-print,
    .sidebar,
    .topbar,
    .actions,
    .report-filter {
        display: none !important;
    }

    .main-panel {
        padding: 0 !important;
    }

    .panel,
    .stat-card {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .print-sheet {
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }

    th,
    td {
        padding: 8px;
        font-size: 12px;
    }
}

/* Visual system v2: professional glass academic interface */
:root {
    --ink: #10282b;
    --muted: #617679;
    --teal: #006b70;
    --teal-dark: #05383e;
    --teal-deep: #052f35;
    --teal-soft: #eaf6f4;
    --gold: #d99a24;
    --gold-soft: #fff4dc;
    --green: #2f9b62;
    --red: #c9483d;
    --line: rgba(143, 171, 169, .32);
    --paper: rgba(255, 255, 255, .78);
    --paper-strong: rgba(255, 255, 255, .94);
    --shadow: 0 22px 70px rgba(7, 45, 50, .13);
    --shadow-soft: 0 12px 34px rgba(7, 45, 50, .08);
    --radius: 18px;
}

body {
    color: var(--ink);
    background:
        linear-gradient(135deg, rgba(247, 251, 250, .98), rgba(231, 243, 241, .98)),
        linear-gradient(90deg, rgba(217, 154, 36, .08), rgba(0, 107, 112, .06));
    font-size: 14px;
}

.app-shell {
    grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
    padding: 20px 16px;
    background:
        linear-gradient(180deg, rgba(4, 58, 64, .98), rgba(5, 38, 43, .99)),
        url("../../assets/img/logo-novaris.jpeg") center calc(100% - 24px) / 140px auto no-repeat;
    box-shadow: 18px 0 46px rgba(4, 35, 39, .16);
}

.system-brand {
    min-height: 72px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: rgba(255, 255, 255, .11);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.system-brand img {
    width: 54px;
    height: 54px;
    border-radius: 16px;
}

.side-nav {
    gap: 6px;
}

.side-nav a {
    min-height: 42px;
    padding: 10px 12px 10px 38px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(255, 255, 255, .80);
    font-size: 14px;
}

.side-nav a::before {
    left: 15px;
    width: 7px;
    height: 7px;
    background: rgba(217, 154, 36, .85);
}

.side-nav a:hover,
.side-nav a.is-active {
    transform: none;
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .13);
}

.main-panel {
    padding: 26px clamp(22px, 3vw, 44px);
}

.topbar {
    margin: -26px calc(clamp(22px, 3vw, 44px) * -1) 22px;
    padding: 22px clamp(22px, 3vw, 44px);
    background: rgba(248, 252, 251, .78);
    border-bottom: 1px solid rgba(143, 171, 169, .25);
    box-shadow: 0 12px 40px rgba(6, 48, 53, .06);
    backdrop-filter: blur(18px);
}

.topbar h1 {
    font-size: clamp(32px, 3.6vw, 46px);
    letter-spacing: 0;
}

.topbar p,
.eyebrow {
    letter-spacing: .08em;
}

.topbar-user {
    border: 1px solid rgba(143, 171, 169, .28);
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
}

.panel,
.stat-card,
.workflow-panel div,
.quick-actions a,
.setup-warning,
.permission-card {
    border: 1px solid rgba(143, 171, 169, .30);
    background: var(--paper);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.panel {
    padding: 24px;
    border-radius: 22px;
}

.panel-header {
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(143, 171, 169, .22);
}

.panel-header h2,
.panel h2 {
    margin-bottom: 14px;
    font-size: 21px;
    letter-spacing: 0;
}

.panel-header h2 {
    margin-bottom: 0;
}

.form-grid,
.form-stack {
    gap: 18px;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.smart-form {
    grid-template-columns: minmax(260px, 1fr) minmax(220px, .45fr);
}

label {
    gap: 8px;
    color: #254b50;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .01em;
}

input,
select,
textarea {
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(112, 151, 148, .38);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
    font-size: 14px;
    font-weight: 700;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(0, 107, 112, .38);
    background: rgba(255, 255, 255, .88);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 107, 112, .68);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 107, 112, .12);
}

textarea {
    min-height: 104px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    min-height: 44px;
    border-radius: 14px;
    letter-spacing: 0;
}

.btn-primary {
    background: linear-gradient(135deg, #00777c, #064047);
    box-shadow: 0 14px 28px rgba(0, 107, 112, .20);
}

.btn-secondary {
    color: #064047;
    background: rgba(232, 246, 244, .95);
    border: 1px solid rgba(0, 107, 112, .12);
}

.btn-danger {
    background: linear-gradient(135deg, #c9483d, #9f2f28);
}

.permission-box,
.check-grid {
    border: 1px solid rgba(143, 171, 169, .28);
    border-radius: 18px;
    background: rgba(247, 252, 251, .82);
}

.permission-box {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    padding: 16px;
}

.permission-box > div {
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(143, 171, 169, .28);
    border-radius: 16px;
    background: rgba(255, 255, 255, .76);
}

.permission-box > div > strong,
.field-block > strong {
    color: #0b3b41;
    font-size: 13px;
    font-weight: 950;
}

.permission-box label,
.check-grid label {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid rgba(143, 171, 169, .22);
    border-radius: 13px;
    color: #173a3f;
    background: rgba(255, 255, 255, .82);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.25;
}

.permission-box label:hover,
.check-grid label:hover {
    border-color: rgba(0, 107, 112, .30);
    background: white;
}

input[type="checkbox"],
.permission-box input[type="checkbox"],
.check-grid input[type="checkbox"] {
    appearance: none;
    display: inline-grid;
    place-items: center;
    flex: 0 0 18px;
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    max-height: 18px !important;
    margin: 0;
    padding: 0 !important;
    border: 2px solid rgba(0, 107, 112, .48);
    border-radius: 6px;
    background: white;
}

input[type="checkbox"]::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 3px;
    transform: scale(0);
    background: var(--teal);
    transition: transform .12s ease;
}

input[type="checkbox"]:checked {
    border-color: var(--teal);
    background: #effaf8;
}

input[type="checkbox"]:checked::after {
    transform: scale(1);
}

.table-wrap {
    border: 1px solid rgba(143, 171, 169, .30);
    border-radius: 18px;
    background: rgba(255, 255, 255, .75);
}

table {
    background: transparent;
}

th {
    color: #49696d;
    background: rgba(236, 247, 245, .82);
}

td {
    background: rgba(255, 255, 255, .52);
}

tbody tr:hover td {
    background: rgba(250, 255, 254, .92);
}

.badge {
    min-height: 24px;
    border: 1px solid rgba(0, 107, 112, .10);
    background: rgba(232, 246, 244, .92);
}

.permission-users {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.permission-card .panel-header {
    align-items: flex-start;
}

.permission-card .panel-header h3,
.permission-card .panel-header p {
    margin: 0;
}

.permission-card .panel-header p {
    margin-top: 5px;
    color: var(--muted);
    font-weight: 750;
}

@media (max-width: 1380px) {
    .enrollment-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .smart-form,
    .executive-hero,
    .enrollment-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .main-panel {
        padding: 16px;
    }

    .topbar {
        margin: -16px -16px 18px;
    }

    .panel {
        padding: 18px;
    }

    .permission-users {
        grid-template-columns: 1fr;
    }
}

/* Mobile polish: the system must behave like an app on phones */
@media (max-width: 1024px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 30;
        width: 100%;
        min-height: auto;
        padding: 10px 12px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, .12);
    }

    .system-brand {
        min-height: 54px;
        padding: 8px;
        border-radius: 18px;
    }

    .system-brand img {
        width: 38px;
        height: 38px;
    }

    .system-brand small {
        display: none;
    }

    .side-nav {
        display: flex;
        gap: 8px;
        margin-top: 10px;
        padding: 0 0 4px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .side-nav::-webkit-scrollbar {
        display: none;
    }

    .side-nav a {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 10px 14px;
        border-radius: 14px;
        white-space: nowrap;
        font-size: 13px;
    }

    .side-nav a::before {
        display: none;
    }

    .main-panel {
        width: 100%;
        padding: 14px;
    }

    .topbar {
        display: grid;
        gap: 14px;
        margin: -14px -14px 16px;
        padding: 18px 14px;
    }

    .topbar h1 {
        font-size: 30px;
        line-height: 1.02;
        overflow-wrap: anywhere;
    }

    .topbar-user {
        width: 100%;
        padding: 8px;
        border-radius: 18px;
    }

    .topbar-user span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .panel,
    .stat-card,
    .scanner-card,
    .scan-result {
        width: 100%;
        padding: 16px;
        border-radius: 22px;
    }

    .panel-header {
        display: grid;
        gap: 12px;
        align-items: stretch;
    }

    .panel-header .actions,
    .actions {
        width: 100%;
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }

    .actions a,
    .actions button,
    .btn-primary,
    .btn-secondary,
    .btn-danger {
        min-height: 44px;
        padding: 11px 14px;
        font-size: 13px;
        white-space: normal;
        text-align: center;
    }

    .panel-header .actions a,
    .panel-header .actions button {
        flex: 1 1 140px;
    }

    .form-grid,
    .form-stack,
    .enrollment-form,
    .report-filter,
    .two-columns,
    .grid-cards,
    .dashboard-grid,
    .module-grid,
    .catalog-lists,
    .permission-box,
    .scanner-shell,
    .manual-scan {
        grid-template-columns: 1fr !important;
    }

    label,
    .field-block {
        min-width: 0;
    }

    input,
    select,
    textarea {
        min-height: 46px;
        font-size: 16px;
    }

    textarea {
        min-height: 92px;
    }

    .enrollment-form .photo-upload-box {
        grid-row: auto;
    }

    .enrollment-form .student-photo-preview,
    .enrollment-form .student-photo-empty {
        max-width: 150px;
        height: 170px;
    }

    .enrollment-form .actions.full {
        position: static;
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .table-wrap {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        min-width: 760px;
    }

    th,
    td {
        padding: 10px;
        font-size: 12px;
    }

    .scanner-shell {
        gap: 16px;
    }

    .scanner-head {
        display: grid;
    }

    .scanner-head h2 {
        font-size: 26px;
    }

    .scanner-camera {
        min-height: 340px;
        border-radius: 22px;
    }

    .scanner-camera video {
        min-height: 340px;
    }

    .scan-frame {
        width: min(78vw, 270px);
        border-radius: 22px;
    }

    .scanner-actions button,
    .manual-scan button {
        width: 100%;
    }

    .result-card {
        grid-template-columns: 74px 1fr;
        gap: 12px;
        padding: 14px;
        border-radius: 20px;
    }

    .result-card img {
        width: 74px;
        height: 88px;
        border-radius: 16px;
    }

    .result-card h3 {
        font-size: 19px;
    }

    .result-card strong {
        font-size: 28px;
    }

    .scan-modal {
        padding: 12px;
    }

    .scan-modal-card {
        padding: 18px;
        border-radius: 22px;
    }

    .scan-confirm {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .scan-confirm img {
        width: 120px;
        height: 140px;
    }

    .scan-confirm h3 {
        font-size: 23px;
    }

    .scan-confirm dl {
        width: 100%;
        grid-template-columns: 1fr;
        text-align: left;
    }

    .scan-modal-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) and (orientation: portrait) {
    .dashboard-grid,
    .grid-cards {
        grid-template-columns: 1fr !important;
    }

    .executive-hero {
        grid-template-columns: 1fr !important;
        padding: 22px;
        border-radius: 22px;
    }

    .executive-hero h2 {
        font-size: 30px;
        line-height: 1.08;
    }

    .executive-hero .stat-card,
    .executive-hero > div:last-child {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 420px) {
    .main-panel {
        padding: 10px;
    }

    .topbar {
        margin: -10px -10px 14px;
        padding: 16px 10px;
    }

    .topbar h1 {
        font-size: 28px;
    }

    .panel,
    .stat-card,
    .scanner-card,
    .scan-result {
        padding: 14px;
        border-radius: 18px;
    }

    .side-nav a {
        padding: 9px 12px;
        font-size: 13px;
    }

    .scanner-camera,
    .scanner-camera video {
        min-height: 300px;
    }
}
