/* ==========================================================================
   QUANLY_GIAONHAN - CUSTOM SHRED STYLESHEET
   ========================================================================== */

:root {
    --primary-color: #0f172a;
    --primary-hover: #1e293b;
    --accent-color: #2563eb;
    --accent-hover: #1d4ed8;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    /* Status Colors */
    --status-cho-xn: #f59e0b;
    --status-da-xn: #3b82f6;
    --status-dang-giao: #06b6d4;
    --status-da-lay: #8b5cf6;
    --status-da-giao: #10b981;
    --status-huy: #ef4444;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NAVBAR STYLING */
.navbar-custom {
    background: linear-gradient(135deg, #021ef4 0%, #021ef4 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.35rem;
    color: #ffffff !important;
    letter-spacing: 0.5px;
}

.navbar-brand i {
    color: #60a5fa;
    margin-right: 8px;
}

.nav-link {
    color: #cbd5e1 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: #0320fc !important;
    background-color: rgb(253, 224, 3);
}

.user-badge {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* CARDS & CONTAINERS */
.main-container {
    flex: 1;
    padding: 1.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* STAT CARDS */
.stat-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary { background-color: #dbeafe; color: #2563eb; }
.stat-icon.warning { background-color: #fef3c7; color: #d97706; }
.stat-icon.success { background-color: #d1fae5; color: #059669; }
.stat-icon.purple { background-color: #f3e8ff; color: #7c3aed; }

.stat-info .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.stat-info .label {
    font-size: 0.85rem;
    color: var(--text-muted);
}
/* =========================================================
   KẺ KHUNG (BORDER) & TỐI ƯU HIỂN THỊ BẢNG TABULATOR
   ========================================================= */
/* TABULATOR TABLE OVERRIDES */
.tabulator {
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    overflow: hidden;
    font-size: 1.1rem;
}

.tabulator .tabulator-header {
    background-color: #dbedff !important;
    border-bottom: 2px solid var(--border-color) !important;
    color: var(--primary-color);
    font-weight: 600;
}

.tabulator .tabulator-header .tabulator-col {
    background-color: transparent !important;
    border-right: 1px solid #cbd5e1 !important; /* Viền đứng ngăn cách các cột tiêu đề */
    font-weight: 700;
}

.tabulator-row {
    border-bottom: 1px solid var(--border-color) !important;
}

.tabulator-row.tabulator-row-even {
    background-color: #f8fafc !important;
}

.tabulator-row:hover {
    background-color: #e2e8f0 !important;
}

/* 3. Kẻ viền cho từng Ô dữ liệu (Cells) */
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell {
    border-right: 1px solid #e2e8f0 !important;  /* Viền đứng giữa các cột */
    border-bottom: 1px solid #e2e8f0 !important; /* Viền ngang giữa các hàng */
}

/* 4. Loại bỏ viền thừa ở ô cuối cùng bên phải */
.tabulator .tabulator-header .tabulator-col:last-child,
.tabulator .tabulator-tableholder .tabulator-table .tabulator-row .tabulator-cell:last-child {
    border-right: none !important;
}


/* BADGES & BUTTONS */
.status-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
}

.badge-cho-xn { background-color: #fef3c7; color: #b45309; }
.badge-da-xn { background-color: #dbeafe; color: #1d4ed8; }
.badge-dang-giao { background-color: #cff4fc; color: #055160; }
.badge-da-lay { background-color: #f3e8ff; color: #6b21a8; }
.badge-da-giao { background-color: #d1fae5; color: #047857; }
.badge-huy { background-color: #fee2e2; color: #b91c1c; }

.btn-custom-primary {
    background-color: var(--accent-color);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-custom-primary:hover {
    background-color: var(--accent-hover);
    color: #ffffff;
}

/* LEAFLET MAP CONTAINER */
.map-container {
    height: 480px;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.map-info-box {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
}

/* LOGIN PAGE */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.login-brand {
    text-align: center;
    margin-bottom: 2rem;
}

.login-brand i {
    font-size: 3rem;
    color: var(--accent-color);
}

.login-brand h3 {
    margin-top: 10px;
    font-weight: 700;
    color: var(--primary-color);
}

/* FOOTER */
footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* =========================================================
   GIAO DIỆN QUẢN LÝ ĐƠN HÀNG & MODAL CHI TIẾT
   ========================================================= */

/* Styling cho khung tải ảnh xác minh trong form CRUD */
.img-upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    background-color: #f8fafc;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}
.img-upload-box:hover {
    border-color: #2563eb;
    background-color: #eff6ff;
}
.img-preview {
    max-height: 90px;
    object-fit: cover;
    border-radius: 6px;
    width: 100%;
    display: none;
}
.img-placeholder {
    color: #64748b;
    font-size: 0.8rem;
}

/* Chi tiết đơn hàng trong Modal */
.detail-label {
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}
.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
}

/* Hiệu ứng nhấp nháy cho định vị GPS */
.gps-pulse-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 1.5s infinite;
}
@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Class dùng chung cho nút thao tác trong bảng */
.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 26px;
    padding: 2px 6px;
    font-size: 0.75rem;
    line-height: 1.2;
    border-radius: 4px;
    border: 1px solid transparent;
    margin-right: 4px;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.btn-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Nút Sửa (Màu vàng) */
.btn-action-edit {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}
.btn-action-edit:hover {
    background-color: #e0a800;
    border-color: #d39e00;
    color: #212529;
}

/* Nút Xóa (Màu đỏ) */
.btn-action-delete {
    background-color: #dc3545;
    border-color: #dc3545;
    color: #ffffff;
}
.btn-action-delete:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: #ffffff;
}

/* Nút Xác nhận (Màu xanh lá) */
.btn-action-confirm {
    background-color: #198754;
    border-color: #198754;
    color: #ffffff;
}
.btn-action-confirm:hover {
    background-color: #157347;
    border-color: #146c43;
    color: #ffffff;
}

/* Nút Hủy xác nhận (Màu cam) */
.btn-action-unconfirm {
    background-color: #fd7e14;
    border-color: #fd7e14;
    color: #ffffff;
}
.btn-action-unconfirm:hover {
    background-color: #e36d09;
    border-color: #dc6502;
    color: #ffffff;
}

/* Nút Phân công (Màu viền xanh dương) */
.btn-action-assign {
    background-color: #ffffff;
    border-color: #0d6efd;
    color: #0d6efd;
    text-decoration: none;
}
.btn-action-assign:hover {
    background-color: #0d6efd;
    color: #ffffff;
}