/* ===== Brand palette ===== */
:root {
    --bg-dark: #06151c;
    --bg-header: #0a1f2a;
    --bg-section: #081b24;
    --bg-card: #0d2a36;
    --bg-grid: #0a1f2a;
    --accent: #1db9a6;
    --text-primary: #ffffff;
    --text-secondary: #8ab4c4;
    --text-muted: #6b8a95;
    --clr-guiones: #1db9a6;
    --clr-grabacion: #e07b5a;
    --clr-edicion: #7b6be0;
    --clr-publicacion: #e0b85a;
    --clr-revision: #5ab8e0;
    --cell-empty: #0f2d3a;
}

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

html { font-size: 14px; }
@media (min-width: 768px) { html { font-size: 15px; } }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ===== App header ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
    padding: 12px 20px;
}
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-logo {
    height: 36px;
    width: auto;
}
.header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.header-user {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.btn-logout {
    background: var(--bg-card);
    color: var(--accent);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-logout:hover { background: #143a4a; }
.header-divider { height: 2px; background: var(--accent); }
.d-inline { display: inline; }

/* ===== Block type selector ===== */
.block-selector {
    background: var(--bg-section);
    padding: 10px 16px;
}
.selector-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: block;
    margin-bottom: 6px;
    padding-left: 4px;
}
.selector-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.block-type-btn {
    background: var(--pill-color);
    color: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.15s, border-color 0.15s;
}
.block-type-btn:hover { opacity: 0.9; }
.block-type-btn.active {
    opacity: 1;
    border-color: #fff;
}

/* ===== Filter bar ===== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-dark);
    flex-wrap: wrap;
    gap: 8px;
}
.filter-pills {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.filter-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-right: 4px;
}
.filter-pill {
    background: var(--pill-color);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.35;
    transition: opacity 0.15s;
}
.filter-pill:hover { opacity: 0.85; }
.filter-pill.active { opacity: 1; }

.week-nav { display: flex; gap: 4px; }
.nav-btn {
    background: var(--bg-card);
    color: var(--accent);
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.nav-btn:hover { background: #143a4a; }
.nav-today { font-size: 0.85rem; }

/* ===== Week label ===== */
.week-label {
    text-align: center;
    padding: 8px 0 4px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== Calendar grid ===== */
.calendar-wrap {
    margin: 0 12px 8px;
    background: var(--bg-grid);
    border-radius: 12px;
    padding: 8px;
    overflow-x: auto;
}
.calendar-grid {
    display: grid;
    grid-template-columns: 70px repeat(7, 1fr);
    gap: 0;
    min-width: 600px;
}
.grid-corner { /* empty top-left */ }
.day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    min-height: 44px;
    position: relative;
}
.day-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
}
.day-date {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.day-header.is-today .day-date {
    color: var(--accent);
}
.day-header.is-today::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    position: absolute;
    bottom: 2px;
}

.time-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 4px 0;
}

.calendar-cell {
    margin: 2px;
    min-height: 52px;
    border-radius: 6px;
    background: var(--cell-empty);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    transition: opacity 0.12s, background 0.15s;
    user-select: none;
}
.calendar-cell:hover { opacity: 0.85; }
.calendar-cell.hidden { opacity: 0.12; pointer-events: none; }

.calendar-cell[data-block="1"] { background: rgba(29, 185, 166, 0.45); }
.calendar-cell[data-block="2"] { background: rgba(224, 123, 90, 0.45); }
.calendar-cell[data-block="3"] { background: rgba(123, 107, 224, 0.45); }
.calendar-cell[data-block="4"] { background: rgba(224, 184, 90, 0.45); }
.calendar-cell[data-block="5"] { background: rgba(90, 184, 224, 0.45); }

/* ===== Stats bar ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-section);
    flex-wrap: wrap;
}
.stat-card {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px;
}
.stat-number {
    font-size: 1.35rem;
    font-weight: 700;
}
.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ===== Tip bar ===== */
.tip-bar {
    background: var(--bg-card);
    padding: 12px 16px;
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-style: italic;
    border-left: 3px solid var(--accent);
    margin: 0 12px 12px;
    border-radius: 0 8px 8px 0;
    background: rgba(29, 185, 166, 0.06);
}

/* ===== Login pages ===== */
.login-body {
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
.login-container {
    width: 100%;
    max-width: 380px;
    padding: 20px;
}
.login-card {
    background: var(--bg-header);
    border-radius: 16px;
    padding: 32px 28px;
    border: 1px solid rgba(29, 185, 166, 0.15);
}
.login-logo-wrap {
    text-align: center;
    margin-bottom: 20px;
}
.login-logo {
    height: 48px;
    width: auto;
}
.login-title {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 14px;
}
.form-group label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.form-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-dark);
    border: 1px solid rgba(138, 180, 196, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.15s;
}
.form-input:focus {
    border-color: var(--accent);
}
.form-hint {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}
.btn-primary-full {
    width: 100%;
    padding: 10px;
    background: var(--accent);
    color: var(--bg-dark);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.15s;
}
.btn-primary-full:hover { opacity: 0.85; }
.login-toggle {
    text-align: center;
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.login-toggle a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.login-toggle a:hover { text-decoration: underline; }
.login-error {
    color: #e07b5a;
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 680px) {
    .calendar-wrap { margin: 0 4px 8px; padding: 4px; }
    .stats-bar { gap: 4px; padding: 8px 8px; }
    .stat-card { padding: 8px 12px; min-width: 70px; }
}
