/* Custom Modern Light CSS for Sottcorlabs Platform */

:root {
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    /* Brand Colors */
    --primary: #0ea5e9; /* Sky blue modern */
    --primary-hover: #0284c7;
    --primary-glow: rgba(14, 165, 233, 0.1);
    --accent: #10b981; /* Emerald green */
    --accent-hover: #059669;
    
    /* Status Colors - Light theme tailored */
    --status-pending-bg: #fef9c3;
    --status-pending-text: #713f12;
    --status-confirmed-bg: #e0e7ff;
    --status-confirmed-text: #3730a3;
    --status-attended-bg: #d1fae5;
    --status-attended-text: #065f46;
    --status-nocontesto-bg: #fee2e2;
    --status-nocontesto-text: #991b1b;
    --status-reprogrammed-bg: #ffe4e6;
    --status-reprogrammed-text: #9f1239;
    --status-rejected-bg: #f3f4f6;
    --status-rejected-text: #374151;

    /* Shadows & Transitions */
    --card-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 8px -1px rgba(15, 23, 42, 0.04);
    --modal-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    height: 100vh;
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* App Grid Layout */
.app-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    height: 100%;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding-left: 8px;
}

.brand-logo-img {
    height: 42px;
    width: 42px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.brand-name h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.brand-name span {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    margin-top: 16px;
    display: block;
    padding-left: 8px;
}

/* Role Selector Button Stack */
.role-selector-container {
    margin-bottom: 24px;
}

.role-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.role-btn {
    background: rgba(15, 23, 42, 0.02);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition-fast);
}

.role-btn svg {
    opacity: 0.7;
    transition: var(--transition-fast);
}

.role-btn:hover {
    background: rgba(15, 23, 42, 0.04);
    color: var(--text-primary);
    border-color: rgba(0, 0, 0, 0.15);
}

.role-btn.active {
    background: var(--primary-glow);
    border-color: rgba(14, 165, 233, 0.3);
    color: #0284c7;
}

.role-btn.active svg {
    color: #0284c7;
    opacity: 1;
}

/* Sidebar Menu */
.sidebar-menu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.menu-item:hover {
    background: rgba(0, 0, 0, 0.02);
    color: var(--text-primary);
}

.menu-item.active {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    border-left: 3px solid var(--primary);
    padding-left: 9px; /* Balance border spacing */
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-indicator-box {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.02);
    padding: 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.indicator-dot.online {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

.app-version {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* Main Area Layout */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
}

/* Top Navigation Bar */
.top-bar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 32px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-bar-left h2 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.top-bar-left p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Excel Uploader styles */
.excel-uploader-card {
    background: rgba(0, 0, 0, 0.01);
    border: 1px dashed rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.excel-uploader-card:hover {
    border-color: var(--primary);
    background: rgba(14, 165, 233, 0.02);
}

.uploader-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.uploader-label svg {
    color: var(--primary);
}

.uploader-text {
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-uploader-card.uploaded {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.03);
}

.excel-uploader-card.uploaded svg {
    color: var(--accent);
}

/* Profile details */
.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 1px solid var(--border-color);
    padding-left: 20px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Content Container wrapper */
.content-wrapper {
    padding: 32px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
}

/* Dashboard Views */
.dashboard-view {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

.dashboard-view.active {
    display: flex;
}

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

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon.scheduled {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}

.stat-icon.attended {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent);
}

.stat-icon.pending {
    background: rgba(234, 179, 8, 0.15);
    color: #a16207;
}

.stat-icon.contact-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #c2410c;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-trend {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.text-success { color: var(--accent-hover) !important; }
.text-warning { color: #a16207 !important; }
.text-danger { color: #b91c1c !important; }

/* Filter Panel styling */
.filters-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

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

.filters-header h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
}

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

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.5fr;
    gap: 16px;
}

.search-only-grid {
    grid-template-columns: 1fr;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

select, input[type="text"], input[type="date"], input[type="time"], input[type="number"], textarea {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition-fast);
    font-family: inherit;
    width: 100%;
}

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

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    padding-right: 36px;
}

/* Search Box element wrapper */
.search-box-wrapper {
    position: relative;
}

.search-box-wrapper input {
    padding-left: 36px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    outline: none;
    font-family: inherit;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--text-primary);
}

.btn-success {
    background-color: var(--accent);
    color: #ffffff;
}

.btn-success:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-whatsapp {
    background-color: #25d366;
    color: #ffffff;
}

.btn-whatsapp:hover {
    background-color: #20ba5a;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
}

.btn-danger {
    background-color: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.btn-danger:hover {
    background-color: #fcd34d;
    background-color: #fca5a5;
}

/* Agenda Table Styling */
.table-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.table-container {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

th {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    color: var(--text-primary);
    vertical-align: middle;
}

tr:hover td {
    background-color: #f8fafc;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.empty-state-content svg {
    color: var(--text-muted);
}

.empty-state-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.empty-state-content p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge.pendiente {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
}

.badge.confirmo {
    background-color: var(--status-confirmed-bg);
    color: var(--status-confirmed-text);
}

.badge.atendido {
    background-color: var(--status-attended-bg);
    color: var(--status-attended-text);
}

.badge.no-contesto {
    background-color: var(--status-nocontesto-bg);
    color: var(--status-nocontesto-text);
}

.badge.reprogramado {
    background-color: var(--status-reprogrammed-bg);
    color: var(--status-reprogrammed-text);
}

.badge.rechazado {
    background-color: var(--status-rejected-bg);
    color: var(--status-rejected-text);
}

/* Actions Column list */
.actions-cell {
    display: flex;
    gap: 6px;
}

.actions-col {
    width: 130px;
}

/* Pagination footer */
.table-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: #f8fafc;
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

/* NUTRITIONIST VIEW STYLES */
.nutrition-settings-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--card-shadow);
}

.nutrition-header-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.nutritionist-selector-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 320px;
}

.nutritionist-selector-box label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.active-profile-badge {
    background: rgba(14, 165, 233, 0.1);
    color: #0284c7;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    white-space: nowrap;
}

.nutritionist-stats-summary {
    display: flex;
    gap: 16px;
}

.stat-badge {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge-number {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0284c7;
    line-height: 1;
}

.badge-lbl {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-badge.success .badge-number {
    color: var(--accent-hover);
}

.nutri-board-title {
    margin-top: 10px;
}

.nutri-board-title h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nutri-board-title p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Patient card grid for nutritionists */
.nutri-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.patient-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.patient-card:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 165, 233, 0.3);
}

.patient-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background-color: var(--text-muted);
}

.patient-card.status-pendiente::before { background-color: var(--status-pending-text); }
.patient-card.status-confirmo::before { background-color: var(--status-confirmed-text); }
.patient-card.status-atendido::before { background-color: var(--status-attended-text); }
.patient-card.status-nocontesto::before { background-color: var(--status-nocontesto-text); }
.patient-card.status-reprogramado::before { background-color: var(--status-reprogrammed-text); }

.card-header-layout {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.card-time {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.card-meta-line svg {
    color: var(--text-muted);
}

.card-purchase-box {
    background: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.card-purchase-title {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.card-actions .btn {
    flex: 1;
}

/* Patients Archive Grid Styles */
.patients-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 20px;
}

.archive-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-fast);
}

.archive-card:hover {
    border-color: rgba(0, 0, 0, 0.1);
}

.archive-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.archive-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.archive-name-box h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.archive-name-box p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.archive-stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.archive-mini-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

.archive-stat-val {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 500;
}

.archive-recent-note {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border-left: 2px solid var(--primary);
    line-height: 1.4;
}

.archive-recent-note span {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

/* Modals General */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-box {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: var(--modal-shadow);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal-box {
    transform: scale(1);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close-btn, .drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.modal-close-btn:hover, .drawer-close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

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

.col-6 { width: calc(50% - 8px); }
.col-4 { width: calc(33.33% - 10.66px); }

.required {
    color: #dc2626;
}

.form-help {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
}

/* DRAWERS CLINICAL FOLLOW-UP */
.drawer-overlay {
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.drawer-overlay.active {
    display: block;
    opacity: 1;
}

.drawer-container {
    position: absolute;
    top: 0;
    right: -600px;
    width: 100%;
    max-width: 600px;
    height: 100%;
    background-color: #ffffff;
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: right var(--transition-normal);
}

.drawer-overlay.active .drawer-container {
    right: 0;
}

.drawer-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.patient-profile-summary {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.patient-profile-summary h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.patient-profile-summary p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Tabs */
.drawer-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: #f8fafc;
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition-fast);
    text-align: center;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.01);
}

.tab-btn.active {
    color: #0284c7;
    border-bottom-color: var(--primary);
    background: #ffffff;
}

.drawer-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.drawer-tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.drawer-tab-content.active {
    display: flex;
}

/* Patient meta info */
.patient-contact-card {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.patient-contact-card h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.meta-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-right: 6px;
}

.meta-val {
    font-size: 0.82rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Clinical sections */
.clinical-section {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title svg {
    color: var(--primary);
}

.section-help {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* BMI Calculated box */
.bmi-result-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--radius-md);
    height: 38px;
}

#nutri-bmi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bmi-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    color: #ffffff;
}

.bmi-underweight { background-color: #3b82f6; }
.bmi-normal { background-color: var(--accent); }
.bmi-overweight { background-color: #f59e0b; }
.bmi-obese { background-color: #ef4444; }

.drawer-actions {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Timeline component */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-item {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    position: relative;
}

.timeline-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.timeline-date {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0284c7;
}

.timeline-author {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timeline-metrics {
    display: flex;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timeline-metrics span strong {
    color: var(--text-primary);
}

.timeline-note {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.45;
    white-space: pre-line;
}

.timeline-guidelines {
    margin-top: 10px;
    background: rgba(14, 165, 233, 0.03);
    border: 1px dashed rgba(14, 165, 233, 0.25);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.timeline-guidelines h5 {
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #0284c7;
    font-weight: 700;
    margin-bottom: 4px;
}

.timeline-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 0;
    font-size: 0.85rem;
}

/* Follow-up Note Form & List */
.followup-entry-box {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: var(--radius-lg);
}

.followup-entry-box h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.followup-entry-box .btn {
    margin-top: 12px;
    width: 100%;
}

.followup-history {
    margin-top: 20px;
}

.followup-history h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.followup-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.followup-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.followup-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    border-bottom: 1px dashed var(--border-color);
    padding-bottom: 6px;
}

.followup-card-date {
    font-weight: 700;
    color: #0284c7;
}

.followup-card-channel {
    background: #f1f5f9;
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
}

.followup-card-notes {
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.45;
}

/* ==========================================
 * INNOVATIVE FEATURE: EVOLUTION CHART STYLES
 * ========================================== */
.chart-section {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 20px;
}

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

.chart-header h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-container {
    position: relative;
    width: 100%;
    height: 180px;
}

.chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.chart-axis {
    stroke: #e2e8f0;
    stroke-width: 1;
}

.chart-axis-text {
    font-size: 10px;
    fill: #94a3b8;
    text-anchor: middle;
}

.chart-line-weight {
    fill: none;
    stroke: var(--primary);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 2s ease-out forwards;
}

.chart-line-bmi {
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: drawPath 2s ease-out forwards;
    stroke-dasharray: 4, 4;
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

.chart-point {
    cursor: pointer;
    transition: r var(--transition-fast);
}

.chart-point:hover {
    r: 7;
}

.chart-point-weight {
    fill: #ffffff;
    stroke: var(--primary);
    stroke-width: 2.5;
}

.chart-point-bmi {
    fill: #ffffff;
    stroke: var(--accent);
    stroke-width: 2.5;
}

.chart-tooltip {
    background: #0f172a;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    position: absolute;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    line-height: 1.4;
}

.chart-legend {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    margin-top: 8px;
    justify-content: center;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 4px;
    border-radius: 2px;
}

/* ==========================================
 * INNOVATIVE FEATURE: SMART WHATSAPP BUILDER
 * ========================================== */
.whatsapp-widget {
    background: #e5ddd5; /* Classic WhatsApp chat background */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23b2a295' fill-opacity='0.08'%3E%3Cpath d='M10 20c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10zm0 40c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10zm40-20c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10zm0-20c0-5.5 4.5-10 10-10s10 4.5 10 10-4.5 10-10 10-10-4.5-10-10z'/%3E%3C/g%3E%3C/svg%3E");
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border: 1px solid #d1c7bd;
    margin-top: 14px;
}

.whatsapp-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.whatsapp-widget-header h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #4b5954;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.whatsapp-template-select {
    max-width: 220px;
    font-size: 0.78rem;
    padding: 6px 10px;
    background-color: #ffffff;
    border-color: #c9c1b7;
}

.whatsapp-chat-bubble {
    background: #ffffff;
    padding: 12px 14px;
    border-radius: 0 10px 10px 10px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    position: relative;
    max-width: 90%;
    align-self: flex-start;
    border: 1px solid #e1dcd7;
}

.whatsapp-chat-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent #ffffff transparent transparent;
}

.whatsapp-chat-textarea {
    width: 100%;
    min-height: 90px;
    border: none;
    resize: none;
    font-size: 0.82rem;
    line-height: 1.4;
    outline: none;
    color: #303030;
    background: transparent;
    padding: 0;
}

.whatsapp-chat-time {
    display: block;
    font-size: 0.65rem;
    color: #999;
    text-align: right;
    margin-top: 4px;
    font-weight: 500;
}

.whatsapp-send-action-row {
    display: flex;
    justify-content: flex-end;
}

/* Responsiveness adjustments */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .filter-search-group {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .app-container {
        grid-template-columns: 1fr;
    }
    .sidebar {
        display: none; /* In production, we'd build a drawer for sidebar on mobile */
    }
}

/* Login Page Overlay Styles */
.login-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgb(239, 246, 255) 0%, rgb(219, 234, 254) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.login-card {
    background: #ffffff;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    height: 64px;
    width: 64px;
    object-fit: contain;
    margin-bottom: 16px;
}

.login-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.btn-logout:hover {
    background: #fecaca !important;
    transform: translateY(-1px);
}
