/* Delivery Max - Modern Design System */

:root {
    /* Brand Colors */
    --primary: #EA1D2C;
    --primary-hover: #d41a28;
    --primary-light: #fef2f2;
    --primary-50: #fff1f2;
    --primary-100: #ffe4e6;
    --primary-200: #fecdd3;
    --primary-500: #ef4444;
    --primary-600: #dc2626;
    --primary-700: #b91c1c;

    /* Neutral */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Semantic */
    --success: #10b981;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;

    /* 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);

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* 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);
}

/* ===== BASE ===== */
* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes bounce-soft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-fade-in { animation: fadeIn var(--transition-slow) ease-out; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease-out; }
.animate-fade-in-down { animation: fadeInDown 0.4s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.3s ease-out; }
.animate-slide-in-left { animation: slideInLeft 0.3s ease-out; }
.animate-scale-in { animation: scaleIn 0.2s ease-out; }
.animate-pulse-soft { animation: pulse-soft 2s ease-in-out infinite; }
.animate-shimmer {
    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;
}
.animate-spin { animation: spin 1s linear infinite; }

/* Staggered animations */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ===== SIDEBAR ===== */
.sidebar {
    background: linear-gradient(180deg, var(--gray-900) 0%, #1a1a2e 100%);
    transition: width var(--transition-slow), transform var(--transition-slow);
}
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-400);
    transition: all var(--transition-base);
    text-decoration: none;
}
.sidebar-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}
.sidebar-link.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(234, 29, 44, 0.4);
}
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: white;
    border-radius: 0 4px 4px 0;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-base);
}
.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-200);
}
.card-stat {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    box-shadow: var(--shadow-xs);
    padding: 1.25rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}
.card-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}
.card-stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}
.card-stat:hover::before {
    opacity: 1;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all var(--transition-base);
    cursor: pointer;
    border: none;
    outline: none;
    line-height: 1;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(234, 29, 44, 0.3);
}
.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 16px rgba(234, 29, 44, 0.4);
    transform: translateY(-1px);
}
.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}
.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}
.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: #dc2626;
}
.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: #059669;
}
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-icon {
    padding: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
}

/* ===== INPUTS ===== */
.input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    background: white;
    transition: all var(--transition-base);
    outline: none;
    color: var(--gray-900);
}
.input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 29, 44, 0.1);
}
.input::placeholder { color: var(--gray-400); }

.select {
    width: 100%;
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    background: white 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") right 0.5rem center/1.5em 1.5em no-repeat;
    transition: all var(--transition-base);
    outline: none;
    appearance: none;
    color: var(--gray-900);
}
.select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(234, 29, 44, 0.1);
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-confirmed { background: #dbeafe; color: #1e40af; }
.badge-preparing { background: #e0e7ff; color: #3730a3; }
.badge-ready { background: #dcfce7; color: #166534; }
.badge-out_for_delivery { background: #f3e8ff; color: #6b21a8; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-canceled { background: #fee2e2; color: #991b1b; }
.badge-paid { background: #d1fae5; color: #065f46; }
.badge-failed { background: #fee2e2; color: #991b1b; }
.badge-refunded { background: #fef3c7; color: #92400e; }

/* ===== STATUS DOT ===== */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.status-dot-online { background: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.status-dot-offline { background: var(--gray-400); }
.status-dot-busy { background: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }

/* ===== TOGGLE ===== */
.toggle {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background: var(--gray-200);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-base);
}
.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    background: white;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base);
}
.toggle.active {
    background: var(--primary);
}
.toggle.active::after {
    transform: translateX(1.25rem);
}

/* ===== TABLE ===== */
.table-container {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    overflow: hidden;
}
.table-container table {
    width: 100%;
    border-collapse: collapse;
}
.table-container thead {
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}
.table-container th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.table-container td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.table-container tr:last-child td {
    border-bottom: none;
}
.table-container tr:hover td {
    background: var(--gray-50);
}

/* ===== MODAL ===== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.15s ease-out;
}
.modal {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 32rem;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease-out;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.modal-body {
    padding: 1.5rem;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-2xl) var(--radius-2xl);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out, fadeIn 0.3s ease-out;
    max-width: 24rem;
}
.toast-success { background: #065f46; color: white; }
.toast-error { background: #991b1b; color: white; }
.toast-warning { background: #92400e; color: white; }
.toast-info { background: #1e40af; color: white; }

/* ===== TABS ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-100);
    gap: 0;
}
.tab {
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-base);
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
}
.tab:hover {
    color: var(--gray-700);
}
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* ===== AVATAR ===== */
.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-lg { width: 3rem; height: 3rem; font-size: 1rem; }

/* ===== SKELETON ===== */
.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-md);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-state-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
    display: inline-block;
}
.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-100);
    min-width: 12rem;
    z-index: 50;
    animation: scaleIn 0.15s ease-out;
    overflow: hidden;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    transition: background var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}
.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}
.dropdown-divider {
    height: 1px;
    background: var(--gray-100);
    margin: 0.25rem 0;
}

/* ===== PROGRESS ===== */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: var(--gray-100);
    border-radius: 999px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: var(--primary);
    transition: width 0.5s ease;
}

/* ===== FLOATING CART ===== */
.floating-cart {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: white;
    padding: 0.875rem 1.5rem;
    border-radius: 999px;
    box-shadow: var(--shadow-xl);
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    transition: all var(--transition-base);
}
.floating-cart:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ===== PRODUCT CARD ===== */
.product-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-100);
    overflow: hidden;
    transition: all var(--transition-base);
}
.product-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}
.product-card-img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
    background: var(--gray-100);
}
.product-card-body {
    padding: 1rem;
}

/* ===== SEARCH ===== */
.search-input {
    position: relative;
}
.search-input i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 0.875rem;
}
.search-input input {
    padding-left: 2.5rem;
}

/* ===== PRINT ===== */
@media print {
    .no-print { display: none !important; }
    .sidebar { display: none !important; }
    body { background: white; }
}

/* ===== DARK OVERLAY FOR IMAGES ===== */
.img-overlay {
    position: relative;
}
.img-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
}

/* ===== HOVER LIFT ===== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* ===== GRADIENT BACKGROUNDS ===== */
.gradient-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #ff6b6b 100%);
}
.gradient-dark {
    background: linear-gradient(135deg, var(--gray-900) 0%, #1a1a2e 100%);
}
.gradient-mesh {
    background:
        radial-gradient(at 40% 20%, rgba(234, 29, 44, 0.08) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(59, 130, 246, 0.06) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(16, 185, 129, 0.06) 0px, transparent 50%);
}
