:root {
    --bg: #f3f5f8;
    --card: #ffffff;
    --text: #172033;
    --muted: #687386;
    --border: #d9e0ea;
    --line: #eef1f5;
    --primary: #1f5eff;
    --primary-soft: #eef4ff;
    --danger-bg: #fff0f0;
    --danger: #b42318;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background: var(--bg);
}
a { color: inherit; }
.topbar {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 22px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}
.topbar-logo {
    height: 46px;
    width: auto;
    max-width: 190px;
    object-fit: contain;
    display: block;
}
.topbar-title {
    color: var(--muted);
    font-size: 16px;
    white-space: nowrap;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.topbar-link, .logout {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
}
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 22px;
}
.welcome, .card, .app-tile, .school-card, .person-card, .install-box, .empty-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
}
.welcome {
    padding: 26px;
    margin-bottom: 22px;
}
.welcome h1 { margin: 0; font-size: 30px; }
.welcome p { color: var(--muted); margin: 10px 0 0 0; }
.app-grid, .school-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}
.app-tile, .school-card {
    display: block;
    width: calc(33.333% - 12px);
    min-height: 145px;
    padding: 22px;
    text-decoration: none;
    color: var(--text);
}
.app-tile:hover, .school-card:hover { border-color: var(--primary); }
.app-icon { font-size: 30px; margin-bottom: 10px; }
.app-tile h2, .school-card h2 { margin: 0 0 8px 0; font-size: 20px; }
.app-tile p, .school-status, .status { color: var(--muted); margin: 0; }
.shift-day, .day-row {
    border-top: 1px solid var(--line);
    padding-top: 10px;
    margin-top: 10px;
}
.shift-date, .day-date, .school-date {
    font-weight: bold;
    color: var(--muted);
    margin-bottom: 6px;
}
.shift-badge, .badge, .group-badge {
    display: inline-block;
    background: var(--primary-soft);
    color: #18315f;
    border-radius: 999px;
    padding: 6px 10px;
    margin: 3px 4px 3px 0;
    font-weight: bold;
    font-size: 14px;
}
.school-title { margin-top: 8px !important; color: var(--text) !important; font-weight: bold; line-height: 1.35; }
.status-full { color: var(--danger); font-weight: bold; }
.info-list { margin: 0; padding: 0; list-style: none; }
.info-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.install-box { padding: 18px; margin-bottom: 18px; display: none; }
.install-box p { color: var(--muted); margin: 8px 0 12px 0; }
.install-box button, button {
    border: 0;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    font-weight: bold;
    font-size: 15px;
}
.week-buttons, .branch-buttons { display: flex; gap: 12px; margin: 16px 0 0 0; }
.week-buttons a, .branch-buttons a {
    flex: 1;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
    border: 2px solid #d6e2ff;
}
.week-buttons a.active, .branch-buttons a.active { background: var(--primary); color: #fff; }
.desktop-plan {
    background: #fff;
    border-radius: 18px;
    padding: 12px;
    overflow-x: auto;
}
.desktop-plan table { width: 100%; border-collapse: collapse; font-size: 15px; }
.desktop-plan th, .desktop-plan td { border: 1px solid #aaa; padding: 8px; vertical-align: top; }
.mobile-plan { display: none; }
.person-card { padding: 18px; margin-bottom: 16px; }
.person-card h2 { margin: 0 0 14px 0; font-size: 21px; }
.day-free { color: #9aa3af; font-style: italic; }
.empty-box { padding: 22px; }
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(19, 35, 65, 0.12);
}
.login-logo {
    width: 190px;
    max-width: 82%;
    height: auto;
    display: block;
    margin: 0 auto 20px auto;
    object-fit: contain;
}
.login-card h1 { margin: 0 0 4px 0; text-align: center; }
.login-card .subtitle, .hint { color: var(--muted); text-align: center; }
label { display: block; margin: 16px 0 8px; font-weight: bold; }
input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px 14px;
    font-size: 16px;
}
input:focus { outline: 3px solid rgba(31, 94, 255, 0.18); border-color: var(--primary); }
.login-card button { width: 100%; min-height: 50px; margin-top: 22px; }
.alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; background: #eef4ff; color: #18315f; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 760px) {
    .topbar { min-height: 62px; padding: 9px 14px; gap: 10px; }
    .topbar-logo { height: 34px; max-width: 145px; }
    .topbar-title { font-size: 14px; }
    .topbar-link { font-size: 0; }
    .topbar-link::first-letter { font-size: 16px; }
    .container { padding: 18px 14px; }
    .welcome { padding: 20px; border-radius: 20px; margin-bottom: 16px; }
    .welcome h1 { font-size: 25px; }
    .app-grid, .school-grid { display: block; }
    .app-tile, .school-card { width: 100%; min-height: auto; margin: 0 0 18px 0; }
    .desktop-plan { display: none; }
    .mobile-plan { display: block; }
    .week-buttons, .branch-buttons { flex-direction: column; }
    .login-page { align-items: flex-start; padding: 16px; }
    .login-card { margin-top: 24px; padding: 22px; border-radius: 20px; }
    .login-logo { width: 170px; }
}
