/* ==========================================================================
   UNIMEDIC IPS - Módulo de Fisioterapia y Rehabilitación Cardiopulmonar
   Design System & Styling - High Contrast Theme
   ========================================================================== */

:root {
    --primary: #c20042;
    --primary-hover: #9e0035;
    --primary-dark: #121f3d;
    --primary-light: #fff1f4;
    --secondary: #121f3d;
    --secondary-dark: #091224;
    --secondary-hover: #1e293b;
    --accent: #e11d48;
    --accent-dark: #be123c;
    --accent-light: #ffe4e6;
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --bg-main: #f1f5f9;            /* Gris Slate moderno de alto contraste (sin tonos celestes/azules de baño) */
    --bg-card: #ffffff;
    --text-main: #0f172a;          /* High contrast text */
    --text-muted: #64748b;
    --border: #cbd5e1;            /* Clean subtle borders from fcardio */
    --border-light: #e2e8f0;
    --border-focus: #c20042;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 24px rgba(15, 23, 42, 0.10);
}

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

html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    background: #f1f5f9;
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* TOP NAVBAR - FCARDIO DEEP NAVY & CRIMSON WINE */
.navbar {
    background: #121f3d;
    border-bottom: 3.5px solid #c20042;
    padding: 12px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(18, 31, 61, 0.25);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-brand img {
    height: 48px;
    width: auto;
    background: transparent;
    padding: 0;
    border-radius: 0;
    object-fit: contain;
}

.nav-title h1 {
    font-size: 1.22rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.nav-title span {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

/* MAIN CONTAINER */
.container {
    max-width: 1440px;
    margin: 22px auto;
    padding: 0 24px 60px;
}

/* SEARCH HERO */
.search-card {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 22px;
    box-shadow: 0 2px 6px rgba(18, 31, 61, 0.05);
}

.search-grid {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: #64748b;
    pointer-events: none;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.search-input-wrapper:focus-within .search-icon {
    color: var(--primary);
}

.search-input-wrapper input#searchInput,
.search-input-wrapper input[type="text"] {
    width: 100%;
    padding: 14px 20px 14px 58px !important;
    font-size: 1.05rem;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--secondary);
    font-weight: 600;
    transition: all 0.2s;
    box-sizing: border-box;
}

.search-input-wrapper input#searchInput:focus {
    outline: none;
    border-color: #c20042;
    box-shadow: 0 0 0 4px rgba(194, 0, 66, 0.18);
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: #c20042;
    color: #ffffff;
    border: 1px solid #9e0035;
}

.btn-primary:hover {
    background: #9e0035;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: #10b981;
    color: #ffffff;
    border: 1px solid #059669;
}

.btn-accent:hover {
    background: #059669;
}

.btn-secondary {
    background: #334155;
    color: #ffffff;
    border: 1px solid #1e293b;
}

.btn-secondary:hover {
    background: #1e293b;
}

/* PATIENT INFO BANNER - FCARDIO NAVY & CRIMSON CONTRAST */
.patient-banner {
    display: none;
    background: linear-gradient(135deg, #121f3d 0%, #1e293b 100%);
    border: 2px solid #c20042;
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-lg);
    color: #ffffff;
}

.patient-banner-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 22px;
    align-items: center;
}

.patient-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #c20042;
    color: #ffffff;
    border: 3px solid #ff4d79;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.patient-details h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.patient-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 6px;
    font-size: 0.88rem;
    color: #cbd5e1;
}

.patient-meta span {
    background: rgba(255, 255, 255, 0.12);
    padding: 3px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.patient-meta strong {
    color: #ff6b8b;
    font-weight: 700;
}

.patient-actions {
    display: flex;
    gap: 10px;
}

/* APP TABS - HIGH CONTRAST PILLS */
.tabs-header {
    display: flex;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #475569;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.tab-btn:hover {
    color: #121f3d;
    background: #fff1f4;
}

.tab-btn.active {
    background: #c20042;
    color: #ffffff;
    border-color: #9e0035;
    box-shadow: 0 2px 6px rgba(194, 0, 66, 0.35);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* FORM CARDS - CRISP AND STRUCTURED */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    margin-bottom: 22px;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    box-sizing: border-box;
}

.card-title {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--secondary);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ==========================================================================
   COLLAPSIBLE MODULES / ACCORDION CARDS
   ========================================================================== */
.collapsible-card {
    transition: box-shadow 0.2s ease, border-color 0.2s ease, padding 0.2s ease;
}

.collapsible-card .card-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: background 0.15s ease, color 0.15s ease;
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    margin: -6px -10px 18px -10px;
}

.collapsible-card .card-title:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.card-title-main {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.card-title-main span {
    font-size: 1.05rem;
    font-weight: 800;
}

.card-title-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.collapsible-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.collapse-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff1f4;
    color: #c20042;
    font-size: 0.72rem;
    font-weight: 900;
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s ease, color 0.2s ease;
}

.collapsible-card:hover .collapse-indicator {
    background: #c20042;
    color: #ffffff;
}

.collapse-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #cbd5e1;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* STATE: COLLAPSED */
.collapsible-card.collapsed {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
    background: #ffffff;
    border-color: #cbd5e1;
    margin-bottom: 12px;
}

.collapsible-card.collapsed .card-title {
    margin-bottom: 0 !important;
    padding-bottom: 6px !important;
    border-bottom: none !important;
}

.collapsible-card.collapsed .collapse-indicator {
    transform: rotate(-90deg);
    background: #f1f5f9;
    color: #64748b;
}

.collapsible-card.collapsed .collapse-badge {
    background: #fff1f4;
    color: #9e0035;
    border-color: #fecaca;
}

.collapsible-card.collapsed .card-body {
    display: none !important;
}

.collapsible-card:not(.collapsed) .card-body {
    animation: fadeInSlide 0.2s ease-in-out;
}

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

/* ACCORDION TOOLBAR */
.accordion-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-left: 5px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 10px 18px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}

.accordion-toolbar-info {
    font-size: 0.88rem;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.accordion-toolbar-info small {
    color: var(--text-muted);
    font-weight: 500;
}

.accordion-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-acc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    color: #1e293b;
    transition: all 0.15s ease;
}

.btn-acc-toggle:hover {
    background: #fff1f4;
    border-color: #c20042;
    color: #9e0035;
    transform: translateY(-1px);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.form-group.col-span-2 { grid-column: span 2; }
.form-group.col-span-3 { grid-column: span 3; }
.form-group.col-span-4 { grid-column: span 4; }
.form-group.full-width { grid-column: 1 / -1; }

label {
    font-size: 0.84rem;
    font-weight: 700;
    color: #1e293b;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--secondary);
    font-weight: 500;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #c20042;
    box-shadow: 0 0 0 3.5px rgba(194, 0, 66, 0.18);
}

input[readonly], textarea[readonly] {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #334155;
    font-weight: 600;
}

textarea {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    min-height: 85px;
    resize: vertical;
    font-family: inherit;
    overflow-y: hidden;
    overflow-x: hidden !important;
    white-space: pre-wrap !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.45;
}

/* CHECKBOX TILES - HIGH CONTRAST */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.checkbox-tile {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #ffffff;
    cursor: pointer;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--secondary);
    user-select: none;
    transition: all 0.15s;
}

.checkbox-tile:hover {
    background: #fff1f4;
    border-color: #c20042;
}

.checkbox-tile input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: #c20042;
    cursor: pointer;
}

.checkbox-tile:has(input:checked) {
    background: #fff1f4;
    border-color: #c20042;
    color: #9e0035;
}

/* STATS BADGE & CALCULATORS */
.calc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
    font-weight: 800;
    background: #e2e8f0;
    color: var(--secondary);
    border: 1px solid #cbd5e1;
}

.calc-badge.normal { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.calc-badge.warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.calc-badge.danger { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* DATA TABLES */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    margin-top: 10px;
    background: #ffffff;
}

.data-table th, .data-table td {
    padding: 11px 14px;
    border: 1px solid var(--border-light);
    text-align: left;
}

.data-table th {
    background: #121f3d;
    color: #ffffff;
    font-weight: 700;
    border-color: #1e293b;
}

.data-table tr:nth-child(even) {
    background: #f8fafc;
}

.data-table tr:hover {
    background: #f1f5f9;
}

/* STICKY FOOTER ACTION BAR */
.action-bar {
    position: sticky;
    bottom: 0;
    background: #121f3d;
    color: #ffffff;
    border-top: 2.5px solid #c20042;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.25);
    z-index: 90;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

/* SIGNATURE CANVAS */
.signature-pad-container {
    border: 2px dashed #64748b;
    border-radius: var(--radius-sm);
    background: #ffffff;
    display: inline-block;
    position: relative;
    box-shadow: var(--shadow-sm);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.signature-pad-container canvas {
    display: block;
    cursor: crosshair;
    touch-action: none;
}

/* TOAST NOTIFICATION */
#toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    background: #0f172a;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#toast.success { background: #059669; }
#toast.error { background: #dc2626; }

/* CONSULTATION CARDS & TIMELINE */
.consult-card {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-left: 5px solid #c20042;
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s, box-shadow 0.15s;
}

.consult-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #c20042;
}

.consult-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
    margin-bottom: 14px;
}

.consult-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.consult-badge-esp {
    background: #c20042;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.consult-date {
    font-size: 0.88rem;
    color: #475569;
    font-weight: 700;
}

.consult-doctor {
    font-size: 0.95rem;
    font-weight: 800;
    color: #0f172a;
}

.consult-dx {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-left: 4px solid #059669;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.88rem;
    margin-bottom: 12px;
    color: #0f172a;
}

.consult-vitals {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.vital-pill {
    background: #f1f5f9;
    border: 1.5px solid #cbd5e1;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #1e293b;
    font-weight: 600;
}

.vital-pill strong {
    color: #c20042;
}

.consult-body {
    font-size: 0.88rem;
    line-height: 1.55;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 12px;
    white-space: pre-line;
}

.consult-orders {
    background: #eff6ff;
    border: 1.5px solid #93c5fd;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    color: #1e3a5f;
}

.consult-orders ul {
    margin-left: 20px;
    margin-top: 6px;
}

.consult-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==========================================================================
   COMPONENT STYLES: TABLES, CARDS, PILLS, KARVONEN, EVA, SIGNATURE
   ========================================================================== */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 8px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: #ffffff;
}

.pill-group {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    max-width: 100%;
}

.pill-group label {
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-main);
    white-space: normal;
}

.eva-scale-container {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 6px;
    width: 100%;
}

.eva-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 2px solid #cbd5e1;
    background: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.eva-btn:hover {
    border-color: #c20042;
    background: #fff1f4;
}

.eva-btn.active {
    background: #c20042;
    color: #ffffff;
    border-color: #9e0035;
    box-shadow: 0 2px 6px rgba(194, 0, 66, 0.35);
}

.karvonen-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 2px solid #86efac;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-top: 14px;
}

.karvonen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.card-title-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.alert-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 18px;
    color: #065f46;
    font-size: 0.86rem;
}

.pulse-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 0.82rem;
}

.pulse-table th, .pulse-table td {
    border: 1px solid #cbd5e1;
    padding: 6px 10px;
    text-align: center;
}

.pulse-table th {
    background: #f8fafc;
    color: var(--secondary);
    font-weight: 700;
}

.phase-matrix-table {
    width: 100%;
    min-width: 580px;
    border-collapse: collapse;
    margin-top: 6px;
    background: #ffffff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.phase-matrix-table th {
    background: #121f3d;
    color: #ffffff;
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.phase-matrix-table td {
    border: 1px solid #e2e8f0;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.phase-matrix-table td:first-child {
    text-align: left;
    font-weight: 700;
    color: var(--secondary);
    background: #f8fafc;
    width: 180px;
}

.phase-matrix-table input {
    width: 100%;
    min-width: 70px;
    padding: 6px 8px;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.phase-matrix-table input:focus {
    border-color: #c20042;
    outline: none;
    box-shadow: 0 0 0 2px rgba(194, 0, 66, 0.2);
}

.system-check-card {
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    padding: 12px;
    background: #ffffff;
    transition: border-color 0.2s;
}

.system-check-card:hover {
    border-color: #94a3b8;
}

.system-check-card.has-alteration,
.system-check-card.system-altered {
    border-color: #f87171;
    background: #fff5f5;
}

.signature-wrapper {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    margin-top: 8px;
    flex-wrap: wrap;
}

.signature-pad-container {
    width: 100%;
    max-width: 480px;
    overflow: hidden;
    background: #ffffff;
    border: 2px dashed #94a3b8;
    border-radius: var(--radius-sm);
}

.signature-pad-container canvas {
    display: block;
    width: 100% !important;
    max-width: 100%;
    height: 160px !important;
    touch-action: none;
}

/* ==========================================================================
   RESPONSIVE DESIGN SYSTEM (Desktop, Laptop, Tablet, Mobile, Tiny screens)
   ========================================================================== */

@media (max-width: 1200px) {
    .container {
        padding: 0 16px 50px;
    }
}

@media (max-width: 1024px) {
    .form-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .form-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .form-group.col-span-4 {
        grid-column: span 2;
    }
    .form-group.col-span-3 {
        grid-column: span 2;
    }
    .patient-banner-grid {
        grid-template-columns: auto 1fr;
    }
    .patient-actions {
        grid-column: 1 / -1;
        margin-top: 10px;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px 60px;
        width: 100%;
    }
    .navbar {
        padding: 10px 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
    }
    .nav-brand {
        gap: 12px;
        width: 100%;
    }
    .nav-brand img {
        height: 34px;
    }
    .nav-title h1 {
        font-size: 1.02rem;
        line-height: 1.25;
    }
    .nav-title span {
        font-size: 0.74rem;
    }
    .nav-badges {
        width: 100%;
        justify-content: flex-start;
    }
    .search-card {
        padding: 14px;
        width: 100%;
    }
    .search-grid {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }
    .search-input-wrapper .search-icon {
        left: 16px;
        width: 20px;
        height: 20px;
    }
    .search-input-wrapper input#searchInput {
        font-size: 16px;
        padding: 13px 16px 13px 52px !important;
        width: 100%;
    }
    .search-grid .btn {
        width: 100%;
        padding: 12px;
    }
    .patient-banner {
        padding: 14px;
        width: 100%;
    }
    .patient-banner-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
        width: 100%;
    }
    .patient-avatar {
        margin: 0 auto;
    }
    .patient-meta {
        justify-content: center;
        gap: 6px;
        font-size: 0.8rem;
    }
    .patient-actions {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    .patient-actions .btn {
        width: 100%;
    }
    .tabs-header {
        padding: 4px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tabs-header::-webkit-scrollbar {
        display: none;
    }
    .tab-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
        flex-shrink: 0;
    }
    .card {
        padding: 16px 14px;
        width: 100%;
    }
    .card-title {
        font-size: 0.98rem;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .collapsible-card .card-title {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 4px 6px;
        margin: -4px -6px 14px -6px;
    }
    .collapsible-card.collapsed .card-title {
        margin: -4px -6px !important;
    }
    .collapsible-card .card-title-main {
        font-size: 0.93rem;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }
    .collapsible-card .card-title-main span,
    .collapsible-card .card-title-main label {
        font-size: 0.93rem !important;
        white-space: normal;
        line-height: 1.25;
    }
    .card-title-subtitle {
        display: none !important;
    }
    .collapsible-actions {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
    .collapse-indicator {
        width: 24px;
        height: 24px;
        font-size: 0.65rem;
    }
    .collapse-badge {
        font-size: 0.68rem;
        padding: 2px 7px;
    }
    .accordion-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }
    .accordion-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .btn-acc-toggle {
        justify-content: center;
        width: 100%;
        padding: 8px;
        font-size: 0.8rem;
    }
    .card-title-actions {
        width: 100%;
        flex-direction: column;
        gap: 6px;
    }
    .card-title-actions .btn {
        width: 100%;
    }
    .form-grid-3,
    .form-grid-2,
    .form-grid-4 {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 12px;
        width: 100% !important;
        max-width: 100% !important;
    }
    .form-group.col-span-2,
    .form-group.col-span-3,
    .form-group.col-span-4 {
        grid-column: 1 / -1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    input[type="text"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px !important;
        min-height: 42px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    textarea {
        min-height: 75px;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: hidden !important;
        white-space: pre-wrap !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }
    .action-bar {
        padding: 10px 14px;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    .action-bar div {
        display: none;
    }
    .action-bar .btn {
        width: 100%;
        padding: 12px;
        font-size: 0.96rem;
    }
    .consult-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    .consult-actions {
        width: 100%;
        flex-direction: column;
        gap: 6px;
    }
    .consult-actions .btn {
        width: 100%;
    }
    .signature-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        width: 100%;
    }
    .signature-pad-container {
        width: 100%;
        max-width: 100%;
    }
    .signature-pad-container canvas {
        width: 100% !important;
        height: 160px !important;
    }
    .signature-wrapper .btn {
        width: 100%;
    }
    .alert-banner {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .alert-banner .btn {
        width: 100%;
    }
    .karvonen-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .karvonen-box {
        padding: 12px 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px 48px;
    }
    .navbar {
        padding: 8px 12px;
    }
    .nav-title h1 {
        font-size: 0.94rem;
    }
    .nav-title span {
        font-size: 0.7rem;
    }
    .search-card {
        padding: 12px;
        border-radius: var(--radius-md);
    }
    .patient-banner {
        padding: 12px;
        border-radius: var(--radius-md);
    }
    .patient-details h2 {
        font-size: 1.05rem;
    }
    .patient-meta span {
        font-size: 0.74rem;
        padding: 2px 6px;
    }
    .checkbox-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .tab-btn {
        padding: 7px 10px;
        font-size: 0.8rem;
    }
    .card {
        padding: 14px 12px;
        border-radius: var(--radius-sm);
        margin-bottom: 14px;
    }
    .card-title {
        font-size: 0.92rem;
        margin-bottom: 12px;
    }
    .pill-group {
        width: 100%;
        gap: 6px;
        padding: 6px 8px;
    }
    .pill-group label {
        font-size: 0.78rem;
    }
    .eva-scale-container {
        display: grid;
        grid-template-columns: repeat(11, 1fr);
        gap: 3px;
        width: 100%;
    }
    .eva-btn {
        width: 100%;
        height: 32px;
        min-width: 0;
        font-size: 0.72rem;
        padding: 0;
    }
    .system-check-card {
        padding: 10px;
    }
    label {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 6px 45px;
    }
    .navbar {
        padding: 6px 8px;
    }
    .nav-title h1 {
        font-size: 0.86rem;
    }
    .badge-status {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    .card {
        padding: 10px 8px;
        border-radius: 6px;
    }
    .eva-scale-container {
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
    }
    .eva-btn {
        height: 32px;
        font-size: 0.76rem;
    }
    .btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    .pill-group label {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   CAMPOS SINCRONIZADOS CON SALUDIPS (RESOLUCIÓN 1888 RDA)
   ========================================================================== */
.input-saludips,
.field-saludips input,
.field-saludips select,
.field-saludips textarea {
    border: 2px solid #0284c7 !important;
    background-color: #f0f9ff !important;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.input-saludips:focus,
.field-saludips input:focus,
.field-saludips select:focus,
.field-saludips textarea:focus {
    border-color: #0369a1 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.25) !important;
    outline: none;
}

.badge-saludips {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    vertical-align: middle;
}

.badge-saludips::before {
    content: "●";
    color: #0284c7;
    font-size: 0.65rem;
}

/* ==========================================================================
   LISTA DE ESPERA DEL DÍA (SALUDIPS)
   ========================================================================== */
.waiting-list-card {
    border: 1px solid var(--border-light);
    border-left: 4px solid #0284c7;
    background: #ffffff;
    transition: box-shadow 0.2s ease;
}

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

.waiting-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.waiting-item-card {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.15s, border-color 0.15s;
    cursor: pointer;
}

.waiting-item-card:hover {
    transform: translateY(-2px);
    border-color: #0284c7;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.12);
}

.waiting-item-card.waiting-item-active-now {
    border: 2px solid #059669 !important;
    background: #ecfdf5 !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.22) !important;
    position: relative;
}

.waiting-active-ribbon {
    position: absolute;
    top: -9px;
    right: 12px;
    background: #059669;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.waiting-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.waiting-item-time {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.waiting-item-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 12px;
    text-transform: uppercase;
}

.badge-estado-facturado {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.badge-estado-atendido {
    background: #fff1f4;
    color: #c20042;
    border: 1px solid #ffccd6;
}

.badge-estado-agendado {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.waiting-item-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    margin-bottom: 4px;
}

.waiting-item-meta {
    font-size: 0.76rem;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 8px;
}

.waiting-item-btn {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    background: #0284c7;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s;
}

.waiting-item-btn:hover {
    background: #0369a1;
}

/* ==========================================================================
   ESTADO DE SINCRONIZACIÓN Y RESGUARDO OFFLINE
   ========================================================================== */
.nav-sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 600;
}

.sync-badge.ok {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.4);
    font-size: 0.78rem;
    font-weight: 700;
}

.sync-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
    box-shadow: 0 0 8px #34d399;
}

.sync-btn-pending {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #facc15;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
    animation: pulsePending 2s infinite;
}

.sync-btn-pending:hover {
    background: #fde047;
    transform: translateY(-1px);
}

@keyframes pulsePending {
    0%, 100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(234, 179, 8, 0); }
}

/* BANNER DE BORRADOR DE SEGURIDAD */
.draft-recovery-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    background: #f0fdf4;
    border: 1.5px solid #86efac;
    color: #166534;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(22, 101, 52, 0.08);
    animation: slideDown 0.3s ease-out;
}

.draft-recovery-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.draft-icon {
    font-size: 1.6rem;
}

.draft-sub {
    font-size: 0.78rem;
    color: #15803d;
    margin-top: 2px;
}

.draft-recovery-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-sm {
    padding: 5px 12px !important;
    font-size: 0.78rem !important;
}

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

/* ==========================================================================
   MÓDULO DE FÓRMULAS TC6M (TROOSTERS, TANAKA, VO2, METS)
   ========================================================================== */
.tc6m-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 14px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.tc6m-card.active {
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(194, 0, 66, 0.08);
}

.tc6m-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 14px;
}

.tc6m-toggle-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tc6m-patient-bar {
    background: #f1f5f9;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--secondary);
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
    border-left: 4px solid var(--primary);
}

.calc-stat-box {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.calc-stat-box:hover {
    border-color: var(--primary);
}

.calc-stat-label {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.calc-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--secondary-dark);
}

.calc-stat-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* ==========================================================================
   TANITA EN SECCIÓN 6
   ========================================================================== */
.tanita-sec6-container {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 18px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid #059669;
}

.tanita-sec6-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.tanita-badge-brand {
    background: #d1fae5;
    color: #065f46;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid #a7f3d0;
}

/* ==========================================================================
   CUESTIONARIOS CALIDAD DE VIDA (SF-36 / SGRQ)
   ========================================================================== */
.cv-container {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 18px;
    margin-top: 16px;
}

.cv-selector-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cv-tab-btn {
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: #f8fafc;
    color: var(--secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cv-tab-btn:hover {
    background: #e2e8f0;
}

.cv-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(194, 0, 66, 0.15);
}

.cv-score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.cv-score-tile {
    background: #f8fafc;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    transition: transform 0.2s;
}

.cv-score-tile:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.cv-score-tile .score-num {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.1;
    margin: 4px 0;
}

.cv-score-tile .score-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--secondary);
    text-transform: uppercase;
}

.cv-question-block {
    background: #ffffff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 12px;
}

.cv-question-block:nth-child(even) {
    background: #fafafa;
}

.cv-question-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 10px;
    line-height: 1.35;
}

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

.cv-option-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.cv-option-pill:hover {
    border-color: var(--primary);
    background: #fff1f4;
}

.cv-option-pill input[type="radio"],
.cv-option-pill input[type="checkbox"] {
    accent-color: var(--primary);
    margin: 0;
    cursor: pointer;
}

.cv-option-pill.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: 600;
}

/* ==========================================================================
   CUSTOM MODAL DIALOG (HIGH VISIBILITY & BULLETPROOF)
   ========================================================================== */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s ease-out;
}

.custom-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.custom-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 92%;
    max-width: 530px;
    box-shadow: 0 25px 35px -5px rgba(0, 0, 0, 0.3), 0 15px 15px -5px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
    z-index: 1;
    animation: modalSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideDown {
    from {
        opacity: 0;
        transform: translateY(-24px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}




