:root {
    --primary-color: #d63384;
    /* Pink/Magenta from brand */
    --primary-light: #f8d7da;
    --secondary-color: #2c3e50;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --header-height: 60px;
    --nav-height: 70px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: var(--nav-height);
    /* Space for bottom nav */
}

a {
    text-decoration: none;
    color: inherit;
}

/* Utilities */
.container {
    padding: 20px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.card:active {
    transform: scale(0.98);
}

/* Typography */
h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

h4 {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    /* Soft gray instead of black */
    margin-bottom: 15px;
}

.text-muted {
    color: #888;
    font-size: 14px;
}

/* Buttons */
.btn {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* Auth Pages */
.login-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 80vh;
    padding: 30px;
    background: white;
}

/* Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item.active {
    color: var(--primary-color);
}

/* Central Button */
.nav-item.central-btn {
    transform: translateY(-20px);
}

.nav-item.central-btn .icon-circle {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 10px rgba(214, 51, 132, 0.4);
}

/* Loaders */
.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Inputs */
.form-group {
    margin-bottom: 20px;
}

.form-input {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: #fafafa;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

/* Lists */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.list-item:last-child {
    border-bottom: none;
}

/* Home Header */
/* Home Header & PAGE HEADER Shared Styling */
.home-header,
.page-header {
    background: #D65DB3;
    background: linear-gradient(180deg, #d65db1 0%, #ce4da4 100%);
    color: white;
    padding-top: 23px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    position: relative;
    z-index: 0;
}

.home-header {
    padding-bottom: 50px;
    margin-bottom: -30px;
}

.page-header {
    padding-bottom: 6px;
    margin-bottom: 0px;
}

.page-header-content {
    display: flex;
    align-items: center;
    padding: 0 20px 20px 20px;
    gap: 15px;
}

.back-btn {
    color: white;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Refined Cards */
.grid-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    position: relative;
    z-index: 10;
    padding: 0 10px;
}

.menu-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    text-align: center;
    transition: transform 0.2s;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.menu-card:active {
    transform: scale(0.98);
}

.menu-card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square image */
    object-fit: cover;
    display: block;
}

.menu-card-body {
    padding: 12px 5px;
    background: #fdfdfd;
}

.menu-card-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: #444;
}

/* Notifications */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #ff3b30;
    border-radius: 50%;
    border: 1px solid white;
}

/* Notification Badge correct z-index */
.notification-badge {
    z-index: 5;
}

/* WELCOME SCREEN */
.welcome-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #fef4ff;
}

.welcome-bg {
    background: url('../img/welcome-blob.png');
    background-size: cover;
    background-position: center bottom;
    height: 55%;
    border-radius: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 30px;
}

.welcome-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 40px 30px;
}

.actions-area {
    width: 100%;
}

/* LOGIN CLEAN */
.login-screen-clean {
    padding: 30px;
    background: white;
    min-height: 100vh;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .icon-left {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
}

.input-with-icon .icon-right {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.form-input-clean {
    width: 100%;
    padding: 15px 15px 15px 45px;
    /* Space for icon */
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    background: white;
}

.form-input-clean::placeholder {
    color: #aaa;
}

/* User Initials Circle */
.user-initials-circle {
    width: 50px;
    height: 50px;
    background: #EFBEE1;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    font-size: 18px;
    border: 2px solid #ffbceb;
}

/* Appointments Tabs & Legacy Tables */
.nav-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
    padding-bottom: 0;
    gap: 10px;
}

.nav-tab-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 500;
}

.nav-tab-item.active {
    border-bottom-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Legacy Table Wrappers */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

/* Procedimiento Table Styles */
/* Procedimiento Table Styles - Modern Redesign */
.procedimientotab {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 1em;
    font-size: 13px;
    /* Updated from 14px as requested */
    background: white;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f5f5f7;
    /* Very subtle border */
}

.procedimientotab th {
    background: #fff0f5;
    /* Pastel Pink (lavender blush type) */
    color: #8e8e93;
    /* IOS Gray */
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #fce4ec;
}

.procedimientotab td {
    padding: 14px 15px;
    border-bottom: 1px solid #f5f5f7;
    vertical-align: middle;
    color: #555;
    /* Soft gray text */
}

.procedimientotab tr:last-child td {
    border-bottom: none;
}

/* Status Badges - Pastel Palette */
.dispo {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    /* Softer, apple-like */
    font-weight: 600;
    font-size: 12px;
    min-width: 30px;
    text-align: center;
    transition: all 0.2s;
}

.dispo.neutro {
    background: #f2f2f7;
    /* Apple System Gray 6 */
    color: #8e8e93;
}

.dispo.sihay {
    background: #e8f5e9;
    /* Pastel Green */
    color: #2e7d32;
    /* Or specifically pastel teal/mint if preferred, but this is clean */
}

.dispo.nohay {
    background: #ffebee;
    /* Pastel Red/Pink */
    color: #c62828;
}

/* Alerts redesign - iOS Pastel Style */
.advertencia,
.alert {
    display: block;
    background: #f9f9f9;
    color: #333;
    padding: 16px;
    border-radius: 14px;
    /* iOS rounded */
    margin-bottom: 20px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    /* Subtle depth */
    letter-spacing: -0.2px;
}

.alert-danger {
    background: #ffe5e5;
    /* Soft pastel red */
    color: #d63031;
}

.alert-warning {
    background: #fff2f2;
    /* Soft pastel orange/amber */
    color: #e17055;
}

/* Specific overrides */
tr.eliminar {
    display: none !important;
    /* Hide rows with 0 value if requested by logic */
}

@media (max-width: 480px) {
    .escondermovil {
        display: none;
    }
}

/* Plan Details Table (Legacy) */
.plan {
    width: 100%;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #eee;
    font-size: 14px;
}

.plan td,
.plan th {
    padding: 8px 12px;
    border-bottom: 1px solid #eee;
}

.plan td.cap {
    font-weight: 600;
    text-transform: capitalize;
    background: #f9f9f9;
    width: 40%;
    color: #555;
}

/* Legacy Buttons */
.et_pb_button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.5;
}

.et_pb_button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.botoneseliminar {
    width: 100%;
    margin-top: 30px;
}

.botoneseliminar td {
    padding: 5px;
    text-align: center;
}

/* Appointment Card List Styles */
.plan-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    overflow: hidden;
    transition: transform 0.2s;
}

.icon-circle-pastel {
    width: 80px;
    height: 80px;
    background: #eee;
    /* Light gray like Video Card */
    border-radius: 8px;
    /* Match Video Card style */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    /* Gray icon */
    font-size: 28px;
    flex-shrink: 0;
}

.plan-card-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    position: relative;
    z-index: 2;
}

.plan-card-header:active {
    background-color: #f9f9f9;
}

.plan-info h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    /* Black Title */
}

.plan-meta {
    font-size: 13px;
    color: #888;
    margin-top: 5px;
    display: flex;
    gap: 10px;
    align-items: center;
}


.plan-id {
    font-weight: 600;
    color: #666;
    margin-right: 10px;
}

.sede-badge {
    display: inline-block;
    background: #ffeeee;
    color: #d95798;
    padding: 8px 8px;
    border-radius: 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #ffffff;
}

.plan-toggle-icon {
    color: #ccc;
    font-size: 20px;
    transition: transform 0.3s;
}

.plan-details-container {
    display: none;
    border-top: 1px solid #eee;
    background: #fafafa;
    padding: 0px 2px 2px 2px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Open State */
.plan-card.open .plan-toggle-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

/* ==========================================
   PROGRESS BARS (Added for Treatments Dashboard)
   ========================================== */
.progress {
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #e9ecef;
    border-radius: .25rem;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #0d6efd;
    transition: width .6s ease;
}

/* ==========================================
   CIRCULAR PROGRESS (Treatments)
   ========================================== */
.circular-progress {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* Gradient set inline for dynamic value */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.circular-progress::before {
    content: "";
    position: absolute;
    width: 48px;
    /* Inner cut-out */
    height: 48px;
    border-radius: 50%;
    background: white;
}

.circular-progress span {
    position: relative;
    font-weight: 700;
    font-size: 13px;
    color: #d63384;
    z-index: 1;
}

/* Notification Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 20px;
    padding: 20px;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: modalPop 0.3s ease-out;
}

@keyframes modalPop {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notification-item {
    padding: 15px 0;
    border-bottom: 1px solid #f5f5f5;
}

.notification-item:last-child {
    border-bottom: none;
}

.notif-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 5px;
    color: #333;
}

.notif-date {
    font-size: 11px;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.notif-body {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.notif-empty {
    text-align: center;
    padding: 20px;
    color: #999;
}