/* ── Reset & base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy:       #1B2B6B;
    --navy-dark:  #141f50;
    --navy-light: #e8eaf6;
    --green:      #5BA85A;
    --green-dark: #3d7a3c;
    --green-light:#e8f5e9;
    --orange:     #E8833A;
    --blue-light: #7EB5D6;
    --red:        #d93025;
    --text:       #202124;
    --text-muted: #5f6368;
    --border:     #dadce0;
    --bg:         #f8f9fa;
    --white:      #ffffff;
    --radius:     8px;
    --shadow:     0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
    --shadow-md:  0 2px 6px rgba(0,0,0,.15);
}

body {
    font-family: 'Nunito', 'Google Sans', Roboto, Arial, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    font-size: 30px;
    font-weight: 800;
    font-family: 'Nunito', sans-serif;
    line-height: 1;
}
.logo-icon { height: 68px; width: auto; display: block; }
.logo-text { color: var(--navy); font-weight: 400; font-family: 'Fredoka One', sans-serif; letter-spacing: 0.5px; display: flex; align-items: center; }
.logo-text span { color: var(--green); }

@media (min-width: 800px) {
    .logo { font-size: 42px; }
    .logo-icon { height: 90px; }
    .header-inner { height: 110px; }
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 16px;
}
.header-nav a { color: var(--text-muted); }
.header-nav a:hover { color: var(--navy); text-decoration: none; }
.btn-switch {
    background: var(--navy-light);
    color: var(--navy) !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 500;
}

/* ── Mobile header ──────────────────────────────────────────────────────── */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: opacity .2s;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 12px 24px 16px;
    gap: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.mobile-menu a {
    font-size: 15px;
    color: var(--text-muted);
    padding: 6px 0;
}
.mobile-menu a:hover { color: var(--navy); text-decoration: none; }
.mobile-menu .btn-switch {
    display: inline-block;
    width: fit-content;
    margin-top: 4px;
}
.mobile-menu.is-open { display: flex; }

@media (max-width: 600px) {
    .header-nav { display: none; }
    .hamburger  { display: flex; }
    .logo { font-size: 26px; }
    .logo-icon { height: 58px; }
}

/* ── Main ───────────────────────────────────────────────────────────────── */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 200px;
}

@media (max-width: 600px) {
    .main { padding: 20px 16px 200px; }
}

/* ── Flash messages ─────────────────────────────────────────────────────── */
.flash-messages { margin-bottom: 20px; }
.flash {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 14px;
}
.flash--success { background: var(--green-light); color: var(--green-dark); border: 1px solid #a8d5a8; }
.flash--error   { background: #fce8e6; color: var(--red); border: 1px solid #f5c6c2; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
}
.card--wide { max-width: 600px; }
.card-title { font-size: 20px; font-weight: 500; margin-bottom: 6px; color: var(--navy); }
.card-subtitle { color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }

@media (min-width: 800px) {
    .card-title { font-size: 22px; }
    .card { padding: 32px; }
}

@media (max-width: 600px) {
    .card { padding: 20px 16px; }
    .card--wide { max-width: 100%; }
}

/* ── Page layouts ───────────────────────────────────────────────────────── */
.page-center {
    display: flex;
    justify-content: center;
    padding-top: 16px;
}

/* Desktop: wider centered card */
@media (min-width: 800px) {
    .page-center .card--wide {
        max-width: 520px;
        width: 100%;
    }
    .page-center {
        padding-top: 40px;
    }
}

.page-two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

/* Desktop: two column layout */
@media (min-width: 800px) {
    .page-two-col {
        grid-template-columns: 420px 1fr;
        gap: 32px;
    }
    .col-form .card {
        position: sticky;
        top: 108px;
    }
}

@media (max-width: 600px) {
    .page-center { padding-top: 8px; }
}

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 120px; }

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
}
.hint { font-weight: 400; color: var(--text-muted); }
.required { color: var(--red); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="file"],
textarea,
select {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    font-size: 16px;
    color: var(--text);
    background: var(--white);
    width: 100%;
    transition: border-color .15s;
    font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 2px rgba(27,43,107,.15); }
textarea { resize: vertical; min-height: 80px; }

input[type="date"] {
    display: block;
    width: 100%;
    min-height: 40px;
    -webkit-appearance: none;
    appearance: none;
    padding-left: 12px;
    text-align: left;
    text-align-last: left;
}

input[type="url"] {
    -webkit-appearance: none;
    appearance: none;
}

.radio-group { display: flex; gap: 20px; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    cursor: pointer;
}
.radio-label input[type="radio"] { width: auto; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background .15s, box-shadow .15s;
    font-family: inherit;
    text-decoration: none;
}
.btn--primary  { background: var(--navy); color: var(--white); }
.btn--primary:hover { background: var(--navy-dark); text-decoration: none; color: var(--white); }
.btn--green    { background: var(--green); color: var(--white); }
.btn--green:hover { background: var(--green-dark); text-decoration: none; color: var(--white); }
.btn--ghost    { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg); text-decoration: none; }
.btn--full     { width: 100%; }
.btn--sm       { padding: 6px 14px; font-size: 16px; }
.btn-icon      { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; opacity: .7; }
.btn-icon:hover { opacity: 1; }

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Teacher list (index) ───────────────────────────────────────────────── */
.teacher-list { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── Entry list ─────────────────────────────────────────────────────────── */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.list-actions { display: flex; gap: 8px; flex-shrink: 0; }

.entry-list { display: flex; flex-direction: column; gap: 10px; }

.entry-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    box-shadow: var(--shadow);
    transition: box-shadow .15s;
}
.entry-card:hover { box-shadow: var(--shadow-md); }

.entry-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
    background: var(--navy-light);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--navy);
    line-height: 1.2;
}
.entry-month { font-size: 11px; font-weight: 600; text-transform: uppercase; }
.entry-day   { font-size: 20px; font-weight: 700; }

.entry-body { flex: 1; min-width: 0; }
.entry-title { font-weight: 500; font-size: 15px; margin-bottom: 4px; }
.entry-link  { font-size: 12px; color: var(--green); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.entry-desc  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.entry-meta  { margin-top: 6px; }

@media (min-width: 800px) {
    .entry-card { padding: 16px 20px; }
    .entry-title { font-size: 16px; }
    .entry-link { font-size: 13px; }
    .entry-desc { font-size: 14px; }
    .entry-date { min-width: 50px; padding: 8px 10px; }
    .entry-day { font-size: 24px; }
}

.entry-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* ── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--text-muted);
    background: var(--white);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }

/* ── Info box ───────────────────────────────────────────────────────────── */
.info-box {
    background: var(--navy-light);
    border: 1px solid #c5cae9;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.7;
}
code {
    background: rgba(27,43,107,.1);
    padding: 1px 5px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* ── Mobile overflow fix ────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .page-two-col,
    .col-form,
    .col-list,
    .card,
    .form,
    input,
    textarea,
    .btn {
        max-width: 100%;
        box-sizing: border-box;
    }
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
