:root {
    --corpo-primary: #1f7a6b;
    --corpo-accent: #ff7c5a;
    --corpo-dark: #0f3d35;
    --corpo-light: #f5f7f6;
    --sidebar-width: 252px;
}

body {
    background-color: var(--corpo-light);
    color: #333;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.navbar-brand {
    color: var(--corpo-dark);
}

.navbar-brand img { height: 46px; width: auto; }
.navbar-brand .brand-corto { display: none; }

.brand-largo { border-radius: 12px; }

@media (max-width: 575.98px) {
    .navbar-brand .brand-largo { display: none; }
    .navbar-brand .brand-corto { display: inline-block; height: 42px; }
}

.btn-primary {
    background-color: var(--corpo-primary);
    border-color: var(--corpo-primary);
}

.btn-primary:hover {
    background-color: var(--corpo-dark);
    border-color: var(--corpo-dark);
}

.hero h1 {
    color: var(--corpo-dark);
    letter-spacing: .15em;
}

.hero p {
    color: #4f4f4f;
    letter-spacing: .08em;
    text-transform: uppercase;
}

/* ---------- Layout con barra lateral ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--corpo-dark) 0%, var(--corpo-primary) 100%);
    color: #eaf3f1;
    transition: transform .25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: 1.15rem 1.25rem;
    color: #fff;
    font-weight: 700;
    letter-spacing: .12em;
    text-decoration: none;
    font-size: 1.05rem;
}

.sidebar-brand:hover { color: #fff; }

.sidebar-brand img { height: 40px; width: auto; max-width: 100%; }
.sidebar-brand .brand-corto { display: none; }

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: .5rem .75rem 1rem;
}

.sidebar-heading {
    display: block;
    margin: 1rem .5rem .4rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255, 255, 255, .55);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    margin-bottom: .15rem;
    border-radius: .55rem;
    color: rgba(255, 255, 255, .88);
    text-decoration: none;
    font-size: .94rem;
    transition: background-color .15s ease, color .15s ease;
}

.sidebar-link i { font-size: 1.05rem; width: 1.25rem; text-align: center; }

.sidebar-link:hover {
    background-color: rgba(255, 255, 255, .1);
    color: #fff;
}

.sidebar-link.active {
    background-color: var(--corpo-accent);
    color: #fff;
    font-weight: 600;
}

.sidebar-footer {
    padding: .75rem;
    border-top: 1px solid rgba(255, 255, 255, .15);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .35rem .5rem .6rem;
    font-size: .85rem;
}

a.sidebar-user {
    color: inherit;
    text-decoration: none;
    border-radius: .5rem;
    transition: background .15s ease;
}

a.sidebar-user:hover,
a.sidebar-user.active {
    background: rgba(255, 255, 255, .08);
    color: inherit;
}

.sidebar-user i { font-size: 1.6rem; }
.sidebar-user small { color: rgba(255, 255, 255, .6); font-size: .68rem; letter-spacing: .08em; }

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(0, 0, 0, .45);
    display: none;
}

.sidebar-backdrop.show { display: block; }

.has-sidebar .app-main { margin-left: var(--sidebar-width); }

.app-main { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 60px;
    padding: .6rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e5e9e8;
}

.topbar-title { font-weight: 600; color: var(--corpo-dark); }

.topbar-brand img { height: 38px; width: auto; }

.topbar-action {
    color: var(--corpo-dark);
    font-size: 1.2rem;
    text-decoration: none;
}

.topbar-action .badge {
    position: absolute;
    top: -.5rem;
    right: -.6rem;
    font-size: .62rem;
}

/* Popup de notificaciones de la campanita */
.notif-menu {
    min-width: 320px;
    max-width: 380px;
    max-height: 70vh;
    overflow-y: auto;
    padding: .35rem 0;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.notif-menu .dropdown-header {
    font-weight: 700;
    color: var(--corpo-dark);
    letter-spacing: .02em;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    white-space: normal;
    padding: .55rem .9rem;
    border-left: 3px solid transparent;
}

.notif-item:hover,
.notif-item:focus {
    background: #f3f7f6;
    border-left-color: var(--corpo-dark);
}

.notif-item i {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-top: .05rem;
}

.notif-item strong { font-size: .875rem; }

.app-content { padding: 1.5rem; flex: 1 1 auto; }

/* Tarjetas de indicadores */
.stat-card {
    border: 0;
    border-radius: .8rem;
    box-shadow: 0 1px 3px rgba(15, 61, 53, .08);
}

.stat-card .stat-icon {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: .7rem;
    font-size: 1.3rem;
    background-color: rgba(31, 122, 107, .12);
    color: var(--corpo-primary);
}

.stat-card.accent .stat-icon {
    background-color: rgba(255, 124, 90, .16);
    color: var(--corpo-accent);
}

.stat-card .stat-value { font-size: 1.7rem; font-weight: 700; color: var(--corpo-dark); line-height: 1; }

/* Barra lateral replegada (solo íconos) */
body.sidebar-collapsed { --sidebar-width: 84px; }

body.sidebar-collapsed .sidebar-brand { justify-content: center; padding-left: .5rem; padding-right: .5rem; }
body.sidebar-collapsed .sidebar-brand .brand-largo { display: none; }
body.sidebar-collapsed .sidebar-brand .brand-corto { display: block; height: 36px; }

body.sidebar-collapsed .sidebar-heading { display: none; }
body.sidebar-collapsed .sidebar-link { justify-content: center; padding-left: 0; padding-right: 0; }
body.sidebar-collapsed .sidebar-link span { display: none; }
body.sidebar-collapsed .sidebar-user { justify-content: center; }
body.sidebar-collapsed .sidebar-user .text-truncate { display: none; }
body.sidebar-collapsed .sidebar-nav { padding-left: .5rem; padding-right: .5rem; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .has-sidebar .app-main { margin-left: 0; }

    .sidebar-brand .brand-largo { display: none; }
    .sidebar-brand .brand-corto { display: block; height: 36px; }
}

/* Separador más grueso entre días dentro de cada semana de la rutina */
tbody tr.separador-dia > td {
    border-top: 3px solid #1f7a6b;
}
/* ---------------- Calendario semanal (admin y socio) ---------------- */
.cal-envoltorio { overflow-x: auto; }

.cal-grid { display: flex; align-items: flex-start; }

.cal-horas {
    position: relative;
    width: 46px;
    flex: none;
    height: calc(var(--slot) * var(--total));
    border-right: 1px solid #e2e7e5;
}

.cal-hora {
    position: absolute;
    right: 4px;
    transform: translateY(-50%);
    font-size: .66rem;
    line-height: 1;
    color: #7a8b87;
    white-space: nowrap;
}

.cal-hora.media { color: #b9c7c3; }

.cal-dias { display: flex; flex: 1; min-width: 0; }

.cal-dia {
    flex: 1;
    min-width: 112px;
    border-right: 1px solid #eef2f1;
}

.cal-dia:last-child { border-right: none; }

.cal-dia-head {
    text-align: center;
    font-weight: 700;
    font-size: .72rem;
    padding: .3rem .15rem;
    background: #eaf2f0;
    color: #14403a;
    border-bottom: 1px solid #e2e7e5;
    position: sticky;
    top: 0;
    z-index: 2;
}

.cal-columna {
    position: relative;
    background:
        repeating-linear-gradient(to bottom,
            #e6ecea 0, #e6ecea 1px, transparent 1px, transparent var(--slot)),
        repeating-linear-gradient(to bottom,
            #cfdad7 0, #cfdad7 1px, transparent 1px, transparent calc(var(--slot) * 2)),
        #fff;
}

.cal-columna.over {
    background-color: #eaf4f1;
    outline: 2px dashed #1f7a6b;
    outline-offset: -2px;
}

.cal-chip {
    position: absolute;
    left: 3px;
    right: 3px;
    border: none;
    border-left: 3px solid #1f7a6b;
    border-radius: .35rem;
    background: #e7f3f0;
    color: #14403a;
    padding: .15rem .3rem .55rem .35rem;
    overflow: hidden;
    font-size: .68rem;
    line-height: 1.2;
    text-align: left;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08);
}

a.cal-chip:hover { background: #d7ebe6; }

.cal-chip-nombre {
    display: block;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: .9rem;
}

.cal-chip-hora {
    display: block;
    color: #4a6b65;
    font-size: .6rem;
}

.cal-chip-inscripta {
    background: #fdeee9;
    border-left-color: #ff7c5a;
}

.cal-chip-editar {
    position: absolute;
    top: 2px;
    right: 3px;
    color: #4a6b65;
    font-size: .66rem;
    text-decoration: none;
    line-height: 1;
}

.cal-chip-editar:hover { color: #14403a; }

.cal-chip.dragging { opacity: .45; }

.cal-chip.resizing { box-shadow: 0 2px 8px rgba(0, 0, 0, .22); z-index: 5; }

.cal-chip-resize {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 8px;
    cursor: ns-resize;
    border-radius: 0 0 .35rem .35rem;
    background: linear-gradient(to bottom,
        transparent 0, transparent 3px,
        rgba(31, 122, 107, .4) 3px, rgba(31, 122, 107, .4) 5px,
        transparent 5px);
    touch-action: none;
}

.cal-chip-resize:hover { background: linear-gradient(to bottom,
    transparent 0, transparent 2px,
    rgba(31, 122, 107, .75) 2px, rgba(31, 122, 107, .75) 6px,
    transparent 6px); }

.cal-leyenda {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: #e7f3f0;
    border-left: 3px solid #1f7a6b;
    vertical-align: -1px;
}

.cal-leyenda-inscripta {
    background: #fdeee9;
    border-left-color: #ff7c5a;
}

/* Detalle de clase (socios): bottom sheet en mobile */
.modal-cal-detalle .modal-dialog { margin: 0; }

@media (max-width: 575.98px) {
    .modal-cal-detalle .modal-dialog {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
    }

    .modal-cal-detalle .modal-content {
        border-radius: .9rem .9rem 0 0;
    }
}

.tablero-aviso {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: #14403a;
    color: #fff;
    border-radius: 2rem;
    padding: .45rem 1.1rem;
    font-size: .85rem;
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
    z-index: 1080;
    pointer-events: none;
}

.tablero-aviso.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.tablero-aviso:not(.ok) { background: #b02a37; }
