* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1e293b;
    background: #f5f7fb;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: #4f46e5;
}

.page-shell {
    width: 94%;
    max-width: 1140px;
    margin: 28px auto 40px;
}

body.centered .page-shell {
    padding-top: 24px;
    padding-bottom: 24px;
}

.topbar,
.panel,
.sub-panel,
.auth-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.07);
}

.topbar {
    overflow: hidden;
    padding: 28px 30px;
    margin-bottom: 24px;
}

.topbar > div:first-child {
    float: left;
    width: 68%;
}

.topbar > .action-row {
    float: right;
    width: 30%;
    text-align: right;
    margin-top: 4px;
}

.panel,
.sub-panel,
.auth-card {
    padding: 28px;
}

.sub-panel {
    margin-top: 22px;
    background: #f8fafc;
}

.auth-container {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 20px 0;
}

.student-checkin-shell {
    max-width: 760px;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.logo-badge {
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: #4f46e5;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 54px;
    text-align: center;
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.25);
}

.auth-panel,
.student-panel {
    width: 100%;
}

.grid-two {
    margin: 0 -12px 24px;
}

.grid-two:after,
.topbar:after,
.inline-form:after,
.compact-form:after,
.copy-row:after,
.class-session-action:after {
    content: "";
    display: block;
    clear: both;
}

.grid-two > * {
    float: left;
    width: 50%;
    padding: 0 12px;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: #4f46e5;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    color: #0f172a;
}

h1 {
    font-size: 40px;
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 8px;
}

h2 {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    margin-bottom: 8px;
}

h3 {
    font-size: 17px;
    line-height: 1.35;
    font-weight: 700;
}

p {
    margin: 0;
}

.muted,
.empty-state {
    color: #64748b;
}

.empty-state {
    padding-top: 14px;
}

.action-row a,
.action-row button,
.action-row form {
    display: inline-block;
    vertical-align: middle;
    margin: 0 0 8px 8px;
}

.action-row form {
    margin-left: 8px;
}

.action-row form:first-child,
.action-row a:first-child,
.action-row button:first-child {
    margin-left: 0;
}

.form-grid {
    margin-top: 20px;
}

.form-grid > * {
    margin-bottom: 16px;
}

.form-grid > *:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

label > span {
    display: block;
    margin-bottom: 8px;
}

.label-row {
    margin-bottom: 8px;
}

.checkbox-row {
    overflow: hidden;
}

.checkbox-row input {
    float: left;
    width: auto;
    margin-top: 3px;
}

.checkbox-row span {
    display: block;
    margin-bottom: 0;
    margin-left: 28px;
}

.inline-form > * {
    display: inline-block;
    vertical-align: bottom;
    margin-right: 12px;
    margin-bottom: 12px;
}

.inline-form > *:last-child {
    margin-right: 0;
}

.inline-form .grow {
    width: 260px;
    max-width: 100%;
}

.compact-form label {
    float: left;
    width: 72%;
    margin-bottom: 0;
}

.compact-form .button {
    float: right;
    width: 24%;
    margin-top: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    margin-top: -9px;
    color: #64748b;
    font-size: 14px;
    font-weight: 700;
}

input,
select,
button,
textarea {
    font: inherit;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    background: #ffffff;
    color: #1e293b;
}

.input-wrapper input {
    padding-left: 42px;
}

input:focus,
select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.password-toggle {
    position: absolute;
    top: 8px;
    right: 12px;
    padding: 4px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.button {
    display: inline-block;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    font-weight: 600;
    cursor: pointer;
}

.button.primary,
.btn-submit {
    color: #ffffff;
    background: #4f46e5;
    box-shadow: 0 10px 18px rgba(79, 70, 229, 0.2);
}

.button.primary:hover,
.btn-submit:hover {
    background: #4338ca;
}

.button.secondary {
    color: #4338ca;
    background: #eef2ff;
    border-color: #c7d2fe;
}

.button.ghost {
    color: #1e293b;
    background: #ffffff;
    border-color: #d9e2ec;
}

.button.danger {
    color: #b91c1c;
    background: #fee2e2;
    border-color: #fecaca;
}

.small-button {
    padding: 10px 14px;
    font-size: 13px;
}

.btn-submit {
    display: block;
    width: 100%;
}

.alert {
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
}

.alert.success {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.alert.error {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}

.demo-box,
.note-box {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
}

.demo-box p,
.note-box p {
    margin-top: 8px;
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
}

.text-link {
    color: #4f46e5;
    text-decoration: none;
    font-weight: 600;
}

.text-link:hover {
    text-decoration: underline;
}

.qr-panel {
    text-align: center;
}

.qr-wrapper {
    margin: 24px 0;
}

.qr-wrapper img {
    width: 100%;
    max-width: 300px;
    height: auto;
    padding: 14px;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
}

.copy-row input {
    float: left;
    width: 68%;
}

.copy-row .button {
    float: right;
    width: 28%;
}

.session-list,
.modal-session-list,
.modal-session-groups {
    margin-top: 18px;
}

.session-list > *,
.modal-session-list > *,
.modal-session-groups > * {
    margin-bottom: 14px;
}

.session-list > *:last-child,
.modal-session-list > *:last-child,
.modal-session-groups > *:last-child {
    margin-bottom: 0;
}

.session-card,
.modal-session-link {
    display: block;
    padding: 18px;
    color: #1e293b;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.session-card strong,
.session-card span,
.modal-session-link strong,
.modal-session-link span {
    display: block;
}

.session-card strong,
.modal-session-link strong {
    margin-bottom: 6px;
}

.class-session-action .button,
.class-session-action .muted {
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    margin-bottom: 6px;
}

.dashboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    overflow: auto;
}

.dashboard-modal__backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    opacity: 0.45;
    filter: alpha(opacity=45);
}

.dashboard-modal__dialog {
    position: relative;
    width: 720px;
    max-width: 94%;
    margin: 60px auto;
    background: #ffffff;
    border: 1px solid #d9e2ec;
    border-radius: 18px;
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.dashboard-modal__header {
    padding: 26px 28px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.dashboard-modal__body {
    max-height: 480px;
    overflow-y: auto;
    padding: 22px 28px 28px;
}

.dashboard-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 18px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}

.modal-empty-state {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    color: #64748b;
}

.modal-session-group {
    margin-bottom: 18px;
}

.modal-session-group:last-child {
    margin-bottom: 0;
}

.modal-session-group h3 {
    margin-bottom: 12px;
}

.modal-session-link__meta {
    margin-top: 10px;
    color: #4f46e5;
    font-size: 13px;
    font-weight: 700;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #ffffff;
}

table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

thead th {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
    background: #f8fafc;
}

.status {
    display: inline-block;
    min-width: 92px;
    padding: 7px 12px;
    border-radius: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.status.present {
    color: #166534;
    background: #dcfce7;
}

.status.absent {
    color: #b91c1c;
    background: #fee2e2;
}

.status.late {
    color: #b45309;
    background: #fef3c7;
}

.status.excused {
    color: #1d4ed8;
    background: #dbeafe;
}

.delete-form {
    margin-top: 18px;
}

code {
    padding: 2px 7px;
    border-radius: 8px;
    background: #eef2ff;
    color: #4f46e5;
}

@media (max-width: 860px) {
    .page-shell {
        width: auto;
        margin: 20px 10px 28px;
    }

    .topbar,
    .panel,
    .sub-panel,
    .auth-card {
        padding: 22px;
    }

    .topbar > div:first-child,
    .topbar > .action-row {
        float: none;
        width: auto;
        text-align: left;
    }

    .topbar > .action-row {
        margin-top: 18px;
    }

    .grid-two {
        margin-left: 0;
        margin-right: 0;
    }

    .grid-two > * {
        float: none;
        width: 100%;
        padding: 0;
        margin-bottom: 24px;
    }

    .grid-two > *:last-child {
        margin-bottom: 0;
    }

    h1 {
        font-size: 30px;
    }

    h2 {
        font-size: 22px;
    }

    .inline-form > *,
    .compact-form label,
    .compact-form .button,
    .copy-row input,
    .copy-row .button {
        float: none;
        width: 100%;
        margin-right: 0;
    }

    .compact-form .button {
        margin-top: 0;
    }

    .dashboard-modal__dialog {
        width: auto;
        margin: 20px 10px;
    }

    .dashboard-modal__header,
    .dashboard-modal__body {
        padding-left: 20px;
        padding-right: 20px;
    }
}
