/* =====================================================
   Preneel 3D Universe — OMS Design System
   Clean Light Theme with Premium Feel
   ===================================================== */

/* =====================================================
   CSS VARIABLES / DESIGN TOKENS
   ===================================================== */
:root {
    /* Primary Colors */
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-light: #EFF6FF;
    --primary-dark: #1D4ED8;
    
    /* Neutral Colors */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    
    /* Semantic Colors */
    --success: #22C55E;
    --success-light: #F0FDF4;
    --success-dark: #16A34A;
    --warning: #F59E0B;
    --warning-light: #FFFBEB;
    --warning-dark: #D97706;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --danger-dark: #DC2626;
    --info: #06B6D4;
    --info-light: #ECFEFF;
    
    /* Stage Colors */
    --stage-new: #6366F1;
    --stage-design: #8B5CF6;
    --stage-design-review: #EC4899;
    --stage-printing: #3B82F6;
    --stage-post-processing: #14B8A6;
    --stage-painting: #10B981;
    --stage-ready: #22C55E;
    --stage-payment-clear: #06B6D4;
    --stage-delivered: #64748B;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-xs: 0.6875rem;
    --font-sm: 0.8125rem;
    --font-base: 0.875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    
    /* Borders & Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    --border: 1px solid var(--gray-200);
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    
    /* Layout */
    --sidebar-width: 260px;
    --header-height: 60px;
    --sidebar-collapsed-width: 68px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
}

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

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

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    color: var(--gray-800);
    background: var(--gray-50);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
}

/* =====================================================
   LAYOUT — APP SHELL
   ===================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: #fff;
    border-right: var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--transition-slow), width var(--transition-slow);
    overflow: hidden;
}

.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-slow);
    min-width: 0;
}

.app-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: var(--border);
    display: flex;
    align-items: center;
    padding: 0 var(--space-6);
    gap: var(--space-4);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-xs);
}

.app-content {
    flex: 1;
    padding: var(--space-6);
    max-width: 100%;
    overflow-x: hidden;
    min-width: 0;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-5) var(--space-5);
    border-bottom: var(--border);
    min-height: 68px;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand-icon svg {
    color: #fff;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: var(--font-md);
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand-text span {
    display: block;
    font-size: var(--font-xs);
    font-weight: 400;
    color: var(--gray-400);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-3) var(--space-3);
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-section {
    margin-bottom: var(--space-4);
}

.sidebar-section-title {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: var(--space-2) var(--space-3);
    margin-bottom: var(--space-1);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-weight: 500;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.sidebar-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.sidebar-link.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-link-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: var(--font-xs);
    font-weight: 600;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    padding: 0 6px;
}

.sidebar-user {
    padding: var(--space-4) var(--space-4);
    border-top: var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: var(--font-sm);
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-weight: 600;
    font-size: var(--font-sm);
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: var(--font-xs);
    color: var(--gray-400);
    text-transform: capitalize;
}

.sidebar-logout-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.sidebar-logout-btn:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* =====================================================
   HEADER
   ===================================================== */
.header-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--gray-600);
}

.header-title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--gray-900);
}

.header-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: var(--space-2) var(--space-3) var(--space-2) 36px;
    border: var(--border);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-800);
    font-size: var(--font-sm);
    transition: all var(--transition-fast);
    outline: none;
}

.header-search input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.header-search input::placeholder {
    color: var(--gray-400);
}

.header-search svg {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--gray-400);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: auto;
}

.header-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    color: var(--gray-500);
    position: relative;
    transition: all var(--transition-fast);
}

.header-action-btn:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.header-action-btn .badge {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

/* Notification Dropdown */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 380px;
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 200;
    display: none;
    animation: dropdownFadeIn 0.2s ease;
}

.notification-dropdown.open {
    display: block;
}

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

.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4);
    border-bottom: var(--border);
}

.notification-header h3 {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--gray-900);
}

.notification-header button {
    background: none;
    border: none;
    color: var(--primary);
    font-size: var(--font-sm);
    cursor: pointer;
    font-weight: 500;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.notification-item:hover {
    background: var(--gray-50);
}

.notification-item.unread {
    background: var(--primary-light);
}

.notification-item.unread:hover {
    background: #DBEAFE;
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}

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

.notification-body p {
    font-size: var(--font-sm);
    color: var(--gray-700);
    margin-bottom: 2px;
}

.notification-body .time {
    font-size: var(--font-xs);
    color: var(--gray-400);
}

.notification-empty {
    padding: var(--space-8) var(--space-4);
    text-align: center;
    color: var(--gray-400);
    font-size: var(--font-sm);
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #EFF6FF 0%, #F0F9FF 50%, #F5F3FF 100%);
    padding: var(--space-4);
}

.login-card {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-10);
    width: 100%;
    max-width: 420px;
    animation: slideUp 0.4s ease;
}

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

.login-logo {
    text-align: center;
    margin-bottom: var(--space-8);
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary), #8B5CF6);
    border-radius: var(--radius-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.login-logo-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.login-logo h1 {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.login-logo p {
    font-size: var(--font-sm);
    color: var(--gray-400);
}

.login-error {
    background: var(--danger-light);
    color: var(--danger-dark);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    margin-bottom: var(--space-4);
    display: none;
    align-items: center;
    gap: var(--space-2);
    animation: shake 0.3s ease;
}

.login-error.show {
    display: flex;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* =====================================================
   FORMS
   ===================================================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #fff;
    color: var(--gray-800);
    font-size: var(--font-base);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-input.error,
.form-select.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 36px;
}

.form-help {
    font-size: var(--font-xs);
    color: var(--gray-400);
    margin-top: var(--space-1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-4);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: var(--font-sm);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    line-height: 1.4;
}

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

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: var(--border);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    padding: 8px 12px;
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--font-xs);
}

.btn-lg {
    padding: 12px 28px;
    font-size: var(--font-md);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-icon {
    padding: 8px;
    min-width: 36px;
    min-height: 36px;
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: var(--font-xs);
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.5;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-info { background: var(--info-light); color: #0891B2; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* Stage badges */
.badge-stage-new { background: #EEF2FF; color: #4F46E5; }
.badge-stage-design { background: #EDE9FE; color: #7C3AED; }
.badge-stage-design_review { background: #FCE7F3; color: #BE185D; }
.badge-stage-printing { background: #DBEAFE; color: #1D4ED8; }
.badge-stage-post_processing { background: #CCFBF1; color: #0F766E; }
.badge-stage-painting { background: #D1FAE5; color: #059669; }
.badge-stage-ready { background: #DCFCE7; color: #15803D; }
.badge-stage-payment_clear { background: #CFFAFE; color: #0E7490; }
.badge-stage-delivered { background: var(--gray-100); color: var(--gray-600); }

/* Priority badges */
.badge-priority-low { background: var(--gray-100); color: var(--gray-500); }
.badge-priority-normal { background: var(--primary-light); color: var(--primary); }
.badge-priority-high { background: var(--warning-light); color: var(--warning-dark); }
.badge-priority-urgent { background: var(--danger-light); color: var(--danger-dark); }

/* Payment badges */
.badge-payment-unpaid { background: var(--danger-light); color: var(--danger-dark); }
.badge-payment-advance_paid { background: var(--warning-light); color: var(--warning-dark); }
.badge-payment-fully_paid { background: var(--success-light); color: var(--success-dark); }

/* =====================================================
   CARDS
   ===================================================== */
.card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: var(--border);
}

.card-header h3 {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--gray-800);
}

.card-body {
    padding: var(--space-5);
}

.card-footer {
    padding: var(--space-3) var(--space-5);
    border-top: var(--border);
    background: var(--gray-50);
}

/* =====================================================
   METRIC CARDS (Dashboard)
   ===================================================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.metric-card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    transition: all var(--transition-base);
    cursor: default;
}

.metric-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.metric-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.metric-icon.blue { background: var(--primary-light); color: var(--primary); }
.metric-icon.green { background: var(--success-light); color: var(--success); }
.metric-icon.yellow { background: var(--warning-light); color: var(--warning); }
.metric-icon.red { background: var(--danger-light); color: var(--danger); }
.metric-icon.purple { background: #EDE9FE; color: #7C3AED; }
.metric-icon.cyan { background: var(--info-light); color: var(--info); }

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.metric-label {
    font-size: var(--font-sm);
    color: var(--gray-500);
    margin-top: 2px;
}

/* =====================================================
   TABLE
   ===================================================== */
.table-container {
    overflow-x: auto;
    border: var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: var(--gray-50);
}

.data-table th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: var(--border);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    transition: background var(--transition-fast);
}

.data-table th:hover {
    background: var(--gray-100);
}

.data-table th.sorted {
    color: var(--primary);
}

.data-table th .sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.3;
}

.data-table th.sorted .sort-icon {
    opacity: 1;
}

.data-table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-100);
    font-size: var(--font-sm);
    color: var(--gray-700);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

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

.table-order-number {
    font-weight: 600;
    color: var(--primary);
}

.table-customer {
    font-weight: 500;
    color: var(--gray-800);
}

.table-amount {
    font-weight: 600;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
}

.table-date {
    color: var(--gray-500);
    font-size: var(--font-xs);
}

.table-date.overdue {
    color: var(--danger);
    font-weight: 600;
}

/* Table toolbar */
.table-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-bottom: var(--border);
    flex-wrap: wrap;
}

.table-toolbar .search-input {
    flex: 1;
    min-width: 200px;
}

.table-filters {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.filter-select {
    padding: 6px 28px 6px 10px;
    border: var(--border);
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    color: var(--gray-600);
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    outline: none;
}

.filter-select:focus {
    border-color: var(--primary);
}

.table-empty {
    text-align: center;
    padding: var(--space-12) var(--space-4);
    color: var(--gray-400);
}

.table-empty svg {
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.table-empty h3 {
    font-size: var(--font-lg);
    color: var(--gray-600);
    margin-bottom: var(--space-2);
}

/* =====================================================
   KANBAN BOARD
   ===================================================== */
.kanban-container {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    padding-bottom: var(--space-4);
    height: calc(100vh - 175px);
    align-items: flex-start;
    width: 100%;
}

.kanban-column {
    flex: 0 0 280px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--gray-50);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 1;
}

.kanban-column-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kanban-column-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--gray-700);
    flex: 1;
}

.kanban-column-count {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--gray-400);
    background: var(--gray-200);
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    padding: 0 6px;
}

.kanban-cards {
    flex: 1;
    padding: var(--space-2) var(--space-3);
    overflow-y: auto;
    min-height: 80px;
}

.kanban-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    margin-bottom: var(--space-2);
    cursor: grab;
    transition: all var(--transition-fast);
    position: relative;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-light);
    border: 2px dashed var(--primary);
}

.kanban-card.sortable-drag {
    box-shadow: var(--shadow-xl);
    transform: rotate(2deg);
}

.kanban-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
}

.kanban-card-number {
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--primary);
}

.kanban-card-title {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kanban-card-customer {
    font-size: var(--font-xs);
    color: var(--gray-500);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--gray-100);
}

.kanban-card-amount {
    font-size: var(--font-sm);
    font-weight: 700;
    color: var(--gray-800);
}

.kanban-card-due {
    font-size: var(--font-xs);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    gap: 4px;
}

.kanban-card-due.overdue {
    color: var(--danger);
    font-weight: 600;
}

.kanban-card-due svg {
    width: 12px;
    height: 12px;
}

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: var(--space-8);
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: #fff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 640px;
    animation: modalSlideIn 0.3s ease;
    margin-top: 40px;
}

.modal-lg {
    max-width: 800px;
}

.modal-xl {
    max-width: 960px;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    border-bottom: var(--border);
}

.modal-header h2 {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: var(--space-6);
    max-height: calc(100vh - 250px);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: var(--border);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
.toast-container {
    position: fixed;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;
}

.toast {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--danger); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-info .toast-icon { color: var(--primary); }

.toast-message {
    flex: 1;
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--gray-700);
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 2px;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--gray-600);
}

/* =====================================================
   PAGE HEADER
   ===================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.page-header h1 {
    font-size: var(--font-2xl);
    font-weight: 800;
    color: var(--gray-900);
}

.page-header-subtitle {
    font-size: var(--font-sm);
    color: var(--gray-500);
    margin-top: 2px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* View Tabs */
.view-tabs {
    display: flex;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 3px;
    gap: 2px;
}

.view-tab {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: var(--font-xs);
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
}

.view-tab:hover {
    color: var(--gray-700);
}

.view-tab.active {
    background: #fff;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.view-tab svg {
    width: 14px;
    height: 14px;
}

/* =====================================================
   CHARTS CONTAINER
   ===================================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.chart-card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.chart-card h3 {
    font-size: var(--font-base);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.chart-wrapper {
    position: relative;
    height: 280px;
}

/* =====================================================
   CALENDAR
   ===================================================== */
.calendar-container {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.calendar-container .fc {
    font-family: var(--font-family);
}

.calendar-container .fc-toolbar-title {
    font-size: var(--font-xl) !important;
    font-weight: 700;
    color: var(--gray-800);
}

.calendar-container .fc-button {
    background: var(--gray-100) !important;
    border: var(--border) !important;
    color: var(--gray-600) !important;
    font-weight: 500 !important;
    text-transform: capitalize !important;
    box-shadow: none !important;
    font-size: var(--font-sm) !important;
}

.calendar-container .fc-button:hover {
    background: var(--gray-200) !important;
    color: var(--gray-800) !important;
}

.calendar-container .fc-button-active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

.calendar-container .fc-event {
    border-radius: var(--radius-sm) !important;
    padding: 2px 6px !important;
    font-size: var(--font-xs) !important;
    font-weight: 500 !important;
    border: none !important;
    cursor: pointer !important;
}

.calendar-container .fc-daygrid-day-number {
    color: var(--gray-600);
    font-weight: 500;
    font-size: var(--font-sm);
}

.calendar-container .fc-day-today {
    background: var(--primary-light) !important;
}

.calendar-container .fc-col-header-cell-cushion {
    font-weight: 600;
    color: var(--gray-500);
    font-size: var(--font-xs);
    text-transform: uppercase;
}

/* =====================================================
   CUSTOMER PAGE
   ===================================================== */
.customer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.customer-card {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    transition: all var(--transition-base);
    cursor: pointer;
}

.customer-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.customer-card-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.customer-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-md);
    color: #fff;
    flex-shrink: 0;
}

.customer-card-name {
    font-weight: 600;
    font-size: var(--font-md);
    color: var(--gray-800);
}

.customer-card-city {
    font-size: var(--font-xs);
    color: var(--gray-400);
}

.customer-card-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.customer-stat {
    text-align: center;
    padding: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.customer-stat-value {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--gray-800);
}

.customer-stat-label {
    font-size: var(--font-xs);
    color: var(--gray-500);
}

/* =====================================================
   SETTINGS PAGE
   ===================================================== */
.settings-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: var(--space-6);
}

.settings-nav {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--gray-600);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.settings-nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}

.settings-nav-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}

.settings-content {
    background: #fff;
    border: var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
}

.settings-section {
    margin-bottom: var(--space-8);
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h3 {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.settings-section p {
    font-size: var(--font-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-5);
}

/* User management table */
.user-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    border: var(--border);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.user-list-item:hover {
    background: var(--gray-50);
}

/* =====================================================
   ORDER DETAIL
   ===================================================== */
.order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-6);
}

.order-detail-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.order-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.order-info-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.order-info-card h4 {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: var(--space-3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.order-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--gray-200);
}

.order-info-row:last-child {
    border-bottom: none;
}

.order-info-label {
    font-size: var(--font-sm);
    color: var(--gray-500);
}

.order-info-value {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--gray-800);
}

/* Stage Progress Bar */
.stage-progress {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: var(--space-4);
    padding: var(--space-4) 0;
}

.stage-step {
    flex: 1;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    position: relative;
    transition: background var(--transition-base);
}

.stage-step.completed {
    background: var(--success);
}

.stage-step.current {
    background: var(--primary);
}

.stage-step-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: var(--gray-400);
    white-space: nowrap;
    display: none;
}

.stage-step.current .stage-step-label,
.stage-step:first-child .stage-step-label,
.stage-step:last-child .stage-step-label {
    display: block;
}

.stage-step.current .stage-step-label {
    color: var(--primary);
    font-weight: 600;
}

/* History timeline */
.history-timeline {
    position: relative;
    padding-left: var(--space-6);
}

.history-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--gray-200);
}

.history-item {
    position: relative;
    margin-bottom: var(--space-4);
}

.history-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid #fff;
}

.history-item:first-child::before {
    background: var(--primary);
}

.history-item-text {
    font-size: var(--font-sm);
    color: var(--gray-700);
}

.history-item-time {
    font-size: var(--font-xs);
    color: var(--gray-400);
    margin-top: 2px;
}

.history-item-user {
    font-weight: 600;
    color: var(--gray-800);
}

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.file-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border: 1px solid var(--gray-200);
    transition: background var(--transition-fast);
}

.file-item:hover {
    background: var(--gray-100);
}

.file-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: var(--font-xs);
    color: var(--gray-400);
}

/* File upload dropzone */
.file-dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: var(--space-6);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-dropzone:hover,
.file-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-dropzone svg {
    margin-bottom: var(--space-2);
    color: var(--gray-400);
}

.file-dropzone p {
    font-size: var(--font-sm);
    color: var(--gray-500);
}

.file-dropzone .browse-link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-12);
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.empty-state-icon svg {
    width: 36px;
    height: 36px;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: var(--font-sm);
    color: var(--gray-400);
    margin-bottom: var(--space-5);
}

/* =====================================================
   LOADING STATES
   ===================================================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

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

.loading-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    flex-direction: column;
    gap: var(--space-4);
}

.loading-page p {
    color: var(--gray-400);
    font-size: var(--font-sm);
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: var(--font-sm); }
.text-xs { font-size: var(--font-xs); }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }

.hidden { display: none !important; }
.w-full { width: 100%; }

/* =====================================================
   CONFIRM DIALOG
   ===================================================== */
.confirm-dialog {
    text-align: center;
    padding: var(--space-4);
}

.confirm-dialog-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-4);
}

.confirm-dialog-icon.danger {
    background: var(--danger-light);
    color: var(--danger);
}

.confirm-dialog h3 {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
}

.confirm-dialog p {
    font-size: var(--font-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-6);
}

.confirm-dialog-actions {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

/* =====================================================
   MOBILE BOTTOM NAV
   ===================================================== */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: var(--border);
    padding: var(--space-2) var(--space-4);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
}

.mobile-bottom-nav-items {
    display: flex;
    justify-content: space-around;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-1) var(--space-2);
    font-size: 10px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border: none;
    background: none;
    transition: color var(--transition-fast);
}

.mobile-nav-item.active {
    color: var(--primary);
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 99;
}

.sidebar-overlay.open {
    display: block;
}

/* =====================================================
   RESPONSIVE — TABLET
   ===================================================== */
@media (max-width: 1024px) {
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .order-detail-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-layout {
        grid-template-columns: 1fr;
    }
    
    .settings-nav {
        position: static;
    }
    
    .kanban-column {
        flex: 0 0 260px;
    }
}

/* =====================================================
   RESPONSIVE — MOBILE
   ===================================================== */
@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        z-index: 200;
        width: 280px;
    }
    
    .app-sidebar.open {
        transform: translateX(0);
    }
    
    .app-main {
        margin-left: 0;
    }
    
    .header-menu-btn {
        display: flex;
    }
    
    .header-search {
        display: none;
    }
    
    .app-content {
        padding: var(--space-4);
        padding-bottom: 80px;
    }
    
    .mobile-bottom-nav {
        display: block;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .page-header-actions {
        width: 100%;
        overflow-x: auto;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row, .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    .kanban-column {
        flex: 0 0 240px;
    }
    
    .modal {
        margin: var(--space-4);
        max-width: calc(100vw - 32px);
    }
    
    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }
    
    .modal {
        margin: 0;
        max-width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        animation: modalSlideUp 0.3s ease;
    }
    
    @keyframes modalSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .notification-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    
    .customer-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-wrapper {
        height: 220px;
    }
    
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .confirm-dialog-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .login-card {
        padding: var(--space-6);
    }
    
    .kanban-column {
        flex: 0 0 85vw;
    }
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .app-sidebar,
    .app-header,
    .mobile-bottom-nav,
    .toast-container,
    .modal-overlay,
    .btn,
    .sidebar-overlay {
        display: none !important;
    }
    
    .app-main {
        margin-left: 0;
    }
    
    .app-content {
        padding: 0;
    }
    
    body {
        background: #fff;
    }
}

/* =====================================================
   SCROLLBAR STYLES
   ===================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* Kanban specific scrollbar */
.kanban-container::-webkit-scrollbar {
    height: 10px;
}

.kanban-container::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 5px;
}

.kanban-container::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
    border: 2px solid var(--gray-100);
}

.kanban-container::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* =====================================================
   BOARD LAYOUT WRAPPER & SLIDE-OUT DRAWER
   ===================================================== */
.board-layout-wrapper {
    display: flex;
    position: relative;
    width: 100%;
    height: calc(100vh - 175px);
    overflow: hidden;
    gap: var(--space-4);
}

.board-drawer {
    width: 500px;
    height: 100%;
    background: #ffffff;
    border-left: 1px solid var(--gray-200);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    position: absolute;
    top: 0;
    right: -520px; /* Hidden offscreen */
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.board-drawer.open {
    right: 0;
}

.board-drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.15); /* Sleek backdrop dark tint */
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.board-drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.board-drawer-header {
    padding: var(--space-4) var(--space-6);
    border-bottom: var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
}

.board-drawer-header h2 {
    font-size: var(--font-base);
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
}

.board-drawer-close {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.board-drawer-close:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.board-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.drawer-section {
    border-bottom: 1px solid var(--gray-100);
    padding-bottom: var(--space-4);
}

.drawer-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.drawer-title {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-1);
}

.drawer-meta-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-4) var(--space-2);
    align-items: center;
    margin-top: var(--space-3);
}

.drawer-meta-label {
    font-size: var(--font-sm);
    font-weight: 600;
    color: var(--gray-500);
}

.drawer-meta-value {
    font-size: var(--font-sm);
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Inline interactive elements for drawer */
.drawer-select {
    font-size: var(--font-sm);
    padding: 6px 12px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: #ffffff;
    cursor: pointer;
    color: var(--gray-800);
    outline: none;
    font-weight: 500;
    max-width: 220px;
    width: 100%;
}

.drawer-select:focus {
    border-color: var(--primary);
}

.drawer-input-date {
    font-size: var(--font-sm);
    padding: 6px 10px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    color: var(--gray-800);
    max-width: 220px;
    width: 100%;
}

.drawer-notes-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    font-size: var(--font-sm);
    color: var(--gray-700);
    white-space: pre-wrap;
    min-height: 80px;
}
