:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --bg-dark: #0f0f23;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252541;
    --text-primary: #ffffff;
    --text-secondary: #a0a0c0;
    --border-color: #2a2a4a;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --primary-light: #667eea;
    --accent-color: #0070f3;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    padding: 32px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.logo-title {
    font-size: 28px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.logo-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Login Modal */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    font-size: 15px;
    transition: all 0.3s ease;
}

.login-form input:focus {
    border-color: var(--primary-light);
    outline: none;
    background: rgba(255, 255, 255, 0.08);
}

.login-error {
    color: #ff8a80;
    font-size: 13px;
    text-align: center;
    min-height: 20px;
}

.btn-danger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f5576c, #d32f2f);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #667eea;
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon-blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.stat-icon-purple {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 16px rgba(240, 147, 251, 0.4);
}

.stat-icon-green {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 16px rgba(79, 172, 254, 0.4);
}

.stat-icon svg {
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Table Container */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.table-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-generar-tabla {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(79, 172, 254, 0.3);
    white-space: nowrap;
}

.btn-generar-tabla:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(79, 172, 254, 0.4);
}

.btn-generar-tabla:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-print-pdf {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.btn-print-pdf:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-print-pdf:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-print-cirugias {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    white-space: nowrap;
}

.btn-print-cirugias:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

/* Checkbox column */
.th-checkbox,
.td-checkbox {
    width: 40px;
    text-align: center;
}

.th-checkbox input[type="checkbox"],
.td-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.table-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box svg {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 650px;
    border-radius: 12px;
}

.patients-table {
    width: 100%;
    border-collapse: collapse;
}

.patients-table thead {
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 10;
}

.patients-table th {
    padding: 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.patients-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.patients-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.patients-table td {
    padding: 16px;
    font-size: 14px;
    color: var(--text-primary);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success {
    background: rgba(79, 172, 254, 0.2);
    color: #4facfe;
}

.badge-warning {
    background: rgba(245, 87, 108, 0.2);
    color: #f5576c;
}

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

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-primary {
    background: rgba(79, 172, 254, 0.1);
    color: #4facfe;
}

.icon-success {
    background: rgba(0, 230, 118, 0.1);
    color: #00e676;
}

.icon-warning {
    background: rgba(255, 167, 38, 0.1);
    color: #ffb74d;
}

.icon-danger {
    background: rgba(245, 87, 108, 0.1);
    color: #f5576c;
}

.stat-alert {
    border: 1px solid rgba(245, 87, 108, 0.3);
}

.stat-alert .stat-value {
    color: #f5576c;
}

.btn-edit {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.btn-edit:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.btn-delete {
    background: rgba(245, 87, 108, 0.2);
    color: #f5576c;
}

.btn-delete:hover {
    background: rgba(245, 87, 108, 0.3);
    transform: scale(1.1);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 64px 24px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-value {
        font-size: 24px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
    }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box input {
        width: 100%;
    }

    .patients-table {
        font-size: 12px;
    }

    .patients-table th,
    .patients-table td {
        padding: 12px 8px;
    }

    .tab-nav {
        padding: 0 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        flex: 0 0 auto;
        padding: 14px 12px;
        font-size: 13px;
        gap: 6px;
    }

    .tab-btn svg {
        width: 16px;
        height: 16px;
    }

    .modal-content {
        padding: 24px;
        border-radius: 16px;
        width: 95%;
    }

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

    .piso-card {
        padding: 14px;
    }

    .cirugias-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .table-wrapper {
        max-height: 400px;
    }
}

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

    .tab-btn {
        padding: 10px 8px;
        font-size: 12px;
        gap: 4px;
    }

    .tab-btn svg {
        width: 14px;
        height: 14px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-card {
        padding: 12px;
        gap: 8px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .modal-content {
        padding: 16px;
        border-radius: 12px;
    }

    .piso-card {
        padding: 12px;
        border-radius: 12px;
    }
}

/* Status Select Dashboard */
.status-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    width: 130px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.status-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
}

.status-select option {
    background: #1a1a2e;
    color: white;
}

/* Status Filter Header */
.th-filterable {
    position: relative;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.filter-header:hover {
    color: #667eea;
}

.filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #1a1a2e;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: none;
    margin-top: 8px;
    animation: fadeInSlideUp 0.3s ease-out;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown.active {
    display: block;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
}

.filter-option:hover {
    color: var(--text-primary);
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #667eea;
    cursor: pointer;
}

.filter-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.btn-filter-reset,
.btn-filter-all {
    background: transparent;
    border: none;
    color: #667eea;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-filter-reset:hover,
.btn-filter-all:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Status Colors */
.status-select[data-status="Operado"] {
    color: #4facfe;
    border-color: rgba(79, 172, 254, 0.3);
}

.status-select[data-status="En espera"] {
    color: #a0a0c0;
}

.status-select[data-status="Reprogramar"] {
    color: #f093fb;
    border-color: rgba(240, 147, 251, 0.3);
}

.status-select[data-status="Cancelado"] {
    color: #f5576c;
    border-color: rgba(245, 87, 108, 0.3);
}

/* Date Conditional Formatting (VPO and Labs) */
.date-indicator {
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.date-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.indicator-green {
    background: rgba(0, 230, 118, 0.15);
    color: #00e676;
    border: 1px solid rgba(0, 230, 118, 0.3);
}

.indicator-green::after {
    background: #00e676;
}

.indicator-orange {
    background: rgba(255, 167, 38, 0.15);
    color: #ffb74d;
    border: 1px solid rgba(255, 167, 38, 0.3);
}

.indicator-orange::after {
    background: #ffb74d;
}

.indicator-red {
    background: rgba(245, 87, 108, 0.15);
    color: #ff8a80;
    border: 1px solid rgba(245, 87, 108, 0.3);
}

.indicator-red::after {
    background: #ff8a80;
}

/* Custom Delete Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px;
    width: 90%;
    max-width: 450px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-icon {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: white;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn-danger-confirm {
    background: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Table Filters Bar */
.table-filters {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
    color: #667eea;
    font-weight: 600;
}

.filter-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.filter-select:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
}

.filter-select option {
    background: #1a1a2e;
    color: white;
}

/* Calendar Toggle Button */
.btn-calendar {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
}

/* Calendar Container */
.calendar-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    animation: fadeIn 0.3s ease;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.cal-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #667eea;
}

.cal-month-title {
    font-size: 22px;
    font-weight: 700;
    flex: 1;
}

.btn-cal-today {
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cal-today:hover {
    background: rgba(102, 126, 234, 0.25);
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.cal-day-header {
    background: var(--bg-dark);
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cal-day-cell {
    background: var(--bg-card);
    min-height: 110px;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    vertical-align: top;
    position: relative;
}

.cal-day-cell:hover {
    background: var(--bg-card-hover);
}

.cal-day-cell.other-month {
    background: rgba(26, 26, 46, 0.5);
}

.cal-day-cell.other-month .cal-day-number {
    color: rgba(160, 160, 192, 0.3);
}

.cal-day-cell.today {
    background: rgba(102, 126, 234, 0.08);
}

.cal-day-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.cal-day-cell.today .cal-day-number {
    background: var(--primary-gradient);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.cal-patient-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 6px;
    margin-bottom: 2px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cal-patient-chip:hover {
    transform: translateX(2px);
    opacity: 0.9;
}

.cal-patient-chip .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-patient-chip .chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
}

.chip-operado {
    background: rgba(79, 172, 254, 0.15);
    color: #4facfe;
}

.chip-espera {
    background: rgba(160, 160, 192, 0.15);
    color: #a0a0c0;
}

.chip-reprogramar {
    background: rgba(240, 147, 251, 0.15);
    color: #f093fb;
}

.chip-cancelado {
    background: rgba(245, 87, 108, 0.15);
    color: #f5576c;
}

.cal-more-link {
    font-size: 11px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.cal-more-link:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Patient Detail Modal */
.detail-modal {
    max-width: 500px;
    text-align: left;
}

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

.modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.detail-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.detail-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 100px;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        font-size: 11px;
    }

    .cal-day-cell {
        min-height: 80px;
        padding: 4px;
    }

    .cal-patient-chip {
        font-size: 9px;
        padding: 2px 4px;
    }

    .cal-day-number {
        font-size: 12px;
    }
}

/* Print Table Modal */
.print-modal-content {
    background: white;
    border-radius: 16px;
    width: 95%;
    max-width: 1400px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #1a1a2e;
}

.print-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 2px solid #667eea;
    flex-shrink: 0;
}

.print-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #667eea;
}

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

.print-modal-body {
    padding: 20px 24px;
    overflow: auto;
    flex: 1;
}

.print-modal-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.print-modal-body thead th {
    background: #667eea;
    color: white;
    padding: 8px 6px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.print-modal-body tbody tr {
    border-bottom: 1px solid #ddd;
}

.print-modal-body tbody tr:nth-child(even) {
    background: #f8f9ff;
}

.print-modal-body tbody td {
    padding: 7px 6px;
    vertical-align: middle;
    font-size: 12px;
    color: #333;
}

.print-modal-body td.num {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    width: 30px;
}

.print-modal-body td.nombre {
    font-weight: 600;
    min-width: 180px;
}

.print-modal-body .print-header-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 16px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

.print-modal-body .print-header-info h2 {
    font-size: 16px;
    font-weight: 700;
    color: #667eea;
}

.print-modal-body .print-header-info .fecha {
    font-size: 11px;
    color: #666;
}

.print-modal-body .footer-note {
    margin-top: 16px;
    font-size: 10px;
    color: #999;
    text-align: right;
}

.btn-close-print svg {
    vertical-align: middle;
}

/* ===== Tab Navigation ===== */
.tab-nav {
    display: flex;
    gap: 0;
    padding: 0 32px;
    margin-top: -8px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    margin-bottom: -1px;
}

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

.tab-btn.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
    font-weight: 600;
}

.tab-btn svg {
    flex-shrink: 0;
}

/* ===== Tab Content ===== */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* ===== Quick Actions ===== */
.quick-actions {
    display: flex;
    gap: 12px;
    padding: 0 0 20px 0;
}

.quick-actions .btn-primary {
    padding: 10px 20px;
    font-size: 14px;
}

/* ===== Section Title Inline ===== */
.section-title-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* ===== Piso Section ===== */
.piso-header {
    margin-bottom: 24px;
}

.piso-header .piso-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.piso-header .piso-header-top .section-title-inline {
    margin-bottom: 0;
}

.piso-search-area {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.piso-search-area .search-box {
    max-width: 420px;
    width: 100%;
}

.piso-search-results {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.piso-search-results.active {
    display: block;
}

.piso-search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.piso-search-result-item:last-child {
    border-bottom: none;
}

.piso-search-result-item:hover {
    background: rgba(102, 126, 234, 0.08);
}

.piso-result-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.piso-result-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.piso-result-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.piso-result-add {
    padding: 6px 14px;
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.3);
    border-radius: 8px;
    color: #00e676;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.piso-result-add:hover {
    background: rgba(0, 230, 118, 0.2);
}

.piso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.piso-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.piso-empty p {
    margin: 8px 0 0;
    font-size: 15px;
}

.piso-empty-hint {
    font-size: 13px !important;
    opacity: 0.5;
}

.piso-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.piso-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.piso-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.piso-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 8px;
}

.piso-card-top .piso-cama-input {
    width: 72px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 6px 10px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    text-align: center;
    transition: all 0.2s ease;
}

.piso-card-top .piso-cama-input:focus {
    border-color: var(--primary-light);
    outline: none;
    background: rgba(255, 255, 255, 0.07);
}

.piso-card-top .piso-cama-input::placeholder {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 12px;
}

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

.piso-card-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.piso-card-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.piso-card-info {
    margin-bottom: 10px;
}

.piso-field-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.deih-wrapper {
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}

.diag-wrapper {
    display: flex;
    align-items: flex-end;
    padding-bottom: 2px;
}

.diag-badge {
    background: rgba(41, 151, 255, 0.12);
    border: 1px solid rgba(41, 151, 255, 0.3);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #2997ff;
    white-space: nowrap;
    letter-spacing: 0.3px;
}

.deih-badge {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #00e676;
    white-space: nowrap;
}

.piso-card-actions {
    display: flex;
    gap: 6px;
}

.piso-card-remove {
    padding: 6px 10px;
    background: rgba(245, 87, 108, 0.1);
    border: 1px solid rgba(245, 87, 108, 0.2);
    border-radius: 8px;
    color: #ff8a80;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.piso-card-remove:hover {
    background: rgba(245, 87, 108, 0.2);
}

.piso-card-edit {
    padding: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.piso-card-edit:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
    color: var(--primary-light);
}

.piso-card-alta {
    padding: 6px 14px;
    background: linear-gradient(135deg, #00e676, #00c853);
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.piso-card-alta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 230, 118, 0.3);
}

.piso-card-alta:active {
    transform: translateY(0);
}

.deih-badge {
    background: rgba(0, 230, 118, 0.12);
    border: 1px solid rgba(0, 230, 118, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #00e676;
    white-space: nowrap;
    flex-shrink: 0;
}

.piso-card-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.piso-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.piso-field-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.piso-field input,
.piso-field textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.piso-field input:focus,
.piso-field textarea:focus {
    border-color: var(--primary-light);
    outline: none;
    background: rgba(255, 255, 255, 0.07);
}

.piso-field textarea {
    resize: vertical;
    min-height: 60px;
    font-size: 13px;
    line-height: 1.5;
}

.piso-card-footer {
    display: flex;
    margin-top: 12px;
}

.piso-card-report {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    background: rgba(41, 151, 255, 0.1);
    border: 1px solid rgba(41, 151, 255, 0.3);
    border-radius: 10px;
    color: #2997ff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.piso-card-report:hover {
    background: rgba(41, 151, 255, 0.2);
}

.piso-estado-select {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    margin-left: 8px;
    appearance: auto;
    transition: all 0.2s ease;
}

.piso-estado-en-espera {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.35);
    color: #ff9500;
}

.piso-estado-operado {
    background: rgba(52, 199, 89, 0.12);
    border-color: rgba(52, 199, 89, 0.4);
    color: #34c759;
}

.piso-estado-reprogramar {
    background: rgba(88, 86, 214, 0.12);
    border-color: rgba(88, 86, 214, 0.35);
    color: #5856d6;
}

.piso-estado-cancelado {
    background: rgba(255, 59, 48, 0.12);
    border-color: rgba(255, 59, 48, 0.35);
    color: #ff3b30;
}

.piso-estado-alta-definitiva-sin-cirugia {
    background: rgba(90, 200, 250, 0.12);
    border-color: rgba(90, 200, 250, 0.35);
    color: #5ac8fa;
}

.piso-estado-alta-transitoria {
    background: rgba(90, 200, 250, 0.12);
    border-color: rgba(90, 200, 250, 0.35);
    color: #5ac8fa;
}

.piso-estado-defuncion {
    background: rgba(142, 142, 147, 0.12);
    border-color: rgba(142, 142, 147, 0.35);
    color: #8e8e93;
}

.piso-estado-hospitalizado {
    background: rgba(255, 149, 0, 0.12);
    border-color: rgba(255, 149, 0, 0.35);
    color: #ff9500;
}

.piso-estado-select option {
    background: #1c1c1e;
    color: white;
}

/* ===== Placeholder Section ===== */
.placeholder-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.placeholder-section h3 {
    font-size: 22px;
    margin: 16px 0 8px;
    color: var(--text-primary);
}

.placeholder-section p {
    font-size: 15px;
    opacity: 0.6;
}

.alta-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    font-size: 15px;
    width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

.alta-input:focus {
    border-color: var(--primary-light);
    outline: none;
    background: rgba(255,255,255,0.07);
}

select.alta-input option {
    background: #1a1a2e;
    color: white;
}

textarea.alta-input {
    resize: vertical;
    min-height: 60px;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== CIRUGÍAS DASHBOARD ===== */
.cirugias-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.cirugias-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.cirugias-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cirugias-filter-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.cirugias-filter-select {
    padding: 8px 12px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    min-width: 100px;
}

.cirugias-filter-select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.cirugias-dashboard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.cirugias-stats-row-compact {
    display: flex;
    gap: 16px;
}

.cirugias-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.cirugias-card-meses {
    flex: 0.6;
}

.cirugias-card-medico {
    flex: 1;
}

.cirugias-card-ayudante {
    flex: 1;
}

.cirugias-card-rol {
    flex: 1;
}

.cirugias-card-diagnosticos {
    flex: 2;
}

.cirugias-card-zona {
    flex: 1;
}

.cirugias-card-header {
    padding: 14px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: rgba(255,255,255,0.02);
}

.cirugias-card-body {
    padding: 12px 16px;
}

.cirugias-card-ayudante .cirugias-card-body {
    max-height: 250px;
    overflow-y: auto;
}

.cirugias-card-ayudante .cirugias-card-body::-webkit-scrollbar {
    width: 6px;
}

.cirugias-card-ayudante .cirugias-card-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
}

.cirugias-mes-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.cirugias-mes-row + .cirugias-mes-row {
    border-top: 1px solid rgba(255,255,255,0.03);
}

.cirugias-mes-label {
    color: var(--text-primary);
}

.cirugias-mes-count {
    color: var(--accent-color);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cirugias-zona-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.cirugias-zona-row + .cirugias-zona-row {
    border-top: 1px solid rgba(255,255,255,0.03);
}

.cirugias-zona-label {
    color: var(--text-primary);
}

.cirugias-zona-count {
    color: #4facfe;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.cirugias-stat-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    gap: 2px;
}

.cirugias-stat-box-total {
    flex: 0 0 auto;
    min-width: 180px;
}

.cirugias-stats-row-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.cirugias-filter-select-lg {
    padding: 10px 16px;
    font-size: 15px;
}

.cirugias-stat-box-sexo {
    padding: 8px 12px;
}

.cirugias-sexo-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cirugias-sexo-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cirugias-sexo-label {
    width: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    flex-shrink: 0;
}

.cirugias-sexo-bar {
    height: 12px;
}

.cirugias-sexo-count {
    width: 28px;
    text-align: right;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.cirugias-stat-number {
    font-size: 24px;
    font-weight: 700;
    color: white;
    font-variant-numeric: tabular-nums;
}

.cirugias-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.cirugias-tipo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.cirugias-tipo-row + .cirugias-tipo-row {
    border-top: 1px solid rgba(255,255,255,0.03);
}

.cirugias-tipo-label {
    width: 180px;
    font-size: 14px;
    color: var(--text-primary);
    flex-shrink: 0;
}

.cirugias-tipo-bar-bg {
    flex: 1;
    height: 22px;
    background: rgba(255,255,255,0.04);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.cirugias-tipo-bar-fill {
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--accent-color), #667eea);
    transition: width 0.6s ease;
    min-width: 2px;
}

.cirugias-tipo-count {
    width: 50px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.cirugias-card-zona .cirugias-tipo-label {
    width: 100px;
    font-size: 13px;
}

.cirugias-card-zona .cirugias-tipo-count {
    width: 32px;
    font-size: 13px;
}

.cirugias-card-zona .cirugias-tipo-row {
    gap: 8px;
}

.cirugias-card-medico .cirugias-tipo-label {
    width: 100px;
    font-size: 13px;
}

.cirugias-card-medico .cirugias-tipo-count {
    width: 32px;
    font-size: 13px;
}

.cirugias-card-medico .cirugias-tipo-row {
    gap: 8px;
}

.cirugias-card-ayudante .cirugias-tipo-label,
.cirugias-card-rol .cirugias-tipo-label {
    width: 100px;
    font-size: 13px;
}

.cirugias-card-ayudante .cirugias-tipo-count,
.cirugias-card-rol .cirugias-tipo-count {
    width: 32px;
    font-size: 13px;
}

.cirugias-card-ayudante .cirugias-tipo-row,
.cirugias-card-rol .cirugias-tipo-row {
    gap: 8px;
}

.cirugias-bottom-actions {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.cirugias-bottom-actions .btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
}

@media (max-width:768px) {
    .cirugias-stats-row {
        flex-direction: column;
    }
    .cirugias-stats-row-total {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .cirugias-stats-row-compact {
        flex-wrap: wrap;
        gap: 12px;
    }
    .cirugias-stats-row-compact .cirugias-stat-box {
        flex: 0 0 calc(33% - 8px);
        padding: 14px;
    }
    .cirugias-stat-box-total {
        align-self: flex-start;
    }
    .cirugias-stat-number {
        font-size: 22px;
    }
    .cirugias-tipo-label {
        width: 120px;
        font-size: 12px;
    }
    .cirugias-card-zona .cirugias-tipo-label,
    .cirugias-card-medico .cirugias-tipo-label,
    .cirugias-card-ayudante .cirugias-tipo-label,
    .cirugias-card-rol .cirugias-tipo-label {
        width: 100px;
    }
}

@media (max-width:480px) {
    .cirugias-stats-row-compact .cirugias-stat-box {
        flex: 0 0 100%;
    }
}

/* ===== Cross-filtering ===== */
[data-filter-type] {
    cursor: pointer;
    transition: background 0.15s ease;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 6px;
}
[data-filter-type]:hover {
    background: rgba(255,255,255,0.06);
}
[data-filter-type].active {
    background: rgba(102, 126, 234, 0.2);
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.3);
}
[data-filter-type].active .cirugias-mes-count,
[data-filter-type].active .cirugias-tipo-count,
[data-filter-type].active .cirugias-sexo-count,
[data-filter-type].active .cirugias-zona-count {
    color: #fff;
}

.cirugias-filter-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.12);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-primary);
}
.cirugias-filter-bar strong {
    color: #fff;
}
.cirugias-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 5px;
    font-size: 12px;
    margin: 2px 0;
}
.cirugias-filter-chip-x {
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    color: var(--text-secondary);
    margin-left: 2px;
    transition: color 0.15s;
}
.cirugias-filter-chip-x:hover {
    color: #ff8a80;
}
.cirugias-filter-count {
    color: var(--text-secondary);
    font-size: 12px;
    white-space: nowrap;
}
.cirugias-filter-clear {
    background: none;
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    transition: all 0.15s ease;
}
.cirugias-filter-clear:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

/* Últimas Cirugías - Tarjetas */
.ultimas-cirugias-section {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.ultimas-cirugias-section h2 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 16px;
}
.ultimas-cirugias-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.cirugia-card {
    background: var(--card-bg);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 220px;
    max-width: 300px;
}
.cirugia-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.cirugia-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.cirugia-card-nss {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.cirugia-card-fecha {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 8px;
    opacity: 0.7;
}

/* Modal Nota Postquirúrgica */
.nota-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nota-modal.hidden {
    display: none;
}
.nota-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}
.nota-modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.nota-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s;
}
.nota-modal-close:hover {
    color: var(--text-primary);
}
.nota-preview {
    background: #fff;
    color: #000;
    padding: 40px 36px;
    border-radius: 8px;
    font-family: 'Times New Roman', Times, serif;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 20px;
    min-height: 300px;
}
.nota-preview .nota-header {
    text-align: center;
    margin-bottom: 24px;
}
.nota-preview .nota-header p {
    margin: 2px 0;
    font-size: 13px;
}
.nota-preview .nota-header p:first-child {
    font-weight: bold;
    font-size: 14px;
}
.nota-preview .nota-campo {
    margin-bottom: 4px;
}
.nota-preview .nota-campo-label {
    font-weight: bold;
}
.nota-preview .nota-diagnostico {
    margin-top: 12px;
    margin-bottom: 8px;
}
.nota-preview .nota-diagnostico-texto {
    white-space: pre-wrap;
}
.nota-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.btn-nota-action {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
}
.btn-nota-download {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
}
.btn-nota-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.3);
}
.btn-nota-print {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}
.btn-nota-print:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* Botones de técnicas quirúrgicas preset */
.tecnicas-btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.btn-tecnica-preset {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-tecnica-preset:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}