/* Stylesheet for Risk & Hazard Report System */

:root {
    --primary-color: #0D1B2A;       /* Deep Navy */
    --primary-light: #1B263B;       /* Navy Accent */
    --primary-lighter: #415A77;     /* Slate Blue */
    --accent-purple: #3A0CA3;       /* Royal Purple */
    --accent-gradient: linear-gradient(135deg, #0D1B2A 0%, #3A0CA3 100%);
    --secondary-color: #778DA9;
    --text-color: #1F2937;
    --text-muted: #6B7280;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    
    /* Status Colors */
    --pending-color: #B45309;       /* Dark Amber */
    --pending-bg: #FEF3C7;          /* Amber Light */
    --progress-color: #1D4ED8;      /* Royal Blue */
    --progress-bg: #DBEAFE;         /* Blue Light */
    --resolved-color: #047857;      /* Emerald Green */
    --resolved-bg: #D1FAE5;         /* Green Light */
    
    /* System Tokens */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.02);
    --shadow-md: 0 10px 20px rgba(13, 27, 42, 0.04);
    --shadow-lg: 0 20px 40px rgba(13, 27, 42, 0.08);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.thai-text {
    font-size: 0.9em;
    opacity: 0.95;
    margin-top: 2px;
}

/* Navigation Bar */
.navbar {
    background: var(--accent-gradient);
    color: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    height: 75px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    padding: 8px;
    border-radius: var(--radius-md);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 28px;
    height: 28px;
}

.brand-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    line-height: 1.1;
    color: #FFFFFF;
}

.sub-brand {
    font-size: 0.68rem;
    color: #A5B4FC;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    padding: 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-tab {
    background: transparent;
    border: none;
    color: #C7D2FE;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.nav-tab:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--primary-color);
    background: #FFFFFF;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.tab-icon {
    width: 16px;
    height: 16px;
}

/* Main Layout */
.main-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    min-height: calc(100vh - 155px);
}

.content-section {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.content-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Section 1: Form Card */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    max-width: 720px;
    margin: 0 auto;
    overflow: hidden;
}

.form-header {
    background: var(--accent-gradient);
    color: #FFFFFF;
    padding: 30px 40px;
    text-align: center;
}

.form-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
}

.form-sub {
    font-size: 0.85rem;
    color: #C7D2FE;
    line-height: 1.5;
}

#hazard-form {
    padding: 40px;
}

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

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.form-group label span.required {
    color: #EF4444;
}

.form-group label span.optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8rem;
}

/* Inputs & Form controls */
input[type="text"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-color);
    background-color: #FFFFFF;
    transition: var(--transition);
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(58, 12, 163, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #9CA3AF;
}

/* Custom Checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    font-size: 0.88rem;
    user-select: none;
    padding-left: 32px;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 20px;
    width: 20px;
    background-color: #FFFFFF;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.checkbox-container:hover input ~ .checkmark {
    border-color: var(--accent-purple);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    color: var(--text-color);
    line-height: 1.3;
}

.other-specify-input {
    margin-top: 10px;
    animation: slideDown 0.2s ease-out;
}

.hidden {
    display: none !important;
}

.error-text {
    color: #EF4444;
    font-size: 0.78rem;
    margin-top: 5px;
    display: block;
}

/* File Upload Zone */
.upload-zone {
    border: 2px dashed var(--secondary-color);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    background: #FAFBFD;
    transition: var(--transition);
}

.upload-zone:hover {
    background: #F0F4F8;
    border-color: var(--accent-purple);
}

.upload-icon {
    width: 40px;
    height: 40px;
    stroke: var(--primary-lighter);
    margin: 0 auto 12px;
}

.upload-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upload-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary-color);
}

.upload-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Previews */
.preview-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.85);
    color: white;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.preview-remove:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
}

/* Buttons */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(58, 12, 163, 0.2);
    transition: var(--transition);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(58, 12, 163, 0.35);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-primary {
    padding: 10px 22px;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(58, 12, 163, 0.15);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(58, 12, 163, 0.25);
}

.btn-secondary {
    padding: 10px 22px;
    background: #E5E7EB;
    color: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #D1D5DB;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* Success Overlay */
.overlay-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.success-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.success-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10B981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    box-shadow: inset 0px 0px 0px #10B981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3px;
    stroke: #FFFFFF;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

.success-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
}

.success-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 10px;
    line-height: 1.5;
}

.success-card button {
    margin-top: 30px;
    width: 100%;
}

/* Modals General */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 27, 42, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    animation: fadeIn 0.25s ease-out;
}

/* PIN Verification Modal */
.pin-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 35px 30px;
    width: 90%;
    max-width: 380px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lock-icon {
    width: 60px;
    height: 60px;
    background: #EEF2F6;
    color: var(--accent-purple);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.lock-icon svg {
    width: 28px;
    height: 28px;
}

.pin-header h3 {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.pin-header p {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.pin-inputs {
    margin: 20px 0;
}

#pin-input {
    width: 150px;
    padding: 10px;
    font-size: 1.8rem;
    letter-spacing: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: #FAFBFD;
}

.pin-error {
    color: #EF4444;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.pin-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pin-actions button {
    flex: 1;
}

/* Section 3: Admin Dashboard Layout */
.dashboard-container {
    animation: fadeIn 0.4s ease-out;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1.5px solid var(--border-color);
    padding-bottom: 20px;
}

.dashboard-header h2 {
    font-size: 1.6rem;
    color: var(--primary-color);
    font-weight: 700;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #FEF2F2;
    border: 1.5px solid #FEE2E2;
    color: #DC2626;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
}

.btn-logout:hover {
    background: #FEE2E2;
    border-color: #FCA5A5;
    color: #B91C1C;
}

.btn-logout svg, .btn-qr-share svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-qr-share {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F5F3FF;
    color: #6D28D9;
    border: 1.5px solid #DDD6FE;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
}

.btn-qr-share:hover {
    background: #EDE9FE;
    border-color: #C4B5FD;
    color: #5B21B6;
}

/* KPI Cards Layout */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    cursor: pointer;
    transition: var(--transition);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
}

.kpi-card:nth-child(1) { background-color: #F8FAFC; }
.kpi-card:nth-child(2) { background-color: #FFFBEB; }
.kpi-card:nth-child(3) { background-color: #EFF6FF; }
.kpi-card:nth-child(4) { background-color: #ECFDF5; }

.kpi-content {
    display: flex;
    flex-direction: column;
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.kpi-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
    margin-top: 4px;
}

.kpi-value.warning { color: #D97706; }
.kpi-value.info { color: #2563EB; }
.kpi-value.success { color: #059669; }

.kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon svg {
    width: 22px;
    height: 22px;
}

.kpi-icon.total { background: #EEF2F6; color: var(--primary-color); }
.kpi-icon.pending { background: #FEF3C7; color: #D97706; }
.kpi-icon.progress { background: #DBEAFE; color: #2563EB; }
.kpi-icon.resolved { background: #D1FAE5; color: #059669; }

/* Filter Bar */
.filter-bar {
    background: white;
    border-radius: var(--radius-md);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

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

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

#dashboard-search {
    padding-left: 40px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
}

.filter-dropdowns {
    display: flex;
    gap: 15px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-item label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-item select {
    padding: 8px 12px;
    font-size: 0.82rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
}

/* Data Table Card styling */
.table-card {
    background: white;
    border-radius: var(--radius-md);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th, .data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #F1F5F9;
}

.data-table th {
    background-color: #F8FAFC;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    user-select: none;
}

.data-table th.sortable {
    cursor: pointer;
}

.data-table th.sortable:hover {
    background-color: #F1F5F9;
}

.sort-icon {
    font-size: 0.65rem;
    margin-left: 4px;
    color: var(--text-muted);
}

.sort-icon.asc, .sort-icon.desc {
    color: var(--accent-purple);
}

.data-table tbody tr {
    transition: var(--transition);
}

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

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.badge.pending {
    background-color: #FFFBEB;
    color: #D97706;
    border: 1px solid #FDE68A;
}

.badge.in-progress {
    background-color: #EFF6FF;
    color: #2563EB;
    border: 1px solid #BFDBFE;
}

.badge.resolved {
    background-color: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.text-center {
    text-align: center;
}

/* View Button */
.btn-view {
    padding: 5px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    color: #475569;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.78rem;
    transition: var(--transition);
}

.btn-view:hover {
    background: var(--accent-purple);
    border-color: var(--accent-purple);
    color: white;
}

/* Pagination Footer */
.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #F9FAFB;
    border-top: 1px solid var(--border-color);
}

.table-info {
    font-size: 0.78rem;
    color: var(--text-muted);
}

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

.pg-btn {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 4px;
    transition: var(--transition);
}

.pg-btn:hover:not(:disabled) {
    background-color: #F3F4F6;
    border-color: var(--secondary-color);
}

.pg-btn.active {
    background: var(--accent-gradient);
    color: white;
    border-color: var(--accent-purple);
}

.pg-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Details Modal Specific */
.modal-card {
    background: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: var(--transition);
}

.close-btn:hover {
    opacity: 1;
    transform: scale(1.15);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
}

/* Report Detail Grid layout */
.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 25px;
}

.detail-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-muted);
}

.detail-val {
    font-size: 0.92rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-top: 4px;
}

.detail-description-box {
    background-color: var(--bg-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-top: 5px;
    font-size: 0.88rem;
    white-space: pre-line;
}

.detail-status-editor {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
    padding: 12px;
    background: #FAFBFD;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.detail-status-editor label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color);
}

.detail-status-editor select {
    width: auto;
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Detail Photos Side */
.detail-photos-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-photos-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.no-photos-msg {
    text-align: center;
    padding: 40px 20px;
    background: #FAFBFD;
    border-radius: var(--radius-md);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
}

.no-photos-msg svg {
    width: 36px;
    height: 36px;
    stroke: var(--secondary-color);
    margin-bottom: 8px;
}

.detail-photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.detail-photo-wrapper {
    aspect-ratio: 1.1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.detail-photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.detail-photo-wrapper:hover img {
    transform: scale(1.05);
}

/* QR Code Modal Specific Styling */
.qr-card-modal {
    max-width: 460px;
}

.qr-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.qr-instructions {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 5px;
}

.qr-code-display-box {
    background: #FFFFFF;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin: 25px 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    width: 100%;
}

.qr-image-container {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F9FAFB;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 15px;
}

.qr-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-details {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.qr-brand-label {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.qr-action-text {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-purple);
    letter-spacing: 0.5px;
}

.qr-url-text {
    font-size: 0.65rem;
    background: #F3F4F6;
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--primary-lighter);
    font-family: monospace;
    margin-top: 8px;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.qr-actions button {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 0.8rem;
}

.qr-actions button svg {
    width: 16px;
    height: 16px;
}

.loader-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #E5E7EB;
    border-radius: 50%;
    border-top-color: var(--accent-purple);
    animation: spin 1s linear infinite;
}

/* Print Styling */
@media print {
    body * {
        visibility: hidden;
    }
    .qr-card-modal, .qr-card-modal * {
        visibility: visible;
    }
    .qr-card-modal {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: none;
    }
    .modal-header .close-btn, .qr-actions, .qr-instructions {
        display: none !important;
    }
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Checkmark animations */
@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}
@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 80px #10B981; }
}

/* Responsive Rules */
@media (max-width: 992px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        height: auto;
        padding: 12px 0;
    }
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    .nav-tabs {
        width: 100%;
        justify-content: center;
    }
    .nav-tab {
        flex: 1;
        justify-content: center;
    }
    .main-content {
        margin: 20px auto;
    }
    #hazard-form {
        padding: 25px;
    }
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .search-box {
        max-width: 100%;
    }
    .filter-dropdowns {
        flex-direction: column;
    }
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .kpi-grid {
        gap: 12px;
    }
    .kpi-value {
        font-size: 1.8rem;
    }
    .preview-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .table-footer {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    .qr-actions {
        flex-direction: column;
    }
}

/* --- Added Admin Edit, Delete and Export Styles --- */

.btn-excel-export {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ECFDF5;
    color: #059669;
    border: 1.5px solid #A7F3D0;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
}

.btn-excel-export:hover {
    background: #D1FAE5;
    border-color: #34D399;
    color: #047857;
}

.btn-excel-export svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.detail-admin-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    border-top: 1.5px solid var(--border-color);
    padding-top: 20px;
}

.detail-admin-actions button {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-detail-edit {
    background: #FAFBFD;
    border: 1.5px solid var(--primary-lighter);
    color: var(--primary-lighter);
}

.btn-detail-edit:hover {
    background: var(--primary-lighter);
    color: white;
}

.btn-detail-edit svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-detail-delete {
    background: #FEF2F2;
    border: 1.5px solid #FCA5A5;
    color: #DC2626;
}

.btn-detail-delete:hover {
    background: #DC2626;
    border-color: #DC2626;
    color: white;
}

.btn-detail-delete svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-detail-save {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.btn-detail-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(16, 185, 129, 0.25);
}

.btn-detail-save svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.btn-detail-cancel {
    background: #F3F4F6;
    border: 1.5px solid var(--border-color);
    color: var(--text-color);
}

.btn-detail-cancel:hover {
    background: #E5E7EB;
}

.edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    margin-top: 6px;
    background: #FAFBFD;
    transition: var(--transition);
}

.edit-input:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 3px rgba(58, 12, 163, 0.15);
}

.edit-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
    background: var(--bg-color);
    padding: 12px;
    border-radius: var(--radius-md);
}

/* Lightbox Styles */
#lightbox-modal {
    background: rgba(13, 27, 42, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.lightbox-content {
    position: relative;
    max-width: 85%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #FFFFFF;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    z-index: 2005;
}

.lightbox-close:hover {
    color: #EF4444;
    transform: scale(1.1);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: none;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    user-select: none;
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.lightbox-prev {
    left: -70px;
}

.lightbox-next {
    right: -70px;
}

@media (max-width: 900px) {
    .lightbox-prev {
        left: 10px;
        background: rgba(0, 0, 0, 0.5);
    }
    .lightbox-next {
        right: 10px;
        background: rgba(0, 0, 0, 0.5);
    }
    .lightbox-content {
        max-width: 95%;
    }
}

.lightbox-caption {
    margin-top: 15px;
    color: #E5E7EB;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.btn-change-pin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    color: #475569;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    transition: var(--transition);
}

.btn-change-pin:hover {
    background: #F1F5F9;
    border-color: #CBD5E1;
    color: #334155;
}

.btn-change-pin svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.change-pin-card {
    max-width: 420px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.change-pin-body {
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
