/* ============================================
   ShipFlow - Main Stylesheet
   Professional Shipment Management System
   ============================================ */

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --secondary: #5f6368;
    --success: #0d904f;
    --success-light: #e6f4ea;
    --danger: #d93025;
    --danger-light: #fce8e6;
    --warning: #f9ab00;
    --warning-light: #fef7e0;
    --info: #1a73e8;
    --info-light: #e8f0fe;
    --dark: #202124;
    --gray-100: #f8f9fa;
    --gray-200: #e8eaed;
    --gray-300: #dadce0;
    --gray-400: #bdc1c6;
    --gray-500: #9aa0a6;
    --gray-600: #80868b;
    --gray-700: #5f6368;
    --gray-800: #3c4043;
    --white: #ffffff;
    --sidebar-width: 260px;
    --header-height: 60px;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
    --transition: all 0.3s ease;

    /* Status Colors */
    --status-new: #1a73e8;
    --status-assigned: #9334e6;
    --status-picked-up: #f9ab00;
    --status-out-for-delivery: #ff6d01;
    --status-delivered: #0d904f;
    --status-returned: #d93025;
}

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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* RTL Support */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

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

img { max-width: 100%; }

/* ============================================
   LAYOUT
   ============================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    padding-top: var(--header-height);
    transition: var(--transition);
}

.page-content {
    padding: 24px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-inline-end: 1px solid var(--gray-200);
    z-index: 1000;
    overflow-y: auto;
    transition: var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    height: var(--header-height);
}

.sidebar-brand h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-brand .logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-section {
    padding: 8px 20px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--gray-700);
    font-size: 0.93rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: inherit;
}

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

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

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.nav-item .badge {
    margin-inline-start: auto;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* ============================================
   HEADER / TOPBAR
   ============================================ */
.topbar {
    position: fixed;
    top: 0;
    inset-inline-start: var(--sidebar-width);
    inset-inline-end: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
    transition: var(--transition);
}

.topbar-start {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-end {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-700);
    cursor: pointer;
    padding: 8px;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
}

/* Notification Bell */
.notification-btn {
    position: relative;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.notification-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.notification-btn .count {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Language Toggle */
.lang-toggle {
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    color: var(--gray-700);
}

.lang-toggle:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.user-menu:hover {
    background: var(--gray-100);
}

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

.user-info {
    line-height: 1.3;
}

.user-info .user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
}

.user-info .user-role {
    font-size: 0.7rem;
    color: var(--gray-500);
}

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

.dropdown-menu {
    position: absolute;
    top: 100%;
    inset-inline-end: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 8px 0;
    display: none;
    z-index: 1001;
}

.dropdown-menu.show { display: block; }

.dropdown-menu a,
.dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--gray-700);
    font-size: 0.85rem;
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: inherit;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.dropdown-divider {
    border-top: 1px solid var(--gray-200);
    margin: 4px 0;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body { padding: 20px; }

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }

.stat-info h4 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

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

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

.table th {
    background: var(--gray-100);
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: inherit;
    white-space: nowrap;
    border-bottom: 2px solid var(--gray-200);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.85rem;
    vertical-align: middle;
}

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

.table .actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   FORMS
   ============================================ */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--white);
    color: var(--dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

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

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 12px center;
    padding-inline-start: 14px;
}

[dir="ltr"] select.form-control {
    background-position: right 12px center;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.input-group {
    display: flex;
}

.input-group .form-control {
    flex: 1;
}

.input-group-text {
    padding: 10px 14px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    font-size: 0.85rem;
    color: var(--gray-600);
    white-space: nowrap;
}

.input-group .form-control:first-child {
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.input-group .input-group-text:last-child {
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-inline-start: none;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { opacity: 0.9; }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { opacity: 0.9; }

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}
.btn-warning:hover { opacity: 0.9; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
}

.btn-icon.btn-sm {
    width: 30px;
    height: 30px;
}

/* ============================================
   BADGES / STATUS
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-new { background: var(--info-light); color: var(--status-new); }
.badge-assigned { background: #f3e8fd; color: var(--status-assigned); }
.badge-picked_up { background: var(--warning-light); color: var(--status-picked-up); }
.badge-out_for_delivery { background: #fff3e0; color: var(--status-out-for-delivery); }
.badge-delivered { background: var(--success-light); color: var(--status-delivered); }
.badge-returned { background: var(--danger-light); color: var(--status-returned); }

.badge-active { background: var(--success-light); color: var(--success); }
.badge-disabled { background: var(--danger-light); color: var(--danger); }

/* ============================================
   MODAL
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

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

.modal {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

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

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 4px;
}

.modal-body { padding: 20px; }

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border: none;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

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

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
}

.pagination button {
    min-width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    background: var(--white);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: inherit;
}

.pagination button:hover {
    background: var(--gray-100);
}

.pagination button.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ============================================
   NOTIFICATIONS PANEL
   ============================================ */
.notifications-panel {
    position: fixed;
    top: var(--header-height);
    inset-inline-end: 0;
    width: 360px;
    max-height: calc(100vh - var(--header-height));
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    z-index: 1001;
    display: none;
    overflow-y: auto;
}

.notifications-panel.show { display: block; }

.notifications-panel .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    background: var(--white);
}

.notification-item {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    cursor: pointer;
    transition: var(--transition);
}

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

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

.notification-item .title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-item .message {
    font-size: 0.78rem;
    color: var(--gray-600);
}

.notification-item .time {
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-top: 4px;
}

/* ============================================
   SHIPMENT CARD (for delivery person mobile view)
   ============================================ */
.shipment-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    margin-bottom: 12px;
    overflow: hidden;
}

.shipment-card .status-bar {
    height: 4px;
}

.shipment-card .status-bar.new { background: var(--status-new); }
.shipment-card .status-bar.assigned { background: var(--status-assigned); }
.shipment-card .status-bar.picked_up { background: var(--status-picked-up); }
.shipment-card .status-bar.out_for_delivery { background: var(--status-out-for-delivery); }
.shipment-card .status-bar.delivered { background: var(--status-delivered); }
.shipment-card .status-bar.returned { background: var(--status-returned); }

.shipment-card .card-content {
    padding: 14px 16px;
}

.shipment-card .tracking {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.shipment-card .info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.shipment-card .info-row i {
    width: 16px;
    color: var(--gray-400);
}

.shipment-card .cod {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--success);
    margin-top: 8px;
}

.shipment-card .card-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.shipment-card .card-actions .btn {
    flex: 1;
    padding: 8px;
    font-size: 0.78rem;
}

/* ============================================
   TIMELINE (for tracking)
   ============================================ */
.timeline {
    position: relative;
    padding-inline-start: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    inset-inline-start: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-300);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item .dot {
    position: absolute;
    inset-inline-start: -26px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gray-300);
    border: 2px solid var(--white);
}

.timeline-item.active .dot {
    background: var(--primary);
}

.timeline-item .content {
    font-size: 0.85rem;
}

.timeline-item .content .status-name {
    font-weight: 600;
    margin-bottom: 2px;
}

.timeline-item .content .time {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ============================================
   TOAST / ALERTS
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    inset-inline-end: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--border-radius);
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-inline-start: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }

.toast .message {
    flex: 1;
    font-size: 0.85rem;
}

.toast .close-toast {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
}

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

[dir="rtl"] @keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   AUTH PAGES (Login, Register)
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, #4285f4 100%);
    padding: 20px;
}

.auth-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.auth-card .logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-card .logo h2 {
    font-size: 1.8rem;
    color: var(--primary);
    font-weight: 700;
}

.auth-card .logo p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 4px;
}

.auth-card .form-group {
    margin-bottom: 20px;
}

.auth-card .btn-primary {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
}

.auth-card .auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   TRACKING PAGE (Public)
   ============================================ */
.tracking-page {
    min-height: 100vh;
    background: var(--gray-100);
}

.tracking-header {
    background: linear-gradient(135deg, var(--primary) 0%, #4285f4 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
}

.tracking-header h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.tracking-header p {
    opacity: 0.9;
    font-size: 0.95rem;
}

.tracking-search {
    max-width: 500px;
    margin: -24px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.tracking-search .search-box {
    display: flex;
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.tracking-search .search-box input {
    flex: 1;
    border: none;
    padding: 16px 20px;
    font-size: 1rem;
    font-family: inherit;
}

.tracking-search .search-box input:focus { outline: none; }

.tracking-search .search-box button {
    padding: 16px 24px;
    background: var(--primary);
    color: white;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.tracking-result {
    max-width: 600px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ============================================
   PRINT LABEL
   ============================================ */
@media print {
    body * { visibility: hidden; }
    .print-area, .print-area * { visibility: visible; }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
}

.label-print {
    width: 100mm;
    padding: 8mm;
    border: 1px solid #000;
    font-family: 'Cairo', Arial, sans-serif;
    font-size: 11px;
    background: white;
}

.label-print .label-header {
    text-align: center;
    border-bottom: 2px solid #000;
    padding-bottom: 4mm;
    margin-bottom: 4mm;
}

.label-print .label-header h2 {
    font-size: 16px;
    margin-bottom: 2mm;
}

.label-print .label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3mm;
}

.label-print .label-barcode {
    text-align: center;
    margin: 4mm 0;
}

.label-print .label-barcode img {
    max-width: 80mm;
}

/* ============================================
   LOADER
   ============================================ */
.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.page-loader.show { display: flex; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-inline-start: 0;
    }
    .topbar {
        inset-inline-start: 0;
    }
    .menu-toggle {
        display: block;
    }
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        grid-template-columns: 1fr;
    }
    .auth-card {
        padding: 24px;
    }
    .user-info {
        display: none;
    }
    .modal {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    html { font-size: 13px; }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 12px;
    }
    .page-content {
        padding: 12px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.text-start { text-align: start; }
.text-end { text-align: end; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--gray-500); }
.text-bold { font-weight: 700; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.d-flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }

.w-100 { width: 100%; }
.hidden { display: none; }
.pointer { cursor: pointer; }
