@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Ultralight.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PP Hatton';
    src: url('fonts/PPHatton-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: dark;

    --bg: #181A10;
    --bg-2: #21231A;
    --bg-card: rgba(28, 30, 18, 0.92);
    --bg-card-hover: rgba(36, 38, 24, 0.98);

    --gold-1: #8F6538;
    --gold-2: #9F7F44;
    --gold-3: #C3C26E;
    --gold-4: #E2EAA2;
    --gold-text: #D6C181;

    --cream: #F3EDDF;
    --cream-muted: rgba(243, 237, 223, 0.55);
    --olive: #656950;
    --olive-dark: #3F4230;

    --border-gold: rgba(195, 194, 110, 0.18);
    --border-gold-hover: rgba(195, 194, 110, 0.45);

    --color-work: #D4A843;
    --color-weekend: #7EB8D9;
    --color-off: #ef4444;
    --color-comp-off: #b084e8;
    --color-meta: #6BAEAD;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 5% 5%, rgba(143, 101, 56, 0.09) 0%, transparent 45%),
        radial-gradient(ellipse at 95% 95%, rgba(101, 105, 80, 0.11) 0%, transparent 45%);
    color: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.bg-ornament {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    will-change: transform;
    contain: layout style paint;
}

.ornament-1 {
    width: 520px; height: 520px;
    background: radial-gradient(circle, rgba(143, 101, 56, 0.13) 0%, transparent 70%);
    top: -120px; left: -160px;
    animation: driftSlow 28s infinite alternate ease-in-out;
}

.ornament-2 {
    width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(101, 105, 80, 0.11) 0%, transparent 70%);
    bottom: -100px; right: -120px;
    animation: driftSlow 32s infinite alternate-reverse ease-in-out;
}

.ornament-3 {
    width: 280px; height: 280px;
    background: radial-gradient(circle, rgba(195, 194, 110, 0.07) 0%, transparent 70%);
    top: 48%; left: 44%;
    animation: driftSlow 22s infinite alternate ease-in-out;
    animation-delay: -9s;
}

@keyframes driftSlow {
    from { transform: translate3d(0, 0, 0); }
    to   { transform: translate3d(45px, 35px, 0); }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 52px 42px;
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    margin-bottom: 48px;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.brand-logo-img {
    height: 140px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(195, 194, 110, 0.25));
    transition: filter 0.3s ease;
}

.brand-logo-img:hover {
    filter: drop-shadow(0 0 22px rgba(195, 194, 110, 0.5));
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.page-title {
    font-family: 'PP Hatton', serif;
    font-size: 1.6rem;
    font-weight: 300;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    background: linear-gradient(130deg, #8F6538 0%, #C3C26E 50%, #E2EAA2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

/* Selector pill (same style as status-indicator) */
.selector-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1c1f12;
    padding: 12px 20px;
    border-radius: 32px;
    border: 1px solid rgba(195, 194, 110, 0.35);
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
}

.selector-pill select {
    background: #1c1f12;
    border: none;
    outline: none;
    color: #F3EDDF;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 4px;
    color-scheme: dark;
}

.selector-pill select option {
    background: #1c1f12;
    color: #F3EDDF;
}

.selector-pill button {
    background: linear-gradient(130deg, var(--gold-1), var(--gold-3));
    border: none;
    color: #1a1c0f;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.selector-pill button:hover { opacity: 0.85; }

.selector-divider {
    width: 1px;
    height: 18px;
    background: var(--border-gold);
}

/* ===== DIVIDER ===== */
.divider {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 48px;
    opacity: 0.45;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-3), transparent);
}

.divider-ornament {
    font-size: 0.85rem;
    color: var(--gold-3);
    flex-shrink: 0;
}

/* ===== CARD ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 36px 42px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    contain: layout style;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-gold);
}

.section-header h2 {
    font-family: 'PP Hatton', serif;
    font-size: 1.4rem;
    font-weight: 400;
    color: var(--cream);
    letter-spacing: 0.03em;
}

.section-header .dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold-3);
    flex-shrink: 0;
    animation: pulseGold 2s infinite;
}

/* ===== LEGEND ===== */
.legend {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: var(--cream-muted);
    margin-left: auto;
}

.legend span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ===== ADMIN LINK ===== */
.admin-link {
    font-size: 0.72rem;
    color: var(--cream-muted);
    text-decoration: none;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--border-gold);
    padding: 5px 12px;
    border-radius: 20px;
    transition: border-color 0.2s, color 0.2s;
    white-space: nowrap;
}

.admin-link:hover {
    color: var(--gold-text);
    border-color: var(--border-gold-hover);
}

/* ===== WEEKLY SCHEDULE TABLE ===== */
.weekly-blocks {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.week-block {
    overflow-x: auto;
    border-radius: 12px;
}

.week-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--olive);
    margin-bottom: 8px;
    padding-left: 2px;
}

.escala-weekly {
    width: 100%;
    border-collapse: collapse;
    min-width: 880px;
    font-size: 0.8rem;
}

/* Header row 1: day names */
.escala-weekly .tr-daynames th {
    background: rgba(143, 101, 56, 0.12);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-text);
    padding: 10px 8px;
    border: 1px solid rgba(195, 194, 110, 0.08);
}

.escala-weekly .tr-daynames .th-sab {
    background: rgba(126, 184, 217, 0.08);
    color: #7EB8D9;
}

/* Header row 2: dates */
.escala-weekly .tr-dates th {
    background: rgba(0, 0, 0, 0.22);
    font-size: 0.72rem;
    color: var(--cream-muted);
    padding: 7px 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-weight: 400;
}

.escala-weekly .tr-dates .th-sab {
    background: rgba(126, 184, 217, 0.05);
    color: rgba(126, 184, 217, 0.6);
}

/* Collaborator name column */
.td-colab {
    text-align: left !important;
    min-width: 140px;
    background: rgba(0, 0, 0, 0.15) !important;
    padding: 10px 14px !important;
    font-weight: 500;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    white-space: nowrap;
}

.td-colab small {
    display: block;
    color: var(--olive);
    font-weight: 400;
    font-size: 0.68rem;
    margin-top: 2px;
}

/* Data cells */
.escala-weekly td {
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
}

/* Working — weekday */
.td-work {
    background: rgba(212, 168, 67, 0.10);
    color: #D4A843;
}

.td-work small {
    display: block;
    font-size: 0.67rem;
    color: rgba(212, 168, 67, 0.6);
    margin-top: 2px;
}

/* Working — weekend / holiday */
.td-weekend {
    background: rgba(126, 184, 217, 0.10);
    color: #7EB8D9;
}

.td-weekend small {
    display: block;
    font-size: 0.67rem;
    color: rgba(126, 184, 217, 0.55);
    margin-top: 2px;
}

/* Day off */
.td-off {
    background: rgba(239, 68, 68, 0.08);
    color: #e07070;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Compensatory Day off */
.td-comp-off {
    background: rgba(176, 132, 232, 0.08);
    color: #b084e8;
    font-weight: 700;
    letter-spacing: 0.04em;
}

/* Empty cell (no data) */
.td-empty {
    color: rgba(255, 255, 255, 0.14);
}

/* Days from adjacent months */
.td-other {
    opacity: 0.28;
}

/* ===== PULSE ANIMATIONS ===== */
.pulse-dot {
    width: 10px; height: 10px;
    background-color: var(--color-meta);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pulseBlue 2s infinite;
}

@keyframes pulseBlue {
    0%   { box-shadow: 0 0 0 0 rgba(107, 174, 173, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(107, 174, 173, 0); }
    100% { box-shadow: 0 0 0 0 rgba(107, 174, 173, 0); }
}

@keyframes pulseGold {
    0%   { box-shadow: 0 0 0 0 rgba(195, 194, 110, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(195, 194, 110, 0); }
    100% { box-shadow: 0 0 0 0 rgba(195, 194, 110, 0); }
}

/* ===== ADMIN PAGE ===== */
.admin-form {
    background: rgba(0, 0, 0, 0.25);
    padding: 32px;
    border-radius: 14px;
    border: 1px solid var(--border-gold);
    max-width: 420px;
    margin: 40px auto 0;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cream-muted);
    margin-bottom: 8px;
}

.form-select {
    width: 100%;
    background: #1c1f12;
    color: #F3EDDF;
    border: 1px solid rgba(195, 194, 110, 0.28);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    color-scheme: dark;
    transition: border-color 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: rgba(195, 194, 110, 0.55);
}

.form-select option {
    background: #1c1f12;
    color: #F3EDDF;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8F6538, #C3C26E);
    color: #1a1c0f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: opacity 0.2s, transform 0.2s;
    margin-top: 8px;
    -webkit-appearance: none;
    appearance: none;
}

.btn-primary:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .container { padding: 36px 28px; }
}

@media (max-width: 960px) {
    .container { padding: 28px 20px; }
    .brand-logo-img { height: 80px; }
    .page-title { font-size: 1.3rem; letter-spacing: 0.18em; }
}

@media (max-width: 768px) {
    .container { padding: 20px 16px; }
    header {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        margin-bottom: 28px;
    }
    .header-logo { grid-column: 1; grid-row: 1; }
    .header-right { grid-column: 2; grid-row: 1; justify-content: flex-end; }
    .header-center { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
    .brand-logo-img { height: 70px; }
    .page-title { font-size: 1.15rem; letter-spacing: 0.16em; }
    .card { padding: 24px 18px; }
    .bg-ornament { display: none; }
    .card { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(28, 30, 18, 0.98); }
}

@media (max-width: 480px) {
    .brand-logo-img { height: 52px; }
    .page-title { font-size: 0.95rem; letter-spacing: 0.12em; }
    .selector-pill { padding: 8px 12px; gap: 8px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeInUp 0.6s ease backwards; }

@media (prefers-reduced-motion: reduce) {
    .bg-ornament { animation: none; }
    .pulse-dot, .dot { animation: none; }
    .card { transition: none; animation: none; }
}

/* ===== CH SEMANAL COLUMN ===== */
.th-ch {
    min-width: 80px;
    text-align: center;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-text);
    background: rgba(143, 101, 56, 0.06);
    border-left: 1px solid var(--border-gold);
}

.td-ch {
    text-align: center;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--cream);
    background: rgba(143, 101, 56, 0.04);
    border-left: 1px solid var(--border-gold);
    letter-spacing: 0.02em;
}

.td-ch-over {
    color: #ef4444;
    font-weight: 700;
}

/* ===== ADMIN EDIT MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: rgba(28, 30, 18, 0.97);
    border: 1px solid var(--border-gold-hover);
    border-radius: 16px;
    padding: 32px;
    min-width: 360px;
    max-width: 440px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(195, 194, 110, 0.1);
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-title {
    font-family: 'PP Hatton', serif;
    font-size: 1.1rem;
    color: var(--gold-text);
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 0.75rem;
    color: var(--cream-muted);
    margin-bottom: 22px;
    letter-spacing: 0.06em;
}

.modal-form .form-group {
    margin-bottom: 16px;
}

.modal-form .form-group label {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--cream-muted);
    margin-bottom: 6px;
}

.modal-form input[type="text"],
.modal-form input[type="time"],
.modal-form select {
    width: 100%;
    background: #1c1f12;
    color: var(--cream);
    border: 1px solid rgba(195, 194, 110, 0.28);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    transition: border-color 0.2s;
    color-scheme: dark;
}

.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: rgba(195, 194, 110, 0.55);
}

.modal-form input:disabled,
.modal-form select:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 22px;
}

.modal-actions .btn-save {
    flex: 1;
    padding: 11px;
    background: linear-gradient(135deg, #8F6538, #C3C26E);
    color: #1a1c0f;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: opacity 0.2s;
}

.modal-actions .btn-save:hover { opacity: 0.88; }

.modal-actions .btn-cancel {
    padding: 11px 18px;
    background: transparent;
    color: var(--cream-muted);
    border: 1px solid rgba(195, 194, 110, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    transition: border-color 0.2s;
}

.modal-actions .btn-cancel:hover {
    border-color: rgba(195, 194, 110, 0.4);
}

.btn-delete {
    width: 100%;
    padding: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: background-color 0.2s;
    margin-top: 12px;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.22);
}

/* Admin editable cells */
.td-editable {
    cursor: pointer;
    transition: outline 0.15s, background-color 0.15s;
    position: relative;
}

.td-editable:hover {
    outline: 2px solid rgba(195, 194, 110, 0.35);
    outline-offset: -2px;
    background-color: rgba(195, 194, 110, 0.05) !important;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: rgba(28, 30, 18, 0.96);
    border: 1px solid var(--border-gold-hover);
    color: var(--cream);
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    z-index: 2000;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.toast.toast-success { border-color: rgba(110, 195, 120, 0.5); }
.toast.toast-error   { border-color: rgba(239, 68, 68, 0.5); color: #ef4444; }

@keyframes fadeOut {
    to { opacity: 0; transform: translateY(8px); }
}
