/* ============================================================
   BARCELONA.CSS — Sistema de estilos compartido
   +Sol Energía · Panel de gestión interno
   ============================================================ */

/* ── Variables globales ──────────────────────────────────── */
:root {
    --blue:          #8bb6fd;
    --blue-main:     #3b82f6;
    --blue-dark:     #285192;
    --blue-darker:   #162a4b;
    --blue-light:    #e9f2ff;
    --blue-mid:      #afceff;
    --blue-bg:       #d2e3ffd3;

    --text:          #1a1a1a;
    --text-muted:    #6b7280;
    --text-dark:     #2c3e50;
    --text-body:     #333;

    --border:        #e5e7eb;
    --border-light:  #e2e8f0;
    --border-mid:    #eee;

    --bg:            #f9fafb;
    --bg-alt:        #fcfcfc;
    --white:         #ffffff;

    --radius:        10px;
    --radius-sm:     6px;
    --radius-xs:     4px;

    --shadow:        0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:     0 4px 12px rgba(0,0,0,0.08);
    --shadow-card:   0 2px 5px rgba(0,0,0,0.05);

    /* Alias de compatibilidad — mantienen el nombre "orange" para no romper
       el HTML existente, pero apuntan a los valores azules correctos */
    --orange:        var(--blue);
    --orange-main:   var(--blue-main);
    --orange-dark:   var(--blue-dark);
    --orange-darker: var(--blue-darker);
    --orange-light:  var(--blue-light);
    --orange-mid:    var(--blue-mid);
    --orange-bg:     var(--blue-bg);
}

/* ── Reset base ──────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-alt);
    color: var(--text-body);
    font-family: sans-serif;
    font-size: 14px;
    min-height: 100vh;
}

/* ============================================================
   BANNER CORPORATIVO
   ============================================================ */
.banner-corp {
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 60%, #2563eb 100%);
    color: #fff;
    padding: 6px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px var(--blue-mid);
    position: sticky;
    top: 0;
    z-index: 100;
}

.banner-corp-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: #fff;
    text-decoration: none;
    height: 60px;
    overflow: hidden;
}
.banner-corp-logo span {
    background: rgba(255,255,255,0.18);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.banner-corp-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.banner-corp-nav a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 5px;
    transition: background 0.15s, color 0.15s;
}
.banner-corp-nav a:hover {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.banner-corp-nav a.active {
    background: rgba(255,255,255,0.22);
    color: #fff;
    font-weight: 700;
}
.banner-corp-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255,255,255,0.9);
}
.banner-corp-user strong { color: #fff; }
.banner-corp-logout {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 4px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.banner-corp-logout:hover { background: rgba(0,0,0,0.28); }

/* ============================================================
   NAVBAR (legacy)
   ============================================================ */
.navbar {
    background-color: var(--blue-main);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.navbar h1 { margin: 0; font-size: 20px; }
.navbar a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    background: var(--blue-dark);
    padding: 8px 15px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    transition: background 0.2s ease;
}
.navbar a:hover { background: var(--blue-darker); }

/* ============================================================
   LAYOUT GENERAL
   ============================================================ */
.container {
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}
@media (max-width: 768px) {
    .grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TARJETAS Y SECCIONES
   ============================================================ */
.section-card {
    background: var(--white);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}
.section-card h3 {
    margin-top: 0;
    border-bottom: 2px solid var(--border-mid);
    padding-bottom: 10px;
    color: #444;
}

.welcome-card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-card);
    margin-bottom: 25px;
    border-left: 4px solid var(--blue-main);
}
.welcome-card h2 { margin-top: 0; color: var(--blue-main); }

/* ============================================================
   TABLAS
   ============================================================ */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}
th, td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border-mid);
}
th {
    background-color: #f8f9fa;
    color: #666;
}

/* ============================================================
   BADGES DE ESTADO
   ============================================================ */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
.badge-pendiente  { background-color: #fff3cd; color: #856404; }
.badge-confirmada { background-color: #d4edda; color: #155724; }
.badge-cancelada  { background-color: #f8d7da; color: #721c24; }

/* ============================================================
   ALERTAS
   ============================================================ */
.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 12px;
    border-radius: var(--radius-xs);
    margin-bottom: 20px;
}
.alert-error {
    background-color: #fdf3f2;
    border: 1px solid #f9aca4;
    color: #e74c3c;
    padding: 10px;
    border-radius: var(--radius-xs);
    font-size: 14px;
    margin-bottom: 15px;
    text-align: center;
}

/* ============================================================
   BOTONES GLOBALES
   ============================================================ */
.btn-download {
    display: inline-block;
    background: var(--blue-bg);
    color: var(--blue-dark);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.2s ease;
}
.btn-download:hover { background: var(--blue-main); color: white; }

.link-incidencia {
    color: var(--blue-main);
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    padding: 4px 0;
}
.link-incidencia:hover { text-decoration: underline; color: var(--blue-dark); }

.empty-text {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px 0;
    margin: auto;
}

/* ============================================================
   PÁGINA: SELECCIÓN DE PERFIL
   ============================================================ */
.body-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: var(--bg-alt);
}

.select-card {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: center;
    max-width: 420px;
    width: 100%;
    border-top: 5px solid var(--blue-main);
    box-sizing: border-box;
}
.select-card h2 { margin-top: 0; color: var(--text-dark); font-size: 22px; }
.select-card p  { color: #666; margin-bottom: 30px; font-size: 15px; line-height: 1.5; }

.btn-perfil {
    display: block;
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid var(--blue-main);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--blue-main);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-sizing: border-box;
}
.btn-perfil:hover { background: var(--blue-main); color: white; }

.btn-logout {
    display: inline-block;
    color: #999;
    text-decoration: none;
    margin-top: 20px;
    font-size: 14px;
    transition: color 0.2s;
}
.btn-logout:hover { color: var(--blue-dark); text-decoration: underline; }

/* ============================================================
   PÁGINA: ACCESO DENEGADO
   ============================================================ */
.bg-error-light { background-color: #fdf3f2 !important; }

.error-container {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    text-align: center;
    max-width: 400px;
    width: 100%;
    border-top: 5px solid #e74c3c;
    box-sizing: border-box;
}
.error-container h1 { color: #e74c3c; margin-top: 0; font-size: 24px; }
.error-container p  { color: #555; line-height: 1.5; font-size: 15px; }

.btn-error-back {
    display: inline-block;
    background: var(--blue-main);
    color: white !important;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    margin-top: 15px;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.2s ease;
}
.btn-error-back:hover { background: var(--blue-dark); }

/* ============================================================
   PÁGINA: LOGIN
   ============================================================ */
.login-card {
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    width: 100%;
    max-width: 350px;
    border-top: 5px solid var(--blue-main);
    box-sizing: border-box;
}
.login-card h2 {
    margin-top: 0;
    color: var(--blue-main);
    text-align: center;
    font-size: 24px;
}
.form-group { margin-bottom: 15px; }
.login-card label { display: block; margin-bottom: 5px; color: #666; font-size: 14px; }
.login-card input[type="text"],
.login-card input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xs);
    box-sizing: border-box;
    font-size: 14px;
}
.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
    outline: none;
    border-color: var(--blue-main);
}
.pwd-container { position: relative; display: flex; gap: 5px; }
button#btn-mostrar {
    background: #f4f4f4;
    border: 1px solid var(--border-light);
    padding: 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 12px;
    color: #555;
    font-weight: 500;
    transition: background 0.2s;
}
button#btn-mostrar:hover { background: var(--border-light); }

.btn-login-submit {
    width: 100%;
    background: var(--blue-main);
    color: white;
    border: none;
    padding: 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
    transition: background-color 0.2s ease;
}
.btn-login-submit:hover { background: var(--blue-dark); }

/* ============================================================
   PANEL AGENDA (panel_agenda.php)
   ============================================================ */

/* ── Top bar ── */
.ag-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f4f6f8;
}
.ag-topbar h2 { font-size: 18px; font-weight: bold; color: var(--text-dark); }

.date-nav {
    display: flex;
    align-items: center;
    background: #f4f6f8;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.date-nav button {
    background: var(--white);
    border: 1px solid var(--border-light);
    color: #555;
    padding: 6px 10px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 14px;
    transition: all .2s;
}
.date-nav button:hover { background: var(--blue-main); color: #fff; border-color: var(--blue-main); }
.date-nav .dlabel {
    padding: 0 15px;
    font-weight: bold;
    font-size: 14px;
    color: #333;
    min-width: 140px;
    text-align: center;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--blue-main);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    box-shadow: 0 2px 6px var(--blue-light);
}
.btn-primary:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--blue-mid);
}

/* ── Tabla de agenda ── */
.ag-wrap { overflow-x: auto; margin-top: 8px; }

.ag-table { border-collapse: collapse; min-width: 100%; table-layout: auto; }

.ag-table .th-hora,
.ag-table .td-hora {
    width: 68px; min-width: 68px;
    background: #f8f9fa;
    border-right: 2px solid var(--border-light);
    border-bottom: 1px solid var(--border-mid);
    text-align: center; vertical-align: middle;
    position: sticky; left: 0; z-index: 3;
    padding: 0;
}
.ag-table .th-hora { border-bottom: 2px solid #dee2e6; height: 60px; }
.hora-chip { font-size: 12px; font-weight: 700; color: #555; letter-spacing: .5px; }

.ag-table .th-prov-group {
    background: linear-gradient(135deg, #f0f6ff 0%, #e9f2ff 100%);
    border-left: 3px solid var(--blue-main);
    border-right: 2px solid var(--border-light);
    border-bottom: 1px solid #bdd6ff;
    padding: 10px 14px;
    vertical-align: middle;
    text-align: left;
}
.prov-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.prov-name {
    font-size: 14px; font-weight: 700; color: var(--blue-dark);
    display: flex; align-items: center; gap: 7px;
}
.prov-badge {
    font-size: 11px; padding: 3px 9px; border-radius: 12px;
    background: var(--blue-main); color: #fff; font-weight: 700;
}

.ag-table .th-com {
    min-width: 220px;
    background: var(--white);
    border-right: 1px solid var(--border-mid);
    border-bottom: 2px solid #dee2e6;
    padding: 8px 12px;
    vertical-align: middle;
}
.ag-table .th-com:last-child { border-right: 2px solid var(--border-light); }
.com-head { display: flex; align-items: center; gap: 8px; }
.avatar {
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--blue-main); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.com-name  { font-size: 12px; font-weight: 600; color: var(--text-dark); line-height: 1.3; }
.com-role  { font-size: 10px; color: #aaa; }

.ag-table td.td-sep,
.ag-table th.th-sep {
    width: 10px; min-width: 10px;
    background: #f0f2f5;
    border: none; padding: 0;
}

.ag-table .td-cita {
    vertical-align: top;
    padding: 7px;
    border-right: 1px solid var(--border-mid);
    border-bottom: 1px solid var(--border-mid);
    background: #fcfcfc;
    min-width: 220px;
}
.ag-table .td-cita:last-child { border-right: 2px solid var(--border-light); }

/* Huecos vacíos */
.hueco-vacio {
    display: flex; align-items: center; justify-content: center;
    min-height: 68px;
    border: 1px dashed #c8e6c9;
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: background .15s;
    cursor: pointer;
}
.hueco-vacio:hover { background: #f1fff4; }
.btn-add-cita {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: #43a047; font-style: italic;
    background: none; border: none; cursor: pointer;
    text-decoration: none; padding: 10px 14px;
}
.btn-add-cita:hover { color: #2e7d32; }

/* Tarjeta de cita */
.cita-card {
    border: 1px solid #edf2f7; border-radius: var(--radius-sm);
    padding: 8px 10px; margin-bottom: 4px;
    background: #fdfdfd; cursor: pointer;
    border-left: 4px solid #cbd5e1;
    transition: transform .15s, box-shadow .15s;
}
.cita-card:hover { box-shadow: 0 3px 8px rgba(0,0,0,.1); transform: scale(1.015); }
.cita-card:last-child { margin-bottom: 0; }

/* Estados de cita */
.est-agendada   { border-left-color: var(--blue-main); background: #f5f8ff; }
.est-pendiente  { border-left-color: #f39c12; background: #fffdf5; }
.est-reserva    { border-left-color: #3498db; background: #f7faff; }
.est-nula       { border-left-color: #e74c3c; background: #fdf5f5; }
.est-aplazada   { border-left-color: #2ecc71; background: #f7fef9; }
.est-sinviab    { border-left-color: #95a5a6; background: #fafafa; }
.est-noint      { border-left-color: #bdc3c7; background: #fafafa; }

.cc-cliente {
    font-size: 13px; font-weight: 600; color: var(--text-dark);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 195px;
}
.cc-loc { font-size: 11px; color: #888; margin-top: 2px; }
.cc-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }

/* Badges de cita */
.badge { font-size: 11px; padding: 3px 7px; border-radius: 10px; font-weight: 600; text-transform: uppercase; }
.b-agendada  { background: #e9f2ff; color: var(--blue-dark); }
.b-pendiente { background: #fff3cd; color: #856404; }
.b-reserva   { background: #cff4fc; color: #055160; }
.b-nula      { background: #f8d7da; color: #721c24; }
.b-aplazada  { background: #d4edda; color: #155724; }
.b-default   { background: #f4f6f8; color: #555; }
.b-rc-ok     { background: #d4edda; color: #155724; }
.b-rc-nc     { background: #fff3cd; color: #856404; }
.b-rc-nq     { background: #f8d7da; color: #721c24; }
.b-rc-no     { background: #f4f6f8; color: #555; }

.btn-add-mini {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    width: 100%; margin-top: 5px; padding: 4px;
    border: 1px dashed #a5d6a7; border-radius: var(--radius-xs);
    background: none; font-size: 11px; color: #43a047; font-style: italic;
    cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn-add-mini:hover { background: #f1fff4; color: #2e7d32; }

/* Estado vacío */
.empty-state {
    text-align: center; padding: 60px 20px;
    background: #f9fafb; border-radius: 12px;
    border: 2px dashed var(--border-light);
    margin-top: 16px;
}
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; opacity: .4; }
.empty-state p { color: #6c757d; font-size: 14px; margin-bottom: 20px; }

/* ── Modales ── */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.5);
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--white); border-radius: var(--radius);
    padding: 26px; width: 500px; max-width: 95vw;
    max-height: 90vh; overflow-y: auto;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    border-top: 4px solid var(--blue-main);
}
.modal-close {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; font-size: 20px;
    cursor: pointer; color: #aaa; line-height: 1; transition: color .15s;
}
.modal-close:hover { color: var(--blue-main); }
.modal-title { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 18px; padding-right: 24px; }

/* Inputs dentro de modales */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; font-size: 12px; color: #6c757d;
    font-weight: 600; margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: .5px;
}
.form-group select,
.form-group input {
    width: 100%; font-size: 14px; padding: 9px 12px;
    border: 1px solid #ced4da; border-radius: 7px;
    outline: none; background: var(--white); color: #333;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.form-group select:focus,
.form-group input:focus { border-color: var(--blue-main); box-shadow: 0 0 0 3px var(--blue-bg); }

.modal-actions {
    display: flex; gap: 10px; justify-content: flex-end;
    margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f0f0;
}
.btn-cancel {
    padding: 8px 16px; border: 1px solid #ced4da;
    border-radius: var(--radius-sm); background: var(--white);
    cursor: pointer; font-size: 13px; color: #555; transition: all .15s;
}
.btn-cancel:hover { background: #f4f6f8; }
.btn-submit {
    padding: 8px 18px; border: none; border-radius: var(--radius-sm);
    background: var(--blue-main); color: #fff;
    cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s;
}
.btn-submit:hover { background: var(--blue-dark); }
.btn-submit:disabled { opacity: 1; cursor: not-allowed !important; }

/* Botón eliminar comercial */
.btn-del-com {
    flex-shrink: 0; width: 22px; height: 22px;
    border-radius: 50%; border: 1px solid #fecaca;
    background: #fff5f5; color: #e53e3e;
    font-size: 11px; font-weight: 700; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1; transition: background .15s, border-color .15s, transform .15s;
    margin-left: auto;
}
.btn-del-com:hover {
    background: #e53e3e; color: #fff;
    border-color: #e53e3e; transform: scale(1.15);
}

/* Botón añadir cita en provincia */
.btn-add-cita-prov {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 700; padding: 5px 12px;
    border-radius: 12px; border: 1px solid #bdd6ff;
    background: var(--white); color: var(--blue-dark);
    cursor: pointer; transition: background .15s, transform .15s;
    white-space: nowrap; flex-shrink: 0;
}
.btn-add-cita-prov:hover {
    background: var(--blue-main); color: #fff;
    border-color: var(--blue-main); transform: translateY(-1px);
}

/* Modal nueva cita — secciones */
.nc-section {
    background: #fafafa; border: 1px solid #f0f0f0;
    border-radius: 8px; padding: 14px 16px; margin-bottom: 14px;
}
.nc-section-title {
    font-size: 12px; font-weight: 700; color: var(--blue-dark);
    text-transform: uppercase; letter-spacing: .6px;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid #d4e4ff;
}
.nc-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group textarea {
    width: 100%; font-size: 13px; padding: 8px 10px;
    border: 1px solid #ced4da; border-radius: 7px;
    outline: none; resize: vertical; color: #333;
    font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.form-group textarea:focus { border-color: var(--blue-main); box-shadow: 0 0 0 3px var(--blue-mid); }
.req { color: #e53e3e; font-weight: 700; }

/* Sección pendiente reconfirmación */
.ag-table td.td-pend,
.ag-table th.th-pend { background: #fffbf0; }
.hora-chip-pend { font-size: 12px; font-weight: 700; color: #b45309; letter-spacing: .5px; }

/* ============================================================
   DETALLE DE CITA
   ============================================================ */
.detalle-container {
    font-family: 'Segoe UI', sans-serif;
    color: #333; text-align: left;
    margin: 0; padding: 20px;
    width: 100%; box-sizing: border-box;
}
#modal-body { text-align: left; }

.header-cita {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 15px; margin-bottom: 20px;
}
.header-cita h1 { margin: 0; font-size: 1.5em; color: #2d3748; }

.grid-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.info-box {
    background: #f9fafb; padding: 12px;
    border-radius: 8px; border: 1px solid var(--border-light);
}
.label {
    font-weight: 700; color: #718096; font-size: 0.75em;
    text-transform: uppercase; margin-bottom: 4px; display: block;
}
.value       { color: #2d3748; font-size: 1em; font-weight: 500; }
.empty-value { color: #cbd5e0; font-style: italic; font-size: 0.9em; }

.notas-box {
    background: #fefced; border: 1px solid #fbd38d;
    padding: 15px; border-radius: 8px; margin-top: 20px;
}

.detalle-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
.campo-box  { border: 1px solid #ced4da; padding: 10px; background: var(--white); }
.campo-label {
    font-size: 0.7em; font-weight: bold; color: #495057;
    text-transform: uppercase; margin-bottom: 5px; display: block;
}
.campo-value { font-size: 1em; color: #212529; min-height: 1.2em; }
.notas-area  { margin-top: 10px; border: 1px solid #ced4da; padding: 10px; }

/* ============================================================
   MÓDULO AGENDA — ESPECIFICIDAD WORDPRESS
   ============================================================ */
#seccion-Agenda.hidden { display: none !important; }

#seccion-Agenda .agenda-top-bar {
    display: flex !important; justify-content: space-between !important;
    align-items: center !important; border-bottom: 2px solid #f4f6f8 !important;
    padding-bottom: 15px !important; margin-bottom: 20px !important;
    flex-wrap: wrap !important; gap: 15px !important;
}
#seccion-Agenda .agenda-titulo {
    margin: 0 !important; color: var(--text-dark) !important;
    font-size: 18px !important; font-weight: bold !important;
}
#seccion-Agenda .agenda-controles {
    display: flex !important; align-items: center !important; gap: 15px !important;
}
#seccion-Agenda .agenda-date-nav {
    display: flex !important; align-items: center !important;
    background: #f4f6f8 !important; padding: 4px !important; border-radius: 6px !important;
}
#seccion-Agenda .agenda-nav-btn {
    background: white !important; border: 1px solid var(--border-light) !important;
    color: #555 !important; padding: 6px 10px !important;
    border-radius: 4px !important; cursor: pointer !important;
    display: flex !important; align-items: center !important;
    justify-content: center !important; transition: all 0.2s !important;
}
#seccion-Agenda .agenda-nav-btn:hover {
    background: var(--blue-main) !important; color: white !important;
    border-color: var(--blue-main) !important;
}
#seccion-Agenda .agenda-nav-btn svg {
    width: 16px !important; height: 16px !important;
    stroke: currentColor !important; stroke-width: 2.5 !important;
}
#seccion-Agenda .agenda-date-label {
    padding: 0 15px !important; font-weight: bold !important;
    font-size: 14px !important; color: #333 !important;
    min-width: 140px !important; text-align: center !important;
}
#seccion-Agenda .agenda-date-input {
    border: 1px solid var(--border-light) !important; padding: 7px 10px !important;
    border-radius: 6px !important; font-size: 14px !important;
    color: #444 !important; outline: none !important; background: white !important;
}
#seccion-Agenda .agenda-date-input:focus { border-color: var(--blue-main) !important; }
#seccion-Agenda .agenda-leyenda {
    display: flex !important; gap: 20px !important;
    margin-bottom: 25px !important; background: #fafafa !important;
    padding: 10px 15px !important; border-radius: 6px !important;
    font-size: 13px !important; color: #666 !important;
}
#seccion-Agenda .agenda-leyenda-item { display: flex !important; align-items: center !important; gap: 8px !important; }
#seccion-Agenda .agenda-dot { width: 10px !important; height: 10px !important; border-radius: 50% !important; display: inline-block !important; }
#seccion-Agenda .agenda-dot--placas   { background-color: var(--blue-main) !important; }
#seccion-Agenda .agenda-dot--baterias { background-color: #3498db !important; }
#seccion-Agenda .agenda-dot--libre    { background-color: #2ecc71 !important; }
#seccion-Agenda .agenda-provincias-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)) !important;
    gap: 20px !important; width: 100% !important;
}
#seccion-Agenda .provincia-card {
    background: var(--white) !important; border: 1px solid var(--border-light) !important;
    border-radius: 8px !important; overflow: hidden !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
    display: flex !important; flex-direction: column !important;
}
#seccion-Agenda .provincia-header {
    background: #f8f9fa !important; padding: 12px 15px !important;
    border-bottom: 1px solid var(--border-light) !important;
    display: flex !important; justify-content: space-between !important; align-items: center !important;
}
#seccion-Agenda .provincia-nombre {
    font-weight: bold !important; color: var(--text-dark) !important;
    display: flex !important; align-items: center !important; gap: 6px !important; font-size: 14px !important;
}
#seccion-Agenda .provincia-pin  { width: 14px !important; height: 14px !important; color: var(--blue-main) !important; }
#seccion-Agenda .provincia-badge {
    font-size: 11px !important; background: var(--blue-light) !important;
    color: var(--blue-dark) !important; padding: 3px 8px !important;
    border-radius: 10px !important; font-weight: bold !important;
}
#seccion-Agenda .provincia-huecos { padding: 10px !important; display: flex !important; flex-direction: column !important; gap: 8px !important; }
#seccion-Agenda .hueco {
    display: flex !important; align-items: center !important;
    padding: 10px 12px !important; border-radius: 6px !important;
    gap: 12px !important; box-sizing: border-box !important; transition: all 0.2s ease !important;
}
#seccion-Agenda .hueco-hora { font-weight: bold !important; font-size: 13px !important; color: #444 !important; min-width: 40px !important; }
#seccion-Agenda .hueco-info { flex-grow: 1 !important; }
#seccion-Agenda .hueco-nombre { font-weight: 600 !important; font-size: 13px !important; color: #333 !important; }
#seccion-Agenda .hueco-sub   { font-size: 11px !important; color: #777 !important; margin-top: 2px !important; }
#seccion-Agenda .hueco--ocupado { background: #fdfdfd !important; border: 1px solid #edf2f7 !important; border-left: 4px solid #cbd5e1 !important; }
#seccion-Agenda .hueco--ocupado:has(.agenda-dot--placas)  { border-left-color: var(--blue-main) !important; background: #f5f8ff !important; }
#seccion-Agenda .hueco--ocupado:has(.agenda-dot--baterias){ border-left-color: #3498db !important; background: #f7faff !important; }
#seccion-Agenda .hueco--libre { background: white !important; border: 1px dashed #2ecc71 !important; cursor: pointer !important; }
#seccion-Agenda .hueco--libre:hover { background: #f2fcf6 !important; transform: translateX(2px) !important; }
#seccion-Agenda .hueco-nombre--libre { color: #2ecc71 !important; font-style: italic !important; }
#seccion-Agenda .hueco-add-icon { width: 14px !important; height: 14px !important; color: #2ecc71 !important; opacity: 0.6 !important; }
#seccion-Agenda .hueco--libre:hover .hueco-add-icon { opacity: 1 !important; }
#seccion-Agenda a.hueco-ocupado { color: inherit !important; transition: transform 0.2s, box-shadow 0.2s !important; }
#seccion-Agenda a.hueco-ocupado:hover { transform: scale(1.02) !important; box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important; cursor: pointer !important; }

/* ============================================================
   PANEL ESTADÍSTICAS
   ============================================================ */
.header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-icon {
    width: 38px; height: 38px;
    background: var(--blue);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 18px;
}
.header h1 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
}
.header h1 small {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 1px;
}
.header-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.filters-section {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
}
.filters-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blue);
    margin-bottom: 12px;
}
.filters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
}
.filter-group input,
.filter-group select {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    padding: 7px 11px;
    outline: none;
    transition: border-color 0.15s;
    width: 160px;
}
.filter-group input:focus,
.filter-group select:focus { border-color: var(--blue); }

.price-pair { display: flex; gap: 6px; }
.price-pair input { width: 75px; }

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    padding: 8px 14px;
    transition: border-color 0.15s, color 0.15s;
    align-self: flex-end;
    text-decoration: none;
    display: inline-block;
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
    padding: 20px 32px;
}
.kpi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}
.kpi-card.accent {
    background: var(--blue);
    border-color: var(--blue);
}
.kpi-label {
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.kpi-card.accent .kpi-label { color: rgba(255,255,255,0.8); }
.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}
.kpi-card.accent .kpi-value { color: #fff; }
.kpi-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.kpi-card.accent .kpi-sub { color: rgba(255,255,255,0.75); }

.charts-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 14px;
    padding: 0 32px 32px;
}
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-12 { grid-column: span 12; }

@media (max-width: 1100px) {
    .col-4, .col-5, .col-6, .col-7 { grid-column: span 12; }
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.chart-card-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.chart-card-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}
.chart-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.chart-canvas-wrap {
    flex: 0 0 auto;
    width: 200px; height: 200px;
    position: relative;
}
.chart-canvas-wrap canvas { width: 100% !important; height: 100% !important; }

.stat-table-wrap { flex: 1; min-width: 0; overflow-x: auto; }
.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.stat-table th {
    text-align: left;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    padding: 8px 8px 8px;
    border-bottom: 1px solid var(--border);
}
.stat-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}
.stat-table tr:last-child td { border-bottom: none; }
.stat-table tr:hover td { background: var(--blue-light); }

.dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}
.label-cell { display: flex; align-items: center; }

.pct-pill {
    background: var(--blue-mid);
    color: var(--blue-dark);
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    white-space: nowrap;
}
.num-bold { font-weight: 600; color: var(--text); }
.null-label { color: var(--text-muted); font-style: italic; font-size: 0.72rem; }

.section-divider {
    grid-column: span 12;
    border: none;
    border-top: 1px solid var(--border);
    margin: 4px 0;
}
.section-heading {
    grid-column: span 12;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--blue);
    padding-top: 4px;
}

/* ── Navbar ── */
.pc-logout:hover { background: #f4f6f8; }

.pc-wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px; }

/* ── Welcome ── */
.pc-welcome { background: #fff; border-radius: 12px; border: 1px solid #eee; padding: 20px 24px; margin-bottom: 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.pc-welcome-left { display: flex; align-items: center; gap: 16px; }
.pc-avatar { width: 50px; height: 50px; border-radius: 50%; background: #e3f2fd; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; color: #1565c0; flex-shrink: 0; }
.pc-welcome-name { font-size: 17px; font-weight: 700; color: #2c3e50; }
.pc-welcome-sub { font-size: 13px; color: #888; margin-top: 2px; }
.pc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pc-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px; border-radius: 20px; border: 1px solid #e8e8e8; color: #666; background: #fafafa; }

/* ── Stats ── */
.pc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pc-stat { background: #fff; border-radius: 10px; border: 1px solid #eee; padding: 16px; text-align: center; }
.pc-stat-num { font-size: 26px; font-weight: 700; color: #2c3e50; margin-bottom: 4px; }
.pc-stat-lbl { font-size: 12px; color: #999; }

/* ── Layout 2 col ── */
.pc-two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 640px) { .pc-two-col { grid-template-columns: 1fr; } }

/* ── Cards ── */
.pc-card { background: #fff; border-radius: 12px; border: 1px solid #eee; margin-bottom: 16px; overflow: hidden; }
.pc-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f0; }
.pc-card-title { font-size: 14px; font-weight: 700; color: #2c3e50; display: flex; align-items: center; gap: 8px; }
.pc-count { font-size: 11px; padding: 3px 8px; border-radius: 10px; background: #e3f2fd; color: #1565c0; font-weight: 700; }

/* ── Info rows ── */
.pc-info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.pc-info-row:last-child { border-bottom: none; }
.pc-info-row label { color: #999; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; flex-shrink: 0; min-width: 100px; }
.pc-info-row span { color: #2c3e50; text-align: right; }

/* ── Notificaciones ── */
.pc-notif-alert { display: flex; align-items: flex-start; gap: 10px; background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #7b5900; }
.pc-notif-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.pc-notif-item:last-child { border-bottom: none; }
.pc-notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.nc-unread { background: #1976d2; }
.nc-read   { background: #ccc; }
.pc-notif-body { flex: 1; }
.pc-notif-msg  { color: #333; line-height: 1.5; }
.pc-notif-time { font-size: 11px; color: #aaa; margin-top: 3px; }

/* ── Citas / Llamadas ── */
.pc-list-item { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.pc-list-item:last-child { border-bottom: none; }
.pc-list-ico { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.ico-blue   { background: #e3f2fd; color: #1565c0; }
.ico-green  { background: #e8f5e9; color: #2e7d32; }
.ico-gray   { background: #f4f6f8; color: #888; }
.ico-orange { background: #fff3e0; color: #e65100; }
.ico-yellow { background: #fffde7; color: #f57f17; }
.pc-list-body  { flex: 1; min-width: 0; }
.pc-list-title { font-weight: 600; color: #2c3e50; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-list-sub   { font-size: 12px; color: #aaa; margin-top: 2px; }
.pc-list-transcript { font-size: 12px; color: #888; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }

.est-agendada { background: #e8f5e9; color: #2e7d32; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.est-pendiente{ background: #fff3e0; color: #e65100; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.est-reserva  { background: #e3f2fd; color: #1565c0; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.est-nula     { background: #fde8e8; color: #c62828; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }

/* ── Documentos por tipo ── */
.doc-tipo-section   { border-bottom: 1px solid #f0f0f0; }
.doc-tipo-section:last-child { border-bottom: none; }
.doc-tipo-header    { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; background: #fafafa; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: #2c3e50; gap: 8px; }
.doc-tipo-header:hover { background: #f4f6f8; }
.doc-tipo-label     { display: flex; align-items: center; gap: 8px; }
.doc-tipo-badge     { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: #e3f2fd; color: #1565c0; font-weight: 700; }
.doc-tipo-arrow     { font-size: 11px; color: #aaa; transition: transform .2s; }
.doc-tipo-arrow.open { transform: rotate(180deg); }
.doc-tipo-body      { display: none; }
.doc-tipo-body.open { display: block; }

/* ── Descarga ── */
.pc-dl-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 5px 10px; border-radius: 6px; border: 1px solid #e0e0e0; background: #fff; color: #555; text-decoration: none; transition: background .15s; white-space: nowrap; }
.pc-dl-btn:hover { background: #f4f6f8; }

/* ── Equipo ── */
.equipo-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; }
@media (max-width: 640px) { .equipo-grid { grid-template-columns: 1fr; } }
.equipo-bloque { padding: 14px 18px; border-right: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
.equipo-bloque:nth-child(3n) { border-right: none; }
.equipo-bloque-title { font-size: 11px; font-weight: 700; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; display: flex; align-items: center; gap: 5px; }
.equipo-campo { font-size: 12px; color: #2c3e50; margin-bottom: 4px; }
.equipo-campo span { color: #888; font-size: 11px; }
.equipo-fecha { padding: 12px 18px; font-size: 12px; color: #888; border-top: 1px solid #f0f0f0; background: #fafafa; }

/* ── Planta ── */
.planta-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid #f8f8f8; font-size: 13px; }
.planta-row:last-child { border-bottom: none; }
.planta-row label { color: #999; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; min-width: 90px; flex-shrink: 0; }
.planta-val { display: flex; align-items: center; gap: 8px; color: #2c3e50; font-weight: 600; }
.passwd-mask { letter-spacing: 3px; color: #bbb; font-size: 14px; }
.btn-reveal { background: none; border: 1px solid #e0e0e0; border-radius: 5px; padding: 3px 8px; font-size: 11px; color: #555; cursor: pointer; transition: background .15s; }
.btn-reveal:hover { background: #f4f6f8; }

/* ── Fotos instalación ── */
.foto-grupo { border-bottom: 1px solid #f0f0f0; }
.foto-grupo:last-child { border-bottom: none; }
.foto-grupo-header { display: flex; align-items: center; gap: 8px; padding: 10px 18px; background: #fafafa; cursor: pointer; user-select: none; font-size: 13px; font-weight: 600; color: #2c3e50; }
.foto-grupo-header:hover { background: #f4f6f8; }
.foto-grupo-badge  { font-size: 11px; padding: 2px 7px; border-radius: 10px; background: var(--blue-light); color: var(--blue-dark); font-weight: 700; }
.foto-grupo-arrow  { font-size: 11px; color: #aaa; margin-left: auto; transition: transform .2s; }
.foto-grupo-arrow.open { transform: rotate(180deg); }
.foto-grupo-body   { display: none; padding: 14px 18px; }
.foto-grupo-body.open { display: block; }
.fotos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.foto-thumb-wrap   { border-radius: 8px; overflow: hidden; border: 1px solid #eee; background: #f8f8f8; }
.foto-thumb        { aspect-ratio: 4/3; overflow: hidden; }
.foto-thumb img    { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.foto-thumb:hover img { transform: scale(1.04); }
.foto-thumb-meta   { padding: 6px 8px; font-size: 11px; color: #888; background: #fafafa; border-top: 1px solid #f0f0f0; }
.foto-thumb-meta strong { display: block; color: #555; font-size: 11px; }
.foto-lightbox-link { display: block; width: 100%; }

/* ── Lightbox ── */
.lightbox-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 1000; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox-overlay.active { display: flex; }
.lightbox-img   { max-width: 90vw; max-height: 88vh; border-radius: 8px; box-shadow: 0 8px 48px rgba(0,0,0,.5); }
.lightbox-close { position: fixed; top: 16px; right: 20px; font-size: 28px; color: #fff; cursor: pointer; background: none; border: none; line-height: 1; }

/* ── Full-width card ── */
.pc-full-col { grid-column: 1 / -1; }
.pc-empty { text-align: center; padding: 24px; font-size: 13px; color: #bbb; }

/* ============================================================
   PANEL GERENCIA / DIRECCIÓN
   ============================================================ */
.gd-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 48px 20px 64px;
}
.gd-header {
    text-align: center;
    margin-bottom: 48px;
}
.gd-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--blue-mid);
    color: var(--blue-dark);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .7px;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}
.gd-welcome-title {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -.4px;
    margin-bottom: 6px;
}
.gd-welcome-sub { font-size: 14px; color: #888; }

.gd-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 560px) {
    .gd-grid { grid-template-columns: 1fr; }
}

.gd-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 30px 20px 26px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    position: relative;
    overflow: hidden;
}
.gd-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .18s ease;
    border-radius: inherit;
    background: linear-gradient(145deg, var(--blue-light) 0%, transparent 70%);
}
.gd-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(59,130,246,.18);
    border-color: #93c5fd;
}
.gd-btn:hover::before { opacity: 1; }

.gd-btn-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; flex-shrink: 0;
    position: relative; z-index: 1;
    transition: transform .18s ease;
}
.gd-btn:hover .gd-btn-icon { transform: scale(1.08); }

.icon-agenda    { background: var(--blue-light); }
.icon-stats     { background: #e8f5e9; }
.icon-auditoria { background: #fde8f0; }

.gd-btn-label { font-size: 13px; font-weight: 700; color: #1a1a1a; line-height: 1.3; position: relative; z-index: 1; }
.gd-btn-desc  { font-size: 11px; color: #a0a0a0; line-height: 1.5; position: relative; z-index: 1; }

.gd-footer {
    text-align: center;
    margin-top: 52px;
    font-size: 12px;
    color: #ccc;
}

/* ============================================================
   PANEL AUDITORÍA
   ============================================================ */

/* ── BARRA DE FILTROS ── */
.filter-bar { background: #f8f9fa; border: 1px solid #e2e8f0; padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-end; }
.filter-group { display: flex; flex-direction: column; gap: 4px; }
.filter-group label { font-size: 11px; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: .5px; }
.filter-group input[type="date"], .filter-group select { font-size: 13px; color: #2c3e50; border: 1px solid #ced4da; border-radius: 5px; padding: 6px 10px; background: #fff; outline: none; min-width: 140px; }
.filter-group input:focus, .filter-group select:focus { border-color: var(--blue-main); box-shadow: 0 0 0 3px var(--blue-mid); }
.btn-filter { padding: 7px 16px; background: var(--blue); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: background .15s; }
.btn-filter:hover { background: var(--blue-dark); }

/* ── Resumen ── */
.summary-bar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.summary-card { background: #fff; border: 1px solid #edf2f7; border-radius: 8px; padding: 12px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.summary-card .sc-label { font-size: 11px; color: #6c757d; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.summary-card .sc-value { font-size: 22px; font-weight: 700; color: #2c3e50; }
.summary-card.sc-total .sc-value { color: var(--blue-main); }
.summary-card.sc-rev   .sc-value { color: #27ae60; }
.summary-card.sc-apr   .sc-value { color: #1976d2; }

/* ── Tabla ── */
.table-wrap { overflow-x: auto; }
.citas-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.citas-table thead tr { background: #f8f9fa; border-bottom: 2px solid #dee2e6; }
.citas-table thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: #6c757d; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.citas-table tbody tr { border-bottom: 1px solid #f0f2f5; transition: background .15s; cursor: pointer; }
.citas-table tbody tr:hover { background: #f5f8ff; }
.citas-table tbody td { padding: 10px 14px; vertical-align: middle; color: #2c3e50; }
.cliente-nombre { font-weight: 600; color: #2c3e50; font-size: 13px; }
.fecha-chip { font-size: 12px; color: #555; }
.fecha-hora { font-size: 11px; color: #888; margin-top: 2px; }
.badge { display: inline-block; font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; text-transform: uppercase; white-space: nowrap; }
.b-renove  { background: var(--blue-light); color: var(--blue-dark); }
.b-np      { background: #e3f2fd; color: #0c447c; }
.b-default { background: #f4f6f8; color: #555; }
.estado-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; white-space: nowrap; }
.pill-ok { background: #d4edda; color: #155724; }
.pill-ko { background: #f8d7da; color: #721c24; }
.dir-text { font-size: 12px; color: #555; line-height: 1.5; }
.dir-prov { font-size: 11px; color: #888; margin-top: 2px; }

/* ── Modal auditoría ── */
.modal-box { background: #fff; border-radius: 10px; padding: 26px 28px; width: 700px; max-width: 95vw; max-height: 92vh; overflow-y: auto; position: relative; box-shadow: 0 12px 40px rgba(0,0,0,.2); border-top: 4px solid var(--blue-main); display: flex; flex-direction: column; gap: 0; }
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 20px; cursor: pointer; color: #aaa; line-height: 1; transition: color .15s; }
.modal-close:hover { color: var(--blue-mid); }
.modal-title { font-size: 16px; font-weight: 700; color: #2c3e50; margin-bottom: 4px; padding-right: 28px; }
.modal-sub   { font-size: 12px; color: #888; margin-bottom: 18px; }

/* ── Formulario del modal ── */
.det-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.det-section { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--blue-mid); padding: 12px 0 4px; border-bottom: 1px solid var(--blue-light); grid-column: 1/-1; margin-top: 2px; }
.det-field { display: flex; flex-direction: column; gap: 4px; }
.det-field.span2 { grid-column: 1/-1; }
.det-field label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: #6c757d; }
.det-field input, .det-field select, .det-field textarea { font-size: 13px; color: #2c3e50; border: 1px solid #e2e8f0; border-radius: 5px; padding: 7px 10px; background: #fff; width: 100%; transition: border-color .15s; font-family: inherit; }
.det-field input:focus, .det-field select:focus, .det-field textarea:focus { outline: none; border-color: var(--blue-bg); box-shadow: 0 0 0 3px var(--blue-mid); }
.det-field input[readonly], .det-field textarea[readonly] { background: #f8f9fa; color: #666; cursor: default; border-color: #edf2f7; }
.det-field textarea { resize: vertical; min-height: 68px; }

/* Toggle */
.toggle-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.toggle-switch { position: relative; width: 40px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #dee2e6; border-radius: 22px; transition: .25s; }
.toggle-slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s; }
.toggle-switch input:checked + .toggle-slider { background: #27ae60; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-label { font-size: 13px; color: #555; }

/* Footer modal */
.modal-footer { padding-top: 18px; border-top: 1px solid #f0f2f5; margin-top: 18px; display: flex; justify-content: flex-end; gap: 8px; }
.btn-cancel { padding: 8px 18px; border: 1px solid #dee2e6; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; color: #555; transition: all .15s; }
.btn-cancel:hover { background: #f8f9fa; }
.btn-save { padding: 8px 20px; background: var(--blue-main); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; transition: opacity .15s; }
.btn-save:disabled { opacity: .55; cursor: not-allowed; }

/* Toast */
#toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #fff; z-index: 2000; opacity: 0; transition: opacity .3s; pointer-events: none; }
#toast.show { opacity: 1; }
#toast.ok  { background: #27ae60; }
#toast.err { background: #dc3545; }

/* ── Transcripción ── */
.trans-wrap {
    background: #f5f8ff;
    border: 1px solid #bdd6ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 14px;
    width: 100%;
    box-sizing: border-box;
}
.trans-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-main);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
}
.trans-text {
    font-size: 13px;
    color: #4a5568;
    line-height: 1.6;
    white-space: pre-line;
    max-height: 180px;
    overflow-y: auto;
    padding-right: 8px;
}
.trans-text::-webkit-scrollbar       { width: 6px; }
.trans-text::-webkit-scrollbar-track { background: transparent; }
.trans-text::-webkit-scrollbar-thumb { background: var(--blue-mid); border-radius: 4px; }
.trans-text::-webkit-scrollbar-thumb:hover { background: var(--blue-main); }

/* ── Audio ── */
.audio-wrap {
    background: #f5f8ff;
    border: 1px solid #bdd6ff;
    border-radius: 8px;
    padding: 16px;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}
.aw-header { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.aw-title  { font-size: 12px; font-weight: 700; color: #2c3e50; text-transform: uppercase; letter-spacing: .5px; }
.aw-id     { font-size: 11px; color: #888; background: #edf2f7; padding: 2px 6px; border-radius: 4px; }
.audio-wrap audio { width: 100%; display: block; outline: none; }

/* ── Filtros tipo text ── */
.filter-group input[type="text"] { font-size: 13px; color: #2c3e50; border: 1px solid #ced4da; border-radius: 5px; padding: 6px 10px; background: #fff; outline: none; min-width: 140px; }
.filter-group input[type="text"]:focus { border-color: var(--blue-bg); box-shadow: 0 0 0 3px var(--blue-mid); }

/* ── Botón limpiar ── */
.btn-clear {
    display: inline-block;
    padding: 7px 16px;
    background: #ffffff;
    color: #4a5568;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all .15s;
}
.btn-clear:hover { background: #f1f5f9; border-color: #94a3b8; color: #2d3748; }
.filter-actions { align-self: flex-end; }

/* ── Botón exportar ── */
.btn-export {
    padding: 7px 16px;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-export:hover { background: #219653; }

/* ============================================================
   PANEL EMPLEADOS
   ============================================================ */
.emp-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}
.emp-page-title { font-size: 22px; font-weight: 800; color: var(--text-dark); margin: 0; letter-spacing: -.3px; }
.emp-page-sub   { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── KPIs compactos ── */
.emp-kpi-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.emp-kpi { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 18px; display: flex; flex-direction: column; align-items: center; min-width: 80px; box-shadow: var(--shadow); }
.emp-kpi-num { font-size: 22px; font-weight: 700; color: var(--text-dark); line-height: 1; }
.emp-kpi-lbl { font-size: 11px; color: var(--text-muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }

/* ── Tabla empleados ── */
.emp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.emp-table thead tr { background: #f8f9fa; border-bottom: 2px solid var(--border); }
.emp-table thead th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.emp-table tbody tr { border-bottom: 1px solid #f0f2f5; transition: background .15s; cursor: default; }
.emp-table tbody tr:hover { background: #f5f8ff; }
.emp-table tbody td { padding: 10px 14px; vertical-align: middle; color: var(--text-dark); }

/* ── Avatar ── */
.emp-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-main); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.emp-fullname { font-weight: 600; color: var(--text-dark); font-size: 13px; }
.emp-dni { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.emp-cargo { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 10px; background: var(--blue-mid); color: var(--blue-dark); white-space: nowrap; }
.emp-depto { font-size: 12px; color: #555; max-width: 180px; }
.emp-contact-line { font-size: 12px; color: #555; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.emp-fecha { font-size: 12px; color: #555; white-space: nowrap; }

.emp-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.pill-trabajando { background: #d4edda; color: #155724; }
.pill-baja       { background: #fff3cd; color: #856404; }
.pill-despido    { background: #f8d7da; color: #721c24; }
.pill-default    { background: #f4f6f8; color: #555; }

.btn-emp-detail { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: var(--radius-xs); border: 1px solid var(--border-light); background: var(--white); color: var(--blue-dark); cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
.btn-emp-detail:hover { background: var(--blue-main); color: #fff; border-color: var(--blue-main); }

/* ── Topbar ── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    z-index: 10;
}
.topbar-logo   { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-main); }
.topbar-user   { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.topbar-nombre { font-size: 14px; font-weight: 600; }
.topbar-cargo  { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

/* ── Layout ── */
.page { display: flex; flex-direction: column; min-height: 100vh; }
.main {
    max-width: 520px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px 80px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Reloj ── */
.clock-section { text-align: center; padding: 8px 0 4px; }
.clock {
    font-family: var(--font-mono);
    font-size: clamp(52px, 14vw, 80px);
    font-weight: 500;
    letter-spacing: .04em;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.date { font-size: 13px; color: var(--muted); margin-top: 8px; letter-spacing: .05em; }

/* ── Status card ── */
.status-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    transition: border-color .3s;
}
.status-card.dentro { border-color: var(--accent); }
.status-card.fuera  { border-color: var(--border); }

.status-indicator { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: var(--muted); transition: background .3s; }
.status-indicator.dentro { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.status-indicator.fuera  { background: var(--muted); }

.status-label { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.status-sub   { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

/* ── Métricas ── */
.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.metric-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.metric-value { font-family: var(--font-mono); font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--text); }

/* ── Progreso ── */
.progress-wrap { padding: 0 2px; }
.progress-bar  { height: 4px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; width: 0%; transition: width 1s linear, background .3s; }
.progress-fill.completa { background: #60d0f0; }

/* ── Botón fichar ── */
.btn-fichar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: var(--radius);
    background: var(--accent);
    color: #0f0f0f;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: .04em;
    transition: transform .12s, background .3s, opacity .15s;
}
.btn-fichar:hover  { opacity: .88; }
.btn-fichar:active { transform: scale(.97); }
.btn-fichar.salida { background: var(--accent-out); }
.btn-fichar:disabled { opacity: .45; cursor: not-allowed; }
.btn-icon { font-size: 20px; line-height: 1; }

/* ── Toast ── */
.toast { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; font-family: var(--font-mono); opacity: 0; transition: opacity .3s; }
.toast.visible { opacity: 1; }
.toast.ok  { color: var(--accent); }
.toast.err { color: var(--accent-out); }

/* ── Timeline ── */
.section-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 14px; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.empty-msg { font-size: 13px; color: var(--muted); font-family: var(--font-mono); }
.tl-item { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tl-dot.entrada { background: var(--accent); }
.tl-dot.salida  { background: var(--accent-out); }
.tl-tipo { font-size: 13px; font-weight: 600; min-width: 58px; }
.tl-hora { font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.tl-elapsed { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

@media (max-width: 400px) {
    .metrics { grid-template-columns: 1fr 1fr; }
    .metrics .metric:last-child { grid-column: 1 / -1; }
}

/* ── Fichadero ── */
.fich-wrap { max-width: 560px; margin: 0 auto; padding: 32px 16px 64px; }
.fich-page-header { margin-bottom: 24px; }
.fich-page-title  { font-size: 22px; font-weight: 800; color: #2c3e50; letter-spacing: -.3px; margin-bottom: 3px; }
.fich-page-sub    { font-size: 13px; color: #6b7280; }

.fich-welcome {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid var(--blue-main);
    padding: 18px 22px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.fich-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--blue-main); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; flex-shrink: 0; }
.fich-welcome-name { font-size: 16px; font-weight: 700; color: #2c3e50; margin-bottom: 2px; }
.fich-welcome-sub  { font-size: 12px; color: #6b7280; }

.fich-clock-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 28px 22px 22px; text-align: center; margin-bottom: 16px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.fich-clock { font-size: clamp(48px, 14vw, 72px); font-weight: 700; font-variant-numeric: tabular-nums; color: #2c3e50; letter-spacing: .02em; line-height: 1; font-family: 'Courier New', monospace; }
.fich-date  { font-size: 13px; color: #6b7280; margin-top: 8px; text-transform: capitalize; }

.fich-status-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.06); transition: border-color .3s, background .3s; }
.fich-status-card.dentro { border-color: #22c55e; background: #f0fdf4; }
.fich-status-indicator { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; background: #d1d5db; transition: background .3s, box-shadow .3s; }
.fich-status-indicator.dentro { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.fich-status-label { font-size: 14px; font-weight: 700; color: #2c3e50; margin-bottom: 2px; }
.fich-status-sub   { font-size: 12px; color: #6b7280; }

.fich-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.fich-metric  { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); display: flex; flex-direction: column; gap: 5px; }
.fich-metric-label { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.fich-metric-value { font-size: 15px; font-weight: 700; color: #2c3e50; font-variant-numeric: tabular-nums; font-family: 'Courier New', monospace; }

.fich-progress-wrap { margin-bottom: 16px; padding: 0 2px; }
.fich-progress-bar  { height: 6px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }

.avatar-dyn img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.fich-progress-fill { height: 100%; background: var(--blue-main); border-radius: 99px; width: 0%; transition: width 1s linear, background .3s; }
.fich-progress-fill.completa { background: #22c55e; }
.fich-progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: #9ca3af; margin-top: 5px; }

.fich-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 10px;
    background: var(--blue-main);
    color: #fff;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .03em;
    box-shadow: 0 4px 12px var(--blue-mid);
    transition: background .2s, transform .12s, box-shadow .2s;
    margin-bottom: 10px;
}
.fich-btn:hover  { background: var(--blue-dark); box-shadow: 0 6px 16px var(--blue-mid); transform: translateY(-1px); }
.fich-btn:active { transform: scale(.98); }
.fich-btn.salida { background: #ef4444; box-shadow: 0 4px 12px rgba(239,68,68,.3); }
.fich-btn.salida:hover { background: #dc2626; box-shadow: 0 6px 16px rgba(239,68,68,.4); }
.fich-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.fich-btn-icon { font-size: 18px; line-height: 1; }

.fich-toast { text-align: center; font-size: 13px; color: #6b7280; min-height: 18px; opacity: 0; transition: opacity .3s; margin-bottom: 16px; }
.fich-toast.visible { opacity: 1; }
.fich-toast.ok  { color: #16a34a; font-weight: 600; }
.fich-toast.err { color: #dc2626; font-weight: 600; }

.fich-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.fich-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #f0f0f0; }
.fich-card-title  { font-size: 14px; font-weight: 700; color: #2c3e50; display: flex; align-items: center; gap: 7px; }
.fich-card-count  { font-size: 11px; padding: 3px 9px; border-radius: 10px; background: var(--blue-bg); color: var(--blue-dark); font-weight: 700; }

.fich-empty { text-align: center; padding: 24px; font-size: 13px; color: #9ca3af; font-style: italic; }

.fich-tl-item { display: flex; align-items: center; gap: 14px; padding: 12px 18px; border-bottom: 1px solid #f8f8f8; transition: background .15s; animation: fichFadeIn .25s ease; }
.fich-tl-item:last-child { border-bottom: none; }
.fich-tl-item:hover { background: #f5f8ff; }

@keyframes fichFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: none; }
}

.fich-tl-ico { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.fich-tl-ico.entrada { background: #dcfce7; color: #16a34a; }
.fich-tl-ico.salida  { background: #fee2e2; color: #dc2626; }

.fich-tl-body { flex: 1; min-width: 0; }
.fich-tl-tipo { font-size: 13px; font-weight: 700; color: #2c3e50; margin-bottom: 1px; }
.fich-tl-hora { font-size: 12px; color: #6b7280; font-family: 'Courier New', monospace; }
.fich-tl-elapsed { font-size: 12px; color: #9ca3af; font-family: 'Courier New', monospace; white-space: nowrap; }

@media (max-width: 400px) {
    .fich-metrics { grid-template-columns: 1fr 1fr; }
    .fich-metrics .fich-metric:last-child { grid-column: 1 / -1; }
}

.banner-corp-logo-img { height: 150px; width: auto; display: block; object-fit: contain; }

/* ============================================================
   PANEL ALMACENES
   ============================================================ */
.alm-tipo { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 10px; white-space: nowrap; }
.tipo-fijo  { background: var(--blue-light); color: var(--blue-dark); }
.tipo-movil { background: #e3f2fd; color: #0c5e9b; }

.alm-actions { display: flex; gap: 6px; align-items: center; }
.btn-alm { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 5px; border: 1px solid var(--border-light); background: var(--white); cursor: pointer; transition: background .15s, border-color .15s, color .15s; white-space: nowrap; text-decoration: none; gap: 4px; }
.btn-alm-ver:hover   { background: var(--blue-main); color: #fff; border-color: var(--blue-main); }
.btn-alm-stock  { color: #27ae60; border-color: #b7e4c7; }
.btn-alm-stock:hover { background: #27ae60; color: #fff; border-color: #27ae60; }
.btn-alm-edit   { color: #1976d2; border-color: #bbdefb; }
.btn-alm-edit:hover  { background: #1976d2; color: #fff; border-color: #1976d2; }
.btn-alm-del    { color: #e53e3e; border-color: #fecaca; }
.btn-alm-del:hover   { background: #e53e3e; color: #fff; border-color: #e53e3e; }

.stock-info { display: flex; flex-direction: column; gap: 2px; }
.stock-num  { font-size: 14px; font-weight: 700; color: #2c3e50; }
.stock-lbl  { font-size: 11px; color: #aaa; }

.modal-tabs { display: flex; border-bottom: 2px solid #f0f0f0; margin-bottom: 18px; gap: 0; }
.modal-tab  { padding: 9px 18px; font-size: 13px; font-weight: 600; color: #888; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .15s, border-color .15s; }
.modal-tab.active { color: var(--blue-main); border-bottom-color: var(--blue-main); }

.prod-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.prod-item { display: flex; align-items: center; gap: 14px; padding: 11px 14px; background: #fafafa; border: 1px solid #edf2f7; border-radius: 8px; font-size: 13px; transition: background .15s; }
.prod-item:hover { background: #f5f8ff; }
.prod-ico   { width: 32px; height: 32px; border-radius: 8px; background: var(--blue-light); color: var(--blue-dark); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.prod-body  { flex: 1; min-width: 0; }
.prod-nombre { font-weight: 600; color: #2c3e50; }
.prod-obs    { font-size: 11px; color: #aaa; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-stock-badge { font-size: 13px; font-weight: 700; background: #e8f5e9; color: #2e7d32; padding: 4px 10px; border-radius: 8px; white-space: nowrap; }
.prod-actions-mini { display: flex; gap: 5px; }
.btn-prod-mini { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 5px; border: 1px solid var(--border-light); background: var(--white); cursor: pointer; transition: background .15s; white-space: nowrap; }
.btn-prod-add:hover  { background: #27ae60; color: #fff; }
.btn-prod-edit { color: #1976d2; border-color: #bbdefb; }
.btn-prod-edit:hover { background: #1976d2; color: #fff; }

.hist-item { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; font-size: 13px; }
.hist-item:last-child { border-bottom: none; }
.hist-dot  { width: 8px; height: 8px; border-radius: 50%; background: #27ae60; margin-top: 5px; flex-shrink: 0; }
.hist-body { flex: 1; }
.hist-prod { font-weight: 600; color: #2c3e50; }
.hist-meta { font-size: 11px; color: #aaa; margin-top: 2px; }
.hist-qty  { font-size: 13px; font-weight: 700; color: #27ae60; white-space: nowrap; }

.confirm-overlay { display: none; position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.55); align-items: center; justify-content: center; }
.confirm-overlay.open { display: flex; }
.confirm-box { background: #fff; border-radius: 10px; padding: 28px 30px; width: 380px; max-width: 95vw; box-shadow: 0 12px 40px rgba(0,0,0,.2); border-top: 4px solid #e53e3e; text-align: center; }
.confirm-box h3 { font-size: 16px; color: #2c3e50; margin-bottom: 10px; }
.confirm-box p  { font-size: 13px; color: #666; margin-bottom: 22px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ============================================================
   PANEL PRODUCTOS
   ============================================================ */
.view-toggle { display: flex; background: #f4f6f8; border-radius: 6px; padding: 3px; gap: 2px; }
.view-btn { padding: 6px 12px; border-radius: 4px; border: none; background: none; font-size: 12px; font-weight: 600; color: #888; cursor: pointer; transition: background .15s, color .15s; }
.view-btn.active { background: #fff; color: var(--blue-dark); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.stock-pill  { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 10px; }
.sp-ok       { background: #e8f5e9; color: #2e7d32; }
.sp-low      { background: #fff8e1; color: #f57f17; }
.sp-empty    { background: #fde8e8; color: #c62828; }

.alm-dist { display: flex; flex-wrap: wrap; gap: 5px; }
.alm-chip  { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; border-radius: 8px; background: #f4f6f8; color: #444; white-space: nowrap; }
.alm-chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dot-fijo  { background: var(--blue-main); }
.dot-movil { background: #1976d2; }

.prod-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 4px; }
.prod-card { background: #fff; border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,.04); transition: box-shadow .15s, transform .15s; }
.prod-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.prod-card-header { padding: 14px 16px 10px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: flex-start; gap: 12px; }
.prod-card-ico    { width: 38px; height: 38px; border-radius: 9px; background: var(--blue-light); color: var(--blue-dark); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.prod-card-name   { font-size: 14px; font-weight: 700; color: #2c3e50; line-height: 1.3; }
.prod-card-obs    { font-size: 11px; color: #aaa; margin-top: 3px; }
.prod-card-total  { margin-left: auto; text-align: right; flex-shrink: 0; }
.prod-card-total-num { font-size: 20px; font-weight: 800; color: #2c3e50; line-height: 1; }
.prod-card-total-lbl { font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: .4px; }

.prod-card-body { padding: 10px 16px 14px; }
.prod-card-alm-title { font-size: 10px; font-weight: 700; color: #aaa; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.prod-card-alm-row  { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f8f8f8; font-size: 13px; gap: 8px; }
.prod-card-alm-row:last-child { border-bottom: none; }
.prod-card-alm-name { color: #444; display: flex; align-items: center; gap: 6px; min-width: 0; }
.prod-card-alm-prov { font-size: 11px; color: #aaa; white-space: nowrap; }

.prod-card-footer { padding: 10px 16px; border-top: 1px solid #f0f0f0; display: flex; gap: 6px; justify-content: flex-end; }

.stock-bar-wrap { margin-top: 6px; }
.stock-bar      { height: 4px; background: #eee; border-radius: 99px; overflow: hidden; }
.stock-bar-fill { height: 100%; border-radius: 99px; background: var(--blue-main); transition: width .3s; }
.stock-bar-fill.low   { background: #f57f17; }
.stock-bar-fill.empty { background: #e53e3e; }

/* ============================================================
   PANEL CLIENTE (cambio de contraseña)
   ============================================================ */
.pwd-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.pwd-field label { font-size: 13px; font-weight: 600; color: #555; }
.pwd-field input  { padding: 9px 12px; border: 1px solid #dde1e7; border-radius: 8px; font-size: 14px; outline: none; transition: border .2s; }
.pwd-field input:focus { border-color: var(--blue-main); }
.pwd-hint   { font-size: 11px; color: #999; }
.pwd-submit { width: 100%; padding: 10px; background: var(--blue-main); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .2s; }
.pwd-submit:hover { background: var(--blue-dark); }
.pwd-msg { padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.pwd-ok  { background: #e6f9f0; color: #1a7f4b; border: 1px solid #a3e4c1; }
.pwd-err { background: #fff2f2; color: #c0392b; border: 1px solid #f5b7b1; }

/* ============================================================
   SIDEBAR
   ============================================================ */
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.19.0/dist/tabler-icons.min.css');

:root {
    --sidebar-width:        64px;
    --sidebar-bg:           #1A6FB3;
    --sidebar-border:       #e8e8e5;
    --sidebar-icon:         #ffffff;
    --sidebar-icon-hover:   #2c2c2a;
    --sidebar-active-bg:    #ffffff;
    --sidebar-active-icon:  #1A6FB3;
    --sidebar-active-dot:   #1A6FB3;
    --sidebar-brand:        #1A6FB3;
    --sidebar-logout:       #93c5fd;
    --sidebar-logout-bg:    #ffffff;
    --tooltip-bg:           #2c2c2a;
    --tooltip-text:         #f1efe8;
    --tooltip-radius:       6px;
    --item-radius:          10px;
    --transition:           150ms ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --sidebar-bg:           #1A6FB3;
        --sidebar-border:       #2c2c2a;
        --sidebar-icon:         #ffffff;
        --sidebar-icon-hover:   #d3d1c7;
        --sidebar-active-bg:    #ffffff;
        --sidebar-active-icon:  #93c5fd;
        --sidebar-active-dot:   #93c5fd;
        --sidebar-brand:        #93c5fd;
        --sidebar-logout:       #93c5fd;
        --sidebar-logout-bg:    #ffffff;
        --tooltip-bg:           #f1efe8;
        --tooltip-text:         #2c2c2a;
    }
}

body.with-sidebar { margin-left: var(--sidebar-width); }

.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 0;
    z-index: 100;
    box-shadow: 1px 0 0 none;
}
.main-content { margin-left: var(--sidebar-width); flex: 1; min-width: 0; }

.sidebar__brand, .sidebar__brand_aux {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    color: var(--sidebar-brand);
    text-decoration: none;
    font-size: 24px;
    margin-bottom: 8px;
    border-radius: var(--item-radius);
    transition: background var(--transition);
}
.sidebar__brand:hover { background: var(--sidebar-active-bg); }
.sidebar__nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar__nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}
.sidebar__nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar__nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    padding: 8px 10px 0;
    overflow-y: auto;     
    overflow-x: hidden;    
    min-height: 0; 
}
.sidebar__footer { padding: 0 10px 4px; width: 100%; flex-shrink: 0; }

.sidebar__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    color: var(--sidebar-icon);
    text-decoration: none;
    border-radius: var(--item-radius);
    font-size: 20px;
    transition: background var(--transition), color var(--transition);
    outline: none;
}
.sidebar__item:hover,
.sidebar__item:focus-visible {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-icon);
}
.sidebar__item:focus-visible { box-shadow: 0 0 0 2px var(--sidebar-active-dot); }
.sidebar__item--active { background: var(--sidebar-active-bg); color: var(--sidebar-active-icon); }
.sidebar__item--active::before {
    content: '';
    position: absolute;
    left: -10px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--sidebar-active-dot);
}
.sidebar__item--logout:hover,
.sidebar__item--logout:focus-visible {
    background: var(--sidebar-logout-bg);
    color: var(--sidebar-logout);
}

.sidebar__tooltip {
    pointer-events: none;
    position: fixed;      
    top: 0;
    left: 0;
    background: var(--tooltip-bg);
    color: var(--tooltip-text);
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: var(--tooltip-radius);
    opacity: 0;
    z-index: 9999;
    transition: opacity 120ms ease, transform 120ms ease;
}
.sidebar__tooltip::before {
    content: '';
    position: absolute;
    right: 100%; top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: var(--tooltip-bg);
}
.sidebar__item:hover .sidebar__tooltip,
.sidebar__item:focus-visible .sidebar__tooltip {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* ============================================================
   RESPONSIVE MÓVIL — CORRECCIONES GLOBALES
   ============================================================ */

/* Meta viewport — asegúrate de tenerlo en el <head> de cada PHP:
   <meta name="viewport" content="width=device-width, initial-scale=1.0"> */

@media (max-width: 640px) {

    /* ── Sidebar: barra inferior ── */
    .sidebar {
        top: auto;
        bottom: 0; left: 0; right: 0;
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        padding: 0 8px;
    }
    body.with-sidebar {
        margin-left: 0;
        padding-bottom: 60px;
    }
    .main-content { margin-left: 0; margin-bottom: 60px; }
    .sidebar__brand { display: none; }
    .sidebar__nav {
        flex-direction: row;
        padding: 0;
        gap: 0;
        overflow-x: auto;
    overflow-y: hidden;
        justify-content: flex-start;
        flex: 1;
        
    }
    .sidebar__footer { padding: 0; width: auto; flex-shrink: 0; }
    .sidebar__item   { width: 48px; height: 48px; }
    .sidebar__item--active::before { display: none; }

    

    /* ── Banner: ocultar en móvil (el sidebar ya navega) ── */
    .banner-corp { display: none; }

    /* ── Contenedor general ── */
    .container { margin: 16px auto; padding: 0 12px; }

    /* ── Tablas: scroll horizontal y fuente menor ── */
    table    { font-size: 12px; }
    th, td   { padding: 7px 6px; }

    /* ── Panel estadísticas: padding lateral ── */
    .header           { padding: 14px 16px; }
    .filters-section  { padding: 12px 16px; }
    .kpi-strip        { padding: 14px 16px; }
    .charts-grid      { padding: 0 12px 20px; }
    .col-4, .col-5, .col-6, .col-7, .col-12 { grid-column: span 12; }

    /* ── Login / selección de perfil ── */
    .body-centered  { align-items: flex-start; padding-top: 40px; }
    .select-card    { padding: 28px 20px; }
    .login-card     { padding: 24px 18px; }

    /* ── Agenda: navegación de fechas ── */
    .ag-topbar { flex-direction: column; align-items: flex-start; }
    .date-nav .dlabel { min-width: 110px; font-size: 13px; }

    /* ── Modal nueva cita: grid de 2 col → 1 col ── */
    .nc-grid-2 { grid-template-columns: 1fr; }
    .det-grid  { grid-template-columns: 1fr; }

    /* ── Modal box: padding ajustado ── */
    .modal-box { padding: 20px 16px; }

    /* ── Panel dirección: 3 col → 1 col ── */
    .gd-grid { grid-template-columns: 1fr 1fr; }

    /* ── Panel auditoría: barra de filtros apilada ── */
    .filter-bar   { flex-direction: column; gap: 10px; }
    .filter-group input,
    .filter-group select,
    .filter-group input[type="date"],
    .filter-group input[type="text"] { width: 100%; min-width: unset; }
    .summary-bar  { flex-direction: column; }
    .summary-card { min-width: unset; }

    /* ── Tabla auditoría / empleados: scroll ── */
    .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .citas-table,
    .emp-table   { min-width: 600px; }

    /* ── KPIs estadísticas: 2 col ── */
    .kpi-strip { grid-template-columns: repeat(2, 1fr); }

    /* ── Fichadero: métricas 2+1 ── */
    .fich-metrics { grid-template-columns: 1fr 1fr; }
    .fich-metrics .fich-metric:last-child { grid-column: 1 / -1; }

    /* ── Grids gerencia ── */
    .gd-wrap { padding: 28px 16px 80px; }
    .gd-header { margin-bottom: 28px; }
    .gd-welcome-title { font-size: 20px; }

    /* ── Panel cliente (fotos) ── */
    .fotos-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

    /* ── Equipo: 1 col ── */
    .equipo-grid { grid-template-columns: 1fr; }
    .equipo-bloque:nth-child(3n) { border-right: none; }
    .equipo-bloque { border-right: none; }

    /* ── Topbar sticky con sidebar oculto arriba ── */
    .topbar { padding: 12px 16px; }

    /* ── Chart canvas: tamaño reducido ── */
    .chart-canvas-wrap { width: 150px; height: 150px; }

    /* ── Acciones de almacén: apiladas ── */
    .alm-actions { flex-wrap: wrap; }

    /* ── Prod cards: 1 col ── */
    .prod-cards-grid { grid-template-columns: 1fr; }
}

/* Pantallas muy pequeñas (< 360px) */
@media (max-width: 360px) {
    .gd-grid     { grid-template-columns: 1fr; }
    .kpi-strip   { grid-template-columns: 1fr; }
    .fich-metrics { grid-template-columns: 1fr; }
    .fich-metrics .fich-metric:last-child { grid-column: auto; }
    .date-nav .dlabel { min-width: 80px; font-size: 12px; }
}