﻿/* ===== Google Fonts ===== */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap");

/* ===== CSS Variables — LJPN Portal Estetica ===== */
:root {
    --primary: #4FA36A;
    --primary-dark: #2F6F3E;
    --primary-rgb: 79, 163, 106;
    --primary-glow: rgba(79, 163, 106, 0.25);
    --gold: #D4AF37;
    --gold-rgb: 212, 175, 55;
    --gold-light: rgba(212, 175, 55, 0.12);
    --mauve: #F2C94C;
    --mauve-light: rgba(242, 201, 76, 0.12);
    --teal: #4FA36A;
    --teal-rgb: 79, 163, 106;
    --teal-light: rgba(79, 163, 106, 0.1);
    --carbon: #1C1C1C;
    --white: #ffffff;
    --bg: #EDECE6;
    --bg-card: #ffffff;
    --bg-card-solid: #ffffff;
    --border: rgba(47, 111, 62, 0.15);
    --border-light: rgba(47, 111, 62, 0.08);
    --text: #1C1C1C;
    --text-secondary: #3A3A3A;
    --text-muted: #3A3A3A;
    --red: #ef4444;
    --red-rgb: 239, 68, 68;
    --green: #4FA36A;
    --green-rgb: 79, 163, 106;
    --success-rgb: 79, 163, 106;
    --accent-rgb: 79, 163, 106;
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-w: 260px;
    --header-h: 64px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(at 0% 0%, rgba(var(--primary-rgb), 0.18) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(var(--gold-rgb), 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(var(--primary-rgb), 0.12) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(var(--teal-rgb), 0.10) 0px, transparent 50%);
    background-color: var(--bg);
    background-attachment: fixed;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* ===== Layout Shell ===== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== Sidebar (Desktop) ===== */
.sidebar {
    width: var(--sidebar-w);
    background:
        linear-gradient(rgba(var(--primary-rgb), 0.88), rgba(var(--teal-rgb), 0.65)),
        url("img/sidebar.png");
    background-size: cover;
    background-position: center;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: var(--transition);
    color: var(--white);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    /* Efecto relieve/sombra */
}

.sidebar-logo {
    padding: 1.75rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-sidebar {
    height: 65px;
    width: auto;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: rgb(255, 255, 255);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.nav-item .material-symbols-outlined {
    font-size: 1.25rem;
}

.sidebar-user {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--mauve));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}

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

.sidebar-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-user-role {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-logout {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    padding: 4px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-logout:hover {
    color: var(--red);
    background: rgba(var(--red-rgb), 0.1);
}

.sidebar-version {
    padding: 0 1.25rem 8px;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.3);
    font-weight: 500;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
}

/* ===== Main Content Area ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: var(--transition);
}

.page-login .main-content {
    margin-left: 0 !important;
}

/* ===== Bottom Nav (Mobile) ===== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding: 6px 0 env(safe-area-inset-bottom, 8px);
}

.bottom-nav-inner {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.bottom-nav .nav-item {
    flex-direction: column;
    font-size: 0.65rem;
    gap: 2px;
    padding: 6px 8px;
}

.bottom-nav .nav-item .material-symbols-outlined {
    font-size: 1.35rem;
}

/* ===== View Containers ===== */
.view {
    padding: 2rem;
    animation: viewFadeIn 0.4s ease;
}

@keyframes viewFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Login View ===== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

/* Elegant background animated blobs */
.login-container::before,
.login-container::after {
    content: "";
    position: absolute;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    opacity: 0.25;
}

.login-container::before {
    background: var(--primary);
    top: -10%;
    left: -10%;
    animation: blob-move-1 25s infinite alternate ease-in-out;
}

.login-container::after {
    background: var(--gold);
    bottom: -10%;
    right: -10%;
    animation: blob-move-2 30s infinite alternate ease-in-out;
}

@keyframes blob-move-1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

@keyframes blob-move-2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-100px, -80px) scale(1.2);
    }
}

.login-card {
    background:
        linear-gradient(rgba(var(--primary-rgb), 0.88), rgba(var(--teal-rgb), 0.65)),
        url("img/sidebar.png");
    background-size: cover;
    background-position: center;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    padding: 3.5rem 3rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
    animation: cardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardEntrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.logo-login {
    height: 80px;
    width: auto;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.login-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.login-divider {
    width: 40px;
    height: 4px;
    background: linear-gradient(to right, var(--primary), var(--gold));
    border-radius: 10px;
    margin: 0 auto 1.5rem;
}

.pin-error {
    background: rgba(var(--red-rgb), 0.08);
    border: 1px solid rgba(var(--red-rgb), 0.2);
    color: var(--red);
    font-size: 0.8rem;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
}

/* ===== Multi-Select Checkbox Dropdown ===== */
.multi-select {
    position: relative;
}

.ms-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--white);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.ms-trigger:hover {
    border-color: var(--primary);
}

.multi-select.open .ms-trigger {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--teal-light);
}

.ms-arrow {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.multi-select.open .ms-arrow {
    transform: rotate(180deg);
}

.ms-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.ms-pills:empty {
    display: none;
}

.ms-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--teal-light);
    color: var(--teal);
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    border: 1px solid rgba(var(--teal-rgb), 0.2);
}

.ms-pill-remove {
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.ms-pill-remove:hover {
    opacity: 1;
}

.ms-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
    padding: 6px 0;
    animation: msDropIn 0.2s ease;
}

.multi-select.open .ms-dropdown {
    display: block;
}

@keyframes msDropIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.15s;
}

.ms-option:hover {
    background: rgba(var(--teal-rgb), 0.06);
}

.ms-option input[type="checkbox"] {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 10px 15px -3px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: var(--white);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary);
}

.btn-danger-outline {
    background: transparent;
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.06);
}

.btn-confirmed {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--green);
    border: 1px solid rgba(var(--success-rgb), 0.25);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

.btn-full {
    width: 100%;
    padding: 14px 20px;
    justify-content: center;
}

.btn-icon {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}

.btn .material-symbols-outlined {
    font-size: 1.1rem;
}

/* ===== Form Inputs ===== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    transition: var(--transition);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* ===== Pre-Pago Checkbox ===== */
.prepago-check-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    user-select: none;
    transition: color 0.2s;
}

.prepago-check-label input[type="checkbox"] {
    display: none;
}

.prepago-check-box {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.prepago-check-box::after {
    content: "✓";
    font-size: 11px;
    font-weight: 700;
    color: var(--white);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s ease;
}

.prepago-check-label input[type="checkbox"]:checked ~ .prepago-check-box {
    background: var(--teal);
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(var(--teal-rgb), 0.2);
}

.prepago-check-label input[type="checkbox"]:checked ~ .prepago-check-box::after {
    opacity: 1;
    transform: scale(1);
}

.prepago-check-label input[type="checkbox"]:checked ~ span:last-child {
    color: var(--teal);
}

.prepago-check-label:hover .prepago-check-box {
    border-color: var(--teal);
}

/* Skin Evaluation Section */
.skin-fields-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0.5rem 0;
    background: rgba(var(--primary-rgb, 180, 136, 100), 0.04);
    animation: slideDown 0.25s ease;
}

.skin-fields-section.hidden {
    display: none;
}

.skin-fields-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Skin Info in Detail Panel */
.dp-skin-section {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 1rem 0;
    background: rgba(var(--primary-rgb, 180, 136, 100), 0.04);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

/* ===== Client Gallery ===== */
.clientes-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - 4rem);
}

.clientes-gallery-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.clientes-toolbar {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.clientes-toolbar .form-input {
    flex: 1;
    min-width: 250px;
    padding: 9px 14px;
    font-size: 0.8rem;
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

.clientes-toolbar .form-select {
    width: auto;
    padding: 9px 14px;
    font-size: 0.8rem;
    background: var(--bg);
    border-color: var(--border);
    color: var(--text);
}

#clientes-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
    padding-right: 4px;
}

.client-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.client-card:hover {
    border-color: var(--primary);
    background: rgba(var(--gold-rgb), 0.04);
    box-shadow: 0 4px 20px rgba(var(--gold-rgb), 0.08);
    transform: translateY(-1px);
}

.client-card.selected {
    border-color: var(--primary);
    background: rgba(var(--gold-rgb), 0.06);
    box-shadow:
        0 0 0 1px var(--primary),
        0 4px 20px rgba(var(--gold-rgb), 0.1);
}

.client-card.inactive {
    opacity: 0.45;
}

.client-card-avatar {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--mauve), var(--teal));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 0.85rem;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(196, 152, 164, 0.25);
}

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

.client-card-info {
    flex: 1;
    min-width: 0;
}

.client-card-id-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.client-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.client-card-phone {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.client-card-id {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.client-card-status {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.client-card-status.active {
    background: rgba(var(--success-rgb), 0.12);
    color: var(--green);
}

.client-card-status.inactive {
    background: rgba(var(--red-rgb), 0.12);
    color: var(--red);
}

.client-card-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.btn-icon-sm {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    color: var(--text-muted);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-next-cita {
    color: var(--teal);
}
.btn-next-cita:hover {
    color: var(--teal);
    background: rgba(var(--teal-rgb), 0.14);
}

.client-card-actions {
    display: flex;
    gap: 2px;
}

.btn-card-edit {
    color: var(--primary);
}
.btn-card-edit:hover {
    color: var(--primary);
    background: rgba(var(--accent-rgb), 0.12);
}

.btn-card-delete {
    color: var(--red);
}
.btn-card-delete:hover {
    color: var(--red);
    background: rgba(var(--red-rgb), 0.12);
}

/* ===== Client Detail Panel ===== */
#cliente-detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
    max-height: calc(100vh - 4rem);
    position: relative;
    display: flex;
    flex-direction: column;
}

#cliente-detail-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.dp-main-content {
    padding: 2rem;
    width: 100%;
}

/* Subtle glow accent on detail panel top */
#cliente-detail-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--mauve),
            var(--gold),
            transparent);
    border-radius: 9999px;
}

.detail-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.detail-header .back-btn {
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}

.detail-avatar {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--mauve));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 auto 1rem;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(196, 152, 164, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.4);
}

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

.detail-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 999px;
}

.badge-active {
    background: rgba(var(--success-rgb), 0.12);
    color: var(--green);
}

.badge-inactive {
    background: rgba(var(--red-rgb), 0.12);
    color: var(--red);
}

.badge-cancelled {
    background: rgba(var(--red-rgb), 0.12);
    color: var(--red);
}

.detail-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.detail-field {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.detail-field:hover {
    background: rgba(var(--gold-rgb), 0.03);
    border-color: rgba(var(--gold-rgb), 0.15);
}

.detail-field .material-symbols-outlined {
    color: var(--gold);
    font-size: 1.15rem;
    margin-top: 2px;
}

.detail-field small {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-field p {
    font-size: 0.85rem;
    color: var(--text);
    margin-top: 2px;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.detail-actions .btn {
    font-size: 0.75rem;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.detail-actions .btn:hover {
    background: var(--bg);
    color: var(--text);
    border-color: var(--primary);
}

.detail-actions .btn-primary {
    background: var(--primary);
    color: var(--carbon);
    border-color: transparent;
    font-weight: 700;
}

/* ===== SECTION DIVIDER ===== */
.section-divider {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}

.section-divider h4 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    font-size: 1.1rem;
}

/* ===== PROGRESS CHART CONTAINER ===== */
.chart-container {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    padding: 1rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    margin-bottom: 2rem;
    overflow: hidden;
}

.section-divider h4 .material-symbols-outlined {
    font-size: 1.1rem;
    color: var(--gold);
}

/* ===== Medidas ===== */
.medidas-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.medida-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-size: 0.8rem;
}

.medida-fecha {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
    min-width: 140px;
}

.medida-values {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    flex: 1;
}

@media (max-width: 900px) {
    .medida-values {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px 8px;
    }
}

@media (max-width: 500px) {
    .medida-values {
        grid-template-columns: repeat(2, 1fr);
    }

    .medida-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.cita-card-detail {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.cita-info-row {
    font-size: 0.8rem;
    padding: 4px 0;
    color: var(--text-secondary);
}

.cita-info-row strong {
    color: var(--text);
}

/* ===== Detail Panel Redesign (dp-) ===== */
.dp-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

.dp-back {
    flex-shrink: 0;
}

.dp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

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

.dp-avatar span {
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
}

.dp-header-text {
    flex: 1;
    min-width: 0;
}

.dp-header-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.dp-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.dp-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.dp-btn-sm {
    font-size: 0.75rem !important;
    padding: 8px 14px !important;
    gap: 5px !important;
}

.dp-btn-sm .material-symbols-outlined {
    font-size: 1rem;
}

.dp-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.dp-client-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.dp-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.dp-info-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    background: var(--white);
    transition: var(--transition);
}

.dp-info-card:hover {
    border-color: var(--gold);
    box-shadow: 0 2px 8px rgba(var(--gold-rgb), 0.05);
}

.dp-info-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.dp-info-label .material-symbols-outlined {
    font-size: 0.85rem;
    color: var(--gold);
}

.dp-info-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    word-break: break-word;
}

/* Footer Links */
.dp-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px 0 8px;
    border-top: 1px solid var(--border-light);
    margin-top: 24px;
}

.dp-footer-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.dp-footer-link:hover {
    color: var(--gold);
}

.dp-footer-link .material-symbols-outlined {
    font-size: 0.9rem;
}

.dp-footer-danger {
    color: var(--red) !important;
    opacity: 0.7;
}

.dp-footer-danger:hover {
    opacity: 1;
}

.dp-footer-dot {
    color: var(--text-muted);
    opacity: 0.3;
    font-size: 0.7rem;
}

/* ===== Cita del Día (cd-) ===== */
.cita-dia-section {
    margin-top: 4px;
    margin-bottom: 24px;
}

.cita-dia-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 12px 0;
    border-bottom: 2px solid var(--gold);
    margin-bottom: 16px;
}

.cita-dia-header h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.cita-dia-icon {
    color: var(--gold);
    font-size: 1.3rem;
}

.cita-dia-badges {
    display: flex;
    gap: 8px;
}

.cd-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.cd-edit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.cd-edit-toggle .material-symbols-outlined {
    font-size: 1rem;
}

.cita-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 4px 12px;
    border-radius: 999px;
}

.cita-badge-pendiente {
    background: rgba(var(--gold-rgb), 0.12);
    color: var(--gold);
    border: 1px solid rgba(var(--gold-rgb), 0.3);
}

.cita-badge-finalizado {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--green);
    border: 1px solid rgba(var(--success-rgb), 0.25);
}

.cita-badge-cancelado {
    background: rgba(var(--red-rgb), 0.1);
    color: var(--red);
    border: 1px solid rgba(var(--red-rgb), 0.25);
}

.cita-badge-pagado {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--green);
    border: 1px solid rgba(var(--success-rgb), 0.25);
}

.cita-badge-no-pagado {
    background: rgba(var(--red-rgb), 0.08);
    color: var(--red);
    border: 1px solid rgba(var(--red-rgb), 0.2);
}

.cita-badge-prepago {
    background: rgba(var(--accent-rgb), 0.09);
    color: var(--primary);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Top row: Hora | Tratamientos | Monto */
.cd-grid-top {
    display: grid;
    grid-template-columns: 1.2fr 1.5fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* Bottom row: Personal | Oficina | Confirmación */
.cd-grid-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 0;
}

.cd-cell {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    background: var(--white);
    transition: var(--transition);
}

.cd-cell:hover {
    border-color: rgba(0, 0, 0, 0.1);
}

.cd-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.cd-label .material-symbols-outlined {
    font-size: 0.85rem;
    color: var(--gold);
}

.cd-cell-val {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.cd-muted {
    color: var(--text-muted) !important;
    font-style: italic;
}

/* Hora Cell — gold accent border */
.cd-hora-cell {
    border-left: 3px solid var(--gold);
    background: linear-gradient(135deg, rgba(var(--gold-rgb), 0.04), transparent);
    align-self: center;
}

.cd-hora-cell .cd-label {
    color: var(--gold);
}

.cd-hora-val {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

/* Treatment pills */
.cd-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 12px 16px;
    margin-top: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}

.cd-pill {
    display: flex;
    align-items: center;
    white-space: normal;
}

.cd-bullet {
    height: 14px;
    width: auto;
    margin: 0 6px;
    vertical-align: text-bottom;
}

/* Monto Cell */
.cd-monto-cell {
    align-self: center;
}

.cd-monto-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.cd-empty-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.cd-edit-panel {
    margin-top: 16px;
    padding: 18px;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.94),
            rgba(255, 255, 255, 0.72));
    border: 1px solid var(--border-light);
    border-radius: 20px;
    box-shadow: 0 10px 28px -18px rgba(0, 0, 0, 0.12);
}

.cd-edit-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.cd-edit-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.cd-edit-subtitle {
    margin: 4px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-muted);
}

.cd-edit-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.cd-edit-grid .form-group {
    margin: 0;
}

.cd-edit-grid .form-label {
    margin-bottom: 8px;
}

.cd-edit-grid .ms-trigger {
    min-height: 52px;
}

.cd-monto-input {
    min-height: 52px;
    font-size: 1rem;
    font-weight: 700;
}

.cd-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.cd-payment-editor {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(160px, 0.8fr);
    gap: 12px;
    align-items: stretch;
}

.cd-pago-edit-input {
    min-height: 54px;
    font-size: 1rem;
    font-weight: 700;
}

.cd-payment-edit-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.cd-payment-edit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

/* Actions Row - Premium Glassmorphism */
.cd-actions {
    display: flex;
    align-items: stretch;
    gap: 16px;
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(145deg,
            rgba(255, 255, 255, 0.9),
            rgba(255, 255, 255, 0.4));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    box-shadow:
        0 10px 30px -10px rgba(0, 0, 0, 0.08),
        inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.btn-cita-finalizar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow:
        0 4px 15px var(--primary-glow),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.btn-cita-finalizar:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px var(--primary-glow),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    filter: brightness(1.05) saturate(1.1);
}

/* Custom Select for Payment - Premium */
.cd-pago-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.cd-pago-custom {
    padding: 14px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    background: var(--white);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    user-select: none;
    height: 100%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

.cd-pago-custom:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 6px 12px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.cd-pago-custom::after {
    content: "\e5cf";
    font-family: "Material Symbols Outlined";
    margin-left: auto;
    font-size: 1.25rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.cd-pago-options {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.cd-pago-options.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
    animation: slideUpFade 0.3s forwards;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cd-pago-option {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.cd-pago-option:hover {
    background: rgba(0, 0, 0, 0.03);
    padding-left: 24px;
    /* Subtle indent effect on hover */
}

.cd-pago-option img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.cd-pago-select {
    display: none;
}

.btn-cita-pagar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow:
        0 4px 15px var(--primary-glow),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.btn-cita-pagar:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px var(--primary-glow),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    filter: brightness(1.05) saturate(1.1);
}

.btn-cita-cancelar {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(var(--red-rgb), 0.24);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(254, 226, 226, 0.95), rgba(254, 242, 242, 0.98));
    color: #b91c1c;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 6px 18px rgba(var(--red-rgb), 0.08);
}

.btn-cita-cancelar:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--red-rgb), 0.35);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.12);
}

.btn-cita-cancelar:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.cita-dia-done {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--green);
    background: rgba(var(--success-rgb), 0.06);
    border: 1px solid rgba(var(--success-rgb), 0.2);
    border-radius: var(--radius-sm);
}

.cita-dia-done-pago {
    color: var(--teal);
    background: rgba(var(--teal-rgb), 0.06);
    border-color: rgba(var(--teal-rgb), 0.2);
}

.cita-dia-done-cancel {
    color: var(--red);
    background: rgba(var(--red-rgb), 0.06);
    border-color: rgba(var(--red-rgb), 0.2);
}

.cd-pagado-icon {
    height: 18px;
    width: auto;
    object-fit: contain;
    margin-right: 6px;
}

.cita-dia-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.cita-dia-empty .material-symbols-outlined {
    font-size: 2rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-bottom: 8px;
}

.cita-dia-empty p {
    margin: 0;
    font-size: 0.85rem;
}

@media (max-width: 1100px) {
    .cd-edit-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
    .dp-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dp-header-actions {
        display: none;
    }

    .cd-grid-top,
    .cd-grid-bottom {
        grid-template-columns: 1fr;
    }

    .cd-actions {
        flex-direction: column;
    }

    .cd-edit-grid {
        grid-template-columns: 1fr;
    }

    .cd-edit-actions {
        flex-direction: column;
    }

    .cd-payment-editor {
        grid-template-columns: 1fr;
    }

    .cd-payment-edit-actions {
        flex-direction: column;
    }

    .cita-dia-header {
        flex-wrap: wrap;
    }

    .cd-header-actions {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }
}

/* ===== Calendar (Premium Redesign) ===== */
#view-calendario {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.cal-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05);
}

#cal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#cal-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    min-width: 250px;
    text-align: center;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#cal-header .btn-icon {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    color: var(--teal);
    transition: all 0.3s ease;
}

#cal-header .btn-icon:hover {
    background: var(--teal);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(var(--teal-rgb), 0.3);
}

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

.cal-weekday {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 0;
    opacity: 0.8;
}

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

.cal-day {
    background: var(--white);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 110px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.cal-day::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.8),
            rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cal-day:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.08);
    border-color: rgba(var(--teal-rgb), 0.3);
    z-index: 2;
}

.cal-day:hover::before {
    opacity: 1;
}

.cal-day.empty {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: default;
}

.cal-day.empty:hover {
    transform: none;
    box-shadow: none;
    z-index: 1;
}

.cal-day.today {
    border: 2px solid var(--teal);
    background: linear-gradient(145deg, var(--white), rgba(var(--teal-rgb), 0.05));
    box-shadow: 0 8px 25px rgba(var(--teal-rgb), 0.15);
}

.cal-day.today .cal-day-num {
    color: var(--white);
    background: var(--teal);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-top: -4px;
    margin-left: -4px;
    box-shadow: 0 4px 10px rgba(var(--teal-rgb), 0.4);
}

.cal-day-num {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: auto;
    position: relative;
    z-index: 1;
}

.cal-counts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    position: relative;
    z-index: 1;
}

.cal-count {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.cal-count::before {
    content: attr(data-clinic);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    opacity: 0.7;
}

.cal-count.carolina {
    background: rgba(104, 176, 174, 0.12);
    color: var(--teal);
    border: 1px solid rgba(var(--teal-rgb), 0.2);
}

.cal-count.caguas {
    background: rgba(196, 152, 164, 0.12);
    /* Usando Mauve para diferenciar */
    color: var(--mauve);
    border: 1px solid rgba(196, 152, 164, 0.2);
}

.cal-day:hover .cal-count.carolina {
    background: rgba(104, 176, 174, 0.25);
    transform: scale(1.02);
}

.cal-day:hover .cal-count.caguas {
    background: rgba(196, 152, 164, 0.25);
    transform: scale(1.02);
}

/* ===== SMS Sync Badge ===== */
.sms-sync-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: smsBadgePulse 2s ease-in-out infinite;
    z-index: 5;
}

@keyframes smsBadgePulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 16px rgba(239, 68, 68, 0.6);
    }
}

/* ===== Agenda ===== */
.agenda-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.agenda-header h3 {
    flex: 1;
}

#agenda-date-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    text-transform: capitalize;
}

#agenda-date-input {
    display: none;
}

.agenda-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.agenda-filters .form-select {
    padding: 6px 12px;
    font-size: 0.8rem;
    width: auto;
}

.agenda-filters label {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    cursor: pointer;
}

.agenda-filters input[type="checkbox"] {
    accent-color: var(--primary);
}

#agenda-citas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== Agenda Row Cards ===== */
.agenda-row-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
    cursor: default;
}

.agenda-row-card.cancelled {
    opacity: 0.6;
    background: rgba(250, 250, 250, 0.6);
}

.agenda-row-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(var(--teal-rgb), 0.3);
}

.arc-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    flex-shrink: 0;
    color: var(--teal);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding-right: 16px;
}

.arc-time strong {
    font-size: .90rem;
    font-weight: 800;
}

.arc-time small {
    font-size: 0.50rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: -2px;
}

.arc-client {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    flex: 0 1 auto;
}

.arc-client img,
.arc-client .arc-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.arc-client .arc-avatar {
    background: rgba(var(--teal-rgb), 0.15);
    color: var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.arc-client-info {
    display: flex;
    flex-direction: column;
}

.arc-client-info strong {
    font-size: 0.95rem;
    color: var(--dark);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.arc-client-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.arc-client-info span .material-symbols-outlined {
    font-size: 0.9rem;
    color: var(--gold);
}

.arc-details {
    flex: 1;
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr;
    align-items: center;
    gap: 16px;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0 16px;
    min-width: 200px;
}

.arc-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.arc-col-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.arc-service {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 1rem;
    color: var(--teal);
    font-weight: 700;
}

.arc-service .material-symbols-outlined {
    font-size: 1.1rem;
    color: var(--primary);
}

.arc-service-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    align-items: center;
    width: 100%;
}

.arc-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
}

.arc-info .material-symbols-outlined {
    font-size: 1.15rem;
    color: var(--primary-dark);
}

.arc-price {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    justify-content: flex-end;
}

.arc-price .material-symbols-outlined {
    font-size: 1.15rem;
    color: var(--gold);
}

@media (max-width: 1150px) {
    .arc-service-text {
        max-width: 180px;
    }
}

.arc-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    min-width: 180px;
    flex: 0 1 auto;
}

.arc-badges .cita-badge,
.arc-badges span[style*="inline-flex"] {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.arc-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: 140px;
    flex-shrink: 0;
}

.arc-actions .btn-icon-action {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.arc-actions .btn-icon-action:hover {
    background: var(--bg-hover);
    color: var(--dark);
    border-color: rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.arc-actions .btn-icon-action.confirm:hover {
    background: var(--green-light);
    color: var(--green);
    border-color: var(--green);
}

.arc-actions .btn-icon-action.confirm.active {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

.arc-actions .btn-icon-action.cancel:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border-color: var(--red);
}

.arc-actions .btn-icon-action.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border-color: var(--red);
}

/* Disabled state: locked when paid */
.arc-actions .btn-icon-action:disabled {
    opacity: 0.3;
    pointer-events: none;
    cursor: not-allowed;
}

/* Paid card visual indicator */
.agenda-row-card.arc-paid {
    border-left: 3px solid var(--green);
}

.arc-col-price {
    text-align: right;
    align-items: flex-end;
}

.arc-price strong {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
}

@media (max-width: 1150px) {
    .agenda-row-card {
        flex-wrap: wrap;
        gap: 12px;
    }

    .arc-details {
        border: none;
        padding: 0;
        flex-basis: 100%;
        order: 3;
    }

    .arc-badges {
        order: 2;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
        padding-top: 10px;
    }

    .arc-actions {
        order: 4;
        width: 100%;
        justify-content: flex-end;
    }

    .arc-time {
        border: none;
    }
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.25s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(16px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 0;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(var(--red-rgb), 0.1);
    color: var(--red);
    border-color: rgba(var(--red-rgb), 0.2);
}

.modal-body {
    padding: 1.25rem 1.5rem;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 5rem;
    right: 1.5rem;
    z-index: 200;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation:
        toastIn 0.3s ease,
        toastOut 0.3s ease 2.7s forwards;
}

.toast-success {
    background: var(--white);
    color: var(--green);
    border: 1px solid rgba(var(--success-rgb), 0.2);
}

.toast-error {
    background: var(--white);
    color: var(--red);
    border: 1px solid rgba(var(--red-rgb), 0.2);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* ===== Loaders ===== */
.loader-sm {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2rem;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.spinner-sm {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Empty & Error States ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 0.75rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Premium Animated Empty State ===== */
.premium-empty-state {
    position: relative;
    flex: 1;
    min-height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(-45deg,
            var(--bg) 0%,
            #ffffff 30%,
            rgba(196, 152, 164, 0.15) 70%,
            rgba(104, 177, 175, 0.15) 100%);
    background-size: 300% 300%;
    animation: premiumGradientBg 12s ease-in-out infinite;
}

@keyframes premiumGradientBg {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Smoke / blur blobs for organic premium feel */
.premium-empty-state::before,
.premium-empty-state::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    z-index: 0;
    pointer-events: none;
    animation: floatBlobs 12s infinite alternate ease-in-out;
    opacity: 0.8;
}

.premium-empty-state::before {
    width: 300px;
    height: 300px;
    background: rgba(196, 152, 164, 0.25);
    /* Mauve flow */
    top: -50px;
    left: -50px;
    animation-delay: -3s;
}

.premium-empty-state::after {
    width: 280px;
    height: 280px;
    background: rgba(104, 177, 175, 0.2);
    /* Teal flow */
    bottom: -50px;
    right: -50px;
    animation-duration: 15s;
}

@keyframes floatBlobs {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(60px, 40px) scale(1.2);
    }
}

.premium-empty-state>img {
    position: relative;
    z-index: 1;
    max-width: 290px;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    filter: drop-shadow(0 20px 30px rgba(104, 177, 175, 0.12));
    animation: floatPremiumImg 6s ease-in-out infinite;
}

@keyframes floatPremiumImg {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-16px);
    }
}

.premium-empty-state>p {
    position: relative;
    z-index: 1;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.text-error {
    color: var(--red);
    font-size: 0.8rem;
}

/* ===== Confirm Dialog ===== */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.confirm-overlay.hidden {
    display: none !important;
}

.confirm-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

.confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

.confirm-icon .material-symbols-outlined {
    font-size: 32px;
    color: var(--red);
}

.confirm-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem;
}

.confirm-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 1.5rem;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-actions .btn {
    min-width: 120px;
    padding: 10px 20px;
    font-weight: 600;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
}

.btn-danger {
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: #fff;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(248, 113, 113, 0.4);
}

/* ===== Hidden Utility ===== */
.hidden {
    display: none !important;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding-bottom: 80px;
    }

    .bottom-nav {
        display: block;
    }

    .clientes-layout {
        grid-template-columns: 1fr;
    }

    #cliente-detail-panel {
        position: fixed;
        inset: 0;
        z-index: 60;
        display: none;
        border-radius: 0;
        max-height: 100vh;
    }

    #cliente-detail-panel.visible {
        display: flex;
    }

    .detail-header .back-btn {
        display: flex;
    }

    .login-container {
        margin-left: 0;
    }

    .cal-day {
        min-height: 50px;
        padding: 4px;
    }

    .cal-day-num {
        font-size: 0.7rem;
    }

    .cal-count {
        font-size: 0.55rem;
        padding: 1px 4px;
    }
}

@media (max-width: 480px) {
    .view {
        padding: 1rem;
    }

    .agenda-header {
        gap: 0.5rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ===== Asignar Citas ===== */
.asignar-header {
    margin-bottom: 24px;
}

.asignar-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 4px;
    letter-spacing: -0.5px;
}

.asignar-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.asignar-controls {
    margin-bottom: 24px;
}

.asignar-controls-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.asignar-layout {
    display: grid;
    grid-template-columns: minmax(280px, 30%) minmax(320px, 1fr) 240px;
    gap: 20px;
    min-height: 400px;
}

.asignar-gallery-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
    height: calc(100vh - 280px);
    min-height: 400px;
}

.asignar-gallery-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    background: var(--white);
}

.asignar-gallery-header h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
}

.asignar-count {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(var(--gold-rgb), 0.15);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 999px;
}

.asignar-count-green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
}

.asignar-gallery {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg);
}

.asignar-card {
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 16px;
    background: var(--white);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.asignar-card:hover {
    border-color: var(--gold);
    box-shadow: 0 8px 16px rgba(var(--gold-rgb), 0.08);
    transform: translateY(-2px);
}

.asignar-card.selected {
    border-color: var(--primary);
    background: #f0fdfa;
    /* Light teal bg */
    box-shadow:
        0 0 0 2px rgba(45, 212, 191, 0.3),
        0 8px 16px rgba(45, 212, 191, 0.1);
}

.asignar-card-assigned {
    cursor: default;
    border-left: 4px solid var(--primary);
}

.asignar-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.asignar-card-hora {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(var(--gold-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.asignar-card-clinica {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.asignar-card-personal-badge {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--green);
    background: rgba(var(--success-rgb), 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.asignar-card-nombre {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.asignar-card-detail-row {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 3px 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.asignar-detail-label {
    font-weight: 500;
    color: var(--text-muted);
    min-width: 85px;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}

.asignar-detail-value {
    font-weight: 600;
    color: var(--text);
}

.asignar-card-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
}

.asignar-card-costo {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.asignar-card-metodo {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ═══ Premium Assigned Cards ═══ */
.asignar-agenda-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.92) 0%,
            rgba(248, 250, 252, 0.88) 100%);
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-left: 3.5px solid var(--teal);
    border-radius: 14px;
    padding: 14px 16px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: stretch;
    flex-shrink: 0;
    gap: 14px;
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.03),
        0 1px 3px rgba(0, 0, 0, 0.02),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.asignar-agenda-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(104, 176, 174, 0.25),
            transparent);
}

.asignar-agenda-card:hover {
    transform: translateY(-3px);
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.06),
        0 4px 12px rgba(104, 176, 174, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    border-color: rgba(var(--teal-rgb), 0.3);
    border-left-color: var(--teal);
}

/* ─ Time column ─ */
.aac-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding-right: 14px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    position: relative;
}

.aac-time strong {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--teal);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.aac-time small {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1px;
}

/* ─ Main content ─ */
.aac-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    gap: 12px;
}

.aac-client-col {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.aac-service-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 100%;
    border-left: none;
    padding-left: 0;
}

.aac-service-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.aac-person-badge {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--white);
    background: linear-gradient(135deg, var(--teal) 0%, #3db8a6 100%);
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(104, 176, 174, 0.25);
}

/* ─ Right column ─ */
.aac-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    min-width: 75px;
    padding-left: 10px;
    border-left: 1px solid rgba(0, 0, 0, 0.04);
}

.aac-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.5px;
}

.aac-right .btn-icon-action {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.aac-right .btn-icon-action:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
    transform: scale(1.08);
}

.asignar-btn-borrar {
    margin-left: auto;
    color: var(--red) !important;
    border-color: rgba(248, 113, 113, 0.3) !important;
    font-size: 0.65rem !important;
    padding: 4px 10px !important;
}

.asignar-btn-borrar:hover {
    background: rgba(var(--red-rgb), 0.08) !important;
    border-color: var(--red) !important;
}

/* Revenue Summary Panel */
.asignar-summary-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
}

.asignar-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}

.asignar-summary-header h4 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.asignar-summary-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 16px;
}

.summary-metric {
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.summary-metric-historic {
    background: rgba(var(--gold-rgb), 0.04);
    border-color: rgba(255, 191, 0, 0.2);
}

.summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-metric-historic .summary-label {
    color: var(--gold);
}

.summary-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.summary-metric-historic .summary-value {
    color: var(--primary);
}

@media (max-width: 1150px) {
    .asignar-layout {
        grid-template-columns: 1fr 1fr;
    }

    .asignar-summary-panel {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .asignar-layout {
        grid-template-columns: 1fr;
    }

    .asignar-summary-panel {
        grid-column: span 1;
    }

    .asignar-gallery {
        max-height: 50vh;
    }
}

/* ===== Inventario Module — Professional Redesign ===== */

/* Header */
.inv-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.inv-header-left h2 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--carbon) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    margin: 0;
}

.inv-header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.inv-header-right {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Premium Toggle Switch */
.inv-toggle-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.7);
    padding: 6px 14px 6px 6px;
    border-radius: 30px;
    border: 1px solid rgba(var(--teal-rgb), 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    backdrop-filter: blur(8px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-toggle-switch:hover {
    background: var(--white);
    box-shadow: 0 4px 12px rgba(104, 176, 174, 0.08);
    transform: translateY(-1px);
}

.inv-toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.inv-toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.inv-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-toggle-switch input:checked+.inv-toggle-slider {
    background: linear-gradient(135deg, var(--primary) 0%, #3db8a6 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.inv-toggle-switch input:checked+.inv-toggle-slider::after {
    transform: translateX(20px);
}

.inv-toggle-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.3s;
}

.inv-toggle-switch input:checked~.inv-toggle-label {
    color: var(--primary);
}

/* Premium Search Box */
.inv-search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 30px;
    padding: 0 16px;
    height: 38px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-search-box:focus-within {
    border-color: rgba(var(--teal-rgb), 0.4);
    box-shadow: 0 4px 14px rgba(104, 176, 174, 0.12),
        0 0 0 3px rgba(104, 176, 174, 0.1);
    transform: translateY(-1px);
}

.inv-search-icon {
    font-size: 1.15rem;
    color: #94a3b8;
    margin-right: 8px;
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-search-box:focus-within .inv-search-icon {
    color: var(--primary);
}

.inv-search-input {
    border: none;
    outline: none;
    background: transparent;
    width: 100%;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--carbon);
    font-family: inherit;
}

.inv-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Premium Header Button */
.inv-header-btn {
    border-radius: 30px;
    padding: 0 20px;
    height: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    background: linear-gradient(135deg, var(--primary) 0%, #3db8a6 100%);
    box-shadow: 0 4px 12px rgba(104, 176, 174, 0.25);
    border: none;
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(104, 176, 174, 0.35);
    background: linear-gradient(135deg, #3db8a6 0%, var(--primary) 100%);
}

.inv-header-btn .material-symbols-outlined {
    font-size: 1.1rem;
}

/* KPI Strip */
.inv-kpi-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.inv-kpi-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.inv-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.inv-kpi-icon {
    font-size: 1.6rem;
    background: rgba(104, 176, 174, 0.1);
    padding: 10px;
    border-radius: 12px;
    line-height: 1;
}

.inv-kpi-card:nth-child(2) .inv-kpi-icon {
    background: rgba(99, 102, 241, 0.1);
}

.inv-kpi-card:nth-child(3) .inv-kpi-icon {
    background: rgba(245, 158, 11, 0.1);
}

.inv-kpi-card.inv-kpi-alert .inv-kpi-icon {
    background: rgba(239, 68, 68, 0.1);
}

.inv-kpi-info {
    display: flex;
    flex-direction: column;
}

.inv-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--carbon);
    line-height: 1.2;
}

.inv-kpi-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Product Grid */
.inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    align-items: start;
    padding: 10px 0;
}

/* Product Cards */
.inventario-card-premium {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.inventario-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(var(--teal-rgb), 0.3);
}

/* Image Wrapper */
.inv-img-wrapper {
    height: 180px;
    background: #ffffff;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-bottom: 1px solid var(--border-light);
}

.inv-img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.03), transparent);
    pointer-events: none;
    z-index: 1;
}

.inv-img-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.inventario-card-premium:hover .inv-img-wrapper img {
    transform: scale(1.06);
}

/* Action Overlay */
.inv-actions-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 2;
}

.inventario-card-premium:hover .inv-actions-overlay {
    opacity: 1;
    transform: translateY(0);
}

.inv-btn-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.inv-btn-icon .material-symbols-outlined {
    font-size: 1rem;
}

.inv-btn-icon:hover {
    background: var(--white);
    transform: scale(1.1);
}

.inv-btn-icon.edit-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.inv-btn-icon.delete-btn:hover {
    color: var(--red);
    border-color: var(--red);
}

/* Card Content */
.inv-card-content {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.inv-title {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--carbon);
    line-height: 1.3;
}

.inv-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 16px 0;
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stock Grid */
.inv-stock-grid {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.stock-badge {
    flex: 1;
    background: var(--bg);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.stock-badge:hover {
    background: rgba(var(--teal-rgb), 0.06);
    border-color: rgba(var(--teal-rgb), 0.2);
}

.stock-badge.low-stock {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.15);
}

.stock-badge.low-stock:hover {
    background: rgba(var(--red-rgb), 0.08);
}

.stock-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.stock-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}

.stock-badge.low-stock .stock-value {
    color: var(--red);
}

/* Low Stock Warning Pill */
.inv-low-stock-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--red);
    background: rgba(var(--red-rgb), 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 20px;
    padding: 3px 10px;
    margin-bottom: 12px;
}

.inv-low-stock-pill .material-symbols-outlined {
    font-size: 0.8rem;
}

/* Adjust Stock Button */
.btn-inventario-ajustar {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(104, 176, 174, 0.08), rgba(104, 176, 174, 0.02));
    border: 1px solid rgba(var(--teal-rgb), 0.2);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-inventario-ajustar:hover {
    background: linear-gradient(135deg, rgba(var(--teal-rgb), 0.15), rgba(104, 176, 174, 0.08));
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(var(--teal-rgb), 0.15);
}

.btn-inventario-ajustar .material-symbols-outlined {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn-inventario-ajustar:hover .material-symbols-outlined {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .inv-header {
        flex-direction: column;
    }

    .inv-header-right {
        width: 100%;
        justify-content: flex-start;
    }

    .inv-kpi-strip {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .inv-kpi-strip {
        grid-template-columns: 1fr;
    }

    .inv-grid {
        grid-template-columns: 1fr;
    }
}


/* ===== Contabilidad Module ===== */
.premium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.conta-kpi-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.conta-kpi-card.glass {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.conta-kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conta-kpi-icon .material-symbols-outlined {
    font-size: 28px;
}

.conta-kpi-content {
    flex: 1;
}

.conta-kpi-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.conta-kpi-value {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    color: var(--dark);
}

.conta-tabs-header {
    background: #fcfcfc;
}

.conta-tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.conta-tab-btn:hover {
    color: var(--primary);
    background: rgba(104, 117, 175, 0.03);
}

.conta-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: white;
}

/* Contabilidad Tables */
.conta-table-wrapper {
    overflow-x: auto;
}

.conta-table {
    width: 100%;
    border-collapse: collapse;
}

.conta-table th {
    text-align: left;
    padding: 12px 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-light);
    background: #fafafa;
}

.conta-table td {
    padding: 14px 10px;
    font-size: 0.85rem;
    border-bottom: 1px solid #f5f5f5;
    color: var(--text);
}

.conta-table tr:last-child td {
    border-bottom: none;
}

.conta-table tr:hover td {
    background: #fafafa;
}

.pnl-cat-row {
    background: #fdfdfd;
    font-weight: 700;
}

.pnl-sub-row {
    padding-left: 25px !important;
}

.conta-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
}

.badge-ingreso {
    background: #e6f7f1;
    color: #10b981;
}

.badge-gasto {
    background: #fdf2f2;
    color: #ef4444;
}

.badge-pendiente {
    background: #fff9e6;
    color: #f59e0b;
}

@media (max-width: 768px) {
    .conta-kpi-grid {
        grid-template-columns: 1fr 1fr !important;
    }
}

@media (max-width: 480px) {
    .conta-kpi-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===== Dashboard ===== */
.dash-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Greeting & KPIs */
.dash-greeting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    background: linear-gradient(135deg, rgba(104, 176, 174, 0.12), rgba(196, 152, 164, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(16px);
    border-radius: 22px;
    padding: 28px 36px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.dash-greeting-text h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0 0 4px;
}

.dash-greeting-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    font-weight: 500;
}

.dash-name {
    background: linear-gradient(135deg, var(--teal), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dash-kpi-row {
    display: flex;
    gap: 16px;
}

.dash-kpi {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 16px 24px;
    text-align: center;
    min-width: 100px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.dash-kpi:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.dash-kpi-num {
    display: block;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--teal);
    line-height: 1;
}

.dash-kpi-warn .dash-kpi-num {
    color: var(--gold);
}

.dash-kpi-danger .dash-kpi-num {
    color: var(--red);
}

.dash-kpi-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Sections */
.dash-section {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 22px;
    padding: 24px 28px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
}

.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.dash-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dash-section-title .material-symbols-outlined {
    font-size: 1.4rem;
    color: var(--teal);
}

.dash-section-title h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
}

.dash-count {
    background: var(--teal);
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 7px;
}

.dash-count-warn {
    background: var(--gold);
}

.dash-count-danger {
    background: var(--red);
}

.dash-section-link {
    background: none;
    border: none;
    color: var(--teal);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 10px;
}

.dash-section-link:hover {
    background: rgba(104, 176, 174, 0.1);
    transform: translateX(3px);
}

.dash-section-link .material-symbols-outlined {
    font-size: 1rem;
}

/* Empty State */
.dash-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.dash-empty .material-symbols-outlined {
    font-size: 2.5rem;
    opacity: 0.4;
    margin-bottom: 8px;
    display: block;
}

.dash-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* Citas de Hoy Grid */
.dash-citas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}

.dash-cita-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    align-items: stretch;
    gap: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
}

.dash-cita-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    border-color: rgba(var(--teal-rgb), 0.3);
}

.dash-cita-card.cancelled {
    opacity: 0.72;
    border-color: rgba(var(--red-rgb), 0.2);
    background: rgba(255, 250, 250, 0.88);
}

.dash-cita-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    flex-shrink: 0;
    min-width: 90px;
    padding-right: 14px;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.dash-cita-hora {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--teal);
    white-space: nowrap;
}

.dash-cita-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.dash-cita-nombre {
    font-size: 0.92rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 700;
}

.dash-cita-servicio {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.dash-cita-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex-shrink: 0;
    max-width: 130px;
}

.dash-cita-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}

.dash-cita-action {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    border: 1px solid rgba(104, 176, 174, 0.35);
    background: rgba(104, 176, 174, 0.08);
    color: var(--teal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dash-cita-action:hover {
    background: rgba(104, 176, 174, 0.18);
    border-color: var(--teal);
    transform: scale(1.07);
}

.dash-cita-action.cancel {
    border-color: rgba(248, 113, 113, 0.35);
    background: rgba(var(--red-rgb), 0.08);
    color: var(--red);
}

.dash-cita-action.cancel:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: var(--red);
    transform: scale(1.07);
}

.dash-cita-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.dash-cita-clinica {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--teal);
    background: rgba(104, 176, 174, 0.1);
    padding: 3px 8px;
    border-radius: 8px;
    white-space: nowrap;
}

.dash-cita-personal {
    font-size: 0.73rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dash-cita-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.dash-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.dash-badge-ok {
    background: rgba(var(--success-rgb), 0.12);
    color: var(--green);
}

.dash-badge-pend {
    background: rgba(251, 191, 36, 0.12);
    color: var(--gold);
}

.dash-badge-paid {
    background: rgba(var(--success-rgb), 0.1);
    color: var(--green);
}

.dash-badge-cancel {
    background: rgba(var(--red-rgb), 0.12);
    color: var(--red);
}

/* Pendientes de Confirmar */
.dash-pendientes-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-pend-date-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--teal);
    padding: 12px 0 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 6px;
}

.dash-pend-date-label:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.dash-pend-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    transition: all 0.2s ease;
}

.dash-pend-row:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.dash-pend-time {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--teal);
    min-width: 75px;
    white-space: nowrap;
}

.dash-pend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.dash-pend-info strong {
    font-size: 0.88rem;
    color: var(--dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-pend-info span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dash-pend-phone {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 120px;
    text-align: right;
}

.dash-btn-sms {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--teal), #4fa8a6);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(var(--teal-rgb), 0.3);
}

.dash-btn-sms:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(var(--teal-rgb), 0.4);
    filter: brightness(1.05);
}

.dash-btn-sms:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dash-btn-sms .material-symbols-outlined {
    font-size: 1rem;
}

/* Low Stock Inventory */
.dash-inv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.dash-inv-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-left: 3px solid var(--red);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
}

.dash-inv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.dash-inv-card img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.dash-inv-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.dash-inv-info strong {
    font-size: 0.88rem;
    color: var(--dark);
    font-weight: 700;
}

.dash-inv-alert {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--red);
    font-weight: 600;
}

.dash-inv-alert .material-symbols-outlined {
    font-size: 0.9rem;
}

.dash-inv-alert small {
    color: var(--text-muted);
    font-weight: 500;
}

/* Dashboard Responsive */
@media (max-width: 768px) {
    .dash-container {
        padding: 16px;
        gap: 20px;
    }

    .dash-greeting {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 24px;
    }

    .dash-kpi-row {
        width: 100%;
        justify-content: space-between;
    }

    .dash-kpi {
        flex: 1;
        padding: 12px 10px;
        min-width: auto;
    }

    .dash-kpi-num {
        font-size: 1.4rem;
    }

    .dash-citas-grid {
        grid-template-columns: 1fr;
    }

    .dash-pend-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .dash-pend-phone {
        display: none;
    }

    .dash-inv-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================== STAFF VIEWS ===================== */
.mobile-only-staff {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only-nav {
        display: none !important;
    }
}

.staff-view-header {
    margin-bottom: 20px;
}

.staff-view-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    margin: 0;
}

.staff-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
    max-width: 500px;
}

@media (max-width: 768px) {
    .staff-card {
        max-width: none;
    }
}

/* =========================================
   MOBILE RESPONSIVE DESIGN (GLOBAL)
   ========================================= */
@media (max-width: 768px) {

    /* --- Sidebar & Layout --- */
    .sidebar {
        transform: translateX(-100%) !important;
        width: 280px !important;
        /* slightly wider on mobile to fit touch targets */
        z-index: 9999 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.3);
    }

    .sidebar.mobile-open {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: flex !important;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-backdrop.active {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0 !important;
        width: 100vw !important;
        padding-top: 60px !important;
        /* Space for the hamburger button */
    }

    .mobile-only-staff {
        display: flex !important;
    }

    .view {
        padding: 1rem;
        /* Less padding on small screens */
    }

    /* --- Dashboard Mobile Streamlined View --- */
    .dash-greeting,
    .dash-section:not(.dash-section-citas-hoy) {
        display: none !important;
    }

    /* --- Hamburger Button --- */
    .hamburger-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 12px;
        left: 16px;
        z-index: 900;
        width: 44px;
        height: 44px;
        border-radius: 12px;
        background: var(--white);
        border: 1px solid var(--border-light);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        color: var(--primary-dark);
        cursor: pointer;
        transition: var(--transition);
    }

    .hamburger-btn:active {
        transform: scale(0.95);
        background: var(--bg);
    }

    .hamburger-btn .material-symbols-outlined {
        font-size: 1.5rem;
    }

    /* Hide version info on mobile wrapper unless in menu */
    .sidebar-version {
        font-size: 0.75rem;
        padding: 16px;
    }

    .page-login .hamburger-btn {
        display: none;
    }

    /* --- General Touch Improvements --- */
    .btn,
    .nav-item,
    .ms-option,
    .dp-footer-link {
        min-height: 44px;
        /* Minimum touch target iOS */
    }

    /* --- Clientes View --- */
    .clientes-layout {
        grid-template-columns: 1fr;
        /* Stack columns */
        min-height: auto;
    }

    #cliente-detail-panel {
        max-height: none;
    }

    .dp-info-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns instead of 4 */
    }

    /* --- Cita del Día --- */
    .cd-grid-top {
        grid-template-columns: 1fr;
    }

    .cd-grid-bottom {
        grid-template-columns: 1fr;
    }

    .cd-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-cita-finalizar,
    .btn-cita-pagar {
        width: 100%;
        justify-content: center;
    }

    /* --- Agenda Cards --- */
    .agenda-row-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .arc-time {
        width: 100%;
        text-align: left;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        padding-bottom: 8px;
    }

    .arc-details {
        flex-direction: column;
        /* Stack details vertically */
        gap: 8px;
    }

    .arc-badges {
        flex-wrap: wrap;
        /* Ensure badges don't overflow */
    }

    .arc-actions {
        width: 100%;
        justify-content: flex-end;
        border-top: 1px solid rgba(0, 0, 0, 0.06);
        padding-top: 12px;
        margin-top: 8px;
    }

    /* --- Modals & Medidas Form --- */
    .modal {
        max-width: calc(100% - 32px);
        margin: 16px;
    }

    .form-row {
        grid-template-columns: 1fr;
        /* Stack form rows (e.g. Medidas) */
    }
}

/* Hamburger hidden on desktop */
@media (min-width: 769px) {

    .hamburger-btn,
    .sidebar-backdrop {
        display: none !important;
    }
}

/* ===== CLIENT APPOINTMENT POPUP STYLES ===== */
.apt-card {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.apt-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-color: var(--primary-glow);
    transform: translateY(-2px);
}

.apt-info-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.apt-date-box {
    display: flex;
    flex-direction: column;
}

.apt-date {
    font-weight: 700;
    color: var(--carbon);
    font-size: 0.95rem;
}

.apt-time {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

.apt-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.70rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-pendiente { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.status-confirmada { background: #f0fdf4; color: #15803d; border: 1px solid #dcfce7; }
.status-cancelada { background: #fef2f2; color: #b91c1c; border: 1px solid #fee2e2; }

.apt-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background: var(--bg);
    border-radius: 10px;
}

.apt-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.apt-detail-label {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
}

.apt-detail-value {
    font-size: 0.82rem;
    color: #334155;
    font-weight: 500;
}

.apt-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.apt-btn-action {
    flex: 1;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-apt-confirm {
    background: #f0fdf4;
    color: #16a34a;
    border-color: #dcfce7;
}
.btn-apt-confirm:hover { background: #dcfce7; }

.btn-apt-unconfirm {
    background: #fff7ed;
    color: #d97706;
    border-color: #ffedd5;
}
.btn-apt-unconfirm:hover { background: #ffedd5; }

.btn-apt-cancel {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fee2e2;
}
.btn-apt-cancel:hover { background: #fee2e2; }

.btn-apt-edit {
    background: #eff6ff;
    color: #2563eb;
    border-color: #dbeafe;
}
.btn-apt-edit:hover { background: #dbeafe; }

/* ===== AJUSTES ===== */
.ajustes-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ajustes-page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.ajustes-page-header-icon {
    width: 52px;
    height: 52px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ajustes-page-header-icon .material-symbols-outlined {
    font-size: 1.6rem;
    color: var(--primary);
}

.ajustes-page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 3px;
    letter-spacing: -0.3px;
}

.ajustes-page-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Section blocks */
.ajustes-block {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
}

.ajustes-block:last-child { border-bottom: none; }

.ajustes-block-label {
    padding-right: 2rem;
    padding-top: 0.25rem;
}

.ajustes-block-label-icon {
    width: 38px;
    height: 38px;
    background: rgba(var(--primary-rgb), 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.ajustes-block-label-icon .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--primary);
}

.ajustes-block-label h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}

.ajustes-block-label p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.ajustes-block-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

/* Legacy compatibility — redirect old classes */
.ajustes-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Oficinas */
.oficinas-lista {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.oficina-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: border-color 0.15s;
}

.oficina-item:hover { border-color: var(--primary); }

.oficina-item .material-symbols-outlined {
    color: var(--primary);
    font-size: 1rem;
}

.oficina-nombre { flex: 1; font-size: 0.875rem; }

.oficina-add-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.ajustes-input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ajustes-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.btn-primary-sm {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}
.btn-primary-sm:hover { background: var(--primary-dark); }
.btn-primary-sm:active { transform: scale(0.98); }
.btn-primary-sm .material-symbols-outlined { font-size: 0.95rem; }

.btn-icon-sm {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: background 0.15s;
    background: transparent;
    flex-shrink: 0;
}
.btn-icon-sm.danger { color: var(--red); }
.btn-icon-sm.danger:hover { background: rgba(239,68,68,0.1); }
.btn-icon-sm .material-symbols-outlined { font-size: 1rem; }

/* Themes */
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.theme-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.theme-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.theme-card.active {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
    box-shadow: 0 0 0 1px var(--primary), var(--shadow-md);
}

.theme-preview {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-bottom: 2px;
}

.theme-color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.06);
    flex-shrink: 0;
}

.theme-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.theme-nombre {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--text);
}

.theme-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.theme-check {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 1rem;
    color: var(--primary);
    opacity: 0;
    transition: opacity 0.2s;
}
.theme-card.active .theme-check { opacity: 1; }

/* Logo / Favicon */
.logo-favicon-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 900px) {
    .ajustes-block {
        grid-template-columns: 1fr;
    }
    .ajustes-block-label {
        padding-right: 0;
        padding-bottom: 1rem;
    }
}

@media (max-width: 600px) {
    .logo-favicon-grid { grid-template-columns: 1fr; }
    .themes-grid { grid-template-columns: repeat(2, 1fr); }
    .serv-grid { grid-template-columns: 1fr !important; }
}

.logo-upload-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    background: var(--bg);
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-sm);
    transition: border-color 0.2s;
}
.logo-upload-card:hover { border-color: var(--primary); }

.upload-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
}

.logo-preview-box {
    width: 110px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    overflow: hidden;
}
.logo-preview-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.favicon-box { width: 72px; height: 72px; }

.btn-upload {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-upload:hover { background: var(--primary-dark); }
.btn-upload .material-symbols-outlined { font-size: 0.95rem; }

.upload-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

/* ===== SERVICIOS AJUSTES ===== */
.serv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.serv-categoria {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.serv-cat-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(var(--primary-rgb), 0.04);
}

.serv-cat-header .material-symbols-outlined {
    font-size: 1rem;
    color: var(--primary);
}

.serv-cat-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
    flex: 1;
}

.serv-cat-count {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 99px;
    padding: 2px 8px;
}

.serv-lista {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.serv-lista::-webkit-scrollbar { width: 4px; }
.serv-lista::-webkit-scrollbar-track { background: transparent; }
.serv-lista::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }

.serv-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 6px;
    padding: 0.38rem 0.5rem;
    font-size: 0.82rem;
    color: var(--text);
    transition: background 0.12s;
}

.serv-item:hover { background: var(--bg-card); }

.serv-item .material-symbols-outlined:first-child {
    font-size: 0.9rem;
    color: var(--border);
    cursor: grab;
    flex-shrink: 0;
}

.serv-nombre { flex: 1; line-height: 1.3; }

.serv-add-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.6rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.serv-add-row .ajustes-input {
    font-size: 0.8rem;
    padding: 0.45rem 0.7rem;
    background: var(--bg);
}

.serv-add-row .btn-primary-sm {
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
}

/* Custom theme card */
.theme-card-custom .theme-custom-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb), 0.12);
    border-radius: 50%;
}
.theme-card-custom .theme-custom-icon .material-symbols-outlined {
    font-size: 1rem;
    color: var(--primary);
}
.theme-card-custom { border-style: dashed; }
.theme-card-custom:hover { border-style: solid; }
.theme-card-custom.active { border-style: solid; }

/* ===== CUSTOM COLOR EDITOR ===== */
.custom-colors-panel {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.custom-colors-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: rgba(var(--primary-rgb), 0.04);
}

.custom-colors-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.custom-colors-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.btn-reset-colors {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.btn-reset-colors:hover { border-color: var(--primary); color: var(--primary); }
.btn-reset-colors .material-symbols-outlined { font-size: 0.9rem; }

.custom-color-group {
    padding: 0.75rem 1.1rem;
    border-bottom: 1px solid var(--border-light);
}
.custom-color-group:last-child { border-bottom: none; }

.custom-color-group-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
}

.custom-color-fields {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.custom-color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.5rem;
    border-radius: 8px;
    transition: background 0.12s;
}
.custom-color-row:hover { background: var(--bg-card); }

.color-swatch-live {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid rgba(0,0,0,0.1);
    flex-shrink: 0;
    transition: transform 0.15s;
}
.custom-color-row:hover .color-swatch-live { transform: scale(1.08); }

.color-field-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.color-field-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-field-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-picker-input {
    -webkit-appearance: none;
    appearance: none;
    width: 38px;
    height: 38px;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 2px;
    background: var(--bg-card);
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, transform 0.15s;
}
.color-picker-input:hover { border-color: var(--primary); transform: scale(1.05); }
.color-picker-input::-webkit-color-swatch-wrapper { padding: 0; border-radius: 4px; overflow: hidden; }
.color-picker-input::-webkit-color-swatch { border: none; border-radius: 4px; }


