/* ═══════════════════════════════════════════════════════════
   ODERITH DENTAL — Dark Professional Theme
   ═══════════════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
    --c-primary: #1a73e8;
    --c-primary-light: #4a9aff;
    --c-primary-dark: #1557b0;
    --c-bg-body: #1a1a2e;
    --c-bg-sidebar: #16213e;
    --c-bg-card: #0f3460;
    --c-bg-input: #162447;
    --c-bg-hover: #1b3a6b;
    --c-bg-modal: #1a1a2e;
    --c-text: #e0e0e0;
    --c-text-muted: #8a8fa8;
    --c-text-heading: #f0f0f0;
    --c-border: #2a3a5c;
    --c-success: #00c853;
    --c-warning: #ffab00;
    --c-danger: #ff1744;
    --c-info: #29b6f6;
    --sidebar-width: 260px;
    --header-height: 60px;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: all 0.25s ease;
}

/* ─── Reset & Base ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--c-bg-body);
    color: var(--c-text);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--c-bg-body); }
::-webkit-scrollbar-thumb { background: var(--c-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-primary); }

a { color: var(--c-primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 { color: var(--c-text-heading); font-weight: 600; }

.text-muted { color: var(--c-text-muted); }

/* ═══════════════════════════════════════════════════════════
   LAYOUT: Sidebar + Main
   ═══════════════════════════════════════════════════════════ */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--c-bg-sidebar);
    border-right: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
    min-height: var(--header-height);
}

.sidebar-logo {
    font-size: 1.8rem;
}

.sidebar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-text-heading);
    white-space: nowrap;
}

.sidebar-close {
    display: none;
    margin-left: auto;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 20px;
    color: var(--c-text-muted);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.nav-link:hover {
    background: var(--c-bg-hover);
    color: var(--c-text);
    text-decoration: none;
}

.nav-link.active {
    background: rgba(26, 115, 232, 0.12);
    color: var(--c-primary-light);
    border-left-color: var(--c-primary);
    font-weight: 600;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.nav-text {
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-badge {
    margin-left: auto;
    background: var(--c-danger);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--c-border);
    padding: 14px 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--c-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--c-text-muted);
}

/* Main wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: var(--header-height);
    background: var(--c-bg-sidebar);
    border-bottom: 1px solid var(--c-border);
    backdrop-filter: blur(10px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 700;
    display: none; /* Show on mobile */
}

#btn-sidebar-toggle {
    display: none; /* Show on mobile */
    font-size: 1.4rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-user {
    font-size: 0.9rem;
    color: var(--c-text-muted);
}

/* Content */
.app-content {
    flex: 1;
    padding: 24px;
}

/* ═══════════════════════════════════════════════════════════
   AUTH SECTIONS (Login / Register)
   ═══════════════════════════════════════════════════════════ */

.auth-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--header-height));
}

.auth-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.4s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-logo {
    font-size: 3rem;
    display: block;
    margin-bottom: 12px;
}

.auth-header h2 {
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--c-text-muted);
    font-size: 0.9rem;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--c-border);
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 1.4rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */

.card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--c-border);
}

.card-header h3 {
    font-size: 1rem;
}

.card-link {
    font-size: 0.85rem;
    color: var(--c-primary-light);
}

.card-body {
    padding: 16px 20px;
}

/* Dashboard Cards */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dash-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
}

.dash-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.dash-card-icon {
    font-size: 2rem;
    width: 52px;
    height: 52px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dash-card--patients .dash-card-icon { background: rgba(26, 115, 232, 0.15); }
.dash-card--appointments .dash-card-icon { background: rgba(0, 200, 83, 0.15); }
.dash-card--budgets .dash-card-icon { background: rgba(255, 171, 0, 0.15); }
.dash-card--income .dash-card-icon { background: rgba(0, 229, 255, 0.15); }

.dash-card-info { display: flex; flex-direction: column; }

.dash-card-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--c-text-heading);
    line-height: 1.2;
}

.dash-card-label {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    margin-top: 2px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ═══════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════ */

.form-group {
    margin-bottom: 16px;
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--c-text-muted);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--c-bg-input);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    color: var(--c-text);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.2);
}

.form-control::placeholder {
    color: var(--c-text-muted);
    opacity: 0.6;
}

.form-control-sm {
    padding: 7px 10px;
    font-size: 0.85rem;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8fa8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group { margin-bottom: 16px; }

.form-section {
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius);
}

.form-section h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--c-primary-light);
}

.form-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.form-section-header h4 { margin-bottom: 0; }

/* Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.88rem;
}

.checkbox-label:hover {
    background: var(--c-bg-hover);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--c-primary);
    cursor: pointer;
    flex-shrink: 0;
}

/* Search box */
.search-box {
    position: relative;
}

.search-box input {
    padding-left: 14px;
    min-width: 240px;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--c-primary);
    color: #fff;
    border-color: var(--c-primary);
}
.btn-primary:hover {
    background: var(--c-primary-dark);
    box-shadow: 0 4px 14px rgba(26, 115, 232, 0.4);
}

.btn-secondary {
    background: var(--c-bg-input);
    color: var(--c-text);
    border-color: var(--c-border);
}
.btn-secondary:hover {
    background: var(--c-bg-hover);
}

.btn-danger {
    background: var(--c-danger);
    color: #fff;
    border-color: var(--c-danger);
}
.btn-danger:hover {
    background: #d50000;
    box-shadow: 0 4px 14px rgba(255, 23, 68, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--c-primary-light);
    border-color: var(--c-primary);
}
.btn-outline:hover {
    background: rgba(26, 115, 232, 0.1);
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-muted);
    border-color: transparent;
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--c-bg-hover);
    color: var(--c-text);
}
.btn-ghost.active {
    background: rgba(26, 115, 232, 0.15);
    color: var(--c-primary-light);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--c-text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.btn-icon:hover {
    background: var(--c-bg-hover);
    color: var(--c-text);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════ */

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--c-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table thead th {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(42, 58, 92, 0.4);
    font-size: 0.88rem;
    vertical-align: middle;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.08);
}

.data-table tbody tr:hover {
    background: var(--c-bg-hover);
}

.data-table .actions-cell {
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--c-text-muted);
}

.empty-state p {
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-programada, .badge-pendiente { background: rgba(41, 182, 246, 0.15); color: var(--c-info); }
.badge-confirmada { background: rgba(26, 115, 232, 0.15); color: var(--c-primary-light); }
.badge-en_curso, .badge-en_proceso, .badge-parcial { background: rgba(255, 171, 0, 0.15); color: var(--c-warning); }
.badge-completada, .badge-aceptado, .badge-pagada { background: rgba(0, 200, 83, 0.15); color: var(--c-success); }
.badge-cancelada, .badge-rechazado { background: rgba(255, 23, 68, 0.15); color: var(--c-danger); }
.badge-no_asistio { background: rgba(117, 117, 117, 0.2); color: #bbb; }
.badge-info { background: rgba(41, 182, 246, 0.15); color: var(--c-info); }
.badge-success { background: rgba(0, 200, 83, 0.15); color: var(--c-success); }
.badge-warning { background: rgba(255, 171, 0, 0.15); color: var(--c-warning); }
.badge-danger { background: rgba(255, 23, 68, 0.15); color: var(--c-danger); }

/* ═══════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
    overflow-y: auto;
}

.modal-card {
    background: var(--c-bg-modal);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    animation: slideInUp 0.3s ease;
}

.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-sm { max-width: 400px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
}

.modal-header h3 {
    font-size: 1.1rem;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--c-border);
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   BUDGETS
   ═══════════════════════════════════════════════════════════ */

.budget-totals {
    margin-top: 16px;
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.budget-totals .form-row { flex: 1; }

.totals-display {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    padding: 16px;
    min-width: 250px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9rem;
}

.total-row--final {
    border-top: 1px solid var(--c-border);
    margin-top: 6px;
    padding-top: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--c-primary-light);
}

/* ═══════════════════════════════════════════════════════════
   ACCOUNTS
   ═══════════════════════════════════════════════════════════ */

.accounts-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.summary-item {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--c-text-muted);
    text-transform: uppercase;
}

.summary-value {
    font-size: 1.4rem;
    font-weight: 700;
}

.summary-total .summary-value { color: var(--c-info); }
.summary-paid .summary-value { color: var(--c-success); }
.summary-pending .summary-value { color: var(--c-warning); }

.payment-info {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 18px;
}

.payment-info p {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.account-detail-info {
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.account-detail-info p { font-size: 0.9rem; }

/* ═══════════════════════════════════════════════════════════
   WHATSAPP
   ═══════════════════════════════════════════════════════════ */

.whatsapp-content {
    display: grid;
    gap: 20px;
}

.wa-appointment-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(42, 58, 92, 0.4);
}

.wa-appointment-item:last-child { border-bottom: none; }

.wa-appt-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wa-appt-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.wa-appt-detail {
    font-size: 0.82rem;
    color: var(--c-text-muted);
}

.wa-appt-actions {
    display: flex;
    gap: 8px;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
    border-color: #25D366;
}
.btn-whatsapp:hover {
    background: #1da851;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

.wa-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(42, 58, 92, 0.3);
    font-size: 0.85rem;
}

.wa-history-item .wa-status {
    font-size: 1.1rem;
}

/* ═══════════════════════════════════════════════════════════
   ASSISTANTS
   ═══════════════════════════════════════════════════════════ */

.assistants-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.assistant-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.assistant-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.assistant-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.assistant-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--c-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.assistant-info h4 { font-size: 1rem; margin-bottom: 2px; }
.assistant-info p { font-size: 0.8rem; color: var(--c-text-muted); }

.assistant-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 14px;
}

.perm-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(26, 115, 232, 0.12);
    color: var(--c-primary-light);
}

.assistant-card-actions {
    display: flex;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════════
   CALENDAR
   ═══════════════════════════════════════════════════════════ */

.calendar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.calendar-title {
    font-size: 1rem;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--c-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.cal-day-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 8px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-text-muted);
    text-transform: uppercase;
}

.cal-day {
    background: var(--c-bg-card);
    padding: 8px;
    min-height: 100px;
    font-size: 0.8rem;
}

.cal-day-number {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.cal-day.today .cal-day-number {
    color: var(--c-primary-light);
}

.cal-event {
    background: rgba(26, 115, 232, 0.2);
    border-left: 3px solid var(--c-primary);
    padding: 3px 6px;
    margin-bottom: 3px;
    border-radius: 2px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cal-event:hover {
    background: rgba(26, 115, 232, 0.35);
}

.cal-event--completada { border-left-color: var(--c-success); background: rgba(0, 200, 83, 0.12); }
.cal-event--cancelada { border-left-color: var(--c-danger); background: rgba(255, 23, 68, 0.12); }
.cal-event--en_curso { border-left-color: var(--c-warning); background: rgba(255, 171, 0, 0.12); }

.view-toggle {
    display: flex;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.view-toggle .btn {
    border-radius: 0;
    border: none;
}

/* ═══════════════════════════════════════════════════════════
   ODONTOGRAM
   ═══════════════════════════════════════════════════════════ */

.odontogram-wrapper {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.odontogram-tools {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px;
}

.odontogram-tools h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--c-primary-light);
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 20px;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--c-text);
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-family: inherit;
    text-align: left;
}

.tool-btn:hover {
    background: var(--c-bg-hover);
}

.tool-btn.active {
    background: rgba(26, 115, 232, 0.12);
    border-color: var(--c-primary);
    color: var(--c-primary-light);
}

.tool-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.tool-legend {
    border-top: 1px solid var(--c-border);
    padding-top: 16px;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--c-text-muted);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.odontogram-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.odontogram-container {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
}

.odontogram-container svg {
    max-width: 100%;
}

.odontogram-notes {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px;
}

.odontogram-notes h4 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: var(--c-primary-light);
}

/* Odontogram SVG styles */
.tooth-face {
    stroke: #555;
    stroke-width: 1;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.tooth-face:hover {
    opacity: 0.75;
    stroke: var(--c-primary-light);
    stroke-width: 2;
}

.tooth-number {
    fill: var(--c-text-muted);
    font-size: 11px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
    font-family: inherit;
}

.tooth-root {
    fill: none;
    stroke: var(--c-text-muted);
    stroke-width: 1.2;
    pointer-events: none;
}

/* Odontogram context menu */
.odonto-context-menu {
    position: fixed;
    z-index: 3000;
    background: var(--c-bg-sidebar);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    min-width: 180px;
    padding: 4px 0;
}

.odonto-context-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: var(--c-text);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: var(--transition);
}

.odonto-context-menu button:hover {
    background: var(--c-bg-hover);
}

/* Odontogram tooltip */
.odonto-tooltip {
    position: fixed;
    z-index: 3000;
    background: var(--c-bg-sidebar);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    font-size: 0.78rem;
    color: var(--c-text);
    box-shadow: var(--shadow-sm);
    pointer-events: none;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 380px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease;
    font-size: 0.88rem;
    position: relative;
    overflow: hidden;
}

.toast::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: toastProgress 4s linear forwards;
}

.toast-success {
    background: var(--c-bg-sidebar);
    border: 1px solid var(--c-success);
    color: var(--c-text);
}
.toast-success::after { background: var(--c-success); }

.toast-error {
    background: var(--c-bg-sidebar);
    border: 1px solid var(--c-danger);
    color: var(--c-text);
}
.toast-error::after { background: var(--c-danger); }

.toast-warning {
    background: var(--c-bg-sidebar);
    border: 1px solid var(--c-warning);
    color: var(--c-text);
}
.toast-warning::after { background: var(--c-warning); }

.toast-info {
    background: var(--c-bg-sidebar);
    border: 1px solid var(--c-info);
    color: var(--c-text);
}
.toast-info::after { background: var(--c-info); }

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--c-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════
   LOADING OVERLAY / SPINNER
   ═══════════════════════════════════════════════════════════ */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--c-border);
    border-top-color: var(--c-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
    display: inline-block;
    vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(80px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    .budget-totals {
        flex-direction: column;
    }
    .odontogram-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow);
    }

    .sidebar-close {
        display: inline-flex;
    }

    .main-wrapper {
        margin-left: 0;
    }

    #btn-sidebar-toggle {
        display: inline-flex;
    }

    .header-title {
        display: block;
    }

    .app-content {
        padding: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-actions {
        width: 100%;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .search-box input {
        min-width: auto;
        width: 100%;
    }

    .modal-card {
        margin: 10px;
    }

    .auth-card {
        padding: 24px;
    }

    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .cal-day {
        min-height: 70px;
        padding: 4px;
    }

    .accounts-summary {
        grid-template-columns: 1fr;
    }

    .assistants-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════ */

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .sidebar, .app-header, .modal-overlay,
    .toast-container, .loading-overlay,
    .btn, .section-actions {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .app-content {
        padding: 0;
    }

    .data-table {
        background: #fff;
    }

    .data-table thead th {
        background: #f0f0f0;
        color: #333;
        border-bottom: 2px solid #333;
    }

    .data-table tbody td {
        border-bottom: 1px solid #ddd;
        color: #000;
    }

    .card {
        border-color: #ddd;
        background: #fff;
    }

    .badge {
        border: 1px solid #999;
        color: #000 !important;
        background: transparent !important;
    }

    .totals-display {
        background: #f5f5f5;
    }

    .total-row--final {
        color: #000;
    }
}


/* ══════════════════════════════════════════════════
   CSS SUPPLEMENT — Clases adicionales para el HTML 
   ══════════════════════════════════════════════════ */

/* Layout */
.content-area { padding: 24px; min-height: calc(100vh - 60px); }
.top-header { display:flex; align-items:center; gap:12px; padding:12px 24px; background:var(--bg-card,#0f3460); border-bottom:1px solid rgba(255,255,255,.08); }
.header-spacer { flex:1; }
.header-date { color:var(--text-muted,#8a8fa8); font-size:.85rem; }

/* Page headers */
.page-header { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin-bottom:20px; }
.page-title { font-size:1.5rem; font-weight:700; color:#fff; margin:0; }
.page-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }

/* Tables */
.table { width:100%; border-collapse:collapse; background:var(--bg-card,#0f3460); border-radius:12px; overflow:hidden; }
.table thead th { padding:12px 16px; text-align:left; font-size:.8rem; text-transform:uppercase; letter-spacing:.5px; color:var(--text-muted,#8a8fa8); background:rgba(0,0,0,.2); border-bottom:1px solid rgba(255,255,255,.08); white-space:nowrap; }
.table tbody td { padding:12px 16px; border-bottom:1px solid rgba(255,255,255,.05); color:var(--text,#e0e0e0); font-size:.9rem; }
.table tbody tr:hover { background:rgba(26,115,232,.08); }
.table-container { overflow-x:auto; border-radius:12px; }

/* Stats cards */
.stat-card { background:var(--bg-card,#0f3460); border-radius:12px; padding:20px; display:flex; align-items:center; gap:16px; border:1px solid rgba(255,255,255,.06); }
.stat-icon { font-size:2rem; width:50px; height:50px; display:flex; align-items:center; justify-content:center; border-radius:12px; background:rgba(26,115,232,.15); }
.stat-info { display:flex; flex-direction:column; }
.stat-value { font-size:1.6rem; font-weight:700; color:#fff; line-height:1.2; }
.stat-label { font-size:.8rem; color:var(--text-muted,#8a8fa8); margin-top:2px; }

/* Auth extras */
.auth-title { font-size:1.8rem; font-weight:700; color:#fff; margin:12px 0 4px; }
.auth-subtitle { color:var(--text-muted,#8a8fa8); margin-bottom:24px; }

/* Sidebar profile */
.sidebar-profile { display:flex; align-items:center; gap:12px; padding:8px 0; }
.sidebar-avatar-circle { width:40px; height:40px; border-radius:50%; background:var(--primary,#1a73e8); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:1.1rem; flex-shrink:0; }

/* Sidebar icons */
.link-icon { margin-right:10px; font-size:1.1rem; }

/* Modal close button */
.modal-close { background:none; border:none; color:var(--text-muted,#8a8fa8); font-size:1.3rem; cursor:pointer; padding:4px 8px; border-radius:6px; transition:all .2s; }
.modal-close:hover { background:rgba(255,255,255,.1); color:#fff; }

/* Form section */
.form-section { margin-bottom:16px; }
.form-section h4 { color:var(--text,#e0e0e0); font-size:1rem; margin:16px 0 10px; padding-bottom:6px; border-bottom:1px solid rgba(255,255,255,.08); }

/* Odontogram legend */
.odonto-legend { display:flex; flex-wrap:wrap; gap:10px; margin-bottom:16px; }

/* Assistants grid */
.assistants-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:16px; }

/* Calendar grid */
.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:1px; background:rgba(255,255,255,.05); border-radius:12px; overflow:hidden; }

/* Responsive */
@media (max-width:768px) {
    .content-area { padding:16px; }
    .page-header { flex-direction:column; align-items:stretch; }
    .page-actions { flex-direction:column; }
    .dashboard-cards { grid-template-columns:repeat(2,1fr) !important; }
}
