:root {
    --ox-deep-night: #0B0E14;
    --ox-purple: #1A365D;
    --ox-purple-light: #2A4A7F;
    --ox-emerald: #10B981;
    --ox-slate: #94A3B8;
    --ox-surface: #ffffff;
    --ox-surface-light: #f8fafc;
    --ox-border: #e2e8f0;
    --ox-text: #1e293b;
    --ox-text-muted: #64748b;
}

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
    background-color: #ffffff;
    color: var(--ox-text);
    min-height: 100vh;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.bg-primary-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border-bottom: 1px solid var(--ox-border);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar {
    background: white !important;
    border-bottom: 1px solid var(--ox-border);
}

.navbar-brand {
    font-weight: 800 !important;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--ox-purple), var(--ox-purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.navbar-brand small {
    -webkit-text-fill-color: var(--ox-text-muted);
}

.navbar-dark .navbar-toggler-icon {
    filter: invert(1);
}

.login-page {
    background: radial-gradient(ellipse at 30% 50%, rgba(26,54,93,0.06) 0%, transparent 60%),
                #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: white;
    border: 1px solid var(--ox-border);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}
.login-card .form-control {
    background: #f8fafc;
    border: 1px solid var(--ox-border);
    color: var(--ox-text);
    border-radius: 12px;
}
.login-card .form-control:focus {
    border-color: var(--ox-purple);
    box-shadow: 0 0 0 3px rgba(26,54,93,0.1);
    background: white;
    color: var(--ox-text);
}
.login-card .form-label {
    color: var(--ox-text-muted);
    font-weight: 500;
}
.login-card .text-primary {
    background: linear-gradient(135deg, var(--ox-purple), var(--ox-purple-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-card .text-muted {
    color: var(--ox-text-muted) !important;
}
.login-card hr {
    border-color: var(--ox-border);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--ox-purple), var(--ox-purple-light));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
}

.btn-primary {
    background: var(--ox-purple) !important;
    border-color: var(--ox-purple) !important;
    border-radius: 12px;
}
.btn-primary:hover {
    background: var(--ox-purple-light) !important;
    border-color: var(--ox-purple-light) !important;
    box-shadow: 0 4px 15px rgba(26,54,93,0.25);
}
.btn-outline-primary {
    color: var(--ox-purple) !important;
    border-color: var(--ox-purple) !important;
}
.btn-outline-primary:hover, .btn-outline-primary.active, .btn-outline-primary:active {
    background: var(--ox-purple) !important;
    color: white !important;
}

.btn-success {
    background: var(--ox-emerald) !important;
    border-color: var(--ox-emerald) !important;
    border-radius: 12px;
}
.btn-success:hover {
    background: #059669 !important;
    border-color: #059669 !important;
}

.btn-danger {
    border-radius: 12px;
}

.btn-outline-light {
    color: var(--ox-text-muted) !important;
    border-color: var(--ox-border) !important;
}
.btn-outline-light:hover {
    background: var(--ox-purple) !important;
    color: white !important;
    border-color: var(--ox-purple) !important;
}

.stat-card {
    border: none;
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.stat-card.bg-primary {
    background: linear-gradient(135deg, var(--ox-purple), var(--ox-purple-light)) !important;
}
.stat-card.bg-success {
    background: linear-gradient(135deg, var(--ox-emerald), #059669) !important;
}
.stat-card.bg-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706) !important;
    color: white !important;
}
.stat-card.bg-warning small, .stat-card.bg-warning h3 { color: white !important; }
.stat-card.bg-info {
    background: linear-gradient(135deg, #3B82F6, #2563EB) !important;
}
.stat-card.bg-secondary {
    background: linear-gradient(135deg, #64748B, #475569) !important;
}
.stat-card.bg-dark {
    background: linear-gradient(135deg, #1e293b, #334155) !important;
}

.card {
    border-radius: 16px;
    border: 1px solid var(--ox-border);
    background: white;
    color: var(--ox-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.card-header {
    border-radius: 16px 16px 0 0 !important;
    background: var(--ox-surface-light) !important;
    border-bottom: 1px solid var(--ox-border) !important;
    color: var(--ox-text) !important;
}
.card-header.bg-white {
    background: var(--ox-surface-light) !important;
    color: var(--ox-text) !important;
}
.card-header.bg-warning {
    background: linear-gradient(135deg, #F59E0B, #D97706) !important;
    color: white !important;
}
.card-header.bg-danger {
    background: linear-gradient(135deg, var(--ox-purple), var(--ox-purple-light)) !important;
}
.card-body {
    color: var(--ox-text);
}
.card .text-muted {
    color: var(--ox-text-muted) !important;
}

.nav-tabs {
    border-bottom-color: var(--ox-border);
}
.nav-tabs .nav-link {
    border-radius: 12px 12px 0 0;
    font-weight: 500;
    color: var(--ox-text-muted);
    border-color: transparent;
}
.nav-tabs .nav-link:hover {
    color: var(--ox-text);
    border-color: var(--ox-border);
    background: var(--ox-surface-light);
}
.nav-tabs .nav-link.active {
    font-weight: 600;
    background: white;
    color: var(--ox-purple);
    border-color: var(--ox-border);
    border-bottom-color: white;
}

.table {
    color: var(--ox-text);
    --bs-table-bg: transparent;
}
.table th {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ox-text-muted);
    border-bottom-color: var(--ox-border) !important;
}
.table td {
    border-bottom-color: #f8fafc !important;
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    --bs-table-hover-bg: rgba(26,54,93,0.03);
}
.table-light {
    --bs-table-bg: var(--ox-surface-light) !important;
    color: var(--ox-text-muted) !important;
}
.table-light th {
    color: var(--ox-text-muted) !important;
}

.badge {
    font-weight: 500;
    border-radius: 8px;
}
.badge.bg-primary {
    background: var(--ox-purple) !important;
}
.badge.bg-success {
    background: var(--ox-emerald) !important;
}
.badge.bg-light {
    background: var(--ox-surface-light) !important;
    color: var(--ox-text) !important;
    border: 1px solid var(--ox-border);
}

.alert {
    border-radius: 12px;
}
.alert-info {
    background: rgba(26,54,93,0.06);
    border-color: rgba(26,54,93,0.15);
    color: var(--ox-purple);
}
.alert-danger {
    background: rgba(239,68,68,0.06);
    border-color: rgba(239,68,68,0.15);
    color: #dc2626;
}
.alert-success {
    background: rgba(16,185,129,0.06);
    border-color: rgba(16,185,129,0.15);
    color: #059669;
}
.alert-warning {
    background: rgba(245,158,11,0.06);
    border-color: rgba(245,158,11,0.15);
    color: #d97706;
}

.form-control, .form-select {
    background: var(--ox-surface-light);
    border: 1px solid var(--ox-border);
    color: var(--ox-text);
    border-radius: 12px;
}
.form-control:focus, .form-select:focus {
    background: white;
    border-color: var(--ox-purple);
    box-shadow: 0 0 0 3px rgba(26,54,93,0.1);
    color: var(--ox-text);
}
.form-control::placeholder {
    color: #94a3b8;
}
.form-label {
    color: var(--ox-text-muted);
    font-weight: 500;
}

.list-group-item {
    background: transparent;
    border-color: var(--ox-border);
    color: var(--ox-text);
}
.list-group-item-warning {
    background: rgba(26,54,93,0.04) !important;
    color: var(--ox-text) !important;
    border-color: rgba(26,54,93,0.1) !important;
}

.border-start.border-warning {
    border-left-color: #F59E0B !important;
}
.border-start.border-success {
    border-left-color: var(--ox-emerald) !important;
}

footer {
    font-size: 0.85rem;
    background: white !important;
    border-top: 1px solid var(--ox-border) !important;
    color: var(--ox-text-muted) !important;
}
footer .text-muted {
    color: var(--ox-text-muted) !important;
}

.bg-light {
    background: var(--ox-surface-light) !important;
}

.container-fluid {
    color: var(--ox-text);
}

a {
    color: var(--ox-purple);
}
a:hover {
    color: var(--ox-purple-light);
}

.media-capture-box {
    border: 2px dashed var(--ox-border);
    border-radius: 16px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--ox-surface-light);
    color: var(--ox-text);
}
.media-capture-box:hover {
    border-color: var(--ox-purple);
    background: rgba(26,54,93,0.03);
}
.media-capture-box:active {
    transform: scale(0.97);
}
.media-capture-box.media-selected {
    border-color: var(--ox-emerald);
    border-style: solid;
    background: rgba(16,185,129,0.03);
}

.text-muted {
    color: var(--ox-text-muted) !important;
}

.text-success { color: var(--ox-emerald) !important; }

/* Touch-friendly targets for factory / gloved use (min 48x48px) */
.btn, button, [role="button"],
.form-select, .form-control,
.dropdown-item, .list-group-item,
.nav-link, .navbar-toggler,
.sidebar-nav-item,
.category-card, .location-chip {
    min-height: 48px;
}

.btn {
    padding: 10px 20px;
}

.form-select, .form-control {
    padding: 10px 14px;
    font-size: 1rem;
}

.dropdown-item {
    padding: 10px 16px;
}

.table td, .table th {
    padding: 12px 10px;
    vertical-align: middle;
}

a.badge, .badge[onclick], .badge[data-bs-toggle] {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
}

@media (max-width: 768px) {
    .stat-card .card-body h3 {
        font-size: 1.5rem;
    }
    .login-card {
        padding: 1.5rem;
    }
    .media-capture-box {
        padding: 1.2rem 0.8rem;
        min-height: 120px;
    }
    .media-capture-box i {
        font-size: 2rem !important;
    }
    .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    .table {
        font-size: 0.85rem;
    }

    .btn, button, [role="button"] {
        min-height: 52px;
        font-size: 1rem;
    }

    .form-select, .form-control {
        min-height: 52px;
        font-size: 1rem;
    }

    .dropdown-item {
        min-height: 52px;
        font-size: 1rem;
    }
}

.sv-breadcrumb {
    padding: 8px 0 16px;
    margin: 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.sv-breadcrumb li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sv-breadcrumb li + li::before {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.55rem;
    color: #CBD5E1;
}
.sv-breadcrumb a {
    color: #64748B;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.sv-breadcrumb a:hover {
    color: #1A365D;
}
.sv-breadcrumb .active {
    color: #1A365D;
    font-weight: 600;
}

.sv-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.sv-badge-pending {
    background: #FEF3C7;
    color: #92400E;
}
.sv-badge-progress {
    background: #DBEAFE;
    color: #1E40AF;
}
.sv-badge-approved, .sv-badge-active {
    background: #D1FAE5;
    color: #065F46;
}
.sv-badge-closed, .sv-badge-completed {
    background: #E2E8F0;
    color: #475569;
}
.sv-badge-rejected, .sv-badge-overdue {
    background: #FEE2E2;
    color: #991B1B;
}
.sv-badge-draft {
    background: #F1F5F9;
    color: #64748B;
}
.sv-badge-critical {
    background: #FEE2E2;
    color: #DC2626;
    font-weight: 700;
}
.sv-badge-high {
    background: #FED7AA;
    color: #C2410C;
}
.sv-badge-medium {
    background: #FEF3C7;
    color: #B45309;
}
.sv-badge-low {
    background: #D1FAE5;
    color: #047857;
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #94A3B8;
}
.empty-state .empty-state-icon {
    width: 72px;
    height: 72px;
    background: #F1F5F9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: #CBD5E1;
}
.empty-state h5 {
    color: #64748B;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
}
.empty-state p {
    color: #94A3B8;
    font-size: 0.85rem;
    margin-bottom: 16px;
}
.empty-state .btn {
    min-height: 48px;
}

/* Toast notification system */
.sv-toast-container {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
    width: calc(100% - 40px);
    pointer-events: none;
}
.sv-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #64748B;
    animation: svToastIn 0.35s cubic-bezier(0.21,1.02,0.73,1) forwards;
    font-size: 0.88rem;
    color: #1E293B;
    line-height: 1.5;
    transition: opacity 0.3s, transform 0.3s;
}
.sv-toast.sv-toast-out {
    animation: svToastOut 0.3s ease forwards;
}
.sv-toast-success { border-left-color: #10B981; }
.sv-toast-danger, .sv-toast-error { border-left-color: #EF4444; }
.sv-toast-warning { border-left-color: #F59E0B; }
.sv-toast-info { border-left-color: #3B82F6; }
.sv-toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.8rem;
}
.sv-toast-success .sv-toast-icon { background: #D1FAE5; color: #059669; }
.sv-toast-danger .sv-toast-icon, .sv-toast-error .sv-toast-icon { background: #FEE2E2; color: #DC2626; }
.sv-toast-warning .sv-toast-icon { background: #FEF3C7; color: #D97706; }
.sv-toast-info .sv-toast-icon { background: #DBEAFE; color: #2563EB; }
.sv-toast-body { flex: 1; min-width: 0; }
.sv-toast-close {
    background: none;
    border: none;
    color: #94A3B8;
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
    min-height: auto;
}
.sv-toast-close:hover { color: #475569; }
.sv-toast-progress {
    position: absolute;
    bottom: 0;
    left: 4px;
    right: 0;
    height: 3px;
    background: rgba(0,0,0,0.08);
    border-radius: 0 0 14px 14px;
    overflow: hidden;
}
.sv-toast-progress-bar {
    height: 100%;
    border-radius: 0 0 14px 14px;
    animation: svToastProgress var(--sv-toast-duration, 5s) linear forwards;
}
.sv-toast-success .sv-toast-progress-bar { background: #10B981; }
.sv-toast-danger .sv-toast-progress-bar, .sv-toast-error .sv-toast-progress-bar { background: #EF4444; }
.sv-toast-warning .sv-toast-progress-bar { background: #F59E0B; }
.sv-toast-info .sv-toast-progress-bar { background: #3B82F6; }
@keyframes svToastIn {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes svToastOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.95); }
}
@keyframes svToastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* Delete confirmation modal */
.sv-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: svFadeIn 0.2s ease;
}
.sv-confirm-dialog {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: svScaleIn 0.25s cubic-bezier(0.21,1.02,0.73,1);
}
.sv-confirm-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #FEE2E2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: #DC2626;
}
.sv-confirm-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1E293B;
    margin-bottom: 8px;
}
.sv-confirm-text {
    font-size: 0.9rem;
    color: #64748B;
    margin-bottom: 24px;
    line-height: 1.6;
}
.sv-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.sv-confirm-actions .btn {
    min-width: 120px;
    font-weight: 600;
    border-radius: 12px;
    padding: 12px 24px;
}
@keyframes svFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes svScaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

/* Skeleton loader */
.sv-skeleton {
    background: linear-gradient(90deg, #F1F5F9 25%, #E2E8F0 50%, #F1F5F9 75%);
    background-size: 200% 100%;
    animation: svShimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}
.sv-skeleton-text {
    height: 14px;
    margin-bottom: 10px;
    width: 100%;
}
.sv-skeleton-text:last-child { width: 60%; }
.sv-skeleton-title {
    height: 22px;
    width: 45%;
    margin-bottom: 16px;
}
.sv-skeleton-card {
    height: 120px;
    border-radius: 16px;
    margin-bottom: 16px;
}
.sv-skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}
@keyframes svShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Button interaction states */
.btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.btn:active:not(:disabled) {
    transform: translateY(0) scale(0.97);
    box-shadow: none;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.btn-primary:focus-visible,
.btn-success:focus-visible,
.btn-danger:focus-visible,
.btn-warning:focus-visible,
.btn-outline-primary:focus-visible {
    outline: 3px solid rgba(26,54,93,0.4);
    outline-offset: 2px;
}

/* Focus-visible for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid rgba(26,54,93,0.4);
    outline-offset: 2px;
    border-radius: 4px;
}
.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
}

/* Form validation states */
.sv-field-error {
    color: #DC2626;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: svFadeIn 0.2s ease;
}
.sv-field-error::before {
    content: '\f06a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.7rem;
}
.form-control.is-invalid, .form-select.is-invalid {
    border-color: #DC2626 !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.1) !important;
}
.form-control.is-valid, .form-select.is-valid {
    border-color: #10B981 !important;
    box-shadow: 0 0 0 3px rgba(16,185,129,0.1) !important;
}

/* Required field indicator */
.form-label.required::after {
    content: ' *';
    color: #DC2626;
    font-weight: 700;
}

/* Skip link for keyboard navigation */
.sv-skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: #1A365D;
    color: white;
    padding: 12px 24px;
    border-radius: 0 0 12px 12px;
    font-weight: 600;
    z-index: 10002;
    text-decoration: none;
    transition: top 0.2s;
}
.sv-skip-link:focus {
    top: 0;
    color: white;
}
