/* ============================================
   MATADOR SALES & DISTRIBUTION
   Design System & Global Styles
   ============================================ */

/* CSS Variables - Matador Brand */
:root {
    /* Primary Colors - Matador Red Theme */
    --primary: #C41E3A;
    --primary-dark: #9B1B30;
    --primary-light: #E85A71;
    --primary-subtle: #FEF2F4;
    
    /* Secondary Colors */
    --secondary: #1A365D;
    --secondary-dark: #0F2442;
    --secondary-light: #2D4A7C;
    
    /* Accent Colors */
    --accent-green: #10B981;
    --accent-green-light: #D1FAE5;
    --accent-orange: #F59E0B;
    --accent-orange-light: #FEF3C7;
    --accent-blue: #3B82F6;
    --accent-blue-light: #DBEAFE;
    --accent-purple: #8B5CF6;
    
    /* Neutral Colors */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Semantic Colors */
    --success: #10B981;
    --success-bg: #D1FAE5;
    --warning: #F59E0B;
    --warning-bg: #FEF3C7;
    --error: #EF4444;
    --error-bg: #FEE2E2;
    --info: #3B82F6;
    --info-bg: #DBEAFE;
    
    /* Status Colors */
    --status-draft: #6B7280;
    --status-submitted: #3B82F6;
    --status-accepted: #10B981;
    --status-hold: #F59E0B;
    --status-rejected: #EF4444;
    --status-dispatched: #8B5CF6;
    --status-delivered: #059669;
    
    /* Background & Surface */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --surface: #FFFFFF;
    --surface-elevated: #FFFFFF;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-tertiary: #6B7280;
    --text-inverse: #FFFFFF;
    --text-link: #C41E3A;
    
    /* Border */
    --border-light: #E5E7EB;
    --border-medium: #D1D5DB;
    --border-dark: #9CA3AF;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Typography */
    --font-family: 'Inter', 'Noto Sans Bengali', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
    
    /* Z-index layers */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-overlay: 500;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --surface: #1F2937;
    --surface-elevated: #374151;
    
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-tertiary: #9CA3AF;
    
    --border-light: #374151;
    --border-medium: #4B5563;
    --border-dark: #6B7280;
    
    --primary-subtle: #2D1F24;
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bangla font adjustment */
[lang="bn"] {
    font-family: 'Noto Sans Bengali', 'Inter', sans-serif;
}

a {
    color: var(--text-link);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-tertiary); }

.bg-primary { background-color: var(--primary); }
.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-error { background-color: var(--error); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ============================================
   LAUNCHER PAGE STYLES
   ============================================ */
.demo-launcher {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.launcher-header {
    background: var(--bg-primary);
    padding: var(--space-md) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-size: var(--font-size-xl);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.logo-text {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.5px;
}

.logo-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    padding-left: var(--space-md);
    border-left: 2px solid var(--border-light);
}

.header-controls {
    display: flex;
    gap: var(--space-sm);
}

.lang-toggle, .theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-fast);
}

.lang-toggle:hover, .theme-toggle:hover {
    background: var(--gray-200);
    color: var(--text-primary);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--space-2xl) var(--space-xl);
    text-align: center;
}

.hero-content h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto var(--space-xl);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.8;
}

/* App Selection */
.app-selection {
    padding: var(--space-2xl) var(--space-xl);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.app-selection h2 {
    text-align: center;
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.app-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.app-card {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.app-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-md);
}

.sr-icon {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
}

.supervisor-icon {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.hq-icon {
    background: linear-gradient(135deg, #8B5CF6, #6D28D9);
    color: white;
}

.app-card h3 {
    font-size: var(--font-size-xl);
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.app-card p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-md);
}

.app-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.feature-tag {
    background: var(--bg-tertiary);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.app-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.app-user img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.user-role {
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
}

/* Demo Scenarios */
.demo-scenarios {
    padding: var(--space-2xl) var(--space-xl);
    background: var(--bg-tertiary);
}

.demo-scenarios h2 {
    text-align: center;
    font-size: var(--font-size-2xl);
    margin-bottom: var(--space-sm);
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.scenario-cards {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.scenario-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-light);
}

.scenario-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.scenario-number {
    width: 48px;
    height: 48px;
    background: var(--primary-subtle);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.scenario-content {
    flex: 1;
}

.scenario-content h4 {
    font-size: var(--font-size-base);
    margin-bottom: var(--space-xs);
}

.scenario-content p {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-bottom: var(--space-sm);
}

.scenario-flow {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
}

.flow-step {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.scenario-flow i {
    color: var(--gray-400);
    font-size: 10px;
}

.scenario-status {
    font-size: var(--font-size-xl);
}

.scenario-status.ready {
    color: var(--accent-green);
}

/* Demo Control Panel */
.demo-control-panel {
    max-width: 1200px;
    margin: var(--space-xl) auto;
    padding: 0 var(--space-xl);
}

.control-header {
    background: var(--surface);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 1px solid var(--border-light);
}

.control-header h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-size-base);
    color: var(--text-primary);
}

.control-body {
    background: var(--surface);
    padding: var(--space-lg);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border-light);
    border-top: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.control-body.collapsed {
    display: none;
}

.control-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.toggle-buttons {
    display: flex;
    gap: var(--space-xs);
}

.toggle-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.toggle-btn:hover {
    background: var(--gray-200);
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.event-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.event-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    transition: all var(--transition-fast);
}

.event-btn:hover {
    background: var(--primary-subtle);
    color: var(--primary);
}

.reset-btn {
    padding: var(--space-sm) var(--space-lg);
    background: var(--error-bg);
    color: var(--error);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-fast);
}

.reset-btn:hover {
    background: var(--error);
    color: white;
}

/* Footer */
.launcher-footer {
    margin-top: auto;
    background: var(--bg-primary);
    padding: var(--space-lg) var(--space-xl);
    text-align: center;
    border-top: 1px solid var(--border-light);
}

.launcher-footer p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.launcher-footer .version {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
    margin-top: var(--space-xs);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    background: var(--surface);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.success { border-left-color: var(--success); }
.toast.warning { border-left-color: var(--warning); }
.toast.error { border-left-color: var(--error); }
.toast.info { border-left-color: var(--info); }

.toast-icon {
    font-size: var(--font-size-lg);
}

.toast.success .toast-icon { color: var(--success); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.error .toast-icon { color: var(--error); }
.toast.info .toast-icon { color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.toast-close {
    color: var(--text-tertiary);
    padding: var(--space-xs);
}

.toast-close:hover {
    color: var(--text-primary);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-overlay);
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    background: var(--surface);
    padding: var(--space-xl) var(--space-2xl);
    border-radius: var(--radius-xl);
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   MOBILE APP FRAME (for SR App simulation)
   ============================================ */
.mobile-frame {
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-xl);
}

/* Desktop mode shows phone frame */
@media (min-width: 768px) {
    body.mobile-app-view {
        background: var(--gray-800);
        padding: var(--space-xl);
    }
    
    body.mobile-app-view .mobile-frame {
        border-radius: 40px;
        overflow: hidden;
        min-height: 85vh;
        max-height: 900px;
        border: 8px solid var(--gray-900);
    }
}

/* ============================================
   COMMON COMPONENTS
   ============================================ */

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.status-badge.draft { background: var(--gray-100); color: var(--gray-600); }
.status-badge.submitted { background: var(--info-bg); color: var(--info); }
.status-badge.accepted { background: var(--success-bg); color: var(--success); }
.status-badge.on-hold { background: var(--warning-bg); color: var(--warning); }
.status-badge.rejected { background: var(--error-bg); color: var(--error); }
.status-badge.dispatched { background: #EDE9FE; color: var(--accent-purple); }
.status-badge.delivered { background: var(--success-bg); color: #059669; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: var(--font-size-base);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: var(--font-size-xs);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: var(--space-lg);
}

.card-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-input.error {
    border-color: var(--error);
}

.form-error {
    color: var(--error);
    font-size: var(--font-size-xs);
    margin-top: var(--space-xs);
}

.form-select {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    font-size: var(--font-size-base);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
}

/* Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.data-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* ============================================
   OFFLINE INDICATOR
   ============================================ */
.offline-banner {
    background: var(--warning);
    color: white;
    padding: var(--space-sm) var(--space-md);
    text-align: center;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
}

.offline-banner.hidden {
    display: none;
}

.sync-indicator {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
}

.sync-indicator.syncing {
    color: var(--info);
}

.sync-indicator.syncing i {
    animation: spin 1s linear infinite;
}

.sync-indicator.pending {
    color: var(--warning);
}

/* ============================================
   DEMO GUIDE OVERLAY
   ============================================ */
.demo-guide {
    position: fixed;
    bottom: var(--space-lg);
    left: var(--space-lg);
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-lg);
    max-width: 350px;
    z-index: var(--z-modal);
    border: 2px solid var(--primary);
}

.demo-guide-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.demo-guide-header h4 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--primary);
}

.demo-guide-step {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.demo-guide-actions {
    display: flex;
    gap: var(--space-sm);
}

.step-indicator {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
}

.step-dot.active {
    background: var(--primary);
}

.step-dot.completed {
    background: var(--success);
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 768px) {
    .launcher-header {
        padding: var(--space-md);
    }
    
    .logo-subtitle {
        display: none;
    }
    
    .hero-section {
        padding: var(--space-xl) var(--space-md);
    }
    
    .hero-content h1 {
        font-size: var(--font-size-2xl);
    }
    
    .hero-stats {
        gap: var(--space-lg);
    }
    
    .app-selection,
    .demo-scenarios {
        padding: var(--space-xl) var(--space-md);
    }
    
    .app-cards {
        grid-template-columns: 1fr;
    }
    
    .scenario-cards {
        grid-template-columns: 1fr;
    }
    
    .control-body {
        grid-template-columns: 1fr;
    }
    
    .demo-guide {
        left: var(--space-md);
        right: var(--space-md);
        max-width: none;
    }
    
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }
    
    .toast {
        min-width: auto;
    }
}

/* Print styles for reports */
@media print {
    .launcher-header,
    .demo-control-panel,
    .demo-guide,
    .toast-container {
        display: none !important;
    }
}

/* Audit Trail Modal Styles */
.audit-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: 2000;
    padding: 20px;
}

.audit-modal {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.audit-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.audit-modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.audit-modal-header h3 i {
    color: #C41E3A;
}

.audit-entity {
    margin-left: auto;
    background: #e0e0e0;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    color: #666;
}

.audit-modal-header .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    margin-left: 12px;
}

.audit-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.audit-timeline {
    position: relative;
    padding-left: 36px;
}

.audit-timeline::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e0e0;
}

.audit-entry {
    position: relative;
    padding-bottom: 24px;
}

.audit-entry:last-child {
    padding-bottom: 0;
}

.audit-entry.latest .audit-entry-icon {
    box-shadow: 0 0 0 4px rgba(196, 30, 58, 0.2);
}

.audit-entry-icon {
    position: absolute;
    left: -36px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.audit-entry-icon i {
    font-size: 11px;
    color: white;
}

.audit-entry-icon.create { background: #4CAF50; }
.audit-entry-icon.edit { background: #2196F3; }
.audit-entry-icon.delete { background: #f44336; }
.audit-entry-icon.status { background: #9C27B0; }
.audit-entry-icon.view { background: #607D8B; }
.audit-entry-icon.approve { background: #4CAF50; }
.audit-entry-icon.reject { background: #f44336; }

.audit-entry-content {
    background: #f9f9f9;
    padding: 14px 16px;
    border-radius: 10px;
}

.audit-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.audit-action {
    font-weight: 600;
    color: #333;
}

.audit-time {
    font-size: 11px;
    color: #888;
}

.audit-entry-user {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.audit-entry-user i {
    margin-right: 4px;
    color: #999;
}

.audit-entry-details {
    font-size: 13px;
    color: #666;
    padding: 8px 10px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid #C41E3A;
}

.audit-entry-changes {
    margin-top: 8px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
}

.change-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-bottom: 4px;
}

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

.change-field {
    font-weight: 600;
    color: #666;
}

.change-old {
    color: #f44336;
    text-decoration: line-through;
}

.change-item i {
    color: #999;
    font-size: 10px;
}

.change-new {
    color: #4CAF50;
    font-weight: 500;
}

.audit-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    background: #f9f9f9;
    justify-content: flex-end;
}

/* Notification Panel Styles */
.notification-panel {
    position: fixed;
    top: 60px;
    right: 16px;
    width: 360px;
    max-height: 80vh;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 1500;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.notification-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.notification-panel-header h4 {
    margin: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-panel-header h4 i {
    color: #C41E3A;
}

.mark-all-btn {
    background: none;
    border: none;
    color: #C41E3A;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.notification-empty {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.notification-empty i {
    font-size: 36px;
    margin-bottom: 12px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.notification-item:hover {
    background: #f9f9f9;
}

.notification-item.unread {
    background: #fef5f6;
}

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

.notification-icon i {
    font-size: 14px;
    color: white;
}

.notification-icon.approval { background: #4CAF50; }
.notification-icon.delivery { background: #2196F3; }
.notification-icon.pending { background: #ff9800; }
.notification-icon.alert { background: #f44336; }
.notification-icon.info { background: #607D8B; }
.notification-icon.order { background: #9C27B0; }
.notification-icon.collection { background: #4CAF50; }

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

.notification-title {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.notification-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.notification-dot {
    width: 8px;
    height: 8px;
    background: #C41E3A;
    border-radius: 50%;
    position: absolute;
    top: 16px;
    right: 16px;
}

.notification-panel-footer {
    padding: 12px 20px;
    border-top: 1px solid #e5e5e5;
    background: #f9f9f9;
    text-align: center;
}

.notification-panel-footer button {
    background: transparent;
    border: 1px solid #ddd;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
}

.notification-panel-footer button:hover {
    background: #f0f0f0;
}
