:root {
    --blue: #284595;
    --blue-dark: #172e70;
    --blue-light: #eaf0ff;
    --green: #159447;
    --red: #d91e18;
    --ink: #111827;
    --muted: #667085;
    --line: #d8deea;
    --page: #f5f7fb;
    --white: #ffffff;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--ink); background: var(--page); }
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: linear-gradient(180deg, var(--blue-dark), var(--blue), #aebce4);
}

.login-card {
    width: min(440px, 100%);
    background: var(--white);
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.24);
}

.brand-row { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.brand-row.compact { margin-bottom: 28px; }
.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: var(--white);
    font-weight: 800;
    font-size: 24px;
}

h1, h2, h3 { margin: 0; }
h1 { color: var(--blue); font-size: 28px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 4px 0 0; color: var(--muted); }

.form-grid { display: grid; gap: 16px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: 13px; }
input, select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--white);
    color: var(--ink);
}
input:focus, select:focus { outline: 2px solid rgba(40, 69, 149, 0.18); border-color: var(--blue); }

.primary, .secondary {
    min-height: 44px;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-weight: 800;
}
.primary { color: var(--white); background: var(--blue); }
.secondary { color: var(--blue); background: var(--white); border-color: var(--line); }
.primary:disabled, .secondary:disabled { opacity: 0.62; cursor: default; }
.status { min-height: 20px; font-weight: 700; }
.status.ok { color: var(--green); }
.status.error { color: var(--red); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--line);
    padding: 24px;
    display: flex;
    flex-direction: column;
}
.nav-list { display: grid; gap: 8px; }
.nav-item {
    text-align: left;
    border: 0;
    border-radius: 8px;
    padding: 12px 14px;
    background: transparent;
    color: var(--ink);
    font-weight: 800;
}
.nav-item.active { color: var(--blue); background: var(--blue-light); }
#logoutButton { margin-top: auto; }
.content { padding: 28px; overflow: auto; }
.panel { display: grid; gap: 18px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
.student-list-card { position: sticky; top: 28px; display: grid; gap: 12px; }
.student-list { display: grid; gap: 8px; max-height: calc(100vh - 190px); overflow: auto; }
.student-item {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    padding: 12px;
    text-align: left;
}
.student-item.active { border-color: var(--blue); background: var(--blue-light); }
.student-item strong, .student-item span { display: block; }
.student-item span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.detail-card { display: grid; gap: 18px; }
.empty-state { min-height: 220px; display: grid; place-items: center; color: var(--muted); font-weight: 800; }
.section-grid { display: grid; gap: 14px; }
.technique-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.check-row input { width: 20px; min-height: 20px; margin-top: 2px; }
.check-row strong, .check-row span { display: block; }
.check-row span { color: var(--muted); font-size: 13px; margin-top: 2px; }
.attendance-grid { display: grid; grid-template-columns: repeat(7, minmax(42px, 1fr)); gap: 8px; }
.day-button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    font-weight: 800;
}
.day-button.active { background: rgba(21, 148, 71, 0.14); border-color: var(--green); color: var(--green); }
.video-list { display: grid; gap: 12px; }
.video-card { display: grid; gap: 10px; }
.video-meta { color: var(--muted); font-size: 13px; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; }
    .split { grid-template-columns: 1fr; }
    .student-list-card { position: static; }
}

@media (max-width: 640px) {
    .content, .sidebar, .login-card { padding: 18px; }
    .two-columns { grid-template-columns: 1fr; }
}
