/* ======================================
   Premium SaaS Design System
   Inspired by Stripe, Linear, Notion
   ====================================== */

/* ============ CSS Variables ============ */
:root {
    /* Primary Colors - Gold/Yellow (KDP Branding) */
    --primary-50: #fefce8;
    --primary-100: #fef9c3;
    --primary-200: #fef08a;
    --primary-300: #fde047;
    --primary-400: #facc15;
    --primary-500: #eab308;
    --primary-600: #ca8a04;
    --primary-700: #a16207;
    --primary-800: #854d0e;
    --primary-900: #713f12;

    /* Neutral Colors */
    --gray-25: #fcfcfd;
    --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;
    --gray-950: #030712;

    /* Semantic Colors */
    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;

    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --error-700: #b91c1c;

    --info-50: #eff6ff;
    --info-100: #dbeafe;
    --info-500: #3b82f6;
    --info-600: #2563eb;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);

    /* Ring (Focus) */
    --ring-color: var(--primary-500);
    --ring-offset: 2px;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;

    /* Spacing Scale */
    --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;
    --space-16: 4rem;

    /* Z-Index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

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

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

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--gray-900);
    background-color: var(--gray-50);
    direction: rtl;
    min-height: 100vh;
}

/* ============ Typography ============ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--gray-900);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }
h6 { font-size: var(--text-sm); }

p {
    color: var(--gray-600);
    line-height: var(--leading-relaxed);
}

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

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

/* ============ Layout Components ============ */

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-6);
}

.container-sm { max-width: 640px; }
.container-md { max-width: 768px; }
.container-lg { max-width: 1024px; }
.container-xl { max-width: 1280px; }

/* Grid */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

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

/* Row System */
.row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.col-1 { flex: 1; min-width: 0; }
.col-2 { flex: 2; min-width: 0; }
.col-3 { flex: 3; min-width: 0; }
.col-4 { flex: 1 1 calc(33.333% - var(--space-4)); min-width: 200px; }

/* ============ Cards ============ */
.card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card-elevated {
    box-shadow: var(--shadow-lg);
    border: none;
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.card-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

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

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
}

/* ============ Buttons ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.2);
}

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

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--primary-500) 100%);
    color: var(--gray-900);
    border-color: var(--primary-500);
    box-shadow: var(--shadow-sm), 0 4px 14px rgba(234, 179, 8, 0.25);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-300) 0%, var(--primary-400) 100%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 6px 20px rgba(234, 179, 8, 0.35);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border-color: var(--gray-300);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
    border-color: var(--success-600);
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--success-600) 0%, var(--success-700) 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
    color: white;
    border-color: var(--error-600);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--error-600) 0%, var(--error-700) 100%);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: transparent;
}

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

.btn-info {
    background: linear-gradient(135deg, var(--info-500) 0%, var(--info-600) 100%);
    color: white;
    border-color: var(--info-600);
}

/* Button Sizes */
.btn-xs {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    border-radius: var(--radius-sm);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

.btn-xl {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

/* Button with Icon */
.btn-icon {
    padding: var(--space-2);
    width: 36px;
    height: 36px;
}

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

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

.form-control {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    line-height: 1.5;
    color: var(--gray-900);
    background-color: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    appearance: none;
}

.form-control:hover {
    border-color: var(--gray-400);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgb(99 102 241 / 0.15);
}

.form-control::placeholder {
    color: var(--gray-400);
}

.form-control:disabled {
    background-color: var(--gray-100);
    cursor: not-allowed;
}

/* Form Control Sizes */
.form-control-sm {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
}

.form-control-lg {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

/* Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Select with Custom Arrow */
select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: left var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-left: var(--space-10);
}

/* Error State */
.form-control.error,
.form-control.is-invalid {
    border-color: var(--error-500);
    background-color: var(--error-50);
}

.form-control.error:focus,
.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgb(239 68 68 / 0.15);
}

.error-message {
    display: none;
    font-size: var(--text-xs);
    color: var(--error-600);
    margin-top: var(--space-1);
}

.error-message[style*="display:block"],
.error-message[style*="display: block"],
.form-group.has-error .error-message {
    display: block;
}

/* Form Hint */
.form-hint {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-top: var(--space-1);
}

/* Required Indicator */
.required {
    color: var(--error-500);
    margin-right: var(--space-1);
}

/* ============ File Upload ============ */
.file-upload {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-6);
    background: var(--gray-50);
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.file-upload:hover {
    border-color: var(--primary-400);
    background: var(--primary-50);
}

.file-upload.dragover {
    border-color: var(--primary-500);
    background: var(--primary-100);
}

.file-upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload .icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-3);
    opacity: 0.6;
}

.file-upload p {
    color: var(--gray-600);
    font-size: var(--text-sm);
}

.file-upload .hint {
    font-size: var(--text-xs);
    color: var(--gray-400);
    margin-top: var(--space-1);
}

/* ============ Alerts ============ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.alert-success {
    background: var(--success-50);
    border: 1px solid var(--success-100);
    color: var(--success-700);
}

.alert-error {
    background: var(--error-50);
    border: 1px solid var(--error-100);
    color: var(--error-700);
}

.alert-warning {
    background: var(--warning-50);
    border: 1px solid var(--warning-100);
    color: var(--warning-600);
}

.alert-info {
    background: var(--info-50);
    border: 1px solid var(--info-100);
    color: var(--info-600);
}

/* ============ Badges & Status ============ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-700);
}

.badge-success {
    background: var(--success-100);
    color: var(--success-700);
}

.badge-warning {
    background: var(--warning-100);
    color: var(--warning-600);
}

.badge-danger {
    background: var(--error-100);
    color: var(--error-700);
}

.badge-info {
    background: var(--info-100);
    color: var(--info-600);
}

.badge-gray {
    background: var(--gray-100);
    color: var(--gray-700);
}

/* Status Pills */
.status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 500;
    border-radius: var(--radius-full);
}

.status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-new {
    background: var(--info-100);
    color: var(--info-700);
}
.status-new::before { background: var(--info-500); }

.status-review {
    background: var(--warning-100);
    color: var(--warning-600);
}
.status-review::before { background: var(--warning-500); }

.status-edit {
    background: var(--primary-100);
    color: var(--primary-700);
}
.status-edit::before { background: var(--primary-500); }

.status-complete {
    background: var(--success-100);
    color: var(--success-700);
}
.status-complete::before { background: var(--success-500); }

.status-rejected {
    background: var(--error-100);
    color: var(--error-700);
}
.status-rejected::before { background: var(--error-500); }

/* ============ Tables ============ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: white;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

th {
    padding: var(--space-3) var(--space-4);
    text-align: right;
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

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

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

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

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

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ============ Pagination ============ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    margin-top: var(--space-6);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-3);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
}

.pagination a:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--gray-900);
}

.pagination span.active,
.pagination a.active {
    background: var(--primary-600);
    border-color: var(--primary-600);
    color: white;
}

/* ============ Tabs ============ */
.tabs {
    display: flex;
    gap: var(--space-1);
    background: var(--gray-100);
    padding: var(--space-1);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

.tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-600);
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.tab.active {
    background: white;
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* ============ Modal ============ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgb(0 0 0 / 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal-backdrop);
    padding: var(--space-4);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
}

.modal-overlay.show .modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--gray-100);
}

.modal-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--gray-400);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.25rem;
}

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

.modal-body {
    padding: var(--space-6);
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
}

/* ============ Toast Notifications ============ */
.toast-container {
    position: fixed;
    top: var(--space-6);
    left: var(--space-6);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast-success { border-right: 4px solid var(--success-500); }
.toast-error { border-right: 4px solid var(--error-500); }
.toast-warning { border-right: 4px solid var(--warning-500); }
.toast-info { border-right: 4px solid var(--info-500); }

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

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--gray-900);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--gray-600);
    margin-top: var(--space-1);
}

.toast-close {
    padding: var(--space-1);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    border-radius: var(--radius-sm);
}

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

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

.stat-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    font-size: 1.5rem;
    margin-bottom: var(--space-4);
}

.stat-card .stat-icon.primary { background: var(--primary-100); color: var(--primary-600); }
.stat-card .stat-icon.success { background: var(--success-100); color: var(--success-600); }
.stat-card .stat-icon.warning { background: var(--warning-100); color: var(--warning-600); }
.stat-card .stat-icon.info { background: var(--info-100); color: var(--info-600); }

.stat-card .stat-value {
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-top: var(--space-2);
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    font-weight: 500;
    margin-top: var(--space-3);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
}

.stat-card .stat-change.positive {
    background: var(--success-100);
    color: var(--success-700);
}

.stat-card .stat-change.negative {
    background: var(--error-100);
    color: var(--error-700);
}

/* ============ Progress Bars ============ */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-lg { height: 12px; }

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.progress-label span:first-child { color: var(--gray-700); font-weight: 500; }
.progress-label span:last-child { color: var(--gray-500); }

/* ============ Page Header ============ */
.page-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.page-header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.page-header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    background: linear-gradient(135deg, var(--gray-900), var(--gray-700));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    margin-top: var(--space-2);
    color: var(--gray-500);
}

/* ============ Public Form Header ============ */
.header {
    text-align: center;
    padding: var(--space-10) var(--space-6);
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    border-radius: var(--radius-2xl);
    margin-bottom: var(--space-8);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23eab308' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.8;
}

/* Header Logo */
.header-logo {
    position: relative;
    margin-bottom: var(--space-4);
}

.header-logo .kdp-logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    transition: transform var(--transition-base);
}

.header-logo .kdp-logo:hover {
    transform: scale(1.05);
}

/* Header Title */
.header-title {
    position: relative;
    margin-bottom: var(--space-4);
}

.header-subtitle {
    display: block;
    font-size: var(--text-lg);
    font-weight: 400;
    color: rgb(255 255 255 / 0.8);
    margin-bottom: var(--space-1);
}

.header h1 {
    font-size: var(--text-2xl);
    font-weight: 700;
    color: white;
    margin-bottom: var(--space-2);
    position: relative;
}

.header-position {
    display: inline-block;
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--gray-900);
    background: linear-gradient(135deg, var(--primary-400), var(--primary-500));
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    margin-top: var(--space-2);
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.3);
}

/* Header Divider */
.header-divider {
    width: 80px;
    height: 3px;
    background: rgb(255 255 255 / 0.3);
    margin: var(--space-6) auto;
    border-radius: var(--radius-full);
    position: relative;
}

/* System Title */
.header .system-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: white;
    margin-bottom: var(--space-2);
    position: relative;
}

.header p {
    color: rgb(255 255 255 / 0.8);
    font-size: var(--text-lg);
    position: relative;
}

/* ============ Site Footer ============ */
.site-footer {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    margin-top: var(--space-8);
    border-top: 1px solid var(--gray-200);
}

.footer-logo {
    margin-bottom: var(--space-3);
}

.footer-logo img {
    opacity: 0.7;
    transition: opacity var(--transition-base);
}

.footer-logo img:hover {
    opacity: 1;
}

.footer-info {
    margin-bottom: var(--space-3);
}

.footer-title {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: var(--space-1);
}

.footer-subtitle {
    font-size: var(--text-sm);
    color: var(--gray-500);
}

.footer-copyright {
    font-size: var(--text-xs);
    color: var(--gray-400);
}

.footer-developer {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.footer-developer a {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer-developer a:hover {
    color: var(--primary-300);
    text-decoration: underline;
}

/* Footer Social Links */
.footer-social {
    margin: var(--space-4) 0;
    padding: var(--space-4) 0;
    border-top: 1px solid var(--gray-200);
    border-bottom: 1px solid var(--gray-200);
}

.social-title {
    font-size: var(--text-sm);
    color: var(--gray-500);
    margin-bottom: var(--space-3);
    font-weight: 500;
}

.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-600);
    transition: all var(--transition-base);
    text-decoration: none;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Social Link Colors */
.social-facebook:hover {
    background: #1877f2;
    color: white;
}

.social-twitter:hover {
    background: #000000;
    color: white;
}

.social-instagram:hover {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.social-youtube:hover {
    background: #ff0000;
    color: white;
}

.social-whatsapp:hover {
    background: #25d366;
    color: white;
}

.social-linkedin:hover {
    background: #0077b5;
    color: white;
}

.social-telegram:hover {
    background: #0088cc;
    color: white;
}

.social-phone:hover {
    background: #22c55e;
    color: white;
}

.social-email:hover,
.social-mail:hover {
    background: #ea4335;
    color: white;
}

.social-website:hover,
.social-globe:hover {
    background: var(--primary-600);
    color: white;
}

.social-tiktok:hover {
    background: #000000;
    color: white;
}

.social-snapchat:hover {
    background: #fffc00;
    color: #000000;
}

/* ============ Modern Footer (3 Columns) ============ */
.site-footer-modern {
    background: linear-gradient(180deg, var(--gray-900) 0%, #0f172a 100%);
    color: var(--gray-300);
    margin-top: var(--space-10);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    overflow: hidden;
}

.footer-main {
    padding: var(--space-10) var(--space-6);
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: var(--space-8);
    width: 100%;
}

.footer-column {
    min-width: 0;
}

.footer-column h3 {
    color: white;
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-4);
    position: relative;
    padding-bottom: var(--space-2);
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-500);
    border-radius: 2px;
}

/* العمود الأول - عن المكتب */
.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-brand h3 {
    margin-bottom: 0;
    padding-bottom: 0;
}

.footer-brand h3::after {
    display: none;
}

.footer-logo-img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.footer-about-text {
    font-size: var(--text-sm);
    line-height: 1.8;
    color: var(--gray-400);
    margin-bottom: var(--space-4);
}

.footer-hours {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--gray-400);
    background: rgba(255, 255, 255, 0.05);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
}

.footer-hours svg {
    color: var(--primary-500);
    flex-shrink: 0;
}

/* العمود الثاني - روابط سريعة */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--gray-400);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-base);
    padding: var(--space-2) 0;
}

.footer-links a:hover {
    color: var(--primary-400);
    transform: translateX(-5px);
}

.footer-links a svg {
    color: var(--gray-500);
    transition: color var(--transition-base);
}

.footer-links a:hover svg {
    color: var(--primary-400);
}

/* العمود الثالث - تواصل معنا */
.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    font-size: var(--text-sm);
    color: var(--gray-400);
}

.footer-contact li svg {
    color: var(--primary-500);
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-contact a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-contact a:hover {
    color: var(--primary-400);
}

/* روابط التواصل في الفوتر */
.footer-social-section {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-social-section h4 {
    color: var(--gray-300);
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-3);
}

.footer-social-section .social-links {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.footer-social-section .social-link {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
}

.footer-social-section .social-link:hover {
    transform: translateY(-3px);
}

/* الشريط السفلي */
.footer-bottom {
    background: rgba(0, 0, 0, 0.3);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.footer-bottom .copyright {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin: 0;
}

.footer-bottom .developer {
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin: 0;
}

.footer-bottom .developer a {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-base);
}

.footer-bottom .developer a:hover {
    color: var(--primary-300);
}

/* Responsive Footer */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .footer-column:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
    }

    .footer-column:first-child {
        grid-column: span 1;
    }

    .footer-main {
        padding: var(--space-8) var(--space-4);
    }

    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-brand {
        flex-direction: column;
        text-align: center;
    }

    .footer-column h3::after {
        right: 50%;
        transform: translateX(50%);
    }

    .footer-links a:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .header-logo .kdp-logo {
        width: 80px;
        height: 80px;
    }

    .header h1 {
        font-size: var(--text-xl);
    }

    .header-position {
        font-size: var(--text-sm);
    }

    .header .system-title {
        font-size: var(--text-lg);
    }
}

/* ============ Main Content ============ */
.main-content {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-8);
    border: 1px solid var(--gray-100);
}

/* ============ Success Card ============ */
.tracking-card {
    text-align: center;
    padding: var(--space-10);
    background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
    color: white;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-6);
}

.tracking-card h2 {
    font-size: var(--text-2xl);
    color: white;
    margin-bottom: var(--space-4);
}

.tracking-card p {
    color: rgb(255 255 255 / 0.9);
}

.tracking-code {
    display: inline-block;
    padding: var(--space-4) var(--space-8);
    background: rgb(255 255 255 / 0.2);
    border-radius: var(--radius-lg);
    font-size: var(--text-2xl);
    font-weight: 700;
    font-family: var(--font-mono);
    letter-spacing: 0.1em;
    margin: var(--space-4) 0;
    backdrop-filter: blur(10px);
}

/* ============ Request Card ============ */
.request-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.request-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
}

.info-item {
    background: var(--gray-50);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
}

.info-item label {
    display: block;
    font-size: var(--text-xs);
    color: var(--gray-500);
    margin-bottom: var(--space-1);
    font-weight: 500;
}

.info-item span {
    font-size: var(--text-sm);
    color: var(--gray-900);
    font-weight: 500;
}

/* ============ Comments Section ============ */
.comments-section {
    margin-top: var(--space-6);
    padding-top: var(--space-6);
    border-top: 1px solid var(--gray-200);
}

.comments-section h4 {
    font-size: var(--text-lg);
    margin-bottom: var(--space-4);
}

.comment {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
}

.comment.admin {
    background: var(--primary-50);
    border-right: 3px solid var(--primary-500);
}

.comment.user {
    background: var(--gray-50);
    border-right: 3px solid var(--gray-400);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-size: var(--text-xs);
    color: var(--gray-500);
}

.comment-header span:first-child {
    font-weight: 600;
    color: var(--gray-700);
}

.comment-text {
    font-size: var(--text-sm);
    color: var(--gray-700);
    line-height: var(--leading-relaxed);
}

/* ============ Navigation Links ============ */
.nav-links {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    margin-top: var(--space-6);
}

.nav-links a {
    padding: var(--space-3) var(--space-6);
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: var(--radius-lg);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.nav-links a:hover {
    background: var(--primary-100);
    color: var(--primary-700);
}

/* ============ Admin Layout ============ */
.admin-wrapper,
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    right: 0;
    z-index: var(--z-fixed);
}

.sidebar-header {
    padding: var(--space-6);
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    text-decoration: none;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sidebar-logo-img {
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-logo-text h2,
.sidebar-logo-text .logo-title {
    font-size: var(--text-sm);
    font-weight: 600;
    color: white;
    margin: 0;
    line-height: 1.3;
}

.sidebar-logo-text span,
.sidebar-logo-text .logo-subtitle {
    font-size: var(--text-xs);
    color: rgb(255 255 255 / 0.6);
}

.sidebar-logo h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-4);
    list-style: none;
    overflow-y: auto;
}

.sidebar-nav li {
    margin-bottom: var(--space-1);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: var(--gray-400);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.sidebar-nav a:hover {
    background: rgb(255 255 255 / 0.1);
    color: white;
}

.sidebar-nav a.active {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: var(--shadow-md);
}

.sidebar-nav .nav-icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

.sidebar-section {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: var(--space-4);
}

.sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid rgb(255 255 255 / 0.1);
}

/* Main Area */
.main-area,
.admin-content {
    flex: 1;
    margin-right: 260px;
    padding: var(--space-6);
    background: var(--gray-50);
    min-height: 100vh;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: var(--space-4) var(--space-6);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-6);
    border: 1px solid var(--gray-100);
}

.top-bar h1 {
    font-size: var(--text-xl);
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-full);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
}

.user-name {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--gray-700);
}

/* Content Card */
.content-card {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}

.content-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--gray-100);
}

.content-card-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

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

/* Filter Box */
.filter-box {
    background: var(--gray-50);
    padding: var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
}

/* Actions Column */
.actions {
    display: flex;
    gap: var(--space-2);
}

/* ============ Empty State ============ */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    opacity: 0.3;
}

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

.empty-state p {
    color: var(--gray-500);
    max-width: 300px;
    margin: 0 auto;
}

/* ============ Dropdown ============ */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: var(--z-dropdown);
    min-width: 180px;
    padding: var(--space-2);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-fast);
}

.dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(var(--space-2));
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--gray-700);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

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

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-2) 0;
}

/* ============ Search Box ============ */
.search-box {
    position: relative;
}

.search-box input {
    padding-right: var(--space-10);
}

.search-box .search-icon {
    position: absolute;
    right: var(--space-3);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

/* ============ Avatar ============ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-400), var(--primary-600));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: var(--text-sm);
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.avatar-lg { width: 48px; height: 48px; font-size: var(--text-base); }
.avatar-xl { width: 64px; height: 64px; font-size: var(--text-lg); }

/* ============ Divider ============ */
.divider {
    height: 1px;
    background: var(--gray-200);
    margin: var(--space-6) 0;
}

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

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

/* ============ Animations ============ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-fadeInUp { animation: fadeInUp 0.4s ease; }
.animate-slideIn { animation: slideIn 0.3s ease; }
.animate-scaleIn { animation: scaleIn 0.3s ease; }

/* ============ Theme Toggle ============ */
.theme-toggle {
    position: fixed;
    bottom: var(--space-6);
    left: var(--space-6);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all var(--transition-fast);
    z-index: var(--z-fixed);
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* ============ Responsive Design ============ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        transition: transform var(--transition-base);
    }

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

    .main-area {
        margin-right: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --space-6: 1rem;
        --space-8: 1.5rem;
    }

    .container {
        padding: var(--space-4);
    }

    .header {
        padding: var(--space-8) var(--space-4);
        border-radius: var(--radius-xl);
    }

    .header h1 {
        font-size: var(--text-2xl);
    }

    .main-content {
        padding: var(--space-5);
        border-radius: var(--radius-xl);
    }

    .tabs {
        flex-direction: column;
    }

    .row {
        flex-direction: column;
    }

    .col-4 {
        flex: 1 1 100%;
        min-width: auto;
    }

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

    .request-info {
        grid-template-columns: 1fr;
    }

    .nav-links {
        flex-direction: column;
    }

    .nav-links a {
        text-align: center;
    }

    .top-bar {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }

    .pagination {
        flex-wrap: wrap;
    }

    table {
        font-size: var(--text-xs);
    }

    th, td {
        padding: var(--space-2);
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: var(--text-xl);
    }

    .tracking-code {
        font-size: var(--text-lg);
        padding: var(--space-3) var(--space-4);
    }

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

    .btn + .btn {
        margin-top: var(--space-2);
    }
}

/* ============ Print Styles ============ */
@media print {
    .no-print,
    .sidebar,
    .theme-toggle,
    .top-bar-actions,
    .filter-box,
    .pagination,
    .actions {
        display: none !important;
    }

    .main-area {
        margin: 0;
        padding: 0;
    }

    .content-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    body {
        background: white;
    }
}

/* ============ Utilities ============ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-primary { color: var(--primary-600); }
.text-success { color: var(--success-600); }
.text-error { color: var(--error-600); }

.bg-gray-50 { background: var(--gray-50); }
.bg-gray-100 { background: var(--gray-100); }
.bg-white { background: white; }

.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.m-0 { margin: 0; }
.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); }

.w-full { width: 100%; }
.h-full { height: 100%; }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.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;
}

/* ============ Admin Footer ============ */
.admin-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--gray-400);
    text-align: center;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
    z-index: 100;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-footer p {
    margin: 0;
    color: var(--gray-400);
}

.admin-footer a {
    color: var(--primary-400);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.admin-footer a:hover {
    color: var(--primary-300);
    text-decoration: underline;
}

/* Adjust main area for fixed footer */
.main-area {
    padding-bottom: 60px;
}

@media print {
    .admin-footer {
        display: none !important;
    }
}
