html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
}

/* Global NavLink Styling - Override browser defaults */
a.nav-item,
a.nav-item:link,
a.nav-item:visited,
a.nav-item:hover,
a.nav-item:active {
    color: rgba(255, 255, 255, 0.7) !important;
    text-decoration: none !important;
}

a.nav-item:hover {
    color: white !important;
}

a.nav-item.active {
    color: #60a5fa !important;
}


.page {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    box-sizing: border-box;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar h3 {
    margin-top: 0;
}

main {
    flex: 1;
    margin-left: 250px;
    overflow-y: auto;
    min-width: 0;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    padding: 50px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 400px;
}

.admin-header {
    text-align: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 4em;
    margin: 0;
}

.admin-header h2 {
    margin: 10px 0 0 0;
    color: #667eea;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.login-card .form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
}

.login-card .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: all 0.3s;
}

.login-card .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
    border: none;
}

.login-card .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.login-card .btn-secondary {
    background: #6c757d;
    color: white;
}

.login-card .btn-secondary:hover {
    background: #5a6268;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.admin-dashboard {
    padding: 30px;
}

.admin-dashboard h1 {
    margin: 0 0 30px 0;
    color: #333;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

.dashboard-card h2 {
    margin-top: 0;
    color: #667eea;
    font-size: 1.3em;
}

.subtitle {
    color: #999;
    margin-top: -10px;
}

.profile-info p,
.subscription-info p {
    margin: 10px 0;
}

.plan-name {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 15px !important;
}

.usage-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    display: block;
    color: #999;
    margin-top: 5px;
}

.patients-table {
    overflow-x: auto;
}

.patients-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.patients-table th,
.patients-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.patients-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.patients-table tr.severity-1 {
    border-left: 4px solid #dc3545;
}

.patients-table tr.severity-2 {
    border-left: 4px solid #fd7e14;
}

.patients-table tr.severity-3 {
    border-left: 4px solid #ffc107;
}

.patients-table tr.severity-4 {
    border-left: 4px solid #28a745;
}

.patients-table tr.severity-5 {
    border-left: 4px solid #0284c7;
}

.patients-table .badge {
    background: #ffc107;
    color: #856404;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

/* Disposition badges */
.badge.disposition-home { background: #d1fae5; color: #065f46; }
.badge.disposition-admitted { background: #dbeafe; color: #1e40af; }
.badge.disposition-transferred { background: #e0e7ff; color: #3730a3; }
.badge.disposition-ama { background: #fee2e2; color: #991b1b; }
.badge.disposition-lwbs { background: #fef3c7; color: #92400e; }
.badge.disposition-expired { background: #1f2937; color: #f9fafb; }

.disposition-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.disposition-chip {
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    color: #475569;
}

.disposition-chip.high-liability {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.high-liability-row {
    background: #fff5f5 !important;
    border-left: 4px solid #dc3545 !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay .modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-overlay .modal-content h2 {
    margin-top: 0;
    color: #667eea;
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.modal-actions button {
    flex: 1;
}

.loading {
    text-align: center;
    padding: 100px;
    color: #667eea;
    font-size: 1.5em;
}

/* -- Directory Login Button and Divider -- */
.login-divider { display:flex; align-items:center; margin:1.25rem 0; color:#6c757d; font-size:0.85rem; }
.login-divider::before, .login-divider::after { content:''; flex:1; height:1px; background:#dee2e6; }
.login-divider span { padding:0 0.75rem; }
.btn-directory { width:100%; display:flex; align-items:center; justify-content:center; gap:0.5rem; padding:0.6rem 1rem; border:2px solid #0d6efd; border-radius:6px; background:#fff; color:#0d6efd; font-weight:600; font-size:0.95rem; cursor:pointer; transition:all 0.2s; }
.btn-directory:hover:not(:disabled) { background:#e7f1ff; }
.btn-directory:disabled { opacity:0.5; cursor:not-allowed; }


/* -- STAMP row highlights -- */
.stamp-row-red { background: #fff0f0 !important; border-left: 4px solid #dc3545; }
.stamp-row-yellow { background: #fffdf0 !important; border-left: 4px solid #ffc107; }

