@font-face { font-family: 'FiraGO'; font-style: normal; font-weight: 300; font-display: swap; src: url('/fonts/FiraGO-Light.woff2') format('woff2'); }
@font-face { font-family: 'FiraGO'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/FiraGO-Regular.woff2') format('woff2'); }
@font-face { font-family: 'FiraGO'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/FiraGO-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'FiraGO'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/FiraGO-Heavy.woff2') format('woff2'); }

:root {
  --navy: #1b2f5b;
  --navy-deep: #101e3c;
  --gold: #d9a441;
  --gold-deep: #b9862b;
  --ivory: #faf7f1;
  --ink: #2e3a4e;
  --muted: #75809a;
  --border: #e9e2d2;
  --red: #c4432e;
  --ok: #2e7d52;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'FiraGO', 'Fira Sans', 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 300;
  background: var(--ivory);
  color: var(--ink);
}

.topbar { background: var(--navy-deep); border-bottom: 4px solid var(--gold); }
.topbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap;
}
.brand {
  font-family: inherit; font-weight: 800; letter-spacing: 3px; font-size: 19px;
  color: #fff; text-decoration: none; white-space: nowrap;
}
.brand span { color: var(--gold); font-size: 12px; letter-spacing: 1px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.topbar nav a {
  color: #c7d0e4; text-decoration: none; font-size: 13.5px; padding: 8px 10px; border-radius: 6px;
}
.topbar nav a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.topbar-user { display: flex; align-items: center; gap: 10px; color: #c7d0e4; font-size: 13px; }

.container { max-width: 1180px; margin: 26px auto 60px auto; padding: 0 20px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; color: var(--navy); font-size: 28px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-actions form { margin: 0; }

h1, h2, h3 { color: var(--navy); font-family: inherit; font-weight: 800; }
b, strong { font-weight: 600; }
.card h2 { font-size: 19px; margin-top: 0; }
.card h3 { font-size: 15px; margin-bottom: 6px; }

.card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; margin-bottom: 20px;
}
.card-narrow { max-width: 760px; }
.card-head-row { display: flex; justify-content: space-between; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); font-size: 13.5px; }
.plain-list { list-style: none; margin: 6px 0; padding: 0; }
.plain-list li { padding: 3px 0; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; padding: 8px 10px; border-bottom: 2px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid #f0ece1; vertical-align: middle; }
.row-current td { background: #fdf8ec; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.row-actions form { margin: 0; }

.tag { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.tag-primary { background: #e4ecfa; color: #2c56a4; }
.tag-secondary { background: #f6ecd9; color: #8a6210; }
.tag-principal { background: #ece4fa; color: #5b3ea4; }
.tag-admin { background: #e3e6ec; color: #394356; }
.tag-whole_school { background: #e2f0e8; color: #24684a; }

label { display: block; margin: 0 0 14px 0; font-weight: 600; font-size: 14px; color: var(--navy); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid #d6d0c2; border-radius: 8px; font-size: 14.5px; font-family: inherit;
  background: #fffdf9; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-size: 14px; font-weight: 600; padding: 10px 18px; border-radius: 8px; font-family: inherit;
}
.btn-primary { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold-deep); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-secondary { background: #fff; color: var(--navy); border: 1px solid var(--navy); }
.btn-secondary:hover { background: #f2f4f9; }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f6f2e9; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: #fbeeec; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.btn-row form { margin: 0; }

.alert { border-radius: 10px; padding: 12px 16px; margin: 0 0 16px 0; font-size: 14px; }
.alert-error { background: #fbeeec; color: #93301f; border: 1px solid #eccac3; }
.alert-warn { background: #fdf6e4; color: #7a5a10; border: 1px solid #ecdcae; }
.alert-ok { background: #e9f5ee; color: #1d5c3e; border: 1px solid #c2e0cf; }

.inline-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.inline-form input { margin: 0; width: 170px; padding: 6px 10px; font-size: 13px; }

.preview-frame {
  width: 100%; height: 640px; border: 1px solid var(--border); border-radius: 12px; background: #fff;
}
.preview-frame-tall { height: 1100px; }
/* News form + live article preview side by side; preview follows the scroll. */
.grid-form-preview { grid-template-columns: 1.15fr 1fr; align-items: start; }
.grid-form-preview .card:last-child { position: sticky; top: 16px; }
@media (max-width: 900px) { .grid-form-preview { grid-template-columns: 1fr; } .grid-form-preview .card:last-child { position: static; } }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 10px; }
.photo-tile img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.photo-tile form { margin-top: 6px; }

.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 380px; max-width: 92vw; padding: 34px 32px; border-top: 5px solid var(--gold); }
.login-brand { font-weight: 800; letter-spacing: 5px; text-align: center; margin: 0; color: var(--navy); }
.login-sub { text-align: center; color: var(--muted); margin: 6px 0 22px 0; }

.row-excluded td { opacity: 0.55; }
.tag-slot { background: #f6ecd9; color: #8a6210; font-weight: 800; }
.slot-select { max-width: 210px; padding: 5px 8px; font-size: 12.5px; margin: 0; display: inline-block; width: auto; }
