:root {
    --bg: #0b0b0c;
    --bg-soft: #111216;
    --surface: #1a1b1f;
    --surface-2: #202228;
    --surface-3: #262932;
    --border: rgba(212, 175, 55, 0.14);
    --border-strong: rgba(212, 175, 55, 0.34);
    --text: #ffffff;
    --text-muted: #cfcfcf;
    --text-soft: #9d9da2;
    --gold: #d4af37;
    --gold-dark: #a57a03;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
    --radius: 22px;
    --radius-sm: 14px;
    --transition: 0.2s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Manrope', 'Trebuchet MS', sans-serif;
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.12), transparent 28%),
        radial-gradient(circle at top right, rgba(165, 122, 3, 0.1), transparent 24%),
        linear-gradient(180deg, #09090a 0%, #0b0b0c 28%, #101116 100%);
    color: var(--text);
    line-height: 1.5;
}

body::before,
body::after {
    content: '';
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    filter: blur(60px);
    opacity: 0.24;
}

body::before {
    top: 9%;
    left: -120px;
    width: 280px;
    height: 280px;
    background: rgba(212, 175, 55, 0.22);
}

body::after {
    right: -80px;
    bottom: 6%;
    width: 220px;
    height: 220px;
    background: rgba(165, 122, 3, 0.18);
}

body,
input,
select,
button,
textarea {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: rgba(212, 175, 55, 0.35);
    color: var(--text);
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #101115;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.38), rgba(165, 122, 3, 0.56));
    border: 3px solid #101115;
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.58), rgba(165, 122, 3, 0.7));
}

a {
    color: var(--gold);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
}

.container {
    position: relative;
    z-index: 1;
    width: min(1380px, calc(100% - 32px));
    margin: 28px auto 42px;
    display: grid;
    gap: 20px;
}

body.app-authenticated .container {
    grid-template-columns: clamp(230px, 18vw, 270px) minmax(0, 1fr) clamp(280px, 23vw, 340px);
    grid-template-rows: auto auto;
    align-items: start;
}

.card {
    position: relative;
    background: linear-gradient(180deg, rgba(26, 27, 31, 0.98), rgba(18, 19, 23, 0.98));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.brand-header {
    min-height: 0;
    padding: 0;
    border-color: rgba(212, 175, 55, 0.2);
}

body.app-authenticated .brand-header {
    grid-column: 1 / span 2;
    grid-row: 1;
    align-self: stretch;
}

.brand-header-image {
    width: 100%;
    height: auto;
    min-height: 220px;
    max-height: 360px;
    object-fit: cover;
    filter: saturate(0.92) brightness(0.82) contrast(1.02);
}

body.app-authenticated .brand-header-image {
    height: 100%;
    min-height: 220px;
    max-height: 280px;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--gold);
    font-size: 0.78rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    font-weight: 800;
}

.section-kicker::before {
    content: '';
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.9));
}

h1,
h2,
h3,
h4,
h5 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    letter-spacing: 0.01em;
}

p {
    color: var(--text-muted);
}

h1,
h2,
h3,
h4,
h5 {
    color: var(--text);
    font-weight: 700;
}

h1 {
    font-size: clamp(2.4rem, 4.8vw, 3.2rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 2.7rem);
}

h3 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    margin-bottom: 4px;
}

h4 {
    font-size: 1.3rem;
}

#appView {
    display: grid;
    gap: 20px;
}

body.app-authenticated #appView {
    display: contents;
}

.login-card {
    width: min(540px, 100%);
    margin: 0 auto;
    padding: 30px;
    gap: 14px;
}

.login-card h2 {
    margin-top: -4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.94rem;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 14px;
    padding: 13px 14px;
    background: linear-gradient(180deg, rgba(32, 34, 40, 0.96), rgba(22, 24, 29, 0.96));
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}

select {
    color-scheme: dark;
}

select option,
select optgroup {
    color: #0b0b0c;
    background: #ffffff;
}

input::placeholder,
textarea::placeholder {
    color: #7d7f86;
}

input:hover,
select:hover,
textarea:hover {
    border-color: rgba(212, 175, 55, 0.24);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.86);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.12);
}

input[readonly],
input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.68;
    cursor: not-allowed;
    background: linear-gradient(180deg, rgba(26, 27, 31, 0.95), rgba(20, 21, 25, 0.95));
}

fieldset {
    min-width: 0;
}

.btn {
    appearance: none;
    border: 1px solid rgba(212, 175, 55, 0.22);
    border-radius: 14px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #24262d 0%, #181a1f 100%);
    color: var(--text);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition), box-shadow var(--transition);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.5);
    background: linear-gradient(180deg, #2a2d35 0%, #1b1d23 100%);
}

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

.btn.primary {
    color: #0b0b0c;
    background: linear-gradient(180deg, #e5c35d 0%, #d4af37 54%, #b98a12 100%);
    border-color: rgba(212, 175, 55, 0.72);
    box-shadow: 0 16px 30px rgba(165, 122, 3, 0.24);
}

.btn.primary:hover {
    background: linear-gradient(180deg, #cfa637 0%, #a57a03 100%);
    border-color: rgba(212, 175, 55, 0.9);
    color: #070708;
}

.btn.danger {
    background: linear-gradient(180deg, rgba(73, 24, 24, 0.9), rgba(46, 15, 15, 0.92));
    border-color: rgba(176, 74, 74, 0.34);
    color: #f7d7d7;
}

.btn.danger:hover {
    border-color: rgba(200, 103, 103, 0.52);
    background: linear-gradient(180deg, rgba(86, 28, 28, 0.94), rgba(55, 16, 16, 0.96));
}

.topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 24px 28px;
}

body.app-authenticated #appView > .topbar {
    grid-column: 3;
    grid-row: 1;
    align-self: stretch;
    min-height: 220px;
    justify-content: space-between;
}

.topbar-copy {
    display: grid;
    gap: 6px;
}

#sessionInfo {
    color: var(--text-soft);
}

.tabs {
    display: grid;
    gap: 10px;
    padding: 12px;
    background: rgba(18, 19, 24, 0.95);
}

body.app-authenticated #appView > .tabs {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
}

.tab-btn {
    width: 100%;
    min-height: 48px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    box-shadow: none;
    position: relative;
    text-align: left;
}

.tab-btn::after {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 8px;
    height: 2px;
    border-radius: 999px;
    background: transparent;
    transition: background var(--transition), transform var(--transition);
    transform: scaleX(0.45);
}

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

.tab-btn.active {
    background: linear-gradient(180deg, rgba(37, 38, 44, 0.85), rgba(23, 24, 29, 0.95));
    color: var(--text);
    border-color: rgba(212, 175, 55, 0.18);
}

.tab-btn.active::after {
    background: linear-gradient(90deg, rgba(165, 122, 3, 0.3), var(--gold), rgba(165, 122, 3, 0.3));
    transform: scaleX(1);
}

.tab-panel {
    display: grid;
    gap: 22px;
    min-width: 0;
}

body.app-authenticated #appView > .tab-panel {
    grid-column: 2 / span 2;
    grid-row: 2;
}

#appView > .message,
#appView > .loading-overlay {
    grid-column: 1 / -1;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.inline-actions > * {
    flex: 0 0 auto;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.kpi {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    background: linear-gradient(180deg, rgba(29, 30, 35, 0.98), rgba(20, 21, 25, 0.98));
    display: grid;
    gap: 4px;
}

.kpi::before {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.86), transparent);
}

.kpi span {
    color: var(--text-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 800;
}

.kpi strong {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--gold);
    font-size: 2.5rem;
    line-height: 1;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(212, 175, 55, 0.14);
    border-radius: 18px;
    background: rgba(16, 17, 21, 0.92);
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: transparent;
}

thead tr {
    background: linear-gradient(180deg, rgba(32, 34, 40, 0.98), rgba(26, 27, 31, 0.98));
}

th,
td {
    text-align: left;
    vertical-align: top;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

th {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

td {
    color: var(--text);
    font-size: 0.92rem;
}

tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.015);
}

tbody tr:hover td {
    background: rgba(212, 175, 55, 0.06);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.row-actions .btn {
    padding: 9px 12px;
    font-size: 0.78rem;
    border-radius: 12px;
}

.turnos-alert-panel {
    border: 1px solid rgba(212, 175, 55, 0.24);
    background: linear-gradient(135deg, rgba(28, 24, 12, 0.96), rgba(22, 20, 17, 0.98));
    border-radius: 20px;
    padding: 20px;
    display: grid;
    gap: 16px;
}

.turnos-alert-header h4 {
    color: var(--gold);
    margin-bottom: 2px;
}

.turnos-alert-list {
    display: grid;
    gap: 12px;
}

.turno-alert-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    background: rgba(255, 255, 255, 0.03);
    padding: 16px 18px;
}

.turno-alert-copy {
    display: grid;
    gap: 4px;
}

.turno-alert-copy strong {
    color: var(--text);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid transparent;
    white-space: nowrap;
}

.status-pending {
    background: rgba(212, 175, 55, 0.14);
    color: #f0d98b;
    border-color: rgba(212, 175, 55, 0.22);
}

.status-ok {
    background: rgba(212, 175, 55, 0.18);
    color: #f7e3a0;
    border-color: rgba(212, 175, 55, 0.34);
}

.status-lost {
    background: rgba(136, 52, 52, 0.18);
    color: #ffcccc;
    border-color: rgba(163, 67, 67, 0.3);
}

.turno-current td {
    background: rgba(212, 175, 55, 0.08);
}

.hidden-file-input {
    display: none;
}

.foto-upload-group,
.cliente-turno-info,
.clientes-form-panel,
.clientes-right-panel,
.clientes-list-panel,
.clientes-detail-panel,
.report-card {
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    background: linear-gradient(180deg, rgba(31, 33, 39, 0.98), rgba(21, 22, 26, 0.98));
}

.foto-upload-group {
    padding: 16px;
    display: grid;
    gap: 12px;
}

.consultas-resumen-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ia-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    gap: 18px;
}

.ia-photo-panel,
.ia-content-panel {
    display: grid;
    gap: 18px;
}

.ia-photo-preview,
.ia-simulation-preview {
    width: 100%;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.14);
    background: #131418;
}

.ia-photo-preview {
    min-height: 260px;
    max-height: 420px;
    object-fit: cover;
}

.ia-simulation-preview {
    max-height: 680px;
    object-fit: contain;
}

.ia-full-width {
    grid-column: 1 / -1;
}

.ia-result {
    display: grid;
    gap: 18px;
}

.ia-result-summary {
    padding: 20px;
    display: grid;
    gap: 12px;
}

.ia-mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(222, 178, 53, 0.16);
    color: #f4db86;
    border: 1px solid rgba(222, 178, 53, 0.28);
}

.ia-mode-badge-live {
    background: rgba(48, 157, 88, 0.16);
    color: #9aefb7;
    border-color: rgba(48, 157, 88, 0.28);
}

.ia-meta-grid,
.ia-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ia-secondary-grid .report-card {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.ia-list {
    display: grid;
    gap: 10px;
    padding-left: 18px;
    color: var(--text-muted);
}

.consulta-card {
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    gap: 6px;
    text-align: left;
}

.consulta-card span,
.consulta-card small {
    color: var(--text-muted);
}

.consulta-card strong {
    font-size: 2rem;
    line-height: 1;
}

.consulta-card-active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.consulta-card-verde {
    background: linear-gradient(180deg, rgba(24, 56, 39, 0.95), rgba(15, 33, 24, 0.96));
    border-color: rgba(74, 177, 106, 0.28);
}

.consulta-card-verde strong {
    color: #8ae4a8;
}

.consulta-card-amarillo {
    background: linear-gradient(180deg, rgba(74, 58, 17, 0.95), rgba(40, 32, 12, 0.96));
    border-color: rgba(222, 178, 53, 0.28);
}

.consulta-card-amarillo strong {
    color: #f2d16b;
}

.consulta-card-rojo {
    background: linear-gradient(180deg, rgba(80, 25, 25, 0.95), rgba(43, 15, 15, 0.96));
    border-color: rgba(214, 89, 89, 0.28);
}

.consulta-card-rojo strong {
    color: #ff9b9b;
}

.consulta-estado {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    white-space: nowrap;
}

.consulta-estado-verde {
    background: rgba(48, 157, 88, 0.16);
    color: #9aefb7;
    border-color: rgba(48, 157, 88, 0.28);
}

.consulta-estado-amarillo {
    background: rgba(222, 178, 53, 0.16);
    color: #f4db86;
    border-color: rgba(222, 178, 53, 0.28);
}

.consulta-estado-rojo {
    background: rgba(201, 75, 75, 0.16);
    color: #ffb0b0;
    border-color: rgba(201, 75, 75, 0.28);
}

.consulta-row-verde td {
    background: rgba(48, 157, 88, 0.04);
}

.consulta-row-amarillo td {
    background: rgba(222, 178, 53, 0.04);
}

.consulta-row-rojo td {
    background: rgba(201, 75, 75, 0.04);
}

.photo-status,
.cliente-vacio {
    color: var(--text-soft);
}

.turno-photo-preview,
.cliente-turno-foto,
.cliente-foto,
.modal-gallery img {
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.14);
    background: #131418;
}

.turno-photo-preview {
    width: 100%;
    max-width: 240px;
}

.photo-thumb-btn {
    padding: 7px 10px;
    font-size: 0.76rem;
}

.cliente-turno-info {
    padding: 16px;
    display: grid;
    gap: 5px;
}

.cliente-turno-info h4 {
    color: var(--gold);
}

.cliente-turno-fotos,
.cliente-fotos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cliente-turno-foto {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    cursor: pointer;
}

.clientes-layout {
    display: grid;
    grid-template-columns: minmax(320px, 380px) 1fr;
    gap: 18px;
}

.clientes-form-panel,
.clientes-right-panel,
.clientes-list-panel,
.clientes-detail-panel {
    padding: 18px;
}

.clientes-right-panel {
    display: grid;
    gap: 18px;
}

.clientes-list {
    margin-top: 14px;
    display: grid;
    gap: 10px;
    max-height: 560px;
    overflow: auto;
    padding-right: 4px;
}

.cliente-item {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(30, 31, 37, 0.98), rgba(21, 22, 27, 0.98));
    padding: 14px 15px;
    display: grid;
    gap: 4px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.cliente-item:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.24);
    background: linear-gradient(180deg, rgba(37, 39, 46, 0.98), rgba(24, 26, 31, 0.98));
}

.cliente-item.active {
    border-color: rgba(212, 175, 55, 0.56);
    background: linear-gradient(180deg, rgba(44, 38, 20, 0.98), rgba(25, 23, 17, 0.98));
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.16);
}

.cliente-foto {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    cursor: pointer;
}

.cliente-fotos-editor {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(212, 175, 55, 0.12);
    display: grid;
    gap: 12px;
}

.cliente-fotos-editor h5 {
    color: var(--gold);
}

.days-fieldset {
    border: 1px solid rgba(212, 175, 55, 0.12);
    border-radius: 18px;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    background: rgba(255, 255, 255, 0.015);
}

.days-fieldset legend {
    color: var(--gold);
    padding: 0 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.74rem;
}

.checkbox-label,
.day-option {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-weight: 700;
}

.checkbox-label input,
.day-option input {
    width: 18px;
    height: 18px;
    accent-color: var(--gold);
    margin: 0;
}

.report-card {
    padding: 18px;
    margin-bottom: 12px;
    display: grid;
    gap: 10px;
}

.report-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.message {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    width: min(92vw, 860px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.36);
    backdrop-filter: blur(10px);
}

#appMessageText {
    color: inherit;
}

.message.success {
    background: rgba(38, 31, 16, 0.95);
    color: #f0d890;
}

.message.error {
    background: rgba(53, 21, 21, 0.95);
    color: #ffd1d1;
    border-color: rgba(163, 67, 67, 0.3);
}

body.modal-locked {
    overflow: hidden;
}

body.modal-locked > :not(#clienteConfirmModal) {
    pointer-events: none;
    user-select: none;
}

.whatsapp-btn {
    border-radius: 999px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    background: linear-gradient(180deg, #292218 0%, #1c1813 100%);
    border: 1px solid rgba(212, 175, 55, 0.26);
    color: var(--gold);
    font-weight: 800;
}

.whatsapp-btn:hover {
    background: linear-gradient(180deg, #332816 0%, #21190f 100%);
    color: #f4d776;
}

.cumple-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cumple-badge-cliente {
    background: rgba(212, 175, 55, 0.16);
    color: #f3d986;
}

.cumple-badge-personal {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
}

.cumple-calendar {
    width: 100%;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.12);
    background: linear-gradient(180deg, rgba(25, 26, 31, 0.98), rgba(18, 19, 23, 0.98));
    padding: 18px;
}

.cumple-month {
    gap: 10px;
    padding: 0;
}

.cumple-month-label {
    min-width: 180px;
    color: var(--gold);
    text-transform: capitalize;
}

.cumple-weekdays,
.cumple-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.cumple-weekdays span {
    color: var(--text-soft);
    text-align: center;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cumple-day {
    min-height: 72px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: 2px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.015);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
    text-align: left;
    appearance: none;
}

.cumple-day.empty {
    border: 0;
    background: transparent;
    cursor: default;
}

.cumple-day:hover:not(.empty) {
    transform: translateY(-1px);
    border-color: rgba(212, 175, 55, 0.18);
}

.cumple-day.has-birthday {
    border-top-color: rgba(212, 175, 55, 0.8);
    background: rgba(212, 175, 55, 0.06);
}

.cumple-day.selected {
    border-color: rgba(212, 175, 55, 0.52);
    background: rgba(212, 175, 55, 0.11);
    box-shadow: inset 0 0 0 1px rgba(212, 175, 55, 0.14);
}

.cumple-day.today .cumple-day-number {
    color: var(--gold);
}

.cumple-day-number {
    color: var(--text);
    font-weight: 800;
}

.cumple-day-count {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, #d4af37 0%, #a57a03 100%);
    color: #0b0b0c;
    font-size: 0.74rem;
    font-weight: 900;
}

.cumple-phone-link {
    color: #ecd47d;
    text-decoration: none;
    font-weight: 700;
}

.cumple-phone-link:hover {
    color: #f7e3a0;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 7, 0.6);
    backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    z-index: 80;
}

.loading-card {
    min-width: 240px;
    padding: 22px 24px;
    border-radius: 22px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    background: linear-gradient(180deg, rgba(31, 33, 39, 0.98), rgba(20, 21, 25, 0.98));
    box-shadow: var(--shadow);
    display: grid;
    justify-items: center;
    gap: 14px;
}

.loading-card p {
    color: var(--text-muted);
    font-weight: 700;
}

.loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(212, 175, 55, 0.16);
    border-top-color: var(--gold);
    animation: app-spin 0.8s linear infinite;
}

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

.modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 8, 10, 0.74);
    backdrop-filter: blur(7px);
    display: grid;
    place-items: center;
    padding: 18px;
    z-index: 50;
}

.modal-card {
    width: min(900px, 95vw);
    display: grid;
    gap: 16px;
    padding: 24px;
    border-radius: 24px;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background: linear-gradient(180deg, rgba(28, 29, 34, 0.98), rgba(18, 19, 23, 0.98));
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.46);
}

.modal-card h3 {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.16);
    color: var(--gold);
}

.modal-card-small {
    width: min(560px, 95vw);
}

#clienteConfirmModal {
    z-index: 140;
}

.modal-card-confirm {
    width: min(640px, 94vw);
    padding: 32px;
    gap: 20px;
    text-align: center;
}

.modal-card-confirm h3 {
    font-size: clamp(1.65rem, 2.4vw, 2rem);
}

.modal-card-confirm p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

.modal-confirm-actions {
    display: flex;
    justify-content: center;
}

.modal-confirm-actions .btn {
    min-width: 140px;
}

.modal-gallery {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.modal-gallery img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.cumple-historial-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.cumple-historial-resumen {
    margin-top: 6px;
    color: var(--text-soft);
}

.cumple-historial-body {
    display: grid;
    gap: 16px;
}

.cumple-historial-table-wrap {
    overflow-x: hidden;
}

.cumple-historial-table {
    min-width: 0;
    width: 100%;
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    body.app-authenticated .container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    body.app-authenticated .brand-header,
    body.app-authenticated #appView > .topbar,
    body.app-authenticated #appView > .tabs,
    body.app-authenticated #appView > .tab-panel {
        grid-column: 1;
        grid-row: auto;
    }

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

    .cumple-historial-header {
        flex-direction: column;
    }

    .ia-layout,
    .ia-meta-grid,
    .ia-secondary-grid,
    .consultas-resumen-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 900px) {
    .container {
        width: min(100% - 20px, 100%);
        margin-top: 14px;
    }

    .card {
        padding: 18px;
        border-radius: 18px;
    }

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

    .tabs {
        padding: 10px;
    }

    .tab-btn {
        width: 100%;
    }

    .days-fieldset {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-gallery,
    .cliente-turno-fotos,
    .cliente-fotos {
        grid-template-columns: 1fr;
    }

    .turno-alert-card,
    .message {
        flex-direction: column;
        align-items: stretch;
    }

    .message {
        top: 10px;
        width: calc(100vw - 20px);
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

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

    .inline-actions > * {
        width: 100%;
    }

    .days-fieldset {
        grid-template-columns: 1fr;
    }

    .cumple-weekdays,
    .cumple-grid {
        gap: 6px;
    }

    .cumple-day {
        min-height: 62px;
        padding: 8px;
    }
}
