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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

.screen:not(.active) {
    display: none !important;
}

/* Login Screen */
#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3d5a6b 0%, #1e3a47 100%);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #1e3a47;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #5a8a7a;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background: #5a8a7a;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #4a7a6a;
}

.btn-secondary {
    background: #6b5545;
    color: white;
}

.btn-secondary:hover {
    background: #5b4535;
}

.btn-danger {
    background: #c0392b;
    color: white;
    padding: 8px 16px;
    font-size: 12px;
}

.btn-danger:hover {
    background: #a83226;
}

.btn-success {
    background: #27ae60;
    color: white;
    padding: 8px 16px;
    font-size: 12px;
    margin-right: 5px;
}

.btn-success:hover {
    background: #229954;
}

.error {
    color: #c0392b;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

/* Dashboard Layout */
#dashboard-screen {
    display: none;
    min-height: 100vh;
}

#dashboard-screen.active {
    display: flex;
}

.sidebar {
    width: 250px;
    background: #1e3a47;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    margin-bottom: 30px;
}

.sidebar-header h2 {
    margin-bottom: 5px;
}

.sidebar-header p {
    color: #8fa8b5;
    font-size: 14px;
}

.nav-menu {
    list-style: none;
    flex: 1;
}

.nav-menu li {
    margin-bottom: 10px;
}

.nav-menu a {
    display: block;
    padding: 12px 15px;
    color: #8fa8b5;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: #2d4556;
    color: white;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.tab-content {
    display: none;
}

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

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

.stat-card {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card.warning-medium {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.stat-card.warning-high {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #1e3a47;
}

/* Chart Section */
.chart-section {
    background: white;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-section h2 {
    margin-bottom: 20px;
    color: #1e3a47;
}

.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    color: #999;
    font-size: 12px;
}

/* Table Controls */
.table-controls {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.search-input,
.filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.search-input {
    flex: 1;
    max-width: 400px;
}

/* Data Table */
.table-container {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

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

.data-table th {
    background: #1e3a47;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.data-table tbody tr:hover {
    background: #f9f9f9;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Reports List */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.report-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.report-info h3 {
    margin-bottom: 5px;
    color: #1e3a47;
}

.report-meta {
    color: #666;
    font-size: 14px;
}

.report-status {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.report-status.pending {
    background: #fff3cd;
    color: #856404;
}

.report-status.resolved {
    background: #d4edda;
    color: #155724;
}

.report-status.dismissed {
    background: #d1ecf1;
    color: #0c5460;
}

.report-content {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

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

/* Badge */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Chart Styles */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 30px 0;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chart-container h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.chart-container canvas {
    max-height: 300px;
}

.stat-detail {
    font-size: 13px;
    color: #666;
    margin-top: 8px;
}

@media (max-width: 1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* Audit Log Filters */
.audit-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.filter-group input[type="number"],
.filter-group input[type="date"],
.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #5a8a7a;
}

.filter-group button {
    margin-top: 0;
}

.filter-group .btn + .btn {
    margin-left: 5px;
}

.btn.btn-success {
    background: #5a8a7a;
    color: white;
}

.btn.btn-success:hover {
    background: #4a7a6a;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#audit-page-info {
    font-weight: 500;
    color: #555;
}

/* Action Badge */
.action-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Audit Details Cell */
.audit-details {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    color: #666;
}

.data-table td[title] {
    cursor: help;
}
