﻿:root {
    --brand-dark: #1b3a4b;
    --brand-mid: #285f74;
    --brand-light: #f2f8fb;
}

html {
    font-size: 15px;
}

body {
    background: linear-gradient(180deg, #f8fbfd 0%, #edf4f8 100%);
    color: #13202a;
}

.topbar {
    background: linear-gradient(90deg, var(--brand-dark), var(--brand-mid));
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.topbar-content {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-user {
    color: #e7f1f6;
    font-weight: 600;
    font-size: 0.97rem;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #fff;
    text-decoration: none;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 12px rgba(10, 24, 33, 0.25);
    background: rgba(255, 255, 255, 0.16);
}

.brand-title {
    line-height: 1.1;
}

.card {
    border: 0;
    border-radius: 14px;
}

.table > :not(caption) > * > * {
    padding: 0.65rem 0.7rem;
}

.btn {
    --btn-accent: #2475ff;
    border-radius: 12px;
    border-width: 1.5px;
    background: #f3f4f6;
    color: var(--btn-accent);
    border-color: var(--btn-accent);
    box-shadow: none;
    transition: transform 0.14s ease, background-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.btn:hover,
.btn:focus {
    background: #eef3f8;
    border-color: var(--btn-accent);
    color: var(--btn-accent);
    box-shadow: 0 4px 10px rgba(12, 37, 52, 0.06);
    transform: translateY(-0.5px);
}

.btn.btn-sm {
    border-radius: 10px;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

.btn-primary,
.btn-outline-primary {
    --btn-accent: #2475ff;
}

.btn-secondary,
.btn-outline-secondary {
    --btn-accent: #5b6f88;
}

.btn-danger,
.btn-outline-danger {
    --btn-accent: #d93752;
}

.btn-success,
.btn-outline-success {
    --btn-accent: #178f5b;
}

.btn-warning,
.btn-outline-warning {
    --btn-accent: #f0b000;
}

.btn-info,
.btn-outline-info {
    --btn-accent: #14a9d8;
}

.btn-light,
.btn-outline-light {
    --btn-accent: #f3f4f6;
    border-color: rgba(243, 244, 246, 0.92);
}

.topbar .btn-outline-light {
    background: rgba(243, 244, 246, 0.12);
    color: #f3f4f6;
}

.topbar .btn-outline-light:hover,
.topbar .btn-outline-light:focus {
    background: rgba(243, 244, 246, 0.22);
    color: #1b3a4b;
}

.start-screen {
    min-height: calc(100vh - 180px);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.start-section {
    width: min(920px, 100%);
    margin: 0 auto;
}

.start-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #325264;
    margin: 0 0 0.45rem 0.25rem;
}

.start-grid {
    width: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.start-logout-wrap {
    width: min(920px, 100%);
    margin: 0.2rem auto 0.3rem auto;
    display: flex;
    justify-content: center;
}

.start-logout-form {
    width: min(320px, 100%);
}

.start-logout-btn {
    width: 100%;
    min-height: 54px;
    font-size: 1.18rem;
    font-weight: 600;
}

.start-action-btn {
    min-height: 126px;
    border-radius: 12px;
    --action-color: #2475ff;
    border: 1.5px solid var(--action-color);
    background: #f3f4f6;
    box-shadow: none;
    color: var(--action-color);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.start-action-btn:hover,
.start-action-btn:focus {
    transform: translateY(-1px);
    box-shadow: 0 8px 14px rgba(12, 37, 52, 0.08);
    color: var(--action-color);
    background: #eef3f8;
    border-color: var(--action-color);
    filter: saturate(1.02);
}

.start-action-icon {
    width: 2.35rem;
    height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    color: var(--action-color);
    transition: transform 0.18s ease;
}

.start-action-icon svg {
    width: 100%;
    height: 100%;
}

.start-action-btn:hover .start-action-icon,
.start-action-btn:focus .start-action-icon {
    transform: scale(1.02);
    color: var(--action-color);
}

.start-grid .start-action-btn:nth-child(1) {
    --action-color: #2475ff;
}

.start-grid .start-action-btn:nth-child(2) {
    --action-color: #178f5b;
}

.start-grid .start-action-btn:nth-child(3) {
    --action-color: #f0b000;
}

.start-grid .start-action-btn:nth-child(4) {
    --action-color: #14a9d8;
}

.start-grid .start-action-btn:nth-child(5) {
    --action-color: #eb7a1d;
}

.start-grid .start-action-btn:nth-child(6) {
    --action-color: #cc3b5a;
}

.start-grid .start-action-btn:nth-child(7) {
    --action-color: #7a4fd0;
}

.start-grid .start-action-btn:nth-child(8) {
    --action-color: #307a61;
}

.start-grid .start-action-btn:nth-child(9) {
    --action-color: #9b6a2e;
}

.start-action-label {
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.2;
}

.btn-home-back {
    min-width: 220px;
}

.attendance-badge {
    display: inline-block;
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.15;
    border: 1px solid transparent;
}

.attendance-badge-present {
    background: #e8f6ee;
    color: #16784a;
    border-color: #b7e4ca;
}

.attendance-badge-excused {
    background: #fff8e7;
    color: #9a6a00;
    border-color: #f2d79a;
}

.attendance-badge-unexcused {
    background: #fdecee;
    color: #b42336;
    border-color: #f2b6bf;
}

.attendance-badge-unknown {
    background: #edf1f5;
    color: #5b6f88;
    border-color: #d7e0ea;
}

.attendance-icon-btn {
    width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.attendance-action-text {
    display: none;
}

.attendance-status-trigger {
    cursor: pointer;
    padding: 0.25rem 0.55rem;
    background: transparent;
}

.attendance-mobile-table .attendance-status-trigger {
    min-width: 9.5rem;
    min-height: 2.75rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    text-align: center;
}

.attendance-mobile-table .attendance-action-cell {
    width: 1%;
    white-space: nowrap;
}

.attendance-mobile-table .attendance-action-cell .attendance-icon-btn {
    width: auto;
    min-height: 2.75rem;
    padding: 0.6rem 0.95rem;
    gap: 0.5rem;
    border-radius: 0.75rem;
}

.attendance-mobile-table .attendance-action-cell .attendance-action-text {
    display: inline;
    font-size: 0.95rem;
    font-weight: 600;
}

@media (min-width: 769px) {
    .attendance-mobile-table tbody tr.attendance-row-filled > * {
        background: #eaf4ff;
    }
}

.attendance-status-trigger:focus-visible {
    outline: 2px solid #4f86c7;
    outline-offset: 2px;
}

.student-detail-page .card {
    border: 1px solid #dbe5ef;
}

.student-detail-page h2 {
    letter-spacing: 0.04em;
}

.student-detail-page dt {
    color: #567185;
    font-weight: 600;
}

.student-detail-page dd {
    color: #13202a;
    font-weight: 500;
}

.message-feed {
    display: grid;
    gap: 0.8rem;
}

.message-card {
    background: #fff;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    padding: 0.8rem 0.9rem;
    box-shadow: 0 2px 10px rgba(12, 37, 52, 0.05);
}

.message-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.message-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
    color: #2d4f62;
    background: #edf4f8;
    border: 1px solid #d6e4ee;
}

.message-meta-student {
    color: #1f5670;
    background: #e8f3ff;
    border-color: #cfe3fb;
}

.message-meta-sender {
    color: #195d4f;
    background: #eaf8f2;
    border-color: #c8e9dd;
}

.message-card-text {
    white-space: pre-wrap;
    font-size: 0.98rem;
    line-height: 1.45;
    color: #13202a;
    background: #f8fbfd;
    border: 1px solid #e1ebf2;
    border-radius: 10px;
    padding: 0.7rem 0.75rem;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding-left: 0.7rem;
        padding-right: 0.7rem;
    }

    .start-grid {
        gap: 0.7rem;
    }

    .start-section-title {
        font-size: 0.95rem;
    }

    .start-action-btn {
        min-height: 112px;
        padding: 0.8rem;
    }

    .start-action-icon {
        width: 2rem;
        height: 2rem;
        margin-bottom: 0.4rem;
    }

    .start-action-label {
        font-size: 0.98rem;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .brand-title {
        font-size: 0.92rem;
    }

    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table tbody,
    .mobile-stack-table tr,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }

    .mobile-stack-table tr {
        background: #fff;
        border: 1px solid #dbe5ef;
        border-radius: 12px;
        margin-bottom: 0.65rem;
        padding: 0.2rem 0;
    }

    .mobile-stack-table td {
        border: 0;
        padding: 0.45rem 0.7rem;
        text-align: left;
    }

    .mobile-stack-table td[data-label] {
        color: #13202a;
        font-weight: 600;
    }

    .mobile-stack-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.75rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        color: #5b6f88;
        margin-bottom: 0.2rem;
        text-transform: uppercase;
    }

    .mobile-stack-table .table-action-cell,
    .mobile-stack-table .attendance-action-cell {
        text-align: left !important;
    }

    .mobile-stack-table .table-action-cell .btn,
    .mobile-stack-table .attendance-action-cell .btn {
        width: 100%;
        min-height: 2.2rem;
    }

    .mobile-stack-table .attendance-action-cell .attendance-icon-btn {
        height: auto;
        gap: 0.45rem;
        padding: 0.35rem 0.7rem;
    }

    .mobile-stack-table .attendance-action-cell .attendance-action-text {
        display: inline;
        font-size: 0.95rem;
        font-weight: 600;
    }

    .student-detail-page .card-body {
        padding: 0.85rem;
    }

    .student-detail-page dt,
    .student-detail-page dd {
        font-size: 0.92rem;
    }

    .attendance-mobile-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.2rem 0.55rem;
    }

    .attendance-mobile-table tbody tr > td:nth-child(1) {
        display: none;
    }

    .attendance-mobile-table tbody tr > td:nth-child(2) {
        grid-column: 1 / -1;
        padding-bottom: 0.15rem;
        font-size: 1rem;
        font-weight: 700;
    }

    .attendance-mobile-table tbody tr > td:nth-child(2)::before {
        display: none;
    }

    .attendance-mobile-table tbody tr > td:nth-child(3) {
        grid-column: 1;
    }

    .attendance-mobile-table tbody tr > td:nth-child(4) {
        grid-column: 2;
    }

    .attendance-mobile-table tbody tr > td:nth-child(5) {
        grid-column: 1 / -1;
        padding-top: 0.15rem;
    }

    .message-card {
        padding: 0.7rem 0.7rem;
    }

    .message-card-meta {
        gap: 0.35rem;
    }

    .message-meta-pill {
        font-size: 0.78rem;
    }

    .message-card-text {
        font-size: 0.95rem;
    }
}
