/* =====================================================================
   LAGO CREATIVE APP — SISTEMA DE DISEÑO
   Referencia: docs/02_DS_sistema-de-diseno.md
   Toda regla lleva su código DS-* correspondiente en comentario.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700&display=swap');

:root {
    /* DS-COL — Paleta de color */
    --col-white:        #FFFFFF; /* DS-COL-01 */
    --col-dark-gray-blue:#232539; /* DS-COL-02 (alias "Lagoon Serenity" / "Midnight Lagoon") */
    --form-text-color: #232539; /* texto sobre campos de formulario/botones claros, fijo entre temas */
    --col-black:         #000000; /* DS-COL-03 */
    --col-light-gray:    #D6D7D9; /* DS-COL-04 — color de íconos */
    --col-pastel-orange: #E5C697; /* DS-COL-05 */
    --col-grass-green:   #7ED957; /* DS-COL-06 */
    --col-light-blue:    #38B6FF; /* DS-COL-07 */
    --col-azzure-whisper:#D1E0FF; /* DS-COL-08 */
    --col-gray-orange:   #8A795D; /* DS-COL-09 */
    --col-vivid-red:     #EC1C24; /* DS-COL-10 */

    /* DS-BG — Backgrounds */
    --bg-principal: linear-gradient(90deg,
        rgba(0,0,0,0.805) 0%,
        var(--col-gray-orange) 35%,
        var(--col-dark-gray-blue) 65%,
        rgba(0,0,0,0.785) 100%); /* DS-BG-01 */
    --bg-menu: rgba(35, 37, 57, 0.65);   /* DS-BG-02 — Dark Gray Blue @ 65% */
    --bg-menu-solid: #232539;
    --bg-form-field: rgba(255, 255, 255, 0.65); /* DS-BG-03 */

    /* DS-BRD — Bordes */
    --radius-1: 20px; /* DS-BRD-01 */
    --radius-2: 12px; /* DS-BRD-02 */
    --radius-3: 5px;  /* DS-BRD-03 */

    /* DS-TYP */
    --font-main: 'Barlow Condensed', 'Arial Narrow', sans-serif;

    /* Layout widths (LAY-01) */
    --col-a-width: 20%;
    --col-b-width: 60%;
    --col-c-width: 20%;

    /* Spacing base */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
}

/* ---------- Franja persistente de Test Mode ---------- */
.test-mode-banner {
    position: sticky;
    top: 0;
    z-index: 300;
    width: 100%;
    background: #e5c697;
    color: #232539;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 6px 10px;
}

/* ---------- Pestañas horizontales de Settings (solo admin) ---------- */
.settings-tabs {
    display: inline-flex;
    gap: 4px;
    background: var(--bg-menu);
    border-radius: var(--radius-1);
    padding: 6px;
    margin: 14px 0 24px;
}
.settings-tab-btn {
    background: none;
    border: none;
    color: var(--col-light-gray);
    font-family: var(--font-main);
    font-size: 15px;
    padding: 8px 18px;
    border-radius: calc(var(--radius-1) - 6px);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.settings-tab-btn:hover { color: var(--col-white); }
.settings-tab-btn.active {
    background: var(--bg-menu-solid);
    color: var(--col-white);
    font-weight: 600;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 8;
    background: transparent;
    margin: 0 calc(-1 * var(--space-3)) var(--space-2);
    padding: var(--space-2) var(--space-3) var(--space-2);
}

/* ---------- Contador circular "Next Wallpaper" (solo temas Dynamic/Gallery) ---------- */
.wallpaper-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 10px 6px 4px;
    --progress: 0;
}
.wallpaper-ring {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: conic-gradient(var(--col-light-blue) calc(var(--progress) * 1%), rgba(255,255,255,.18) 0);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5px;
    transition: background 0.1s linear;
}
.wallpaper-next-btn {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-menu-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--col-white);
}
.wallpaper-label {
    font-style: italic;
    font-size: 12px;
    color: var(--col-light-gray);
    white-space: nowrap;
}

.nest-form { display: none; }
.nest-form.open-nest-form { display: block; }

* { box-sizing: border-box; }

/* =====================================================================
   TEMAS — el tema por defecto (LAGO Creative) vive en :root arriba.
   Cada tema adicional sobrescribe las mismas variables; todo el resto
   del CSS ya está construido sobre estos tokens, así que cambia solo
   con activar data-theme en <body>.
   ===================================================================== */

/* ---------- LIGHT — limpio, profesional, alto contraste ---------- */
[data-theme="light"] {
    --col-white: #1E2233;
    --col-dark-gray-blue: #DEE1E9;
    --col-black: #1E2233;
    --col-light-gray: #6B7280;
    --col-pastel-orange: #E5C697;
    --col-grass-green: #16A34A;
    --col-light-blue: #2563EB;
    --col-azzure-whisper: #EAF1FF;
    --col-gray-orange: #9C7F52;
    --col-vivid-red: #DC2626;

    --bg-principal: linear-gradient(135deg, #FBFBFD 0%, #EDEFF4 100%);
    --bg-menu: rgba(255, 255, 255, 0.88);
    --bg-menu-solid: #FFFFFF;
    --bg-form-field: rgba(30, 34, 51, 0.06);
}
[data-theme="light"] .nav-menu,
[data-theme="light"] .summary-card,
[data-theme="light"] .project-card,
[data-theme="light"] .est-inv-card,
[data-theme="light"] .customer-card,
[data-theme="light"] .editor-panel,
[data-theme="light"] .calendar-cell,
[data-theme="light"] .utility-panel {
    box-shadow: 0 1px 3px rgba(30, 34, 51, 0.08), 0 1px 2px rgba(30, 34, 51, 0.06);
}

/* ---------- DARK — plano, moderno, sin degradado ---------- */
[data-theme="dark"] {
    --col-white: #F2F3F7;
    --col-dark-gray-blue: #1C1E27;
    --col-black: #000000;
    --col-light-gray: #9AA0AE;
    --col-pastel-orange: #E5C697;
    --col-grass-green: #7ED957;
    --col-light-blue: #38B6FF;
    --col-azzure-whisper: #2A3550;
    --col-gray-orange: #B99B6B;
    --col-vivid-red: #FF6B6B;

    --bg-principal: linear-gradient(180deg, #16171F 0%, #0C0D12 100%);
    --bg-menu: rgba(28, 30, 39, 0.88);
    --bg-menu-solid: #1C1E27;
    --bg-form-field: rgba(255, 255, 255, 0.92);
}

/* ---------- CORPORATE — navy + oro, elegante y robusto ---------- */
[data-theme="corporate"] {
    --col-white: #F5F1E6;
    --col-dark-gray-blue: #16233E;
    --col-black: #0B1220;
    --col-light-gray: #A9B4C6;
    --col-pastel-orange: #C9A227;
    --col-grass-green: #4CAF7D;
    --col-light-blue: #6FA8DC;
    --col-azzure-whisper: #24314F;
    --col-gray-orange: #C9A227;
    --col-vivid-red: #C0524A;

    --bg-principal: linear-gradient(135deg, #0B1220 0%, #16233E 55%, #0B1220 100%);
    --bg-menu: rgba(22, 35, 62, 0.88);
    --bg-menu-solid: #16233E;
    --bg-form-field: rgba(245, 241, 230, 0.94);
}
[data-theme="corporate"] .brand-name,
[data-theme="corporate"] .section-title {
    letter-spacing: 0.5px;
}

/* ---------- LAGO CREATIVE DYNAMIC — imagen de fondo rotativa + vidrio esmerilado real ---------- */
[data-theme="dynamic"], [data-theme="gallery"] {
    --col-white: #FFFFFF;
    --col-dark-gray-blue: #1A1C24;
    --col-black: #000000;
    --col-light-gray: #E4E6EC;
    --col-pastel-orange: #E5C697;
    --col-grass-green: #7ED957;
    --col-light-blue: #38B6FF;
    --col-azzure-whisper: #D1E0FF;
    --col-gray-orange: #E5C697;
    --col-vivid-red: #FF6B6B;

    --bg-menu: rgba(15, 16, 22, 0.38);
    --bg-menu-solid: rgba(20, 22, 30, 0.92);
    --bg-form-field: rgba(255, 255, 255, 0.88);
}
/* La imagen de fondo la inyecta header.php (con respaldo JS ante fallos de red — ver script inline). */
[data-theme="dynamic"] body, [data-theme="gallery"] body { background-image: linear-gradient(135deg, #16171F 0%, #0C0D12 100%); background-color: #0B0C10; }
[data-theme="dynamic"] .nav-menu, [data-theme="gallery"] .nav-menu,
[data-theme="dynamic"] .summary-card, [data-theme="gallery"] .summary-card,
[data-theme="dynamic"] .project-card, [data-theme="gallery"] .project-card,
[data-theme="dynamic"] .est-inv-card, [data-theme="gallery"] .est-inv-card,
[data-theme="dynamic"] .customer-card, [data-theme="gallery"] .customer-card,
[data-theme="dynamic"] .editor-panel, [data-theme="gallery"] .editor-panel,
[data-theme="dynamic"] .editor-face-left, [data-theme="gallery"] .editor-face-left,
[data-theme="dynamic"] .calendar-cell, [data-theme="gallery"] .calendar-cell,
[data-theme="dynamic"] .user-popup, [data-theme="gallery"] .user-popup,
[data-theme="dynamic"] .mobile-topbar, [data-theme="gallery"] .mobile-topbar {
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="dynamic"] .utility-panel, [data-theme="gallery"] .utility-panel {
    background: rgba(15, 16, 22, 0.55);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
[data-theme="dynamic"] .pagination-btns button, [data-theme="gallery"] .pagination-btns button {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(15, 16, 22, 0.5);
}

/* ---------- Selector de tema (Settings) ---------- */
.theme-picker {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-menu);
    border-radius: var(--radius-2);
    padding: 12px 14px;
    cursor: pointer;
    border: 2px solid transparent;
    font-size: 15px;
}
.theme-option.active { border-color: var(--col-light-blue); }
.theme-option input { display: none; }
.theme-swatch {
    display: flex;
    border-radius: 50%;
    overflow: hidden;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.theme-swatch span { flex: 1; height: 100%; }


html {
    min-height: 100%;
    background: var(--bg-principal);
}
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: var(--font-main);
    color: var(--col-white);
    background: var(--bg-principal);
    background-attachment: fixed;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* -------------------------------------------------------------
   Iconos (DS-ICO) — SVG unicolor, currentColor, DS-COL-04
   ------------------------------------------------------------- */
.icon {
    width: 20px;
    height: 20px;
    stroke: var(--col-light-gray);
    fill: none;
    stroke-width: 1.75;
    flex-shrink: 0;
}
.icon-filled { fill: var(--col-light-gray); stroke: none; }

/* -------------------------------------------------------------
   LAY-01 — Grid general de 3 columnas
   ------------------------------------------------------------- */
.app-shell {
    display: grid;
    grid-template-columns: var(--col-a-width) var(--col-b-width) var(--col-c-width);
    min-height: 100vh;
    width: 100%;
}

/* -------------------------------------------------------------
   LAY-02 — Columna A (navegación)
   ------------------------------------------------------------- */
.col-a {
    display: flex;
    flex-direction: column;
    padding: var(--space-3) 0 var(--space-3) var(--space-3);
    gap: var(--space-3);
    min-width: 0;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 0 var(--space-2);
    margin-top: 0.5rem;
}
.brand-mark {
    width: 5rem;
    height: 5rem;
    min-width: 5rem;
    min-height: 5rem;
    border-radius: 50%;
    background: var(--col-black);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.brand-mark img { width: 70%; height: 70%; object-fit: contain; }
.brand-name {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.nav-menu {
    background: var(--bg-menu);
    border-radius: var(--radius-1);
    padding: var(--space-2) var(--space-1);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
    margin-right: var(--space-3);
    margin-bottom: var(--space-3);
    backdrop-filter: blur(6px);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 12px 16px;
    border-radius: var(--radius-3);
    color: var(--col-white);
    font-size: 18px;
    transition: background 0.15s ease;
    white-space: nowrap;
    overflow: hidden;
}
.nav-item:hover, .nav-item.active { background: rgba(255,255,255,0.08); }
.nav-item .icon { stroke: var(--col-light-gray); }

/* Menú reducido: solo íconos */
.nav-menu.collapsed .nav-label { display: none; }
.nav-menu.collapsed .nav-item { justify-content: center; padding: 12px; }
.nav-menu.collapsed .brand-name { display: none; }

/* -------------------------------------------------------------
   LAY-03 — Columna B (contenido)
   ------------------------------------------------------------- */
.col-b {
    padding: var(--space-4) var(--space-3);
    min-width: 0;
    position: relative;
}

.section-title {
    font-size: 42px;
    font-weight: 600;
    line-height: 1;
    margin: 0;
}
.section-subtitle {
    font-size: 18px;
    color: var(--col-light-gray);
    margin-top: 6px;
    font-weight: 400;
}

.section-actions-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

/* Botón "+ New X" */
.btn-new {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: var(--col-white);
    font-size: 18px;
    font-weight: 500;
}
.btn-new .plus {
    font-size: 26px;
    line-height: 1;
    color: var(--col-gray-orange);
}

/* Toggle View (Tipo 1 / Tipo 2) */
.view-toggle-wrap { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--col-light-gray); }
.toggle {
    width: 46px;
    height: 24px;
    border-radius: 999px;
    background: var(--col-dark-gray-blue);
    position: relative;
    border: none;
}
.toggle .knob {
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--col-gray-orange);
    transition: left 0.2s ease;
}
.toggle.on .knob { left: 25px; }

/* Dashboard: 3 contenedores */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
}
.summary-card {
    background: var(--bg-menu);
    border-radius: var(--radius-1);
    aspect-ratio: 1 / 1;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
}
.summary-card .label { font-size: 14px; text-transform: none; color: var(--col-light-gray); }
.summary-card .value-wrap { width: 100%; flex: 1; display: flex; align-items: center; justify-content: center; }
.summary-card .value { font-size: 56px; font-weight: 700; }
.summary-card .underline { width: 60%; height: 5%; min-height: 6px; border-radius: 3px; margin: 0 auto; }
.summary-card.pending .underline { background: var(--col-light-blue); }
.summary-card.delivered .underline { background: var(--col-grass-green); }

/* Tarjetas de Projects Tipo 1 */
.month-label {
    font-size: 30px;
    font-weight: 600;
    margin: var(--space-3) 0 var(--space-2);
}
.card-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-2);
}
.project-card {
    background: var(--bg-menu);
    border-radius: var(--radius-1);
    padding: var(--space-2);
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: transform 0.12s ease;
    position: relative;
}
.project-card .agent-badge {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 11px;
    color: var(--col-light-gray);
    opacity: .85;
}
.project-card .creator-badge {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 10px;
    color: var(--col-gray-orange);
    opacity: .9;
}
.project-card:hover { transform: translateY(-2px); }
.project-card .title {
    font-size: 17px;
    font-weight: 500;
    overflow-wrap: break-word;
    line-height: 1.2;
}
.project-card .status-strip { height: 6px; border-radius: 3px; margin-top: 10px; }

/* Calendario Tipo 2 */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: var(--space-2);
}
.calendar-dow { text-align: center; font-size: 1.2rem; color: var(--col-light-gray); padding-bottom: 4px; }
.calendar-cell {
    background: var(--bg-menu);
    border-radius: var(--radius-1);
    aspect-ratio: 1/1;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4px;
    cursor: pointer;
    font-size: 14px;
}
.calendar-cell > span:first-child { font-size: 1.2rem; text-align: center; }
.calendar-cell.outside { color: var(--col-gray-orange); }
.calendar-cell .dots { display: flex; gap: 3px; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); }
.calendar-cell .dot { width: 6px; height: 6px; border-radius: 50%; }

/* Tarjetas de Estimates / Invoices (fase 1) */
.card-row-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}
.est-inv-card {
    background: var(--bg-menu);
    border-radius: var(--radius-2);
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}
.est-inv-card .creator-badge {
    font-size: 10px;
    color: var(--col-gray-orange);
    opacity: .9;
    margin-bottom: -4px;
}
.est-inv-card .row-top { display: flex; justify-content: space-between; align-items: flex-start; }
.est-inv-card .customer-name { font-size: 18px; font-weight: 500; }
.est-inv-card .gear-btn { background: none; border: none; }
.est-inv-card .row-status { display: flex; justify-content: flex-end; font-size: 13px; color: var(--col-light-gray); }
.est-inv-card .row-code-status { display: flex; justify-content: space-between; align-items: center; }
.status-select {
    background: var(--bg-form-field);
    border-radius: var(--radius-2);
    border: none;
    padding: 6px 10px;
    color: var(--form-text-color);
    font-family: var(--font-main);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.est-inv-card .btn-download {
    background: var(--col-dark-gray-blue);
    border: none;
    color: var(--col-white);
    border-radius: var(--radius-3);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
}

/* Customers grid */
.customers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.customer-card {
    background: var(--bg-menu);
    border-radius: var(--radius-1);
    aspect-ratio: 1/1;
    padding: var(--space-2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}
.customer-card .activities-link { font-size: 13px; color: var(--col-light-gray); align-self: flex-start; }
.customer-card .name { font-size: 20px; font-weight: 500; text-align: center; align-self: center; margin: auto 0; overflow-wrap: break-word; }
.customer-card .gear-btn { align-self: flex-end; background: none; border: none; }

/* Fase 2 — panel de dos caras */
.editor-panel {
    background: var(--bg-menu);
    border-radius: var(--radius-2);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 560px;
    overflow: hidden;
}
.editor-face-left {
    background: var(--col-dark-gray-blue);
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
}
.editor-face-left .face-title {
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--col-white);
    margin-bottom: var(--space-2);
}
.canva-sandbox-wrap {
    flex: 1;
    border-radius: var(--radius-3);
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}
.canva-sandbox-wrap iframe { width: 100%; height: 100%; border: none; background: white; }
.canva-html-input {
    width: 100%;
    flex: 1;
    resize: vertical;
    background: var(--bg-form-field);
    border: none;
    border-radius: var(--radius-2);
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    color: var(--form-text-color);
}

.editor-face-right { padding: var(--space-3); display: flex; flex-direction: column; gap: var(--space-2); }

.form-row { display: flex; gap: var(--space-2); }
.form-field { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.form-field label {
    font-size: 13px;
    text-transform: uppercase;
    color: var(--col-white);
    letter-spacing: 0.5px;
}
.form-field input, .form-field select, .form-field textarea {
    background: var(--bg-form-field);
    border: none;
    border-radius: var(--radius-2);
    padding: 10px 12px;
    font-family: var(--font-main);
    font-size: 16px;
    color: var(--form-text-color);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field.desc textarea { border-radius: var(--radius-3); min-height: 160px; }

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius-3);
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
    color: var(--form-text-color);
    background: var(--col-gray-orange);
}
.btn-primary.blue { background: var(--col-light-blue); color: var(--col-white); }
.btn-primary.yellow { background: #F4D35E; color: var(--form-text-color); }
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    border-radius: var(--radius-3);
    padding: 10px 16px;
    font-size: 15px;
    color: var(--col-white);
}
.btn-danger { border-color: var(--col-vivid-red); color: var(--col-vivid-red); }
.btn-row { display: flex; gap: 10px; margin-top: auto; flex-wrap: wrap; }

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    background: rgba(0,0,0,0.15);
    border-radius: var(--radius-3);
    padding: var(--space-2);
}
.calc-item .label { font-size: 12px; text-transform: uppercase; color: var(--col-light-gray); }
.calc-item .value { font-size: 20px; font-weight: 600; }
.admin-only-badge { font-size: 11px; color: var(--col-gray-orange); }

/* items list (estimates) */
.items-list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.08); border-radius: var(--radius-3); padding: 8px 12px; font-size: 15px; }
.item-row button { background: none; border: none; color: var(--col-light-gray); font-size: 1.4rem; }
.items-header-row { margin-top: 0 !important; margin-bottom: 1vh !important; }

/* -------------------------------------------------------------
   LAY-04 — Columna C
   ------------------------------------------------------------- */
.col-c {
    padding: var(--space-3) var(--space-3) var(--space-3) 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
}
.user-id-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    position: relative;
}
.user-name { font-size: 16px; }
.user-avatar {
    width: 4rem; height: 4rem;
    min-width: 4rem; min-height: 4rem;
    border-radius: 50%;
    background: var(--bg-menu-solid);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem; font-weight: 600;
    border: none; color: var(--col-white);
}
.user-popup {
    position: absolute;
    top: 48px; right: 0;
    background: var(--bg-menu-solid);
    border-radius: var(--radius-3);
    padding: 8px;
    display: none;
    flex-direction: column;
    min-width: 160px;
    z-index: 50;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.user-popup.open { display: flex; }
.user-popup a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-3); font-size: 15px;
}
.user-popup a:hover { background: rgba(255,255,255,0.08); }

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--col-light-gray);
    font-size: 16px;
    margin-top: var(--space-4);
}

.utility-panel {
    background: var(--bg-menu);
    border-radius: var(--radius-3);
    padding: var(--space-2);
    margin-top: var(--space-3);
    flex: 1;
    max-height: 88%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.utility-title {
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    margin-bottom: var(--space-2);
}
.utility-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.utility-item { display: flex; align-items: center; justify-content: space-between; font-size: 14px; }
.utility-item .u-status { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.utility-pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.utility-pagination button { background: none; border: none; color: var(--col-light-gray); }

.pagination-btns { display: flex; gap: 10px; margin-top: auto; padding-top: var(--space-2); justify-content: flex-start; }
.pagination-btns button {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--col-dark-gray-blue);
    border: none;
    display: flex; align-items: center; justify-content: center;
}

/* -------------------------------------------------------------
   LAY-05 — Responsive (SUG-02)
   ------------------------------------------------------------- */
.mobile-topbar { display: none; }
.mobile-overlay { display: none; }

@media (max-width: 1023px) {
    .app-shell { grid-template-columns: 72px 1fr; }
    .col-a .brand-name { display: none; }
    .nav-menu .nav-label { display: none; }
    .nav-item { justify-content: center; }
    .col-c { display: none; }
}

@media (max-width: 767px) {
    .app-shell { grid-template-columns: 1fr; }
    .col-a {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 240px;
        z-index: 200;
        background: var(--bg-principal);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        padding: var(--space-3);
    }
    .col-a.open { transform: translateX(0); }
    .col-a .brand-name, .nav-menu .nav-label { display: inline; }
    .nav-item { justify-content: flex-start; }
    .mobile-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: var(--space-2);
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--col-dark-gray-blue);
    }
    .mobile-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 150;
    }
    .mobile-overlay.open { display: block; }
    .col-b { padding: var(--space-2); }
    .summary-grid { grid-template-columns: 1fr; }
    .card-row { grid-template-columns: repeat(2, 1fr); }
    .card-row-3 { grid-template-columns: 1fr; }
    .customers-grid { grid-template-columns: repeat(2, 1fr); }
    .editor-panel { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .calendar-grid { gap: 3px; }
    .calc-grid { grid-template-columns: 1fr; }

    /* Col-C pasa a bottom-sheet accesible con botón flotante (SUG-02) */
    .col-c {
        display: none;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        max-height: 70vh;
        background: var(--col-dark-gray-blue);
        border-radius: 20px 20px 0 0;
        z-index: 180;
        overflow-y: auto;
        padding: var(--space-3);
    }
    .col-c.open { display: flex; }
    .fab-utility {
        display: flex;
        position: fixed;
        bottom: 20px; right: 20px;
        width: 54px; height: 54px;
        border-radius: 50%;
        background: var(--col-gray-orange);
        border: none;
        align-items: center; justify-content: center;
        z-index: 170;
        box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    }
}
@media (min-width: 768px) {
    .fab-utility { display: none; }
}

/* Empty states (SUG-10) */
.empty-state { text-align: center; padding: var(--space-5) var(--space-3); color: var(--col-light-gray); }
.empty-state .icon { width: 48px; height: 48px; margin-bottom: var(--space-2); }
