/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    height: 100%;
    color: #333;
}

.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Navigation - SIMPLE HOVER DROPDOWNS */
.top-nav {
    background: linear-gradient(135deg, #4169e1 0%, #1e3a8a 100%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.nav-brand {
    font-size: 24px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    padding: 15px 20px 15px 0;
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
}

.nav-item {
    position: relative;
}

.nav-link {
    display: block;
    padding: 15px 18px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Dropdown - appears on hover */
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 2px;
}

.nav-dropdown-right {
    left: auto;
    right: 0;
}

.nav-item:hover .nav-dropdown {
    display: block;
}

.nav-dropdown a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.nav-dropdown a:hover {
    background: #f5f5f5;
}

.dropdown-header {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 8px 0;
}

/* Database Indicator */
.db-indicator {
    background: #fff3cd;
    border-bottom: 2px solid #ffc107;
    padding: 8px 20px;
    text-align: center;
    font-size: 13px;
    color: #856404;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 30px 20px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 14px;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 0;
}

.table thead th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}

.table tbody td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #4169e1;
    color: white;
}

.btn-primary:hover {
    background: #1e3a8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(65, 105, 225, 0.3);
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #4169e1;
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

.alert-danger {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.alert-success {
    background: #d4edda;
    border-left: 4px solid #28a745;
    color: #155724;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    font-weight: 600;
    color: #2d3748;
}

h1 { font-size: 32px; }
h2 { font-size: 28px; }
h3 { font-size: 24px; }
h4 { font-size: 20px; }

/* Responsive */
@media (max-width: 768px) {
    .nav-menu {
        display: none; /* Simplified - hide on mobile */
    }
    
    .main-content {
        padding: 20px 15px;
    }
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Table Action Buttons - Global Styles */
.table th:last-child,
.table td:last-child {
    text-align: right;
    white-space: nowrap;
    width: 180px;
    min-width: 180px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-sm.btn-primary {
    background: #4169e1;
    color: white;
}

.btn-sm.btn-primary:hover {
    background: #1e3a8a;
}

.btn-sm.btn-success {
    background: #28a745;
    color: white;
}

.btn-sm.btn-success:hover {
    background: #218838;
}

.btn-sm.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-sm.btn-warning:hover {
    background: #e0a800;
}

.btn-sm.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm.btn-danger:hover {
    background: #c82333;
}

.btn-sm.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-sm.btn-info:hover {
    background: #138496;
}

.btn-sm.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-sm.btn-secondary:hover {
    background: #5a6268;
}

.btn-icon {
    font-size: 14px;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-3 { margin-top: 20px; }
.mb-3 { margin-bottom: 20px; }
.container-fluid { padding: 0 20px; }

/* Hide Blazor error UI on print pages and when printing */
@media print {
    #blazor-error-ui {
        display: none !important;
    }
}

/* Style the error UI when it does appear (non-print pages) */
#blazor-error-ui {
    background: #ffebee;
    bottom: 0;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
    color: #721c24;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}