/* ========================================
   ZALO TRACKING - Modern Design System
   ======================================== */

:root {
    --z-primary: #0068ff;
    --z-primary-dark: #0052cc;
    --z-primary-light: #e6f0ff;
    --z-success: #00a854;
    --z-success-light: #e6f7ef;
    --z-warning: #faad14;
    --z-warning-light: #fff7e6;
    --z-danger: #f5222d;
    --z-danger-light: #fff1f0;
    --z-gray-50: #fafafa;
    --z-gray-100: #f5f5f5;
    --z-gray-200: #e8e8e8;
    --z-gray-300: #d9d9d9;
    --z-gray-400: #bfbfbf;
    --z-gray-500: #8c8c8c;
    --z-gray-600: #595959;
    --z-gray-700: #434343;
    --z-gray-800: #262626;
    --z-gray-900: #141414;
    --z-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    --z-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);
    --z-shadow-lg: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
    --z-radius: 8px;
    --z-radius-lg: 12px;
    --z-transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.zalo_tracking_list,
.zalo_tracking_list * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.zalo_tracking_list {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    font-size: 14px;
    line-height: 1.6;
    color: var(--z-gray-800);
    background: transparent;
    min-height: 100vh;
}

/* ========================================
   LEFT SIDEBAR
   ======================================== */
.z_tracking_list_left {
    position: sticky;
    top: 24px;
    height: fit-content;
}

.z-user-card {
    background: #fff;
    border-radius: var(--z-radius-lg);
    padding: 24px;
    box-shadow: var(--z-shadow);
    border: 1px solid var(--z-gray-200);
    margin-bottom: 16px;
}

.z-user-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--z-primary) 0%, var(--z-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.z-user-avatar svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

.z-user-avatar.has-avatar {
    background: none;
    overflow: hidden;
    border: 2px solid var(--z-primary);
}

.z-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.z-user-phone {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: var(--z-gray-800);
    margin-bottom: 4px;
}

.z-user-label {
    font-size: 13px;
    color: var(--z-gray-500);
    text-align: center;
}

/* Navigation Menu */
.z-nav-menu {
    background: #fff;
    border-radius: var(--z-radius-lg);
    padding: 8px;
    box-shadow: var(--z-shadow);
    border: 1px solid var(--z-gray-200);
    margin-bottom: 16px;
}

.z-nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.z-nav-menu li {
    margin: 0 !important;
}

.z-nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--z-gray-700);
    text-decoration: none;
    border-radius: var(--z-radius);
    transition: var(--z-transition);
    font-weight: 500;
}

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

.z-nav-menu a.active {
    background: var(--z-primary-light);
    color: var(--z-primary);
}

.z-nav-menu svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Logout Button */
.z-btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid var(--z-gray-300);
    border-radius: var(--z-radius);
    color: var(--z-gray-600);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--z-transition);
    text-decoration: none;
}

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

.z-btn-logout svg {
    width: 18px;
    height: 18px;
}

/* ========================================
   RIGHT CONTENT
   ======================================== */
.z_tracking_list_right {
    min-width: 0;
}

.z-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.z-content-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--z-gray-900);
    margin: 0;
}

/* Status Filter Tabs */
.z-status-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
    background: #fff;
    border-radius: var(--z-radius-lg);
    box-shadow: var(--z-shadow);
    border: 1px solid var(--z-gray-200);
    margin-bottom: 20px;
}

.z-status-tabs a {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--z-gray-600);
    background: var(--z-gray-100);
    border-radius: 20px;
    text-decoration: none;
    transition: var(--z-transition);
    white-space: nowrap;
}

.z-status-tabs a:hover {
    background: var(--z-gray-200);
    color: var(--z-gray-800);
}

.z-status-tabs a.active {
    background: var(--z-primary);
    color: #fff;
}

/* ========================================
   ORDER CARDS
   ======================================== */
.z-order-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.z-order-card {
    background: #fff;
    border-radius: var(--z-radius-lg);
    box-shadow: var(--z-shadow);
    border: 1px solid var(--z-gray-200);
    overflow: hidden;
    transition: var(--z-transition);
}

.z-order-card:hover {
    box-shadow: var(--z-shadow-lg);
    border-color: var(--z-primary-light);
    transform: translateY(-2px);
}

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

.z-order-id {
    font-size: 15px;
    font-weight: 600;
    color: var(--z-gray-800);
}

.z-order-id span {
    color: var(--z-primary);
}

/* Status Badges */
.z-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.z-status-completed {
    background: var(--z-success-light);
    color: var(--z-success);
}

.z-status-processing {
    background: var(--z-primary-light);
    color: var(--z-primary);
}

.z-status-on-hold {
    background: var(--z-warning-light);
    color: var(--z-warning);
}

.z-status-pending {
    background: var(--z-warning-light);
    color: var(--z-warning);
}

.z-status-cancelled,
.z-status-failed,
.z-status-refunded {
    background: var(--z-danger-light);
    color: var(--z-danger);
}

/* Order Body */
.z-order-card-body {
    padding: 20px;
}

.z-order-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.z-order-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--z-gray-200);
    border-radius: var(--z-radius);
}

.z-order-item-img {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: var(--z-radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--z-gray-200);
}

.z-order-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.z-order-item-info {
    flex: 1;
    min-width: 0;
}

.z-order-item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--z-gray-800);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.z-order-item-meta {
    font-size: 13px;
    color: var(--z-gray-500);
}

/* Order Footer */
.z-order-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--z-gray-200);
}

.z-order-total {
    font-size: 14px;
    color: var(--z-gray-600);
}

.z-order-total strong {
    font-size: 18px;
    font-weight: 600;
    color: var(--z-primary);
    margin-left: 8px;
}

.z-btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--z-primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--z-radius);
    text-decoration: none;
    transition: var(--z-transition);
}

.z-btn-view:hover {
    background: var(--z-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 104, 255, 0.3);
    color: #fff;
}

.z-btn-view svg {
    width: 16px;
    height: 16px;
}

/* Load More */
.z-load-more {
    text-align: center;
    padding: 24px;
}

.z-btn-loadmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: #fff;
    border: 2px solid var(--z-primary);
    color: var(--z-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--z-radius);
    cursor: pointer;
    transition: var(--z-transition);
}

.z-btn-loadmore:hover {
    background: var(--z-primary);
    color: #fff;
}

/* Empty State */
.z-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: var(--z-radius-lg);
    box-shadow: var(--z-shadow);
    border: 1px solid var(--z-gray-200);
}

.z-empty-state svg {
    width: 80px;
    height: 80px;
    fill: var(--z-gray-300);
    margin-bottom: 20px;
}

.z-empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--z-gray-700);
    margin: 0 0 8px 0;
}

.z-empty-state p {
    font-size: 14px;
    color: var(--z-gray-500);
    margin: 0;
}

/* ========================================
   ORDER DETAILS PAGE
   ======================================== */
.z-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.z-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 1px solid var(--z-gray-300);
    color: var(--z-gray-600);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--z-radius);
    text-decoration: none;
    transition: var(--z-transition);
}

.z-btn-back:hover {
    border-color: var(--z-primary);
    color: var(--z-primary);
}

.z-btn-back svg {
    width: 18px;
    height: 18px;
}

.z-detail-card {
    background: #fff;
    border-radius: var(--z-radius-lg);
    box-shadow: var(--z-shadow);
    border: 1px solid var(--z-gray-200);
    overflow: hidden;
}

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

.z-detail-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--z-gray-800);
    margin: 0;
    flex: 1;
    min-width: 0;
}

.z-detail-card-body {
    padding: 24px;
}

/* Order Details Table */
.z-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.z-detail-table th,
.z-detail-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--z-gray-200);
}

.z-detail-table th {
    background: var(--z-gray-50);
    font-weight: 600;
    color: var(--z-gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.z-detail-table td {
    color: var(--z-gray-800);
}

.z-detail-table tfoot th,
.z-detail-table tfoot td {
    background: #fff;
    font-weight: 500;
    color: var(--z-gray-700);
}

.z-detail-table tfoot th {
    text-transform: none;
    letter-spacing: normal;
}

.z-detail-table tbody td img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

/* Customer Info */
.z-customer-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.z-info-box {
    background: var(--z-gray-50);
    border-radius: var(--z-radius);
    padding: 20px;
}

.z-info-box h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--z-gray-700);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.z-info-box p {
    font-size: 14px;
    color: var(--z-gray-600);
    margin: 0;
    line-height: 1.8;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 991px) {
    .zalo_tracking_list {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .z_tracking_list_left {
        position: static;
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 16px;
        align-items: start;
    }

    .z-user-card {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px;
    }

    .z-user-avatar {
        margin: 0;
        width: 48px;
        height: 48px;
    }

    .z-user-avatar svg {
        width: 24px;
        height: 24px;
    }

    .z-user-phone {
        text-align: left;
        font-size: 16px;
    }

    .z-user-label {
        text-align: left;
    }

    .z-nav-menu {
        display: none;
    }

    .z-btn-logout {
        padding: 12px 16px;
        white-space: nowrap;
    }
}

@media (max-width: 767px) {
    .z-status-tabs {
        padding: 12px;
        gap: 6px;
    }

    .z-status-tabs a {
        padding: 6px 12px;
        font-size: 12px;
    }

    .z-order-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }

    .z-order-card-body {
        padding: 16px;
    }

    .z-order-item {
        padding: 10px;
    }

    .z-order-item-img {
        width: 56px;
        height: 56px;
    }

    .z-order-card-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .z-order-total {
        text-align: center;
    }

    .z-btn-view {
        justify-content: center;
    }

    .z-content-title {
        font-size: 20px;
    }

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

    .z-btn-logout {
        order: -1;
    }
}

@media (max-width: 480px) {
    .zalo_tracking_list {
        padding: 12px;
    }

    .z-detail-table th,
    .z-detail-table td {
        padding: 12px 8px;
        font-size: 13px;
    }

    .z-detail-card-header {
        padding: 16px;
    }

    .z-detail-card-body {
        padding: 16px;
    }

    .z-detail-card-title {
        font-size: 16px;
    }

    .z-customer-info {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .z-info-box {
        padding: 16px;
    }
}
