/* ============================================
   SHIPGUARD PRO - CONSOLIDATED STYLESHEET
   Dark Mode (Default) + Light Mode Support
   ============================================ */

:root {
    /* Dark Mode - Default */
    /* Coca-Cola Red Brand Color: #DC143C */
    --primary: #0A1628;
    --secondary: #1E3A5F;
    --accent: #DC143C;
    --accent-glow: rgba(220, 20, 60, 0.3);
    --warning: #FF6B35;
    --danger: #FF4757;
    --success: #DC143C;
    --surface: #0D1B2A;
    --surface-light: #1B2838;
    --surface-card: #162033;
    --text-primary: #FFFFFF;
    --text-secondary: #8BA4BE;
    --gradient-primary: linear-gradient(135deg, #DC143C 0%, #B31228 100%);
    --gradient-success: linear-gradient(135deg, #DC143C 0%, #B31228 100%);
    --gradient-warning: linear-gradient(135deg, #FF6B35 0%, #FF4F18 100%);
    --gradient-danger: linear-gradient(135deg, #FF4757 0%, #FF2D3E 100%);
    --gradient-dark: linear-gradient(180deg, #0A1628 0%, #0D1B2A 100%);
    --sidebar-width: 280px;
}

/* Light Mode Theme */
[data-theme="light"] {
    --primary: #F5F7FA;
    --secondary: #E8EEF5;
    --accent: #DC143C;
    --accent-glow: rgba(220, 20, 60, 0.2);
    --warning: #FF6B35;
    --danger: #FF4757;
    --success: #DC143C;
    --surface: #FFFFFF;
    --surface-light: #F5F7FA;
    --surface-card: #F0F3F8;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --gradient-primary: linear-gradient(135deg, #DC143C 0%, #B31228 100%);
    --gradient-success: linear-gradient(135deg, #DC143C 0%, #B31228 100%);
    --gradient-warning: linear-gradient(135deg, #FF6B35 0%, #FF4F18 100%);
    --gradient-danger: linear-gradient(135deg, #FF4757 0%, #FF2D3E 100%);
    --gradient-dark: linear-gradient(180deg, #F5F7FA 0%, #FFFFFF 100%);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background: var(--primary);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
    z-index: 102;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: rgba(0, 212, 170, 0.4);
    background: rgba(0, 212, 170, 0.05);
}

.theme-toggle .material-icons-outlined {
    font-size: 24px;
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

/* Animated Background Grid */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 170, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 170, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.3;
    animation: float 15s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 14s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 16s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 13s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 15s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 11s; }
.particle:nth-child(7) { left: 70%; animation-delay: 2s; animation-duration: 17s; }
.particle:nth-child(8) { left: 80%; animation-delay: 4s; animation-duration: 14s; }
.particle:nth-child(9) { left: 90%; animation-delay: 1s; animation-duration: 12s; }

@keyframes float {
    0%, 100% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 0.5; }
    50% { opacity: 0.3; }
    90% { opacity: 0.1; }
    100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

/* Main Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

/* Login Card */
.login-card {
    background: rgba(13, 27, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(0, 212, 170, 0.05);
    animation: cardEntrance 0.8s ease-out;
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.1),
        0 0 100px rgba(0, 212, 170, 0.05);
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 2.5rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 40px var(--accent-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 10px 40px var(--accent-glow); }
    50% { box-shadow: 0 10px 60px var(--accent-glow), 0 0 30px var(--accent-glow); }
}

.logo-icon .material-icons-outlined {
    font-size: 40px;
    color: var(--primary);
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--accent);
}

.logo-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .material-icons-outlined {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 20px;
    transition: color 0.3s ease;
}

.form-control {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 212, 170, 0.05);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

.form-control:focus + .material-icons-outlined,
.input-wrapper:focus-within .material-icons-outlined {
    color: var(--accent);
}

.form-control::placeholder {
    color: rgba(139, 164, 190, 0.5);
}

[data-theme="light"] .form-control::placeholder {
    color: rgba(107, 114, 128, 0.5);
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.role-option {
    position: relative;
}

.role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.role-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.25rem;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.role-option label:hover {
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
}

.role-option input:checked + label {
    border-color: var(--accent);
    background: rgba(0, 212, 170, 0.1);
}

.role-option .material-icons-outlined {
    font-size: 28px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.role-option input:checked + label .material-icons-outlined {
    color: var(--accent);
}

.role-option span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.role-option input:checked + label span {
    color: var(--text-primary);
}

/* Login Button */
.btn-login {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

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

/* Additional Links */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(139, 164, 190, 0.1);
}

[data-theme="light"] .login-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.login-footer a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.login-footer a:hover {
    opacity: 0.8;
}

/* Status Indicator */
.system-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Decorative Elements */
.corner-accent {
    position: absolute;
    width: 100px;
    height: 100px;
    border: 2px solid rgba(0, 212, 170, 0.1);
    pointer-events: none;
}

.corner-accent.top-left {
    top: -50px;
    left: -50px;
    border-radius: 50%;
}

.corner-accent.bottom-right {
    bottom: -50px;
    right: -50px;
    border-radius: 50%;
}

/* Error State */
.form-control.is-invalid {
    border-color: var(--warning);
}

.invalid-feedback {
    color: var(--warning);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    display: none;
}

.form-control.is-invalid ~ .invalid-feedback {
    display: block;
}

/* ============================================
   SIDEBAR STYLES
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--surface);
    border-right: 1px solid rgba(0, 212, 170, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 212, 170, 0.1);
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon-sm {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon-sm .material-icons-outlined {
    font-size: 24px;
    color: var(--primary);
}

.logo-text-sm {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-text-sm span {
    color: var(--accent);
}

.nav-section {
    flex: 1;
    padding: 1.5rem 1rem;
    overflow-y: auto;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
}

.nav-menu {
    list-style: none;
    margin-bottom: 2rem;
}

.nav-item {
    margin-bottom: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background: rgba(0, 212, 170, 0.05);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(0, 212, 170, 0.1);
    color: var(--accent);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
}

.nav-link .material-icons-outlined {
    font-size: 22px;
}

.nav-link span {
    font-weight: 500;
    font-size: 0.925rem;
}

.user-section {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 212, 170, 0.1);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    font-size: 0.925rem;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

/* ============================================
   MAIN CONTENT STYLES
   ============================================ */

.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.925rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-scan {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-scan:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
    color: var(--primary);
}

.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 100px;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   DASHBOARD STYLES
   ============================================ */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(0, 212, 170, 0.3);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    opacity: 0.5;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon.pending {
    background: rgba(255, 107, 53, 0.15);
    color: var(--warning);
}

.stat-icon.verified {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}

.stat-icon.processing {
    background: rgba(30, 58, 95, 0.5);
    color: var(--text-secondary);
}

.stat-icon.completed {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.stat-change {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

/* Activity Card */
.activity-card {
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.view-all {
    font-size: 0.875rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.view-all:hover {
    opacity: 0.8;
    color: var(--accent);
}

/* Activity List */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(139, 164, 190, 0.1);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.scan {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}

.activity-icon.warning {
    background: rgba(255, 107, 53, 0.15);
    color: var(--warning);
}

.activity-icon.reject {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    font-size: 0.925rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.activity-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.activity-code {
    font-family: 'JetBrains Mono', monospace;
    background: var(--surface-light);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Quick Actions Card */
.actions-card {
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface-light);
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: rgba(0, 212, 170, 0.3);
    background: rgba(0, 212, 170, 0.05);
    color: var(--text-primary);
}

.action-btn .material-icons-outlined {
    font-size: 24px;
    color: var(--accent);
}

.action-btn span {
    font-weight: 500;
}

/* Status Section */
.status-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(139, 164, 190, 0.1);
}

.status-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.status-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
}

.status-dot.offline {
    background: var(--danger);
}

.status-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ============================================
   SCANNER PAGE STYLES
   ============================================ */

.scanner-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
}

.scanner-card {
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.scanner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.scan-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--success);
}

.scan-status .status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 var(--accent-glow);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px transparent;
    }
}

/* Scanner state variants */
.scan-status--ready  { color: #4CAF50; }
.scan-status--ready  .status-dot { background: #4CAF50; animation: pulse 2s infinite; }

.scan-status--scanning { color: #FF9800; }
.scan-status--scanning .status-dot { background: #FF9800; animation: pulse .6s infinite; }

.scan-status--error  { color: var(--danger); }
.scan-status--error  .status-dot { background: var(--danger); animation: none; }

@keyframes scan-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-6px); }
    40%       { transform: translateX(6px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}
.scan-rejected {
    border-color: var(--danger) !important;
    animation: scan-shake .35s ease;
}

.scanner-input-wrapper {
    margin-bottom: 2rem;
}

.scanner-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.barcode-input-field {
    width: 100%;
    padding: 1.5rem;
    background: var(--surface);
    border: 2px solid rgba(220, 20, 60, 0.3);
    border-radius: 16px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.barcode-input-field:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(220, 20, 60, 0.05);
    box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.2);
}

.barcode-input-field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.scanner-status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    margin-top: 1rem;
    background: rgba(220, 20, 60, 0.1);
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 500;
}

.scanner-status-indicator .status-dot {
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes scannerGlow {
    0%, 100% {
        box-shadow: inset 0 0 20px var(--accent-glow);
    }
    50% {
        box-shadow: inset 0 0 40px var(--accent-glow);
    }
}

.scanner-icon {
    width: 80px;
    height: 80px;
    background: rgba(0, 212, 170, 0.1);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.scanner-icon .material-icons-outlined {
    font-size: 40px;
    color: var(--accent);
}

.scanner-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scanner-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.barcode-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.manual-input-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.manual-input {
    flex: 1;
    padding: 0.875rem 1rem;
    background: var(--surface-light);
    border: 2px solid transparent;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.manual-input:focus {
    outline: none;
    border-color: var(--accent);
}

.manual-input::placeholder {
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    letter-spacing: normal;
}

.btn-verify {
    padding: 0.875rem 1.5rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-verify:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-verify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.recent-scans-card {
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 20px;
    padding: 2rem;
}

.scan-list {
    list-style: none;
    max-height: 400px;
    overflow-y: auto;
}

.scan-list::-webkit-scrollbar {
    width: 6px;
}

.scan-list::-webkit-scrollbar-track {
    background: var(--surface);
    border-radius: 3px;
}

.scan-list::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

.scan-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.scan-item:hover {
    background: var(--surface-light);
}

.scan-item:last-child {
    margin-bottom: 0;
}

.scan-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scan-item-icon.success {
    background: rgba(0, 212, 170, 0.15);
    color: var(--success);
}

.scan-item-icon.warning {
    background: rgba(255, 107, 53, 0.15);
    color: var(--warning);
}

.scan-item-icon.error {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
}

.scan-item-content {
    flex: 1;
    min-width: 0;
}

.scan-item-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.925rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.scan-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.scan-item-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 3rem;
}

.empty-state-icon {
    width: 60px;
    height: 60px;
    background: var(--surface);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.empty-state-icon .material-icons-outlined {
    font-size: 28px;
    color: var(--text-secondary);
}

.empty-state-text {
    font-size: 0.925rem;
    color: var(--text-secondary);
}

/* Scan Animation Overlay */
.scan-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 22, 40, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

[data-theme="light"] .scan-animation {
    background: rgba(245, 247, 250, 0.95);
}

.scan-animation.active {
    display: flex;
}

.scan-animation-content {
    text-align: center;
}

.scan-loader {
    width: 120px;
    height: 120px;
    border: 3px solid var(--surface-light);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

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

.scan-animation-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.scan-animation-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--accent);
}

/* ============================================
   SCAN RESULT PAGE STYLES
   ============================================ */

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-btn:hover {
    background: rgba(0, 212, 170, 0.1);
    color: var(--accent);
    border-color: rgba(0, 212, 170, 0.3);
}

.result-container {
    max-width: 900px;
    margin: 0 auto;
}

.status-banner {
    border-radius: 24px;
    padding: 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.status-banner.success {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.15) 0%, rgba(0, 168, 133, 0.1) 100%);
    border: 2px solid rgba(0, 212, 170, 0.3);
}

.status-banner.warning {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15) 0%, rgba(255, 79, 24, 0.1) 100%);
    border: 2px solid rgba(255, 107, 53, 0.3);
}

.status-banner.error {
    background: linear-gradient(135deg, rgba(255, 71, 87, 0.15) 0%, rgba(255, 45, 62, 0.1) 100%);
    border: 2px solid rgba(255, 71, 87, 0.3);
}

.status-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.status-banner.success .status-icon {
    background: var(--gradient-success);
    box-shadow: 0 10px 40px var(--accent-glow);
}

.status-banner.warning .status-icon {
    background: var(--gradient-warning);
    box-shadow: 0 10px 40px rgba(255, 107, 53, 0.3);
}

.status-banner.error .status-icon {
    background: var(--gradient-danger);
    box-shadow: 0 10px 40px rgba(255, 71, 87, 0.3);
}

.status-icon .material-icons-outlined {
    font-size: 50px;
    color: white;
}

.status-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.status-banner.success .status-title { color: var(--success); }
.status-banner.warning .status-title { color: var(--warning); }
.status-banner.error .status-title { color: var(--danger); }

.status-message {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.shipment-code {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    background: var(--surface);
    border-radius: 12px;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Verification Steps */
.verification-steps {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(139, 164, 190, 0.1);
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--surface);
    border-radius: 12px;
}

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

.step-icon.complete {
    background: rgba(0, 212, 170, 0.2);
    color: var(--success);
}

.step-icon.pending {
    background: rgba(139, 164, 190, 0.2);
    color: var(--text-secondary);
}

.step-icon.current {
    background: rgba(255, 107, 53, 0.2);
    color: var(--warning);
}

.step-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.step-status {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Details Card */
.details-card {
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.1);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.detail-item {
    padding: 1rem;
    background: var(--surface);
    border-radius: 12px;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.detail-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.detail-value.mono {
    font-family: 'JetBrains Mono', monospace;
}

.scan-type-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.scan-type-badge.security {
    background: rgba(0, 212, 170, 0.1);
    color: var(--success);
}

.scan-type-badge.warehouse {
    background: rgba(124, 77, 255, 0.1);
    color: #7C4DFF;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.925rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
    color: var(--primary);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 170, 0.2);
}

.btn-secondary:hover {
    background: rgba(0, 212, 170, 0.1);
    border-color: rgba(0, 212, 170, 0.4);
    color: var(--text-primary);
}

.btn-danger {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.btn-danger:hover {
    background: rgba(255, 71, 87, 0.2);
}

/* Exit Ready Banner */
.exit-ready-banner {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.1) 0%, rgba(0, 168, 133, 0.05) 100%);
    border: 2px solid rgba(0, 212, 170, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.exit-ready-banner .material-icons-outlined {
    font-size: 32px;
    color: var(--success);
}

.exit-ready-content {
    flex: 1;
}

.exit-ready-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--success);
    margin-bottom: 0.25rem;
}

.exit-ready-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Timestamp */
.timestamp {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2rem;
}

/* ============================================
   ANIMATIONS & UTILITIES
   ============================================ */

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .scanner-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .verification-steps {
        flex-direction: column;
        align-items: center;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .manual-input-group {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 2rem;
    }

    .logo-text {
        font-size: 1.5rem;
    }

    .role-selector {
        grid-template-columns: 1fr;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }

    .theme-toggle .material-icons-outlined {
        font-size: 20px;
    }
}

.menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    width: 48px;
    height: 48px;
    background: var(--surface-card);
    border: 1px solid rgba(0, 212, 170, 0.2);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    cursor: pointer;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
}

/* ============================================
   SCAN VIOLATIONS STYLES
   ============================================ */

.filters-card {
    background: var(--surface-card);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(220, 20, 60, 0.1);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .material-icons-outlined {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.filter-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(220, 20, 60, 0.05);
}

.filter-select {
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(220, 20, 60, 0.05);
}

.filter-select option {
    background: var(--surface);
    color: var(--text-primary);
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.violations-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.table-card {
    background: var(--surface-card);
    border-radius: 16px;
    border: 1px solid rgba(220, 20, 60, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

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

.violations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.violations-table thead {
    background: rgba(220, 20, 60, 0.05);
    border-bottom: 2px solid rgba(220, 20, 60, 0.2);
}

.violations-table th {
    padding: 1.25rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    user-select: none;
}

.violations-table th.sortable {
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.violations-table th.sortable:hover {
    background: rgba(220, 20, 60, 0.1);
}

.th-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-icon {
    font-size: 0.75rem;
    color: var(--accent);
}

.violations-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
    color: var(--text-primary);
}

.violation-row:hover {
    background: rgba(220, 20, 60, 0.02);
}

/* Shipments / contingency list table */
.shipments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.shipments-table thead {
    background: var(--surface-secondary);
    border-bottom: 2px solid var(--border-color);
}

.shipments-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}

.shipments-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    vertical-align: middle;
}

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

.shipments-table tbody tr:hover {
    background: var(--surface-secondary);
}

.shipment-cell {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: var(--accent);
}

.violation-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.violation-badge.multiple {
    background: rgba(255, 107, 53, 0.15);
    color: #FF6B35;
}

.violation-badge.not-found {
    background: rgba(255, 71, 87, 0.15);
    color: #FF4757;
}

.violation-badge.no-approval {
    background: rgba(220, 20, 60, 0.15);
    color: var(--accent);
}

.violation-badge.prev-granted {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
}

.role-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.role-badge.warehouse {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.role-badge.security {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.role-badge.driver {
    background: rgba(156, 39, 176, 0.15);
    color: #9C27B0;
}

.sync-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.sync-status.synced {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.sync-status.pending {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.sync-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.sync-status.synced .status-dot {
    background: #4CAF50;
}

.sync-status.pending .status-dot {
    background: #FF9800;
}

.pagination-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-top: 1px solid rgba(220, 20, 60, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(220, 20, 60, 0.1);
    border-color: var(--accent);
}

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

.page-numbers {
    display: flex;
    gap: 0.25rem;
}

.page-number {
    width: 40px;
    height: 40px;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.page-number:hover {
    background: rgba(220, 20, 60, 0.1);
    border-color: var(--accent);
}

.page-number.active {
    background: var(--gradient-primary);
    border-color: var(--accent);
    color: white;
}

.table-actions {
    display: flex;
    gap: 1rem;
}

.stat-icon.violations {
    background: rgba(255, 71, 87, 0.15);
    color: #FF4757;
}

.stat-icon.synced {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.stat-icon.multiple {
    background: rgba(255, 107, 53, 0.15);
    color: #FF6B35;
}

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

    .violations-table {
        font-size: 0.9rem;
    }

    .violations-table th,
    .violations-table td {
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .filters-card {
        padding: 1.5rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .violations-table {
        font-size: 0.85rem;
    }

    .violations-table th,
    .violations-table td {
        padding: 0.5rem;
    }

    .violation-badge {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }

    .pagination-section {
        padding: 1rem;
        justify-content: center;
    }

    .pagination-controls {
        order: 3;
        width: 100%;
        justify-content: center;
    }

    .page-number,
    .pagination-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .table-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }
}

/* ============================================
   HISTORY & SHIPMENTS STYLES
   ============================================ */

.history-container {
    background: var(--surface-card);
    border-radius: 16px;
    border: 1px solid rgba(220, 20, 60, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.timeline-wrapper {
    padding: 2rem 0;
}

.timeline-item {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
    transition: background-color 0.3s ease;
}

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

.timeline-item:hover {
    background: rgba(220, 20, 60, 0.02);
}

.timeline-marker {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
}

.timeline-marker.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.timeline-marker.warning {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.timeline-marker.error {
    background: rgba(255, 71, 87, 0.15);
    color: #FF4757;
}

.timeline-content {
    flex: 1;
    padding-top: 0.25rem;
}

.timeline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.timeline-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-status {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.timeline-status.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.timeline-status.warning {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.timeline-status.error {
    background: rgba(255, 71, 87, 0.15);
    color: #FF4757;
}

.timeline-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 80px;
}

.detail-value {
    color: var(--text-primary);
}

.detail-value.mono {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

.shipment-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shipment-status.pending {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.shipment-status.success {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.shipment-status.processing {
    background: rgba(33, 150, 243, 0.15);
    color: #2196F3;
}

.shipment-status.complete {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(220, 20, 60, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
}

/* Responsive Design for History & Shipments */
@media (max-width: 768px) {
    .timeline-item {
        padding: 1rem 1.5rem;
        gap: 1rem;
    }

    .timeline-details {
        grid-template-columns: 1fr;
    }

    .detail-row {
        font-size: 0.85rem;
    }

    .timeline-marker {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* ============================================
   USER & ROLE MANAGEMENT STYLES
   ============================================ */

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-status {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.user-status.active {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.user-status.inactive {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.action-icons {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid rgba(220, 20, 60, 0.2);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: var(--accent);
    background: rgba(220, 20, 60, 0.1);
}

.action-btn.delete:hover {
    border-color: #FF4757;
    background: rgba(255, 71, 87, 0.1);
    color: #FF4757;
}

.action-btn .material-icons-outlined {
    font-size: 18px;
}

.action-header {
    margin-bottom: 2rem;
}

.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.role-card {
    background: var(--surface-card);
    border: 1px solid rgba(220, 20, 60, 0.1);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.role-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 24px rgba(220, 20, 60, 0.15);
}

.role-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.role-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.role-actions {
    display: flex;
    gap: 0.5rem;
}

.role-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.role-meta {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(220, 20, 60, 0.1);
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.meta-item .material-icons-outlined {
    font-size: 18px;
}

.permissions-section {
    flex: 1;
    margin-bottom: 1rem;
}

.permissions-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.permissions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.permission-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.permission-item .material-icons-outlined {
    font-size: 16px;
    color: var(--accent);
}

.role-footer {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.status-badge {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.active {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.status-badge.inactive {
    background: rgba(255, 152, 0, 0.15);
    color: #FF9800;
}

.role-badge.admin {
    background: rgba(156, 39, 176, 0.15);
    color: #9C27B0;
}

.role-badge.driver {
    background: rgba(255, 193, 7, 0.15);
    color: #FFC107;
}

/* Responsive Design for User & Role Management */
@media (max-width: 768px) {
    .roles-grid {
        grid-template-columns: 1fr;
    }

    .role-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .role-card-header {
        flex-direction: column;
    }

    .role-actions {
        align-self: flex-end;
    }

    .user-cell {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Settings Page Styles */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

.settings-card {
    background: var(--surface-card);
    border: 1px solid rgba(220, 20, 60, 0.1);
    border-radius: 20px;
    padding: 2rem;
    transition: all 0.3s ease;
}

.settings-card:hover {
    border-color: rgba(220, 20, 60, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.settings-card.danger {
    border-color: rgba(255, 71, 87, 0.2);
}

.settings-card.danger:hover {
    border-color: rgba(255, 71, 87, 0.4);
    box-shadow: 0 10px 30px rgba(255, 71, 87, 0.1);
}

.settings-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
}

.settings-card-header .material-icons-outlined {
    font-size: 28px;
    color: var(--accent);
    flex-shrink: 0;
}

.settings-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(220, 20, 60, 0.05);
}

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

.setting-label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.setting-label span:first-child {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.setting-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.setting-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-select,
.settings-input {
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    min-width: 150px;
    transition: all 0.3s ease;
}

.settings-select:focus,
.settings-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.2);
    background: rgba(220, 20, 60, 0.05);
}

/* Toggle Switch */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    height: 28px;
    width: 48px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(139, 164, 190, 0.3);
    transition: all 0.3s ease;
    border-radius: 34px;
}

.toggle-switch .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.toggle-switch input:checked + .slider {
    background: var(--accent);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(20px);
}

.btn-setting {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 8px;
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-setting:hover {
    border-color: var(--accent);
    background: rgba(220, 20, 60, 0.05);
}

.btn-setting.danger {
    color: #FF4757;
    border-color: rgba(255, 71, 87, 0.2);
}

.btn-setting.danger:hover {
    border-color: #FF4757;
    background: rgba(255, 71, 87, 0.05);
}

.setting-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 6px;
    color: #00D4AA;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.save-status {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--surface-card);
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideUp 0.3s ease;
    z-index: 100;
}

.save-status.success {
    border-color: rgba(0, 212, 170, 0.3);
}

.save-status.success .material-icons-outlined {
    color: #00D4AA;
}

.save-status.info {
    border-color: rgba(220, 20, 60, 0.3);
}

.save-status.info .material-icons-outlined {
    color: var(--accent);
}

@media (max-width: 1200px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .setting-controls {
        width: 100%;
    }

    .settings-select,
    .settings-input {
        min-width: auto;
        width: 100%;
    }

    .save-status {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        margin-right: auto;
        margin-left: auto;
    }
}

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

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

.modal-content {
    background: var(--surface-card);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(220, 20, 60, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.modal-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-form .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-form input,
.modal-form select {
    width: 100%;
    padding: 0.75rem;
    background: var(--surface);
    border: 1px solid rgba(220, 20, 60, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.modal-form input:focus,
.modal-form select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(220, 20, 60, 0.2);
    background: rgba(220, 20, 60, 0.05);
}

.modal-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.modal-form .form-row.full {
    grid-template-columns: 1fr;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(220, 20, 60, 0.1);
}

.modal-actions .btn {
    flex: 1;
}

/* Print Styles */
@media print {
    .sidebar, .menu-toggle, .back-btn, .action-buttons, .theme-toggle, .filters-card, .table-actions, .pagination-section, .modal-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    body {
        background: white;
        color: black;
    }

    .violations-table {
        border: 1px solid #ddd;
    }

    .violations-table th,
    .violations-table td {
        border: 1px solid #ddd;
        padding: 0.75rem;
    }

    .violations-table th {
        background: #f0f0f0 !important;
        color: black;
    }

    .violation-badge,
    .role-badge,
    .sync-status,
    .shipment-status {
        background: transparent !important;
        border: 1px solid #999;
        color: black !important;
    }

    .timeline-marker {
        background: transparent !important;
        border: 2px solid #999 !important;
        color: black !important;
    }

    .progress-fill {
        background: #999 !important;
    }

    .role-card {
        border: 1px solid #ddd !important;
        background: white !important;
    }

    .status-banner, .details-card {
        border: 1px solid #ddd;
        background: white !important;
    }
}
