@font-face {
    font-family: "MontBold";
    src: url("../fonts/Mont-Bold.ttf") format("truetype");
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "MontRegular";
    src: url("../fonts/Mont-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "MontThinItalic";
    src: url("../fonts/Mont-ThinItalic.ttf") format("truetype");
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

:root {
    --deep: #071d2f;
    --navy: #104b73;
    --cyan: #05a9d7;
    --cyan-soft: #e7f8fd;
    --white: #ffffff;
    --paper: #f6f8fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #64748b;
    --line: #d9e2ea;
    --danger-bg: #fee2e2;
    --danger: #991b1b;
    --success-bg: #dcfce7;
    --success: #166534;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "MontRegular", Arial, Helvetica, sans-serif;
    color: var(--text);
}

.hub-body,
.admin-body {
    background:
        radial-gradient(circle at top left, rgba(5, 169, 215, .2), transparent 34vw),
        linear-gradient(135deg, var(--deep), #0d3554 60%, var(--deep));
}

.hub-wrap,
.admin-wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(24px, 5vw, 56px) 0;
}

.hub-hero,
.admin-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    color: var(--white);
}

.eyebrow {
    margin: 0 0 8px;
    color: #7dd3fc;
    font-family: "MontBold", Arial, sans-serif;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 12px;
}

.hub-hero h1,
.admin-topbar h1,
.login-panel h1 {
    margin: 0;
    font-family: "MontBold", Arial, sans-serif;
    letter-spacing: -.035em;
    line-height: .98;
}

.hub-hero h1 { font-size: clamp(38px, 6vw, 72px); }
.admin-topbar h1 { font-size: clamp(34px, 5vw, 60px); }
.login-panel h1 { font-size: clamp(28px, 4vw, 42px); }

.hub-hero p,
.admin-topbar p {
    max-width: 760px;
    margin: 12px 0 0;
    color: rgba(255,255,255,.78);
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.45;
}

.admin-pill,
.admin-topbar nav a {
    color: var(--white);
    text-decoration: none;
    border: 1px solid rgba(255,255,255,.22);
    background: rgba(255,255,255,.09);
    padding: 11px 16px;
    border-radius: 999px;
    font-family: "MontBold", Arial, sans-serif;
}

.admin-topbar nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dashboard-card,
.admin-panel,
.empty-state {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(255,255,255,.2);
    box-shadow: 0 24px 70px rgba(0,0,0,.25);
    border-radius: 26px;
}

.dashboard-card {
    min-height: 320px;
    padding: 22px;
    display: grid;
    grid-template-rows: 72px 1fr auto;
    gap: 18px;
}

.card-logo {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 72px;
}

.card-logo img {
    max-width: 230px;
    max-height: 72px;
    object-fit: contain;
}

.card-logo.no-logo::after {
    content: "TV BOARD";
    color: var(--navy);
    font-family: "MontBold", Arial, sans-serif;
    opacity: .3;
    letter-spacing: .08em;
}

.badge {
    display: inline-flex;
    align-items: center;
    width: max-content;
    color: var(--cyan);
    background: var(--cyan-soft);
    padding: 6px 10px;
    border-radius: 999px;
    font-family: "MontBold", Arial, sans-serif;
    font-size: 12px;
    letter-spacing: .08em;
}

.card-body h2 {
    margin: 12px 0 8px;
    font-family: "MontBold", Arial, sans-serif;
    font-size: clamp(26px, 3.2vw, 38px);
    line-height: 1.02;
    letter-spacing: -.035em;
}

.card-body p {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--navy);
}

.card-body small,
.muted {
    color: var(--muted);
    line-height: 1.4;
}

.card-actions,
.actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
}

.btn,
button {
    appearance: none;
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: var(--cyan);
    color: var(--white);
    font-family: "MontBold", Arial, sans-serif;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:hover,
button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(5, 169, 215, .28);
}

.btn.ghost,
.ghost-dark {
    background: #eef5f9;
    color: var(--navy);
}

.btn.primary { background: var(--cyan); }

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.admin-panel {
    padding: 24px;
    margin-bottom: 22px;
}

.login-panel {
    width: min(460px, 100%);
}

label {
    display: grid;
    gap: 7px;
    font-family: "MontBold", Arial, sans-serif;
    font-size: 13px;
    color: #334155;
}

input[type='text'],
input[type='password'],
input[type='number'],
input[type='file'],
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 13px;
    padding: 12px 13px;
    font: inherit;
    font-family: "MontRegular", Arial, sans-serif;
    color: var(--text);
    background: #fff;
}

input:focus,
select:focus {
    outline: 2px solid rgba(5, 169, 215, .25);
    border-color: var(--cyan);
}

.alert {
    border-radius: 14px;
    padding: 13px 14px;
    margin-bottom: 16px;
    font-family: "MontBold", Arial, sans-serif;
}

.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); }

.admin-dashboard-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.switch-card {
    text-decoration: none;
    color: var(--text);
    padding: 18px;
    border-radius: 20px;
    background: rgba(255,255,255,.9);
    border: 2px solid transparent;
    display: grid;
    gap: 5px;
}

.switch-card strong {
    font-family: "MontBold", Arial, sans-serif;
    font-size: 20px;
}

.switch-card span { color: var(--muted); }
.switch-card.is-active { border-color: var(--cyan); box-shadow: 0 14px 32px rgba(5,169,215,.18); }

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.section-heading h2,
.empty-state h2 {
    margin: 0;
    font-family: "MontBold", Arial, sans-serif;
    font-size: clamp(26px, 3vw, 34px);
    letter-spacing: -.03em;
}

.section-heading p { margin: 6px 0 0; color: var(--muted); }

.form-grid-admin {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.field-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px;
}

.field-card span { font-size: 15px; }
.field-card small { color: var(--muted); font-family: "MontRegular", Arial, sans-serif; min-height: 36px; }

.full { grid-column: 1 / -1; }

.contacts-admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.contact-edit-card {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
}

.contact-edit-title {
    margin-bottom: 12px;
    font-family: "MontBold", Arial, sans-serif;
}

.contact-edit-layout {
    display: grid;
    grid-template-columns: 126px 1fr;
    gap: 14px;
    align-items: start;
}

.photo-preview {
    width: 126px;
    height: 126px;
    border-radius: 16px;
    overflow: hidden;
    background: #e5e7eb;
    display: grid;
    place-items: center;
    color: #6b7280;
    font-size: 12px;
    text-align: center;
}

.photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.contact-fields {
    display: grid;
    gap: 12px;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "MontRegular", Arial, sans-serif;
    color: var(--muted);
}

.checkbox input { width: auto; }

.empty-state {
    padding: 28px;
    text-align: center;
}

.empty-state h1 {
    font-family: "MontBold", Arial, sans-serif;
    color: var(--text);
}

@media (max-width: 900px) {
    .dashboard-grid,
    .admin-dashboard-switcher,
    .form-grid-admin,
    .contacts-admin-grid,
    .two-cols,
    .contact-edit-layout {
        grid-template-columns: 1fr;
    }

    .hub-hero,
    .admin-topbar,
    .section-heading {
        flex-direction: column;
    }

    .photo-preview {
        width: 100%;
        height: 180px;
    }
}

.official-photo-picker {
    display: grid;
    gap: 8px;
}

.official-photo-picker > span {
    font-family: "MontBold", Arial, sans-serif;
    font-size: 13px;
    color: var(--text);
}

.official-photo-picker code,
.section-heading code {
    padding: 1px 5px;
    border-radius: 6px;
    background: #e5e7eb;
    color: #0f172a;
    font-size: 0.92em;
}

.official-photo-picker label {
    display: grid;
    gap: 7px;
}

.official-photo-picker select {
    min-height: 44px;
    cursor: pointer;
}

.photo-preview .is-hidden,
.is-hidden {
    display: none !important;
}

.photo-library-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    max-height: 236px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.photo-option {
    position: relative;
    display: grid;
    gap: 5px;
    place-items: center;
    min-height: 92px;
    padding: 8px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.photo-option:hover {
    transform: translateY(-1px);
    background: #eef2f7;
}

.photo-option:has(input:checked) {
    border-color: #0f4f7a;
    background: #e7f3fb;
}

.photo-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photo-option img {
    width: 58px;
    height: 58px;
    border-radius: 10px;
    object-fit: cover;
    background: #e5e7eb;
}

.photo-option span {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    font-size: 10px;
    font-family: "MontRegular", Arial, sans-serif;
}

.no-photo-option span {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #64748b;
    white-space: normal;
    font-size: 11px;
}

.warning-note {
    color: #b45309 !important;
}

@media (max-width: 900px) {
    .photo-library-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
