:root {
    --primary-color: #0b1a30;
    --primary-light: #1e2d4a;
    --accent-blue: #1b62b3;
    --background-color: #f3f5f8;
    --card-background: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --success: #1b7a43;
    --warning: #e07a1b;
    --danger: #dc2626;
    --purple: #6f42c1;
    --info: #0ea5e9;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: #ffffff;
    border-bottom: 2px solid var(--border-color);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-img {
    height: 48px;
    object-fit: contain;
}

.company-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.company-sub {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.header-title-section {
    text-align: center;
    flex-grow: 1;
}

.system-title {
    font-size: 20px;
    font-weight: 700;
    color: #0f4c81;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.system-phases {
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 11px;
    font-weight: 700;
}

.phase-item {
    padding: 2px 8px;
    border-radius: 4px;
}
.phase-safety { color: #1b62b3; }
.phase-preparedness { color: #1b7a43; }
.phase-response { color: #dc2626; }
.phase-recovery { color: #6f42c1; }

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-card {
    border: 1px solid var(--border-color);
    background-color: #f8fafc;
    border-radius: var(--border-radius);
    padding: 6px 12px;
    text-align: center;
}

.status-label {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-weight: 700;
    font-size: 13px;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(27, 122, 67, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(27, 122, 67, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(27, 122, 67, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(27, 122, 67, 0);
    }
}

.datetime-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1b62b3;
    font-size: 12px;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    padding-right: 16px;
}

.datetime-widget svg {
    color: #475569;
}

.bell-btn {
    background: none;
    border: none;
    position: relative;
    cursor: pointer;
    color: #475569;
    padding: 4px;
}

.bell-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--danger);
    color: white;
    font-size: 8px;
    font-weight: 700;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    line-height: 1.2;
}

.user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-role {
    font-size: 10px;
    color: var(--text-secondary);
}

/* App Main Container Layout */
.app-container {
    display: flex;
    flex: 1;
}

/* Sidebar Layout */
aside {
    width: 240px;
    background-color: var(--primary-color);
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding-top: 15px;
    border-right: 1px solid #1e293b;
    flex-shrink: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item a:hover {
    background-color: var(--primary-light);
    color: #ffffff;
}

.nav-item.active a {
    background-color: var(--accent-blue);
    color: #ffffff;
    font-weight: 600;
}

.sidebar-site-selector {
    padding: 15px 20px;
    border-top: 1px solid #1e2d4a;
}

.site-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.site-dropdown {
    width: 100%;
    background-color: var(--primary-light);
    color: white;
    border: 1px solid #334155;
    padding: 8px 12px;
    font-size: 12px;
    border-radius: var(--border-radius);
    outline: none;
    cursor: pointer;
}

.sidebar-footer {
    padding: 12px 20px;
    border-top: 1px solid #1e2d4a;
    font-size: 10px;
    color: #475569;
    text-align: center;
}

/* Main Content Styles */
main {
    flex-grow: 1;
    padding: 20px 24px;
    overflow-y: auto;
    max-width: calc(100vw - 240px);
}

.content-header {
    margin-bottom: 20px;
}

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

.breadcrumbs {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs span {
    color: var(--accent-blue);
}

/* Dashboard Tabs Layout */
.dashboard-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    gap: 8px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    top: 2px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

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

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom: 2px solid var(--accent-blue);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
}

.left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.stat-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stat-sub {
    font-size: 9px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Colors for stats icons */
.stat-icon.total { background-color: #fee2e2; color: #ef4444; }
.stat-icon.nearmiss { background-color: #dbeafe; color: #3b82f6; }
.stat-icon.open { background-color: #ffedd5; color: #f97316; }
.stat-icon.investigating { background-color: #fef9c3; color: #eab308; }
.stat-icon.closed { background-color: #dcfce7; color: #22c55e; }
.stat-icon.lti { background-color: #f3e8ff; color: #a855f7; }

/* Filter Bar */
.filter-bar {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow);
}

.filter-left {
    display: flex;
    align-items: center;
    flex-grow: 1;
    gap: 12px;
}

.search-box {
    position: relative;
    flex-grow: 1;
    max-width: 300px;
}

.search-input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    outline: none;
}

.search-box svg, .search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    background-color: white;
    outline: none;
    cursor: pointer;
    min-width: 130px;
}

.btn-reset {
    padding: 8px 16px;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

/* Data Table Card */
.table-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

th {
    background-color: #f8fafc;
    border-bottom: 2px solid var(--border-color);
    padding: 12px 16px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f8fafc;
}

.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-open { background-color: #fee2e2; color: #ef4444; }
.badge-investigation { background-color: #fef9c3; color: #854d0e; }
.badge-closed { background-color: #dcfce7; color: #166534; }

.badge-type-incident { background-color: #fee2e2; color: #ef4444; }
.badge-type-nearmiss { background-color: #dbeafe; color: #1d4ed8; }

.table-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-secondary);
}

.pagination {
    display: flex;
    gap: 4px;
}

.pagination-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
}

.pagination-btn.active {
    background-color: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Right Panel Styles */
.right-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.panel-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.panel-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

/* Quick Actions buttons */
.btn-action {
    width: 100%;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
}

.btn-action:last-child {
    margin-bottom: 0;
}

.btn-report-incident { background-color: #1b62b3; }
.btn-report-incident:hover { background-color: #154c8c; }

/* Charts Layout */
.charts-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
}

.chart-card {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: var(--shadow);
}

.chart-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.chart-container {
    position: relative;
    height: 220px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Footer Section */
.footer-banner {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 10px 20px;
    font-size: 11px;
    font-weight: 500;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
}

/* Custom Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 550px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
}

.btn-close-modal {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 18px;
    opacity: 0.8;
}

.btn-close-modal:hover {
    opacity: 1;
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 16px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    background-color: #fafafa;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent-blue);
    background-color: white;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 8px 16px;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-submit {
    padding: 8px 16px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-submit:hover {
    background-color: #154c8c;
}

/* Success notification message */
.alert-success {
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-close-alert {
    background: none;
    border: none;
    color: #166534;
    cursor: pointer;
    font-size: 16px;
}

/* Login Page Styles */
.login-container {
    background-color: var(--primary-color);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background-color: white;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.login-logo {
    height: 60px;
    object-fit: contain;
    margin-bottom: 16px;
}

.login-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--accent-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}

.login-btn:hover {
    background-color: #154c8c;
}

.text-danger {
    color: var(--danger);
    font-size: 11px;
    margin-top: 4px;
    text-align: left;
}

/* Team Members Styles */
.team-member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
}

.team-member-item:last-child {
    border-bottom: none;
    margin-bottom: 12px;
}

.team-member-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.team-member-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.badge-leader {
    background-color: #dcfce7;
    color: #166534;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.badge-investigator {
    background-color: #fef9c3;
    color: #854d0e;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.badge-member {
    background-color: #dbeafe;
    color: #1d4ed8;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.btn-view-details {
    width: 100%;
    padding: 8px 12px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: block;
    text-decoration: none;
}

.btn-view-details:hover {
    background-color: #e2e8f0;
    color: var(--text-primary);
}

.btn-action-icon {
    font-size: 14px;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s, opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-action-icon:hover {
    background-color: #f1f5f9;
    opacity: 0.8;
}

.btn-action-icon.view {
    color: var(--accent-blue);
}

.btn-action-icon.edit {
    color: #0d9488;
}
