/* ===== CSS Variables & Theme - Modern Minimal ===== */
:root {
    /* Monochrome base */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-card: #111111;
    --bg-elevated: #161616;
    --bg-input: #1a1a1a;
    --bg-hover: #1f1f1f;
    
    /* White variations */
    --white: #ffffff;
    --white-90: rgba(255, 255, 255, 0.9);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-50: rgba(255, 255, 255, 0.5);
    --white-30: rgba(255, 255, 255, 0.3);
    --white-15: rgba(255, 255, 255, 0.15);
    --white-10: rgba(255, 255, 255, 0.1);
    --white-05: rgba(255, 255, 255, 0.05);
    
    /* Accent colors - muted, professional */
    --accent-blue: #0a84ff;
    --accent-blue-dim: rgba(10, 132, 255, 0.15);
    --accent-red: #ff453a;
    --accent-red-dim: rgba(255, 69, 58, 0.15);
    --accent-yellow: #ffd60a;
    --accent-yellow-dim: rgba(255, 214, 10, 0.15);
    --accent-green: #30d158;
    --accent-green-dim: rgba(48, 209, 88, 0.15);
    
    /* Text */
    --text-primary: var(--white-90);
    --text-secondary: var(--white-50);
    --text-muted: var(--white-30);
    
    /* Borders */
    --border-color: var(--white-10);
    --border-subtle: var(--white-05);
    
    /* Status */
    --success: var(--accent-green);
    --warning: var(--accent-yellow);
    --danger: var(--accent-red);
    
    /* Typography - System fonts */
    --font-primary: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'SF Mono', 'Cascadia Code', 'Segoe UI Mono', 'Roboto Mono', Consolas, monospace;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    
    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(10, 132, 255, 0.3);
    
    /* Transitions */
    --transition-fast: 120ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* ===== Selection ===== */
::selection {
    background: var(--accent-blue);
    color: var(--white);
}

/* ===== App Container ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===== Subtle Background ===== */
.bg-decoration {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-decoration::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(10, 132, 255, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(255, 69, 58, 0.02) 0%, transparent 50%);
}

/* ===== Header ===== */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo-img {
    height: 32px;
    width: auto;
    opacity: 0.95;
}

.logo-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

.logo h1 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white-05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--white-10);
    color: var(--white);
    border-color: var(--white-15);
}

.btn-icon:active {
    transform: scale(0.96);
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

/* ===== Main Content ===== */
.main-content {
    position: relative;
    z-index: 1;
    flex: 1;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* ===== Form Card ===== */
.form-card {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.form-header {
    padding: var(--space-lg) var(--space-lg);
    background: linear-gradient(to bottom, var(--bg-elevated), var(--bg-card));
    border-bottom: 1px solid var(--border-subtle);
}

.form-header h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--white);
    letter-spacing: -0.02em;
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 400;
}

/* ===== Form Styles ===== */
.note-form {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.label-icon {
    display: none;
}

/* ===== Select Styles ===== */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 14px 16px;
    padding-right: 44px;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    appearance: none;
    transition: all var(--transition-base);
}

.select-wrapper select:hover {
    background: var(--bg-hover);
    border-color: var(--white-15);
}

.select-wrapper select:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-dim);
}

.select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-base);
}

.select-wrapper:hover .select-arrow {
    color: var(--text-secondary);
}

/* ===== Input & Textarea Styles ===== */
input[type="text"],
textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: vertical;
    transition: all var(--transition-base);
}

input[type="text"]:hover,
textarea:hover {
    background: var(--bg-hover);
    border-color: var(--white-15);
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-dim);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    min-height: 100px;
}

/* ===== Photo Upload ===== */
.photo-upload-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.photo-buttons {
    display: flex;
    gap: var(--space-sm);
}

.btn-photo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 14px 16px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-photo:hover {
    background: var(--bg-hover);
    border-color: var(--accent-blue);
    color: var(--white);
}

.btn-photo:active {
    transform: scale(0.98);
}

.btn-photo svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.btn-photo:hover svg {
    opacity: 1;
}

.photo-preview {
    position: relative;
    background: var(--bg-input);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.photo-preview.hidden {
    display: none;
}

.photo-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
}

.photo-status {
    flex: 1;
    font-size: 0.85rem;
    color: var(--accent-green);
    font-weight: 500;
}

.btn-remove-photo {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-red);
    border: none;
    border-radius: 50%;
    color: var(--white);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.btn-remove-photo:hover {
    background: #ff2d20;
    transform: scale(1.1);
}

/* ===== Submit Button ===== */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 16px 24px;
    margin-top: var(--space-sm);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    background: var(--accent-blue);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    letter-spacing: -0.01em;
}

.btn-submit:hover {
    background: #0077ed;
    box-shadow: var(--shadow-glow);
}

.btn-submit:active {
    transform: scale(0.98);
}

.btn-icon-right {
    display: none;
}

/* ===== Data Screen ===== */
.data-card {
    width: 100%;
    max-width: 960px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.data-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.btn-back {
    padding: 10px 18px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--white);
    background: var(--white-10);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-back:hover {
    background: var(--white-15);
    border-color: var(--white-15);
}

.btn-back:active {
    transform: scale(0.97);
}

.data-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-group select {
    padding: 10px 14px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.filter-group select:hover {
    border-color: var(--white-15);
}

.filter-group select:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.btn-export {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px 18px;
    margin-left: auto;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bg-primary);
    background: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-export:hover {
    background: var(--white-90);
    box-shadow: var(--shadow-sm);
}

.btn-export:active {
    transform: scale(0.97);
}

/* ===== Export Dropdown ===== */
.export-dropdown {
    position: relative;
    margin-left: auto;
}

.btn-export,
.btn-export-report {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.btn-export svg,
.btn-export-report svg {
    flex-shrink: 0;
}

.dropdown-chevron {
    margin-left: 2px;
    transition: transform var(--transition-base);
}

.export-dropdown:has(.export-menu:not(.hidden)) .dropdown-chevron {
    transform: rotate(180deg);
}

.export-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    animation: dropdownFade 0.15s ease;
}

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

.export-menu.hidden {
    display: none;
}

.export-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.export-option:hover {
    background: var(--accent-blue);
    color: var(--white);
}

.export-option:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.export-option svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.export-option:hover svg {
    opacity: 1;
}

/* ===== Records Container ===== */
.records-container {
    padding: var(--space-lg);
    max-height: 60vh;
    overflow-y: auto;
}

.no-records {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-2xl) var(--space-lg);
    font-size: 0.95rem;
}

/* ===== Record Card ===== */
.record-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    transition: all var(--transition-base);
}

.record-card:hover {
    background: var(--bg-hover);
    border-color: var(--white-15);
}

.record-card:last-child {
    margin-bottom: 0;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.record-type {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
}

.record-timestamp {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.record-meta {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.record-badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--white-05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.record-badge.dept-operations {
    color: var(--accent-yellow);
    background: var(--accent-yellow-dim);
    border-color: rgba(255, 214, 10, 0.2);
}

.record-badge.dept-safety {
    color: var(--accent-blue);
    background: var(--accent-blue-dim);
    border-color: rgba(10, 132, 255, 0.2);
}

.record-badge.dept-accounting {
    color: var(--accent-red);
    background: var(--accent-red-dim);
    border-color: rgba(255, 69, 58, 0.2);
}

.record-notes {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-subtle);
    line-height: 1.6;
}

/* ===== Selection Bar ===== */
.selection-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-lg);
    background: var(--accent-blue-dim);
    border-bottom: 1px solid rgba(10, 132, 255, 0.2);
}

.selection-bar.hidden {
    display: none;
}

.selection-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.select-all-container {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.select-all-container input {
    display: none;
}

.select-all-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-blue);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all var(--transition-fast);
}

.select-all-container input:checked + .select-all-check {
    background: var(--accent-blue);
}

.select-all-container input:checked + .select-all-check::after {
    content: '✓';
    color: var(--white);
    font-size: 0.75rem;
    font-weight: bold;
}

.selection-count {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-blue);
}

.selection-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-export-selected {
    background: var(--white);
    color: var(--bg-primary);
}

.btn-export-selected:hover {
    background: var(--white-90);
}

.btn-delete-selected {
    background: var(--accent-red);
    color: var(--white);
}

.btn-delete-selected:hover {
    background: #ff2d20;
}

.btn-clear-selection {
    background: var(--white-10);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-clear-selection:hover {
    background: var(--white-15);
}

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

.btn-export-selected {
    position: relative;
}

.selection-actions .export-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    top: auto;
}

/* ===== Record Checkbox ===== */
.record-checkbox {
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.record-checkbox input {
    display: none;
}

.record-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-input);
    transition: all var(--transition-fast);
}

.record-checkbox:hover .record-check {
    border-color: var(--accent-blue);
}

.record-checkbox input:checked + .record-check {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.record-checkbox input:checked + .record-check::after {
    content: '✓';
    color: var(--white);
    font-size: 0.7rem;
    font-weight: bold;
}

.record-card {
    position: relative;
    padding-left: 48px;
}

.record-card.selected {
    background: var(--accent-blue-dim);
    border-color: rgba(10, 132, 255, 0.3);
}

.record-image-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
    border: 1px solid rgba(10, 132, 255, 0.2);
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

.record-image-badge:hover {
    background: var(--accent-blue);
    color: var(--white);
}

.record-image-badge svg {
    width: 12px;
    height: 12px;
}

/* Responsive selection bar */
@media (max-width: 600px) {
    .selection-bar {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }
    
    .selection-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .selection-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .btn-action {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .btn-action svg {
        display: none;
    }
}

/* Image Modal */
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: var(--space-lg);
    animation: modalFade 0.2s ease;
}

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

.image-modal.hidden {
    display: none;
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.modal-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 8px 14px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-modal-close {
    background: var(--white-10);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-modal-close:hover {
    background: var(--white-15);
}

.btn-modal-download {
    background: var(--accent-blue);
    color: var(--white);
}

.btn-modal-download:hover {
    background: #0077ed;
}

.modal-body {
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: calc(90vh - 80px);
    overflow: auto;
}

.modal-body iframe {
    width: 100%;
    min-width: 600px;
    height: 70vh;
    border: none;
    border-radius: var(--radius-sm);
}

.modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    color: var(--text-secondary);
}

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

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

/* ===== Admin Dashboard ===== */
.admin-dashboard {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* ===== Notes Section ===== */
.notes-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.notes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-subtle);
}

.notes-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
}

.notes-filters {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.notes-section .selection-bar {
    border-radius: 0;
}

.notes-section .records-container {
    max-height: 500px;
    overflow-y: auto;
}

/* Add note button styling */
.btn-add-note {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    color: var(--white) !important;
}

.btn-add-note:hover {
    background: #0077ed !important;
}

/* Export dropdown inline */
.export-dropdown-inline {
    position: relative;
}

.export-dropdown-inline .export-menu {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    top: auto;
}

.admin-header {
    display: none;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}

.stat-card {
    padding: var(--space-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.stat-card:hover {
    background: var(--bg-elevated);
    border-color: var(--white-15);
}

.stat-icon {
    display: none;
}

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

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--white);
    letter-spacing: -0.03em;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-total .stat-value { color: var(--white); }
.stat-operations .stat-value { color: var(--accent-yellow); }
.stat-safety .stat-value { color: var(--accent-blue); }
.stat-accounting .stat-value { color: var(--accent-red); }

/* Subtle indicator line */
.stat-card::before {
    content: '';
    display: block;
    width: 32px;
    height: 3px;
    border-radius: 2px;
    background: var(--white-15);
    margin-bottom: var(--space-md);
}

.stat-total::before { background: var(--white-30); }
.stat-operations::before { background: var(--accent-yellow); }
.stat-safety::before { background: var(--accent-blue); }
.stat-accounting::before { background: var(--accent-red); }

/* ===== Report Filters ===== */
.report-filters {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.report-filters h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--white);
    letter-spacing: -0.02em;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.filter-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filter-section > label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 180px;
    overflow-y: auto;
    padding: var(--space-sm);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.checkbox-item:hover {
    color: var(--white);
    background: var(--white-05);
}

.checkbox-item input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid var(--white-30);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.checkbox-item:hover .checkmark {
    border-color: var(--white-50);
}

.checkbox-item input:checked + .checkmark {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.checkbox-item input:checked + .checkmark::after {
    content: '✓';
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 600;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.date-input {
    flex: 1;
    padding: 12px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    min-height: 44px;
}

.date-input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.date-input:hover {
    border-color: var(--white-15);
}

.date-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue-dim);
}

.date-separator {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Quick Actions ===== */
.quick-actions {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.quick-actions > label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.quick-action-btns {
    display: flex;
    gap: var(--space-sm);
}

.dropdown-container {
    position: relative;
}

.btn-quick {
    padding: 10px 16px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--white-05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-quick:hover {
    background: var(--white-10);
    border-color: var(--white-15);
}

.btn-quick:active {
    transform: scale(0.97);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: var(--space-xs);
    min-width: 160px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
}

.dropdown-menu.hidden {
    display: none;
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--accent-blue);
    color: var(--white);
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid var(--border-subtle);
}

.report-actions {
    display: flex;
    gap: var(--space-md);
}

.btn-generate,
.btn-export-report {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 24px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-generate {
    background: var(--accent-blue);
    color: var(--white);
}

.btn-generate:hover {
    background: #0077ed;
    box-shadow: var(--shadow-glow);
}

.btn-generate:active {
    transform: scale(0.98);
}

.btn-export-report {
    background: var(--white);
    color: var(--bg-primary);
}

.btn-export-report:hover {
    background: var(--white-90);
    box-shadow: var(--shadow-sm);
}

.btn-export-report:active {
    transform: scale(0.98);
}

/* ===== Report Results ===== */
.report-results {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.report-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.report-results-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--white);
    letter-spacing: -0.02em;
}

.report-stats {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.report-stat {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--bg-primary);
    background: var(--white);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.report-stat.stat-ops {
    background: var(--accent-yellow);
    color: var(--bg-primary);
}

.report-stat.stat-safety {
    background: var(--accent-blue);
    color: var(--white);
}

.report-stat.stat-acct {
    background: var(--accent-red);
    color: var(--white);
}

.btn-select-mode {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--white-10);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-select-mode:hover {
    background: var(--white-15);
    border-color: var(--white-15);
}

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

.report-results .records-container {
    max-height: 500px;
    overflow-y: auto;
    padding: var(--space-md);
}

.report-results .record-card {
    padding-left: var(--space-md);
    position: relative;
}

.report-results.select-mode .record-card {
    padding-left: 56px;
}

.report-results .record-checkbox {
    display: none;
    position: absolute;
    top: var(--space-md);
    left: var(--space-md);
}

.report-results.select-mode .record-checkbox {
    display: block;
}

/* ===== Summary Section ===== */
.summary-section {
    margin-bottom: var(--space-xl);
}

.summary-section h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-bars {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.summary-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.bar-label {
    min-width: 130px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: var(--space-sm);
    border-radius: var(--radius-sm);
    transition: width var(--transition-slow);
}

.bar-fill span {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--white);
    opacity: 0.9;
}

.bar-fill.operations { 
    background: var(--accent-yellow); 
}
.bar-fill.operations span { color: var(--bg-primary); }

.bar-fill.safety { 
    background: var(--accent-blue); 
}

.bar-fill.accounting { 
    background: var(--accent-red); 
}

.bar-fill.location { 
    background: var(--white-50); 
}

.bar-fill.note-type { 
    background: var(--white-30); 
}

.bar-value {
    min-width: 50px;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--white);
}

.no-data {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: var(--space-md);
}

/* ===== Report Table ===== */
.report-table-container {
    margin-top: var(--space-xl);
}

.report-table-container h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.report-table th,
.report-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.report-table th {
    background: var(--bg-elevated);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.report-table tbody tr {
    transition: background var(--transition-fast);
}

.report-table tbody tr:hover {
    background: var(--bg-hover);
}

.report-table tbody tr:last-child td {
    border-bottom: none;
}

.report-table .cell-timestamp {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.report-table .cell-department {
    font-size: 0.85rem;
    font-weight: 500;
}

.report-table .cell-department.operations { color: var(--accent-yellow); }
.report-table .cell-department.safety { color: var(--accent-blue); }
.report-table .cell-department.accounting { color: var(--accent-red); }

.report-table .cell-details {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 14px 20px;
    background: var(--bg-elevated);
    color: var(--white);
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform var(--transition-slow);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    font-size: 1.1rem;
}

/* Success and error variations */
.toast[style*="--success"] {
    border-color: rgba(48, 209, 88, 0.3);
}

.toast[style*="--danger"] {
    border-color: rgba(255, 69, 58, 0.3);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--white-15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--white-30);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .app-header {
        padding: var(--space-md);
    }
    
    .main-content {
        padding: var(--space-md);
    }
    
    .form-card,
    .data-card {
        border-radius: var(--radius-lg);
    }
    
    .filters-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-sm);
    }
    
    .btn-export {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }
    
    .report-actions {
        flex-direction: column;
    }
    
    .btn-generate,
    .btn-export-report {
        width: 100%;
        justify-content: center;
    }
    
    .date-inputs {
        flex-direction: column;
    }
    
    .date-separator {
        display: none;
    }
    
    .quick-action-btns {
        flex-direction: column;
    }
    
    .btn-quick {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .stat-card::before {
        display: none;
    }
    
    .stat-content {
        flex-direction: row;
        align-items: center;
        gap: var(--space-md);
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-value {
        order: 2;
        font-size: 1.8rem;
    }
    
    .stat-label {
        order: 1;
        margin-top: 0;
    }
}
