:root {
    --orange: #ff8500;
    --orange-dark: #d97706;
    --purple: #6b35f2;
    --purple-dark: #4b1bb8;
    --blue: #0057b8;
    --pink: #ff5ca8;
    --yellow: #ffc84a;
    --cream: #fff8ef;
    --white: #ffffff;
    --ink: #111827;
    --muted: #5f6678;
    --soft: #f4f2ff;
    --border: rgba(18, 24, 39, 0.10);
    --shadow: 0 24px 70px rgba(30, 20, 80, 0.14);
    --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 8% 5%, rgba(255, 132, 0, 0.18), transparent 28%),
        radial-gradient(circle at 92% 10%, rgba(107, 53, 242, 0.16), transparent 26%),
        linear-gradient(180deg, var(--cream) 0%, #ffffff 64%, #f8f5ff 100%);
    min-height: 100vh;
}

a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; display: block; }

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 248, 239, 0.92);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(18, 24, 39, 0.06);
}

.brand-card {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--purple-dark);
}

.brand-card img {
    width: 58px;
    height: 42px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--white);
    box-shadow: 0 10px 28px rgba(18, 24, 39, 0.08);
    padding: 4px;
}

.app-nav {
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(18, 24, 39, 0.06);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.58rem 0.95rem;
    border-radius: 999px;
    color: rgba(18, 24, 39, .78);
    background: #ffffff;
    border: 1px solid rgba(18, 24, 39, 0.08);
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(18, 24, 39, 0.04);
    transition: transform 180ms ease, box-shadow 180ms ease, color 180ms ease, background 180ms ease;
}
.nav-link:hover {
    color: var(--purple);
    background: var(--soft);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(107, 53, 242, 0.12);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    color: #343247;
}
.form-input {
    width: 100%;
    border: 1px solid rgba(18, 24, 39, 0.14);
    border-radius: 1rem;
    padding: 0.78rem 0.95rem;
    outline: none;
    background: white;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.form-input:focus {
    border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(107, 53, 242, .13);
}

.btn-primary, .btn-secondary, .btn-danger, .btn-warning {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: -0.02em;
    padding: 0.75rem 1.15rem;
    border: 0;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
    text-align: center;
}
.btn-primary {
    background: linear-gradient(135deg, var(--orange), var(--purple));
    color: white;
    box-shadow: 0 14px 32px rgba(107, 53, 242, 0.22);
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover, .btn-warning:hover {
    transform: translateY(-2px);
}
.btn-secondary {
    background: #ffffff;
    color: #343247;
    border: 1px solid rgba(18, 24, 39, 0.10);
    box-shadow: 0 10px 24px rgba(18, 24, 39, 0.06);
}
.btn-danger {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}
.btn-warning {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.card {
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(18, 24, 39, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.card-soft {
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(244,242,255,.96));
    border: 1px solid rgba(107, 53, 242, 0.10);
    border-radius: var(--radius);
}

.stat-number {
    color: var(--purple);
    letter-spacing: -0.05em;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 1.35rem;
    border: 1px solid rgba(18, 24, 39, 0.08);
    background: white;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: .9rem 1rem; border-bottom: 1px solid rgba(18, 24, 39, 0.08); text-align: left; vertical-align: top; }
th { background: #fff8ef; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #5f6678; }
tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex;
    padding: .28rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 900;
    white-space: nowrap;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #ede9fe; color: #5b21b6; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-yellow { background: #fef9c3; color: #854d0e; }

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 132, 0, 0.22), transparent 28%),
        radial-gradient(circle at 86% 18%, rgba(107, 53, 242, 0.2), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.62), transparent 70%),
        var(--cream);
}
.login-logo {
    width: 150px;
    height: 72px;
    object-fit: contain;
    margin: 0 auto 1rem;
    border-radius: 20px;
    background: white;
    padding: .45rem;
    box-shadow: 0 12px 28px rgba(18, 24, 39, 0.08);
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: .9rem;
}
@media (min-width: 768px) {
    .week-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.day-card {
    border-radius: 1.25rem;
    border: 1px solid rgba(18, 24, 39, 0.08);
    background: #ffffff;
    min-height: 150px;
    overflow: hidden;
}
.day-head {
    background: linear-gradient(135deg, rgba(255, 132, 0, 0.12), rgba(107, 53, 242, 0.12));
    padding: .75rem;
    font-weight: 900;
    color: #343247;
}
.schedule-item {
    margin: .65rem;
    padding: .7rem;
    border-radius: 1rem;
    background: var(--soft);
    border-left: 5px solid var(--orange);
}
.schedule-time {
    font-size: .78rem;
    font-weight: 900;
    color: var(--purple-dark);
}
.schedule-student {
    font-weight: 900;
    color: var(--ink);
}

.text-brand { color: var(--purple); }
.bg-brand-soft { background: var(--soft); }
.border-brand { border-color: rgba(107, 53, 242, 0.20); }

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .95rem;
    border: 1px solid rgba(18, 24, 39, 0.08);
    border-radius: 1.1rem;
    background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(244,242,255,.65));
}

.month-calendar {
    border: 1px solid rgba(18, 24, 39, 0.08);
    border-radius: 1.5rem;
    background: #fff;
    overflow: hidden;
}
.month-calendar-head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: linear-gradient(135deg, rgba(255, 132, 0, 0.16), rgba(107, 53, 242, 0.16));
}
.month-calendar-head div {
    padding: .85rem .5rem;
    text-align: center;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 900;
    color: #343247;
}
.month-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}
.month-day {
    min-height: 142px;
    border-right: 1px solid rgba(18, 24, 39, 0.07);
    border-bottom: 1px solid rgba(18, 24, 39, 0.07);
    padding: .65rem;
    background: rgba(255, 255, 255, .92);
}
.month-day:nth-child(7n) { border-right: none; }
.month-day.is-muted {
    background: rgba(248, 250, 252, .9);
    color: #94a3b8;
}
.month-day.is-today {
    background: linear-gradient(180deg, rgba(255, 132, 0, 0.10), rgba(255,255,255,.96));
    box-shadow: inset 0 0 0 2px rgba(255, 132, 0, 0.35);
}
.month-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-weight: 950;
    color: var(--purple-dark);
    background: rgba(107, 53, 242, 0.08);
    margin-bottom: .45rem;
}
.month-day.is-muted .month-day-number {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}
.month-event {
    border-left: 4px solid var(--orange);
    background: var(--soft);
    border-radius: .85rem;
    padding: .5rem .55rem;
    margin-top: .45rem;
    box-shadow: 0 8px 18px rgba(18, 24, 39, 0.04);
}
.month-event-time {
    display: block;
    font-size: .72rem;
    font-weight: 950;
    color: var(--purple-dark);
}
.month-event-title {
    display: block;
    font-size: .8rem;
    font-weight: 900;
    color: var(--ink);
    line-height: 1.15;
}
.month-event-meta {
    display: block;
    font-size: .68rem;
    color: #64748b;
    margin-top: .15rem;
}
@media (max-width: 767px) {
    .month-calendar-head { display: none; }
    .month-calendar-grid { grid-template-columns: 1fr; }
    .month-day {
        min-height: auto;
        border-right: none;
        display: block;
    }
    .month-day.is-muted { display: none; }
}
