:root {
    --primary: #0284c7; /* Vibrant Blue */
    --primary-hover: #0369a1;
    --secondary: #0f172a; /* Slate 900 */
    --background: #f1f5f9; /* Slate 100 */
    --surface: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #10b981;
    --error: #ef4444;
    --input-bg: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    background-image: 
        radial-gradient(at 0% 0%, hsla(199, 100%, 85%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(217, 100%, 85%, 1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* Material Icons Alignment */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Views Management */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* --- Login View --- */
#login-view {
    height: 100vh;
    align-items: center;
    justify-content: center;
}
#login-view.active {
    display: flex;
}

.login-container {
    background: var(--surface);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-tabs {
    display: flex;
    flex-wrap: wrap;
    background: var(--input-bg);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    gap: 4px;
}

.login-tab {
    flex: 1 1 auto;
    padding: 0.6rem 0.5rem;
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    text-align: center;
}

.login-tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.login-brand {
    margin-bottom: 1.5rem;
}

.login-brand .logo-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    background: #e0f2fe;
    padding: 1rem;
    border-radius: 50%;
}

.login-brand h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.login-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

#login-form .input-group {
    text-align: left;
    margin-bottom: 1.25rem;
}

#login-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .material-symbols-outlined {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 1.25rem;
    pointer-events: none; /* Make sure clicking on the icon doesn't block input focus */
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 0.75rem 2.75rem 0.75rem 2.75rem !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.75rem !important;
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    background-color: var(--surface);
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: var(--primary);
    background-color: rgba(2, 132, 199, 0.08);
}

.btn-toggle-password .material-symbols-outlined {
    position: static;
    font-size: 1.25rem;
    pointer-events: auto;
}

.btn-primary {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.2s, transform 0.1s;
    margin-top: 1.5rem;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.login-footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Dashboard Navbar --- */
.navbar {
    background: var(--surface);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon-small {
    color: var(--primary);
    font-size: 1.75rem;
}

.nav-brand h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--secondary);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
}

.btn-icon:hover {
    background-color: var(--background);
    color: var(--error);
}

/* --- Dashboard Content --- */
.dashboard-content {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--secondary);
    margin-bottom: 0.25rem;
}

.page-header p {
    color: var(--text-muted);
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-glass);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-section.full-width {
    grid-column: 1 / -1;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-title .material-symbols-outlined {
    font-size: 1.2rem;
    color: var(--primary);
}

.input-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.input-group input,
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.input-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2rem;
}

.input-group input:focus,
.input-group select:focus,
.input-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    background-color: var(--surface);
}

.input-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    background-color: white;
    color: var(--text-main);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--background);
}

.form-actions .btn-primary {
    margin-top: 0;
    width: auto;
    padding: 0.75rem 2rem;
}

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--surface);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 100;
    border-left: 4px solid var(--success);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast .material-symbols-outlined {
    color: var(--success);
}

/* --- Tabs Navigation --- */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.tab-btn:hover {
    background: var(--background);
    color: var(--text-main);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-section {
    display: none;
}

.tab-section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* --- Data Table --- */
.table-container {
    overflow-x: auto;
    padding: 1.5rem;
}

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

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

.data-table th {
    font-weight: 600;
    color: var(--secondary);
    background-color: var(--input-bg);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background-color: var(--background);
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .glass-panel {
        padding: 1.5rem;
    }

    .directory-toolbar {
        flex-direction: column;
    }

    .modal-container {
        width: 95%;
        max-height: 85vh;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn-action {
        width: 100%;
        justify-content: center;
    }
}

/* --- Directory Toolbar --- */
.directory-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

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

.search-wrapper .material-symbols-outlined {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-icon-labeled {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.btn-icon-labeled:hover {
    background: var(--background);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon-labeled .material-symbols-outlined {
    font-size: 1.15rem;
}

/* --- Action Buttons in Table --- */
.action-buttons {
    display: flex;
    gap: 0.4rem;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action .material-symbols-outlined {
    font-size: 1rem;
}

.btn-action.view {
    background: #e0f2fe;
    color: #0284c7;
}
.btn-action.view:hover {
    background: #bae6fd;
}

.btn-action.edit {
    background: #fef3c7;
    color: #d97706;
}
.btn-action.edit:hover {
    background: #fde68a;
}

.btn-action.delete {
    background: #fee2e2;
    color: #dc2626;
}
.btn-action.delete:hover {
    background: #fecaca;
}

/* --- Danger Button --- */
.btn-danger {
    background-color: #dc2626;
    color: white;
    border: none;
    padding: 0.65rem 1.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: background-color 0.2s, transform 0.1s;
}

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

.btn-danger:active {
    transform: scale(0.98);
}

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay.active .modal-container,
.modal-overlay.active .confirm-container {
    transform: translateY(0) scale(1);
}

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

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
    color: var(--secondary);
}

.modal-header h2 .material-symbols-outlined {
    color: var(--primary);
}

.modal-close-btn {
    color: var(--text-muted);
}

.modal-close-btn:hover {
    color: var(--error);
    background: #fee2e2;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--border);
    background: var(--input-bg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-footer .btn-secondary,
.modal-footer .btn-danger {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* --- Detail Grid (inside modal) --- */
.detail-section {
    margin-bottom: 1.75rem;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.detail-section-title .material-symbols-outlined {
    font-size: 1rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.detail-item {
    padding: 0.6rem 0.75rem;
    background: var(--input-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* --- Confirm Dialog --- */
.confirm-container {
    width: 90%;
    max-width: 400px;
    padding: 2rem;
    text-align: center;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.confirm-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.confirm-icon {
    font-size: 2rem;
    color: #dc2626;
}

.confirm-container h3 {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.confirm-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-actions .btn-secondary,
.confirm-actions .btn-danger {
    flex: 1;
    justify-content: center;
}

/* --- Loading & Empty States --- */
.table-loading,
.table-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.table-loading .material-symbols-outlined {
    font-size: 2.5rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
    margin-bottom: 0.75rem;
}

.table-empty .material-symbols-outlined {
    font-size: 2.5rem;
    color: var(--border);
    margin-bottom: 0.75rem;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.table-empty p,
.table-loading p {
    font-size: 0.95rem;
}

/* --- Status Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.blood {
    background: #fce7f3;
    color: #be185d;
}

/* --- Advanced Filters --- */
.filters-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.filter-select-wrapper .select-icon {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 1.15rem;
    pointer-events: none;
    z-index: 2;
}

.filter-select {
    padding: 0.6rem 2.25rem 0.6rem 2.1rem !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background-color: var(--surface);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    appearance: none;
    -webkit-appearance: none;
    line-height: 1.2;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.filter-select-wrapper::after {
    content: "arrow_drop_down";
    font-family: 'Material Symbols Outlined';
    position: absolute;
    right: 8px;
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
    z-index: 2;
}

/* Print Button in Modal */
.print-invoice-btn {
    background-color: #10b981 !important;
    color: white !important;
    border: none !important;
}

.print-invoice-btn:hover {
    background-color: #059669 !important;
}

/* --- Hide Print Container on Screen --- */
#print-section {
    display: none;
}

/* --- Print Styles --- */
@media print {
    /* Hide screen UI for print */
    #app, .toast, .modal-overlay, #confirm-dialog {
        display: none !important;
    }
    
    /* Make print-section block visible and stretch to fill page */
    #print-section {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        color: #000;
        background: #fff;
        font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
        font-size: 11pt;
        line-height: 1.4;
        padding: 0;
    }

    #print-section * {
        visibility: visible !important;
    }
    
    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 2px solid #000;
        padding-bottom: 10px;
        margin-bottom: 20px;
    }
    
    .print-logo-section {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .print-logo-icon {
        font-size: 24pt;
        color: #000;
    }
    
    .print-hospital-name {
        font-size: 18pt;
        font-weight: 700;
        margin: 0;
        line-height: 1.1;
    }
    
    .print-hospital-sub {
        font-size: 8.5pt;
        color: #444;
        margin: 0;
    }
    
    .print-title {
        text-align: right;
    }
    
    .print-title h1 {
        font-size: 16pt;
        margin: 0;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    
    .print-title p {
        font-size: 8.5pt;
        color: #444;
        margin: 2px 0 0;
    }

    .print-metadata-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .print-meta-block {
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 10px;
    }

    .print-meta-block h3 {
        font-size: 9pt;
        margin-top: 0;
        margin-bottom: 6px;
        text-transform: uppercase;
        border-bottom: 1px solid #ddd;
        padding-bottom: 3px;
        font-weight: 700;
    }

    .print-meta-row {
        display: flex;
        justify-content: space-between;
        margin-bottom: 4px;
        font-size: 9pt;
    }

    .print-meta-label {
        font-weight: 600;
        color: #333;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        margin-bottom: 25px;
    }

    .print-table th, .print-table td {
        border: 1px solid #ccc;
        padding: 8px;
        text-align: left;
        font-size: 9pt;
    }

    .print-table th {
        background-color: #f0f0f0 !important;
        font-weight: bold;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .print-prescription-section {
        border: 1px solid #ccc;
        border-radius: 4px;
        padding: 12px;
        margin-bottom: 20px;
    }

    .print-prescription-section h3 {
        font-size: 9.5pt;
        margin-top: 0;
        margin-bottom: 8px;
        text-transform: uppercase;
        border-bottom: 1px solid #ccc;
        padding-bottom: 4px;
        font-weight: 700;
    }

    .print-prescription-text {
        font-size: 9pt;
        white-space: pre-wrap;
        line-height: 1.5;
        min-height: 60px;
        font-family: inherit;
    }

    .print-footer {
        margin-top: 40px;
        display: flex;
        justify-content: space-between;
        font-size: 9pt;
    }

    .print-signature-space {
        text-align: center;
        width: 180px;
    }

    .print-signature-line {
        border-top: 1px solid #000;
        margin-top: 40px;
        padding-top: 4px;
        font-weight: 600;
    }

    .print-sys-info {
        font-size: 7.5pt;
        color: #666;
        text-align: center;
        margin-top: 30px;
        border-top: 1px dashed #ccc;
        padding-top: 8px;
    }
}

/* --- Doctor Alerts Banner --- */
.doctor-alerts-banner {
    background: rgba(2, 132, 199, 0.08); /* subtle theme primary tint */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(2, 132, 199, 0.2);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    animation: slideInDown 0.4s ease-out;
}

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

.doctor-alerts-banner .alert-icon {
    font-size: 1.6rem;
    color: var(--primary);
    background: rgba(2, 132, 199, 0.12);
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.doctor-alerts-banner .alert-content {
    flex: 1;
}

.doctor-alerts-banner .alert-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--secondary);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.doctor-alerts-banner .alert-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.alert-item {
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-main);
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.alert-item .material-symbols-outlined {
    font-size: 1.15rem;
    display: inline-flex;
    margin-top: 2px;
}

.alert-item.new-patients .material-symbols-outlined {
    color: #d97706; /* warm amber */
}

.alert-item.followup-patients .material-symbols-outlined {
    color: #10b981; /* fresh emerald */
}

.alert-item strong {
    font-weight: 600;
}

.alert-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-sublist {
    margin-left: 1.25rem;
    margin-top: 0.25rem;
    padding-left: 0;
    list-style-type: disc;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-sublist li {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.alert-sublist li strong {
    color: var(--text-main);
    font-weight: 600;
}

.followup-time-badge {
    color: var(--primary);
    font-weight: 600;
}

.test-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.test-chip-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 2rem;
    background-color: var(--surface);
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.test-chip-btn:hover {
    border-color: var(--primary);
    background-color: var(--background);
}

.test-chip-btn.selected {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(10, 107, 209, 0.2);
}

.test-chip-btn.selected .material-symbols-outlined {
    color: white;
}

.test-chip-btn .material-symbols-outlined {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}


.badge-primary { background: #e0e7ff; color: #4338ca; }
.badge-warning { background: #ffedd5; color: #c2410c; }
.badge-grey { background: #f3f4f6; color: #4b5563; }

/* Stats Dashboard */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: rgba(255, 255, 255, 0.4); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.6); padding: 1.5rem; border-radius: 12px; display: flex; align-items: center; gap: 1rem; box-shadow: 0 4px 15px rgba(0,0,0,0.05); transition: transform 0.2s ease, box-shadow 0.2s ease; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.stat-icon { width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.stat-icon .material-symbols-outlined { font-size: 28px; }
.stat-info h3 { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 0.3rem 0; font-weight: 500; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-color); margin: 0; }


/* Pharmacy Specific Styles */
.billing-summary-header { display: flex; justify-content: space-between; background: rgba(0,0,0,0.03); padding: 12px 15px; border-radius: 8px; margin-bottom: 15px; font-size: 0.95rem; }
.medicines-billing-section h3 { margin: 0; font-size: 1.1rem; color: var(--text-color); }
.medicine-row-input { width: 100%; padding: 8px; border: 1px solid rgba(0,0,0,0.1); border-radius: 6px; font-family: inherit; font-size: 0.9rem; }
.medicine-row-input:focus { border-color: var(--primary); outline: none; }
.row-total-display { font-weight: 600; color: var(--text-color); }
.btn-delete-row { background: transparent; border: none; color: #ef4444; cursor: pointer; padding: 4px; border-radius: 4px; display: flex; align-items: center; justify-content: center; }
.btn-delete-row:hover { background: rgba(239,68,68,0.1); }

.grand-total-box { margin-top: 20px; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); padding: 20px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; }
.grand-total-box span:first-child { font-size: 1.2rem; font-weight: 600; color: #065f46; }
.grand-total-box span:last-child { font-size: 1.8rem; font-weight: 800; color: #10b981; }
