﻿/* =============================================
   QuedaListo — Estilos v3 (mejorado)
   ============================================= */


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

:root {
    --color-primary:      oklch(14% 0.025 265);
    --color-primary-dark: oklch(9%  0.02  265);
    --color-accent:       oklch(56% 0.20  265);
    --color-accent-light: oklch(97% 0.018 265);
    --color-accent-hover: oklch(50% 0.20  265);
    --color-success:      oklch(56% 0.17  155);
    --color-warning:      oklch(68% 0.17   68);
    --color-danger:       oklch(56% 0.20   20);
    --color-bg:           oklch(97% 0.006 265);
    --color-surface:      #ffffff;
    --color-border:       oklch(91% 0.008 265);
    --color-border-strong:oklch(84% 0.012 265);
    --color-text:         oklch(14% 0.025 265);
    --color-text-muted:   oklch(52% 0.020 265);
    /* Sidebar — tema claro (día) */
    --color-sidebar-bg:          #ffffff;
    --color-sidebar-text:        oklch(45% 0.02 265);
    --color-sidebar-text-strong: oklch(20% 0.03 265);
    --color-sidebar-muted:       oklch(60% 0.015 265);
    --color-sidebar-border:      oklch(91% 0.008 265);
    --color-sidebar-hover:       oklch(96% 0.006 265);
    --color-sidebar-active-text: var(--color-accent);
    --color-sidebar-active-bg:   oklch(56% 0.20 265 / .10);
    --sidebar-width:      252px;
    --header-height:      58px;
    --radius:             10px;
    --radius-sm:          7px;
    --radius-xs:          5px;
    --shadow-sm:          0 1px 2px rgba(0,0,0,.05);
    --shadow:             0 1px 4px rgba(0,0,0,.06), 0 2px 6px rgba(0,0,0,.03);
    --shadow-md:          0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
    --shadow-lg:          0 16px 48px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.06);
    --shadow-accent:      0 4px 16px oklch(56% 0.20 265 / .28);
}

/* Dark mode — usa html[data-theme="dark"] (especificidad 0,1,1 > :root 0,1,0) */
html[data-theme="dark"] {
    --color-bg:             oklch(13% 0.015 265);
    --color-surface:        oklch(18% 0.018 265);
    --color-border:         oklch(26% 0.018 265);
    --color-border-strong:  oklch(33% 0.020 265);
    --color-text:           oklch(94% 0.010 265);
    --color-text-muted:     oklch(65% 0.018 265);
    /* Sidebar — tema oscuro (noche) */
    --color-sidebar-bg:          oklch(10% 0.018 265);
    --color-sidebar-text:        oklch(55% 0.02 265);
    --color-sidebar-text-strong: oklch(94% 0.01 265);
    --color-sidebar-muted:       oklch(40% 0.015 265);
    --color-sidebar-border:      rgba(255,255,255,.05);
    --color-sidebar-hover:       rgba(255,255,255,.06);
    --color-sidebar-active-text: oklch(78% 0.14 265);
    --color-sidebar-active-bg:   oklch(56% 0.20 265 / .15);
    --color-accent-light:   oklch(22% 0.030 265);
    --shadow-sm:            0 1px 2px rgba(0,0,0,.30);
    --shadow:               0 1px 4px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.22);
    --shadow-md:            0 4px 16px rgba(0,0,0,.45), 0 1px 4px rgba(0,0,0,.28);
    --shadow-lg:            0 16px 48px rgba(0,0,0,.60), 0 4px 12px rgba(0,0,0,.35);
    --shadow-accent:        0 4px 16px oklch(56% 0.20 265 / .45);
}

/* Transición suave entre temas */
body, .card, .stat-card, .topbar, .sidebar, .page-content,
.form-control, .btn-ghost, .auth-box, .chat-sidebar,
.chat-main, .notif-item, .cp-modal, .bottom-nav {
    transition: background-color .25s ease, border-color .2s ease, color .2s ease;
}

html, body {
    height: 100%;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }

/* ============================================================
   LAYOUT
   ============================================================ */
.app-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--color-sidebar-border);
}

.sidebar-logo {
    padding: 18px 16px 16px;
    border-bottom: 1px solid var(--color-sidebar-border);
    display: flex;
    align-items: center;
    gap: 11px;
}

.sidebar-logo h1 {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-sidebar-text-strong);
    letter-spacing: -.2px;
    line-height: 1.1;
}

.sidebar-logo span {
    font-size: 10.5px;
    color: var(--color-sidebar-muted);
    display: block;
    margin-top: 2px;
    font-weight: 500;
    letter-spacing: .1px;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--color-accent);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px oklch(56% 0.20 265 / .4);
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--color-sidebar-muted);
    padding: 16px 16px 5px;
}

.sidebar-nav {
    padding: 8px 8px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: var(--color-sidebar-text);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all .15s ease;
    border-radius: var(--radius-sm);
    margin-bottom: 1px;
    position: relative;
}

.sidebar-nav a:hover {
    background: var(--color-sidebar-hover);
    color: var(--color-sidebar-text-strong);
}

.sidebar-nav a.active {
    background: var(--color-sidebar-active-bg);
    color: var(--color-sidebar-active-text);
    font-weight: 600;
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--color-accent);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav .nav-icon {
    font-size: 15px;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    opacity: .85;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--color-sidebar-border);
    font-size: 12px;
    color: var(--color-sidebar-muted);
}

.sidebar-footer strong {
    display: block;
    color: var(--color-sidebar-text-strong);
    margin-bottom: 8px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer .btn-logout {
    background: transparent;
    border: 1px solid var(--color-sidebar-border);
    color: var(--color-sidebar-muted);
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all .15s;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.sidebar-footer .btn-logout:hover {
    background: oklch(56% 0.20 20 / .12);
    border-color: oklch(56% 0.20 20 / .2);
    color: oklch(70% 0.15 20);
}

/* ============================================================
   MAIN AREA
   ============================================================ */
.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-bg);
}

.topbar {
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -.2px;
}

.topbar-spacer { flex: 1; }

.topbar-badge {
    background: var(--color-danger);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}

.page-content {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    transition: box-shadow .2s;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.card-header h2 {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -.1px;
}

.card-body {
    padding: 20px;
}

/* ============================================================
   STATS GRID
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:nth-child(4n+1)::before { background: var(--color-accent); }
.stat-card:nth-child(4n+2)::before { background: var(--color-success); }
.stat-card:nth-child(4n+3)::before { background: var(--color-warning); }
.stat-card:nth-child(4n+4)::before { background: var(--color-danger); }

.stat-card .stat-label {
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 8px;
    font-weight: 600;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -1.5px;
    line-height: 1;
}

.stat-card .stat-sub {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 5px;
}

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    background: var(--color-bg);
    padding: 9px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--color-border);
    transition: background .1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--color-bg); }

tbody td {
    padding: 11px 15px;
    color: var(--color-text);
    vertical-align: middle;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .1px;
}

.badge-pendiente       { background: oklch(95% 0.05 80);  color: oklch(38% 0.12 68);  border: 1px solid oklch(88% 0.08 75); }
.badge-aceptado        { background: oklch(95% 0.04 240); color: oklch(38% 0.14 240); border: 1px solid oklch(88% 0.06 240); }
.badge-aprobado        { background: oklch(94% 0.05 150); color: oklch(36% 0.14 150); border: 1px solid oklch(86% 0.08 150); }
.badge-rechazado       { background: oklch(95% 0.04 20);  color: oklch(38% 0.16 20);  border: 1px solid oklch(88% 0.07 20); }
.badge-en_proceso      { background: oklch(95% 0.04 280); color: oklch(38% 0.16 280); border: 1px solid oklch(88% 0.07 280); }
.badge-finalizado      { background: oklch(94% 0.05 150); color: oklch(32% 0.14 155); border: 1px solid oklch(86% 0.08 155); }
.badge-cancelado       { background: var(--color-bg);     color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge-suspendido      { background: oklch(95% 0.04 340); color: oklch(38% 0.15 340); border: 1px solid oklch(88% 0.06 340); }
.badge-info_requerida  { background: oklch(95% 0.05 80);  color: oklch(38% 0.12 68);  border: 1px solid oklch(88% 0.08 75); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    min-height: 36px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s ease;
    text-decoration: none;
    letter-spacing: -.1px;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    line-height: 1;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    box-shadow: var(--shadow-accent);
}
.btn-primary:hover:not(:disabled) {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px oklch(56% 0.20 265 / .35);
}

.btn-success {
    background: var(--color-success);
    color: #fff;
    border-color: var(--color-success);
    box-shadow: 0 2px 8px oklch(56% 0.17 155 / .28);
}
.btn-success:hover:not(:disabled) {
    background: oklch(50% 0.17 155);
    border-color: oklch(50% 0.17 155);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
    border-color: var(--color-danger);
    box-shadow: 0 2px 8px oklch(56% 0.20 20 / .28);
}
.btn-danger:hover:not(:disabled) {
    background: oklch(50% 0.20 20);
    border-color: oklch(50% 0.20 20);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--color-warning);
    color: #fff;
    border-color: var(--color-warning);
    box-shadow: 0 2px 8px oklch(68% 0.17 68 / .28);
}
.btn-warning:hover:not(:disabled) {
    background: oklch(62% 0.17 68);
    border-color: oklch(62% 0.17 68);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: var(--color-border);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--color-bg);
    color: var(--color-text);
    border-color: var(--color-border-strong);
    box-shadow: var(--shadow-sm);
}

.btn-mp {
    background: #009ee3;
    color: #fff;
    font-weight: 700;
    border-color: #009ee3;
    box-shadow: 0 2px 10px rgba(0,158,227,.28);
}
.btn-mp:hover:not(:disabled) {
    background: #007eb5;
    border-color: #007eb5;
    transform: translateY(-1px);
}

.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-xs { padding: 3px 8px;  font-size: 11px; border-radius: 4px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: .3px;
    margin-bottom: 5px;
}

.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--color-text);
    background: var(--color-surface);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    touch-action: manipulation;
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px oklch(56% 0.20 265 / .1);
}

.form-control:hover:not(:focus) { border-color: var(--color-border-strong); }
.form-control::placeholder { color: oklch(70% 0.01 265); font-size: 13px; }

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 34px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 14px;
    display: none;
    border: 1px solid transparent;
    font-weight: 500;
    line-height: 1.45;
}

.alert.show { display: block; }
.alert-danger   { background: oklch(97% 0.03 20);  color: oklch(38% 0.18 20);  border-color: oklch(88% 0.08 20); }
.alert-success  { background: oklch(97% 0.03 155); color: oklch(34% 0.14 155); border-color: oklch(88% 0.08 155); }
.alert-info     { background: oklch(97% 0.03 240); color: oklch(38% 0.15 240); border-color: oklch(88% 0.07 240); }
.alert-warning  { background: oklch(97% 0.04 80);  color: oklch(38% 0.14 68);  border-color: oklch(88% 0.08 75); }

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.loading-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(3px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show { display: flex; }

.spinner {
    width: 32px;
    height: 32px;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin .65s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--color-bg) 25%, var(--color-border) 50%, var(--color-bg) 75%);
    background-size: 200% 100%;
    animation: skeleton-pulse 1.4s ease-in-out infinite;
    border-radius: 6px;
}

@keyframes skeleton-pulse {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--color-text-muted);
}

.empty-state .empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
    opacity: .5;
}

.empty-state p { font-size: 13.5px; line-height: 1.6; }
.empty-state small { font-size: 12px; color: var(--color-text-muted); opacity: .7; }

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.toggle input { display: none; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--color-border-strong);
    border-radius: 22px;
    cursor: pointer;
    transition: background .2s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.toggle input:checked + .toggle-slider { background: var(--color-success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, oklch(56% 0.20 265 / .25) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 80%, oklch(56% 0.20 295 / .18) 0%, transparent 70%),
        oklch(12% 0.025 265);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-box {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.12);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-box .auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-box .auth-header h1 {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -.5px;
    margin-bottom: 4px;
}

.auth-box .auth-header p {
    font-size: 13.5px;
    color: var(--color-text-muted);
    margin-top: 5px;
}

.auth-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--color-accent);
    border-radius: 14px;
    margin-bottom: 16px;
    font-size: 22px;
    box-shadow: var(--shadow-accent);
}

.auth-footer {
    text-align: center;
    margin-top: 22px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.auth-footer a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover { text-decoration: underline; }

/* ============================================================
   CHAT
   ============================================================ */
.chat-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.chat-sidebar {
    width: 288px;
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    background: var(--color-surface);
}

.chat-sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}

.chat-lista { flex: 1; overflow-y: auto; }

.chat-item {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
    transition: background .1s;
}

.chat-item:hover { background: var(--color-bg); }
.chat-item.active { background: var(--color-accent-light); }
.chat-item.unread { background: oklch(97% 0.02 230); }

.chat-avatar {
    width: 38px;
    height: 38px;
    background: var(--color-accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
}

.chat-item-body { flex: 1; min-width: 0; }
.chat-item-name { font-size: 13px; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-item-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.chat-item-time { font-size: 10.5px; color: var(--color-text-muted); }
.chat-unread-badge {
    background: var(--color-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-main-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: var(--shadow-sm);
}
.chat-main-name { font-size: 14px; font-weight: 700; }
.chat-main-sub  { font-size: 12px; color: var(--color-text-muted); }

.chat-wrap { display: flex; flex-direction: column; height: 100%; }

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--color-bg);
}

.chat-bubble {
    max-width: 68%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.chat-bubble.own {
    align-self: flex-end;
    background: var(--color-accent);
    color: #fff;
    border-bottom-right-radius: 3px;
    box-shadow: 0 2px 8px oklch(56% 0.20 265 / .25);
}

.chat-bubble.other {
    align-self: flex-start;
    background: var(--color-surface);
    color: var(--color-text);
    border-bottom-left-radius: 3px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.chat-bubble .bubble-author { font-size: 11px; opacity: .75; margin-bottom: 2px; font-weight: 600; }
.chat-bubble .bubble-time   { font-size: 10px; opacity: .6;  text-align: right; margin-top: 4px; }

.chat-input-bar {
    border-top: 1px solid var(--color-border);
    padding: 12px 14px;
    display: flex;
    gap: 10px;
    background: var(--color-surface);
}

.chat-input-bar .form-control { flex: 1; }

/* ============================================================
   NOTIFICACIONES
   ============================================================ */
.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background .1s;
}

.notif-item:hover { background: var(--color-bg); }
.notif-item.unread { background: oklch(97% 0.018 265); border-left: 3px solid var(--color-accent); }

.notif-icon {
    width: 36px;
    height: 36px;
    background: var(--color-accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    border: 1px solid oklch(88% 0.06 265);
}

.notif-body { flex: 1; }
.notif-title { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.notif-msg   { font-size: 12.5px; color: var(--color-text-muted); line-height: 1.4; }
.notif-time  { font-size: 11px; color: var(--color-text-muted); opacity: .7; white-space: nowrap; margin-top: 2px; }

/* ============================================================
   WIZARD DE REGISTRO
   ============================================================ */
.wizard-page {
    min-height: 100vh;
    width: 100%;
    background: var(--color-bg);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 32px 16px 48px;
    overflow-x: hidden;
}

.wizard-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 660px;
}

.wizard-header {
    padding: 26px 30px 0;
    border-bottom: 1px solid var(--color-border);
}

.wizard-header h1 {
    font-size: 19px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -.4px;
}

.wizard-header p {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
    margin-bottom: 22px;
}

.wizard-steps {
    display: flex;
    gap: 0;
    margin-bottom: -1px;
}

.wizard-step-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    position: relative;
    cursor: default;
}

.wizard-step-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-border);
    transition: background .2s;
}

.wizard-step-tab.active::after { background: var(--color-accent); }
.wizard-step-tab.done::after   { background: var(--color-success); }

.wizard-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-bg);
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
    transition: all .2s;
}

.wizard-step-tab.active .wizard-step-num { background: var(--color-accent); color: #fff; box-shadow: var(--shadow-accent); }
.wizard-step-tab.done .wizard-step-num   { background: var(--color-success); color: #fff; }

.wizard-step-label {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--color-text-muted);
    text-align: center;
}

.wizard-step-tab.active .wizard-step-label { color: var(--color-accent); }
.wizard-step-tab.done .wizard-step-label   { color: var(--color-success); }

.wizard-body { padding: 28px 30px; }
.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.wizard-panel-title {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--color-text-muted);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border);
}

.wizard-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 30px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-upload {
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    position: relative;
    background: var(--color-bg);
}

.file-upload:hover,
.file-upload.has-file {
    border-color: var(--color-accent);
    background: var(--color-accent-light);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.file-upload .file-icon   { font-size: 24px; margin-bottom: 8px; }
.file-upload .file-label  { font-size: 12.5px; font-weight: 600; color: var(--color-text-muted); }
.file-upload .file-name   { font-size: 12px; color: var(--color-accent); margin-top: 4px; display: none; font-weight: 600; }
.file-upload.has-file .file-name  { display: block; }
.file-upload.has-file .file-label { display: none; }
.file-upload .file-required { font-size: 11px; color: var(--color-danger); margin-top: 4px; }

/* ============================================================
   CATEGORÍAS
   ============================================================ */
.categoria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 8px;
}

.categoria-item {
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
    background: var(--color-surface);
}

.categoria-item:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.categoria-item.selected { border-color: var(--color-accent); background: var(--color-accent-light); color: var(--color-accent); font-weight: 600; }
.categoria-item input[type="checkbox"] { display: none; }

/* ============================================================
   DISPONIBILIDAD HORARIA
   ============================================================ */
.dias-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

.dia-btn {
    padding: 5px 13px;
    border: 1.5px solid var(--color-border);
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    background: var(--color-surface);
    transition: all .15s;
    font-family: inherit;
    color: var(--color-text-muted);
}

.dia-btn.active { border-color: var(--color-accent); background: var(--color-accent); color: #fff; }

.horario-dia-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 13px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-bottom: 7px;
}

.horario-dia-label { font-weight: 600; font-size: 13px; width: 90px; flex-shrink: 0; }
.horario-dia-times { display: flex; align-items: center; gap: 8px; flex: 1; }
.horario-dia-times label { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }
.horario-dia-times .form-control { width: 120px; padding: 5px 8px; font-size: 13px; }

/* ============================================================
   RESUMEN WIZARD
   ============================================================ */
.resumen-seccion {
    margin-bottom: 12px;
    padding: 13px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.resumen-seccion h4 {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-muted);
    margin-bottom: 10px;
}

.resumen-fila {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 5px;
    gap: 16px;
}

.resumen-fila span:first-child { color: var(--color-text-muted); flex-shrink: 0; }
.resumen-fila span:last-child  { font-weight: 500; text-align: right; }

.resumen-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    font-size: 11.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin: 2px;
}

.resumen-archivo { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-success); margin-bottom: 3px; }
.resumen-archivo.falta { color: var(--color-danger); }

/* ============================================================
   PERFIL PRESTADOR
   ============================================================ */
.perfil-hero {
    background: var(--color-sidebar-bg);
    color: #fff;
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    position: relative;
    overflow: hidden;
}

.perfil-hero::before {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 160px; height: 160px;
    background: radial-gradient(circle, oklch(56% 0.20 265 / .2) 0%, transparent 70%);
    pointer-events: none;
}

.perfil-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    border: 2.5px solid rgba(255,255,255,.2);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

.perfil-avatar img { width: 100%; height: 100%; object-fit: cover; }

.perfil-info { flex: 1; }
.perfil-nombre { font-size: 20px; font-weight: 800; margin-bottom: 4px; letter-spacing: -.3px; }
.perfil-cats   { font-size: 13px; opacity: .7; margin-bottom: 10px; }

.badge-verificado {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-success);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 6px oklch(56% 0.17 155 / .4);
}

.badge-pendiente-verificacion {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--color-warning);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.stars-display { display: flex; align-items: center; gap: 3px; }
.stars-display .star { color: #f59e0b; font-size: 15px; }
.stars-display .star.empty { color: rgba(255,255,255,.22); }
.stars-display .rating-num { font-size: 14px; font-weight: 700; margin-left: 4px; }
.stars-display .rating-count { font-size: 12px; opacity: .65; }

.resena-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--color-border);
    transition: background .1s;
}

.resena-item:hover { background: var(--color-bg); }
.resena-item:last-child { border-bottom: none; }
.resena-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.resena-autor  { font-size: 13px; font-weight: 700; }
.resena-texto  { font-size: 13px; color: var(--color-text-muted); line-height: 1.5; }

/* ============================================================
   BUSCAR PRESTADORES — FILTROS
   ============================================================ */
.filtros-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filtro-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-muted);
}

.form-control-sm { padding: 5px 10px; font-size: 13px; height: 33px; }

.filtro-stars { display: flex; gap: 5px; }

.star-filter-btn {
    padding: 5px 11px;
    border: 1.5px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all .15s;
    color: var(--color-text-muted);
    font-weight: 600;
    font-family: inherit;
}

.star-filter-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.star-filter-btn.active { border-color: var(--color-accent); background: var(--color-accent); color: #fff; }

/* ============================================================
   CARDS DE PRESTADORES
   ============================================================ */
.prestadores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 12px;
}

.prestador-card {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    gap: 13px;
    padding: 15px;
    cursor: pointer;
    transition: all .2s ease;
    align-items: flex-start;
}

.prestador-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 20px oklch(56% 0.20 265 / .12);
    transform: translateY(-2px);
}

.prestador-card.highlight {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px oklch(56% 0.20 265 / .12);
}

.pcard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}

.pcard-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pcard-body { flex: 1; min-width: 0; }

.pcard-header {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.pcard-nombre { font-size: 14px; font-weight: 700; color: var(--color-text); }

.badge-verificado-mini {
    font-size: 10px;
    font-weight: 700;
    background: oklch(94% 0.05 150);
    color: oklch(36% 0.14 150);
    padding: 2px 7px;
    border-radius: 10px;
    border: 1px solid oklch(86% 0.08 150);
    white-space: nowrap;
}

.pcard-stars {
    display: flex;
    align-items: center;
    gap: 1px;
    margin-bottom: 5px;
}

.pcard-stars .star { color: #f59e0b; font-size: 12px; }
.pcard-stars .star.empty { color: var(--color-border-strong); }
.pcard-rating-num { font-size: 12px; font-weight: 700; margin-left: 4px; }
.pcard-trabajos   { font-size: 11px; color: var(--color-text-muted); margin-left: 2px; }

.pcard-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }

.pcard-cat {
    font-size: 11px;
    background: var(--color-accent-light);
    color: var(--color-accent);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.pcard-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 12px;
    color: var(--color-text-muted);
}

.pcard-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }

/* ============================================================
   PINES DEL MAPA
   ============================================================ */
.pin-prestador {
    width: 30px;
    height: 30px;
    background: var(--color-accent);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.25);
    cursor: pointer;
    transition: transform .1s;
}

.pin-prestador:hover { transform: scale(1.1); }
.pin-prestador.verificado { background: var(--color-success); }

.pin-usuario {
    width: 32px;
    height: 32px;
    background: var(--color-sidebar-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,.3);
}

/* ============================================================
   CALENDAR
   ============================================================ */
.cal-dias-semana {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 8px;
    letter-spacing: .3px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-dia {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .12s;
    position: relative;
    padding: 4px 2px;
    min-height: 42px;
}

.cal-dia:hover         { background: var(--color-accent-light); }
.cal-dia.vacio         { cursor: default; }
.cal-dia.vacio:hover   { background: none; }
.cal-dia.hoy .cal-num  { background: var(--color-accent); color: #fff; border-radius: 50%; width: 23px; height: 23px; display: flex; align-items: center; justify-content: center; }
.cal-dia.seleccionado  { background: var(--color-accent-light); outline: 2px solid var(--color-accent); }
.cal-dia.con-turnos    { font-weight: 600; }

.cal-num { font-size: 13px; line-height: 1; color: var(--color-text); }

.cal-puntos { display: flex; gap: 2px; margin-top: 3px; justify-content: center; }
.cal-punto  { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }

/* ============================================================
   TURNO CARD
   ============================================================ */
.turno-card {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
    transition: box-shadow .2s, transform .2s;
}

.turno-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.turno-estado-bar { width: 4px; flex-shrink: 0; }
.turno-body       { padding: 12px 15px; flex: 1; }

.turno-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.turno-hora    { font-size: 11px; font-weight: 700; color: var(--color-text-muted); }
.turno-nombre  { font-size: 13.5px; font-weight: 700; margin-bottom: 3px; }
.turno-desc    { font-size: 12.5px; color: var(--color-text-muted); margin-bottom: 4px; }
.turno-meta    { display: flex; gap: 12px; font-size: 11px; color: var(--color-text-muted); flex-wrap: wrap; }
.turno-acciones{ display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; }

/* ============================================================
   BANNER TURNO (chat)
   ============================================================ */
.banner-turno {
    padding: 9px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
    font-weight: 500;
}

.banner-turno-agendado   { background: oklch(96% 0.03 240); color: oklch(36% 0.15 240); }
.banner-turno-en_curso   { background: oklch(97% 0.04 80);  color: oklch(38% 0.14 68); }
.banner-turno-completado { background: oklch(96% 0.04 155); color: oklch(34% 0.14 155); }
.banner-turno-disputa    { background: oklch(96% 0.04 20);  color: oklch(36% 0.16 20); }

/* ============================================================
   ACUERDO CARD
   ============================================================ */
.acuerdo-card {
    margin: 8px auto;
    max-width: 400px;
    border: 1.5px solid var(--color-accent);
    border-radius: 10px;
    overflow: hidden;
    font-size: 13px;
    box-shadow: 0 4px 16px oklch(56% 0.20 265 / .12);
}

.acuerdo-card-header {
    background: var(--color-accent);
    color: #fff;
    padding: 10px 15px;
    font-weight: 700;
    font-size: 13px;
}

.acuerdo-card-body   { padding: 12px 15px; background: oklch(98% 0.012 265); }
.acuerdo-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 12.5px;
}
.acuerdo-row:last-child { border-bottom: none; }
.acuerdo-row span:first-child { color: var(--color-text-muted); white-space: nowrap; }
.acuerdo-row span:last-child  { font-weight: 600; text-align: right; }
.acuerdo-card-footer { padding: 6px 15px; background: var(--color-accent-light); font-size: 11px; color: var(--color-text-muted); text-align: right; }

/* ============================================================
   MÉTODO PAGO
   ============================================================ */
.metodo-pago-opt {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 13px 8px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all .15s;
    text-align: center;
    user-select: none;
    background: var(--color-surface);
}

.metodo-pago-opt:hover    { border-color: var(--color-accent); background: var(--color-accent-light); }
.metodo-pago-opt.selected { border-color: var(--color-accent); background: var(--color-accent-light); box-shadow: 0 0 0 3px oklch(56% 0.20 265 / .1); }
.metodo-pago-icon  { font-size: 22px; }
.metodo-pago-label { font-size: 13px; font-weight: 700; }
.metodo-pago-sub   { font-size: 11px; color: var(--color-text-muted); }

/* ============================================================
   SELECTOR DE ESTRELLAS
   ============================================================ */
.star-selector { display: flex; justify-content: center; gap: 6px; margin: 10px 0; }

.star-btn {
    background: none;
    border: none;
    font-size: 32px;
    cursor: pointer;
    color: var(--color-border-strong);
    transition: color .1s, transform .1s;
    line-height: 1;
    padding: 0;
}

.star-btn:hover,
.star-btn.activa { color: #f59e0b; transform: scale(1.15); }

/* ============================================================
   DASHBOARD TURNO ROW
   ============================================================ */
.dashboard-turno-row {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--color-border);
    cursor: pointer;
    transition: background .12s;
}

.dashboard-turno-row:last-child { border-bottom: none; }
.dashboard-turno-row:hover      { background: var(--color-bg); }

.dashboard-turno-fecha {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
    gap: 1px;
}

.dashboard-turno-dia  { font-size: 9.5px; text-transform: uppercase; color: var(--color-text-muted); letter-spacing: .3px; }
.dashboard-turno-num  { font-size: 21px; font-weight: 800; line-height: 1; letter-spacing: -1px; }
.dashboard-turno-hora { font-size: 10px; color: var(--color-text-muted); }

.dashboard-turno-bar  { width: 3px; min-height: 42px; border-radius: 2px; flex-shrink: 0; }

.dashboard-turno-body { flex: 1; min-width: 0; }
.dashboard-turno-nombre { font-size: 13.5px; font-weight: 700; }
.dashboard-turno-desc   { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.dashboard-turno-accion { flex-shrink: 0; }

/* ============================================================
   SOLICITUD CARD
   ============================================================ */
.solicitud-card {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    transition: background .1s;
}

.solicitud-card:last-child { border-bottom: none; }
.solicitud-card:hover      { background: var(--color-bg); }

.solicitud-card-bar   { width: 4px; flex-shrink: 0; }
.solicitud-card-body  { flex: 1; padding: 14px 17px; }

.solicitud-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 5px;
}

.solicitud-card-prestador { font-size: 14px; font-weight: 700; display: block; }
.solicitud-card-fecha     { font-size: 11px; color: var(--color-text-muted); margin-left: 4px; }
.solicitud-card-desc      { font-size: 13px; margin-bottom: 4px; line-height: 1.4; }
.solicitud-card-dir       { font-size: 12px; color: var(--color-text-muted); margin-bottom: 4px; }
.solicitud-card-acciones  { display: flex; gap: 8px; margin-top: 11px; flex-wrap: wrap; align-items: center; }

/* ============================================================
   BANNER ESTADO PERFIL
   ============================================================ */
.perfil-banner {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 13px;
    border: 1px solid transparent;
    font-weight: 500;
}

.perfil-banner-icon { font-size: 17px; flex-shrink: 0; }

.banner-verificado  { background: oklch(94% 0.05 150); color: oklch(32% 0.14 155); border-color: oklch(86% 0.08 155); }
.banner-pendiente   { background: oklch(96% 0.05 80);  color: oklch(36% 0.12 68);  border-color: oklch(88% 0.08 75); }
.banner-info        { background: oklch(96% 0.05 80);  color: oklch(36% 0.12 68);  border-color: oklch(88% 0.08 75); }
.banner-rechazado   { background: oklch(96% 0.04 20);  color: oklch(36% 0.16 20);  border-color: oklch(88% 0.07 20); }

/* ============================================================
   NAV BADGE
   ============================================================ */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    padding: 0 4px;
    margin-left: auto;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 0 oklch(56% 0.20 20 / .4); }
    50% { box-shadow: 0 0 0 4px oklch(56% 0.20 20 / 0); }
}

/* ============================================================
   LUCIDE ICONS
   ============================================================ */
.btn i[data-lucide], .btn svg { width: 15px; height: 15px; }
.btn-sm i[data-lucide], .btn-sm svg { width: 13px; height: 13px; }
.sidebar-nav .nav-icon svg,
.sidebar-nav .nav-icon i[data-lucide] { width: 17px; height: 17px; stroke-width: 1.8px; }
.stat-card svg { width: 20px; height: 20px; }
.empty-state svg { width: 44px; height: 44px; opacity: .3; }
.chat-back-btn svg,
.chat-back-btn i[data-lucide] { width: 22px; height: 22px; stroke-width: 2.2px; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#cp-toast-container {
    position: fixed;
    bottom: 22px;
    right: 22px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 340px;
    width: calc(100vw - 44px);
}

.cp-toast {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 10px;
    background: oklch(17% 0.02 265);
    color: oklch(90% 0.01 265);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 28px rgba(0,0,0,.22), 0 2px 6px rgba(0,0,0,.12);
    pointer-events: all;
    transform: translateX(110%);
    opacity: 0;
    transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
    border-left: 3px solid transparent;
}

.cp-toast.cp-toast-show { transform: translateX(0); opacity: 1; }

.cp-toast-success { border-color: var(--color-success); }
.cp-toast-success .cp-toast-icon { color: var(--color-success); }
.cp-toast-danger  { border-color: var(--color-danger); }
.cp-toast-danger  .cp-toast-icon { color: var(--color-danger); }
.cp-toast-warning { border-color: var(--color-warning); }
.cp-toast-warning .cp-toast-icon { color: var(--color-warning); }
.cp-toast-info    { border-color: var(--color-accent); }
.cp-toast-info    .cp-toast-icon { color: var(--color-accent); }

.cp-toast-icon { flex-shrink: 0; }
.cp-toast-icon svg { width: 17px; height: 17px; }
.cp-toast-msg { flex: 1; line-height: 1.4; }

.cp-toast-close {
    background: none;
    border: none;
    color: oklch(45% 0.015 265);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color .15s;
    line-height: 0;
}
.cp-toast-close:hover { color: oklch(85% 0.01 265); }
.cp-toast-close svg { width: 13px; height: 13px; }

/* ============================================================
   MODALES
   ============================================================ */
.cp-modal-overlay {
    position: fixed;
    inset: 0;
    background: oklch(14% 0.025 265 / .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 8000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity .2s ease;
}

.cp-modal-overlay.cp-modal-show { opacity: 1; }
.cp-modal-overlay.cp-modal-show .cp-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.cp-modal {
    background: var(--color-surface);
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    padding: 26px;
    box-shadow: 0 24px 56px rgba(0,0,0,.18), 0 4px 16px rgba(0,0,0,.08);
    transform: translateY(14px) scale(.97);
    opacity: 0;
    transition: transform .25s cubic-bezier(.34,1.4,.64,1), opacity .2s ease;
}

.cp-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.cp-modal-icon svg { width: 24px; height: 24px; }

.cp-modal-icon-primary  { background: var(--color-accent-light);       color: var(--color-accent); }
.cp-modal-icon-danger   { background: oklch(96% 0.04 20);              color: var(--color-danger); }
.cp-modal-icon-warning  { background: oklch(96% 0.05 80);              color: var(--color-warning); }
.cp-modal-icon-success  { background: oklch(95% 0.05 155);             color: var(--color-success); }

.cp-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
}

.cp-modal-titulo {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: -.3px;
    line-height: 1.2;
}

.cp-modal-x {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 8px;
    margin: -4px;
    border-radius: 6px;
    transition: all .15s;
    flex-shrink: 0;
    line-height: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.cp-modal-x:hover { background: var(--color-bg); color: var(--color-text); }
.cp-modal-x svg { width: 17px; height: 17px; }

.cp-modal-mensaje {
    font-size: 13.5px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.cp-modal-input-wrap { margin-bottom: 20px; }

.cp-modal-input-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.cp-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.input-error { border-color: var(--color-danger) !important; box-shadow: 0 0 0 3px oklch(56% 0.20 20 / .1) !important; }

/* ============================================================
   BOTTOM NAVIGATION (mobile)
   ============================================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: oklch(13% 0.025 265 / .97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,.06);
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-inner {
    display: flex;
    height: 100%;
    align-items: stretch;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: oklch(40% 0.015 265);
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .2px;
    padding: 6px 4px;
    transition: color .15s;
    position: relative;
    border: none;
    background: none;
    cursor: pointer;
}

.bottom-nav-item svg,
.bottom-nav-item i[data-lucide] { width: 21px; height: 21px; stroke-width: 1.7px; transition: transform .2s; }

.bottom-nav-item.active { color: oklch(74% 0.14 265); }
.bottom-nav-item.active svg,
.bottom-nav-item.active i[data-lucide] { stroke-width: 2.2px; transform: translateY(-1px); }
.bottom-nav-item:active svg { transform: scale(.88); }

.bottom-nav-badge {
    position: absolute;
    top: 5px;
    right: calc(50% - 18px);
    background: var(--color-danger);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    min-width: 15px;
    height: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid oklch(13% 0.025 265);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .prestadores-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { display: none; }
    .bottom-nav { display: block; }

    .page-content {
        padding: 14px;
        padding-bottom: calc(64px + 14px + env(safe-area-inset-bottom));
    }

    .topbar { padding: 0 14px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }

    div[style*="grid-template-columns:1fr 280px"],
    div[style*="grid-template-columns:1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }

    .prestadores-grid { grid-template-columns: 1fr; }
    .chat-sidebar { width: 100%; }
    .chat-layout { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }

    /* iOS: font-size < 16px dispara zoom automático al enfocar */
    .form-control { font-size: 16px; min-height: 44px; }

    /* Touch targets mínimos (WCAG 2.5.8 / Apple HIG: 44px) */
    .btn:not(.btn-xs):not(.btn-sm) { min-height: 44px; padding-top: 10px; padding-bottom: 10px; }
    .btn-sm { min-height: 36px; }
    .dia-btn { min-height: 36px; padding: 6px 14px; }

    .turno-acciones .btn { flex: 1; justify-content: center; }
    .prestador-card { padding: 13px; }
    .pcard-actions { flex-direction: row; gap: 7px; }
    .pcard-actions .btn { flex: 1; justify-content: center; }
    .solicitud-card-acciones .btn { flex: 1; justify-content: center; }

    .cp-modal { max-width: 100%; border-radius: 18px 18px 0 0; margin: 0; }
    .cp-modal-overlay { align-items: flex-end; padding: 0; }

    #cp-toast-container { bottom: 74px; right: 10px; left: 10px; width: auto; }
}

@media (max-width: 480px) {
    .auth-box { padding: 28px 20px; border-radius: 14px; }
    .topbar-title { font-size: 14px; }
    .stat-card .stat-value { font-size: 24px; }
}

/* =============================================
   Galería de fotos de trabajos
   ============================================= */
.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.galeria-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-bg);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    border: 1px solid var(--color-border);
}

.galeria-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.1);
}

.galeria-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
}

.galeria-caption {
    padding: 5px 9px;
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(.97); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%       { transform: translateX(-5px); }
    30%       { transform: translateX(5px); }
    45%       { transform: translateX(-4px); }
    60%       { transform: translateX(4px); }
    75%       { transform: translateX(-2px); }
    90%       { transform: translateX(2px); }
}

.page-content { animation: fadeIn .2s ease; }
.card { animation: fadeInUp .28s ease both; }
.stat-card { animation: scaleIn .26s ease both; }

.stat-card:nth-child(1) { animation-delay: .03s; }
.stat-card:nth-child(2) { animation-delay: .06s; }
.stat-card:nth-child(3) { animation-delay: .09s; }
.stat-card:nth-child(4) { animation-delay: .12s; }
.stat-card:nth-child(5) { animation-delay: .15s; }
.stat-card:nth-child(6) { animation-delay: .18s; }

.auth-box { animation: scaleIn .32s cubic-bezier(.34,1.4,.64,1) both; }
.auth-box.shake { animation: shake .42s ease; }

.sidebar-nav a { animation: fadeIn .28s ease both; }
.sidebar-nav a:nth-child(1) { animation-delay: .04s; }
.sidebar-nav a:nth-child(2) { animation-delay: .08s; }
.sidebar-nav a:nth-child(3) { animation-delay: .12s; }
.sidebar-nav a:nth-child(4) { animation-delay: .16s; }
.sidebar-nav a:nth-child(5) { animation-delay: .20s; }

.prestador-card { animation: fadeInUp .26s ease both; }

/* ============================================================
   TOPBAR — indicador de carga
   ============================================================ */
.topbar { position: relative; }

.topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), oklch(62% 0.20 295), var(--color-accent));
    background-size: 200% 100%;
    width: 0;
    transition: width .3s ease, opacity .3s ease;
    opacity: 0;
}

.topbar.loading::after {
    width: 100%;
    opacity: 1;
    animation: topbarLoading 1.4s ease-in-out infinite;
}

@keyframes topbarLoading {
    0%   { background-position: 0% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================
   SKELETON — versión mejorada
   ============================================================ */
.skeleton-line {
    height: 12px;
    border-radius: 5px;
    margin-bottom: 9px;
}

.skeleton-line:last-child { margin-bottom: 0; width: 60%; }
.skeleton-title { height: 18px; border-radius: 5px; margin-bottom: 12px; width: 40%; }
.skeleton-avatar { border-radius: 50%; flex-shrink: 0; }

/* ============================================================
   FOCUS — accesibilidad
   ============================================================ */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================================
   SIDEBAR — transición indicador activo
   ============================================================ */
.sidebar-nav a::before {
    transition: opacity .15s ease, transform .15s ease;
    opacity: 0;
    transform: scaleY(0);
}

.sidebar-nav a.active::before {
    opacity: 1;
    transform: scaleY(1);
}

/* ============================================================
   STAT CARD — decoración
   ============================================================ */
.stat-card::after {
    content: '';
    position: absolute;
    bottom: -18px;
    right: -18px;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: .03;
    transition: opacity .3s, transform .3s;
}

.stat-card:hover::after { opacity: .07; transform: scale(1.15); }

/* ============================================================
   MODAL TÉRMINOS Y CONDICIONES
   ============================================================ */
.terminos-modal { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.65); align-items: center; justify-content: center; padding: 16px; }
.terminos-modal.show { display: flex; }
.terminos-modal-box { background: var(--color-surface); border-radius: 14px; width: 100%; max-width: 700px; height: 85vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.terminos-modal-header { padding: 14px 18px; border-bottom: 1px solid var(--color-border); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; color: var(--color-text); flex-shrink: 0; }
.terminos-modal-close { background: none; border: none; cursor: pointer; font-size: 20px; color: var(--color-text-muted); padding: 2px 8px; border-radius: var(--radius-xs); line-height: 1; }
.terminos-modal-close:hover { background: var(--color-bg); color: var(--color-text); }
.terminos-modal-iframe { flex: 1; border: none; width: 100%; }
