:root {
    --brand-primary: #6d28d9;
    --brand-primary-dark: #4c1d95;
    --medical-blue: #38bdf8;
    --medical-blue-dark: #0284c7;
    --medical-blue-light: #e0f2fe;
    --accent-yellow: #facc15;
    --accent-yellow-dark: #ca8a04;
    --bg: #f8fafc;
    --panel: #ffffff;
    --panel-soft: #f1f5f9;
    --text: #1e293b;
    --muted: #64748b;
    --primary: var(--brand-primary);
    --primary-dark: var(--brand-primary-dark);
    --danger: #dc2626;
    --success: #16a34a;
    --border: #d9e2ef;
    --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
    --radius: 10px;
}

* {
    box-sizing: border-box;
}

body {
    max-width: 1180px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 28rem),
        linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
    font-family: Tahoma, Arial, sans-serif;
    line-height: 1.7;
}

h1 {
    margin: 0 0 18px;
    color: var(--brand-primary);
    font-size: 28px;
    font-weight: 800;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

.box,
.container,
.card,
table {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.box,
.container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 26px;
}

.topbar {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 18px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.topbar a,
.main-link,
.box > p:first-child a {
    font-weight: 700;
}

label {
    display: block;
    margin-top: 14px;
    color: #24324a;
    font-weight: 800;
}

input,
textarea,
select {
    width: 100%;
    margin-top: 6px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(56, 189, 248, 0.85);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

input[disabled] {
    background: var(--panel-soft);
    color: var(--muted);
}

button,
a.button,
.btn {
    display: inline-block;
    padding: 9px 14px;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

button,
a.button {
    background: var(--primary);
    color: #fff;
}

button:hover,
a.button:hover,
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(109, 40, 217, 0.18);
}

.site-header {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 22px;
    padding: 14px;
    display: grid;
    gap: 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(109, 40, 217, 0.12);
    border-radius: 22px;
    box-shadow: 0 18px 45px rgba(30, 41, 59, 0.09);
    backdrop-filter: blur(14px);
}

.site-header + .topbar {
    display: none !important;
}

.site-header-main {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.site-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 250px;
}

.site-logo {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-primary), var(--medical-blue-dark));
    box-shadow: 0 12px 24px rgba(109, 40, 217, 0.22);
    font-weight: 900;
    letter-spacing: 0;
}

.site-logo:hover {
    color: #fff;
}

.site-name {
    display: block;
    color: var(--brand-primary);
    font-weight: 900;
    font-size: 17px;
}

.site-tagline {
    color: var(--muted);
    font-size: 13px;
}

.site-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    color: #334155;
    background: #fff;
    border: 1px solid transparent;
    font-weight: 800;
}

.site-nav a:hover,
.site-nav a.active {
    color: var(--brand-primary);
    background: #fff;
    border-color: rgba(109, 40, 217, 0.22);
    box-shadow: 0 8px 18px rgba(109, 40, 217, 0.1);
}

.site-nav a.attention {
    color: #1e293b;
    background: var(--accent-yellow);
    border-color: rgba(202, 138, 4, 0.24);
}

.site-badge {
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #fff;
    background: var(--brand-primary);
    font-size: 12px;
}

.site-user {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    color: var(--text);
    min-width: 230px;
    padding: 8px 10px;
    background: var(--medical-blue-light);
    border-radius: 18px;
}

.site-user-avatar {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: var(--medical-blue-dark);
    font-weight: 900;
}

.site-user span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    color: #fff;
    background: var(--brand-primary);
    font-weight: 800;
}

.logout-link:hover {
    color: #fff;
    background: var(--brand-primary-dark);
}

.site-footer {
    max-width: 1180px;
    margin: 28px auto 0;
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) repeat(2, minmax(160px, 0.8fr)) auto;
    gap: 18px;
    align-items: start;
    color: var(--muted);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.site-footer strong {
    display: block;
    color: var(--brand-primary);
    margin-bottom: 6px;
}

.site-footer-brand span,
.site-footer-meta span {
    display: block;
}

.site-footer-column {
    display: grid;
    gap: 5px;
}

.site-footer-column a {
    font-weight: 700;
}

.site-footer-meta {
    display: grid;
    gap: 5px;
    justify-items: start;
    padding: 10px 12px;
    background: var(--panel-soft);
    border-radius: 14px;
}

.dashboard-shell {
    display: grid;
    gap: 18px;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) minmax(260px, 0.8fr);
    gap: 16px;
    align-items: stretch;
    padding: 22px;
    background: linear-gradient(135deg, #fff 0%, #f5f3ff 48%, #e0f2fe 100%);
    border: 1px solid rgba(109, 40, 217, 0.14);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.dashboard-hero h1 {
    margin-bottom: 8px;
}

.dashboard-hero p {
    margin: 0;
    color: var(--muted);
}

.dashboard-profile-card {
    display: grid;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: 18px;
}

.dashboard-profile-card strong {
    color: var(--brand-primary);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.dashboard-stat {
    position: relative;
    min-height: 132px;
    padding: 18px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.dashboard-stat::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 5px;
    height: 100%;
    background: var(--medical-blue);
}

.dashboard-stat.important::before {
    background: var(--accent-yellow);
}

.dashboard-stat.admin::before {
    background: var(--brand-primary);
}

.dashboard-stat span {
    color: var(--muted);
    font-weight: 700;
}

.dashboard-stat strong {
    display: block;
    margin-top: 12px;
    color: var(--brand-primary);
    font-size: 34px;
    line-height: 1.1;
}

.dashboard-section {
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.dashboard-section h2 {
    margin: 0 0 12px;
    color: var(--brand-primary);
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.dashboard-action {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    padding: 14px;
    min-height: 74px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--text);
    font-weight: 800;
}

.dashboard-action:hover {
    color: var(--brand-primary);
    border-color: rgba(109, 40, 217, 0.22);
    box-shadow: 0 10px 24px rgba(30, 41, 59, 0.08);
}

.dashboard-action.primary {
    background: var(--accent-yellow);
}

.dashboard-action.admin {
    background: #f5f3ff;
}

.dashboard-action.medical {
    background: var(--medical-blue-light);
}

.dashboard-action small {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

a.secondary,
.secondary {
    background: #475569;
}

a.danger,
.danger,
.delete-btn {
    background: var(--danger);
}

.edit-btn {
    background: var(--primary);
}

.success,
.error {
    border-radius: 8px;
    border: 1px solid transparent;
}

.success {
    color: #14532d;
    background: #dcfce7;
    border-color: #bbf7d0;
}

.error {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fecaca;
}

.card-grid {
    gap: 16px;
}

.card {
    padding: 20px;
}

.number {
    color: var(--primary);
    line-height: 1.2;
}

.actions {
    gap: 12px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
}

th,
td {
    border-color: var(--border);
}

th {
    background: var(--medical-blue-light);
    color: #1e2f4d;
}

tr:nth-child(even) td {
    background: #fbfdff;
}

.search-box {
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-box input {
    margin-top: 0;
}

.search-box button,
.search-box a {
    min-width: 86px;
    text-align: center;
}

.profile-photo img,
.profile-placeholder {
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.14);
}

.hint {
    color: var(--muted);
}

.link-box {
    margin-top: 18px;
    text-align: center;
}

.feedback-form {
    max-width: 820px;
}

.feedback-form .hint {
    margin-top: -8px;
    margin-bottom: 18px;
}

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

.attendance-box {
    max-width: 100%;
    margin: 18px auto;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 13px;
}

.status-present {
    color: #14532d;
    background: #dcfce7;
}

.status-absent {
    color: #991b1b;
    background: #fee2e2;
}

.status-late {
    color: #713f12;
    background: #fef3c7;
}

.status-excused {
    color: #075985;
    background: #e0f2fe;
}

.inline-form {
    display: inline-block;
    margin: 2px;
}

.inline-form button {
    width: auto;
}

/* Modern shell hardening */
html {
    background: var(--bg);
}

body > .site-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    text-align: start;
}

body > .site-header .site-header-main {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

body > .site-header .site-brand,
body > .site-header .site-user {
    text-align: start;
}

body > .site-header .site-nav {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
}

body > .site-header .site-nav a,
body > .site-header .logout-link,
body > .site-header .site-name,
body > .site-header .site-logo {
    text-decoration: none;
}

body > .site-header .site-nav a {
    white-space: nowrap;
}

body > main.dashboard-shell {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    text-align: start;
}

body > main.dashboard-shell .actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
}

body > main.dashboard-shell .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 15px;
    text-decoration: none;
}

body > main.dashboard-shell .dashboard-actions a {
    text-decoration: none;
}

body > .site-footer {
    width: 100%;
    text-align: start;
}

@media (max-width: 720px) {
    body {
        padding: 14px;
    }

    h1 {
        font-size: 24px;
    }

    .box,
    .container {
        padding: 18px;
    }

    .topbar,
    .site-header,
    .site-footer,
    .search-box,
    .actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .site-header-main,
    .dashboard-hero {
        display: flex;
        flex-direction: column;
    }

    .site-brand,
    .site-user,
    .site-nav,
    .site-footer-column,
    .site-footer-meta {
        width: 100%;
        justify-content: stretch;
    }

    .site-nav a,
    .logout-link,
    .dashboard-action {
        width: 100%;
        justify-content: center;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }

    .dashboard-hero,
    .dashboard-section {
        padding: 16px;
    }

    .search-box button,
    .search-box a,
    a.button {
        width: 100%;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

@media print {
    .site-header,
    .site-footer {
        display: none !important;
    }
}
