/* CSS Variables for Dashboard */
:root {
    --brand-orange: #228bbf;
    --bg-card2: #f8f9fa;
    --border: #e9ecef;
    --sidebar-bg: #1a1d23;
    --sidebar-hover: #2a2d35;
    --sidebar-active: #228bbf;
    --sidebar-text: #a0a8b8;
    --sidebar-text-bright: #ffffff;
    --sidebar-width: 230px;
}

/* ─── Sidebar Layout ─────────────────────────────── */
.owner-layout {
    display: flex;
    min-height: calc(100vh - 130px);
}

.owner-sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: calc(100vh - 130px);
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 15px;
    font-weight: 700;
    color: var(--sidebar-text-bright);
    letter-spacing: 0.3px;
}

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

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #4a5060;
    padding: 8px 18px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-bright);
    text-decoration: none;
}

.sidebar-link.active {
    background: rgba(243, 156, 18, 0.1);
    color: var(--sidebar-active);
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.sidebar-link i {
    width: 16px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
}

.sidebar-footer-links {
    padding: 12px 0;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.sidebar-go-site {
    color: #6b7280;
}

.sidebar-go-site:hover {
    color: #a0a8b8;
}

.sidebar-logout:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.08);
}

/* ─── Main Content Area ──────────────────────────── */
.owner-content {
    flex: 1;
    min-width: 0;
    background: #f4f7f6;
}

/* ─── Dashboard Container (inside content) ───────── */
.dashboard-container {
    padding: 28px;
    min-height: 100%;
    background-color: #f4f7f6;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #222;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    padding: 20px;
    margin-bottom: 25px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #333;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
}

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

.table-wrap th {
    text-align: left;
    padding: 12px 15px;
    background: #f8f9fa;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    border-bottom: 2px solid #ddd;
}

.table-wrap td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.table-wrap tbody tr:hover {
    background-color: #fcfcfc;
}

.tracking-code {
    font-family: monospace;
    font-weight: bold;
    background: #f0f0f0;
    padding: 4px 8px;
    border-radius: 4px;
    color: #333;
}

/* Buttons */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.btn-primary {
    background-color: #0056b3;
    color: #fff;
    border: none;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #004494;
}

.btn-secondary {
    background-color: #6c757d;
    color: #fff;
    border: none;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Utilities */
.text-sm {
    font-size: 0.9rem;
}

.text-muted {
    color: #888;
}

.text-orange {
    color: #f39c12;
}

.fw-bold {
    font-weight: bold;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
}

.badge-pending { background-color: #f39c12; }
.badge-assigned { background-color: #3498db; }
.badge-picked { background-color: #9b59b6; }
.badge-transit { background-color: #e67e22; }
.badge-delivered { background-color: #2ecc71; }
.badge-cancelled { background-color: #e74c3c; }

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    color: #ccc;
}

.empty-text {
    font-size: 1.1rem;
    color: #777;
}

/* ─── Alerts ─────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* ─── Form Inputs & Select ───────────────────────── */
.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-group select,
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
    appearance: auto;
}
.form-group select:focus,
.form-group input:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(243,156,18,0.1);
}

/* ─── Flex Utilities ─────────────────────────────── */
.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* ─── Text Utilities ─────────────────────────────── */
.text-success { color: #28a745; }

/* ─── Status Timeline (Tracking Page) ───────────── */
.status-timeline {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    margin-top: 24px;
    padding: 0 8px;
}

.status-timeline::before {
    content: '';
    position: absolute;
    top: 14px;
    left: 8px;
    right: 8px;
    height: 3px;
    background: #e9ecef;
    z-index: 0;
}

.timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

.timeline-step.done .timeline-dot {
    background: #228bbf;
    border-color: #228bbf;
}

.timeline-step.done .timeline-dot::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: calc(100% + 0px);
    height: 3px;
    background: #228bbf;
    transform: translateX(0);
    z-index: -1;
}

.timeline-step.active .timeline-dot {
    background: #fff;
    border-color: #228bbf;
    box-shadow: 0 0 0 4px rgba(34, 139, 191, 0.2);
}

.timeline-step.active .timeline-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #228bbf;
}

.timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e9ecef;
    border: 3px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.timeline-label {
    margin-top: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #aaa;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.timeline-step.done .timeline-label,
.timeline-step.active .timeline-label {
    color: #228bbf;
}

.timeline-step.active .timeline-label {
    font-weight: 700;
}

/* ─── Proof Thumbnail ────────────────────────────── */
.proof-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: transform 0.2s;
}
.proof-thumb:hover {
    transform: scale(1.2);
}
.proof-lightbox-link {
    display: inline-block;
    cursor: zoom-in;
    line-height: 0;
}
.proof-lightbox-link:focus {
    outline: 2px solid var(--brand-orange);
    outline-offset: 2px;
    border-radius: 6px;
}

/* ─── Button base ────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.2s, transform 0.1s;
}
.btn:hover { transform: translateY(-1px); }
.btn-full { width: 100%; }

/* ─── Minimal Footer ─────────────────────────────── */
.dash-footer {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-top: 1px solid #eee;
    color: #aaa;
    font-size: 13px;
    margin-top: 20px;
}

/* ─── Premium Owner Pages Styling ────────────────── */

/* Filter Tabs (parcels.php) */
.filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid var(--border);
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #556080;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.filter-tab:hover {
    background-color: #f1f3f7;
    color: var(--brand-orange);
    text-decoration: none;
}

.filter-tab.active {
    background-color: var(--brand-orange);
    color: #fff;
    box-shadow: 0 4px 12px rgba(34, 139, 191, 0.25);
}

/* Assign Driver Grid layout (assign-driver.php) */
.assign-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 991px) {
    .assign-grid {
        grid-template-columns: 1fr;
    }
}

.card-assign-list {
    margin-bottom: 0;
}

.parcel-assign-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Parcel Assign Card */
.parcel-assign-card {
    background: var(--bg-card2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.parcel-assign-card:hover {
    transform: translateY(-2px);
    border-color: #ccd3e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.parcel-assign-card.active {
    border-color: var(--brand-orange);
    background: #fff;
    box-shadow: 0 0 0 1px var(--brand-orange), 0 8px 20px rgba(34, 139, 191, 0.08);
}

.parcel-assign-card.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--brand-orange);
}

.parcel-card-body {
    margin-top: 10px;
    font-size: 0.88rem;
    color: #4a5568;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.parcel-card-row strong {
    color: #2d3748;
}

.parcel-card-address {
    margin-top: 6px;
    font-size: 0.8rem;
    color: #718096;
    background: #f7fafc;
    padding: 6px 10px;
    border-radius: 6px;
    border-left: 2px solid #cbd5e0;
}

.parcel-card-assigned {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--brand-orange);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Sticky Right Column Assignment Form */
.card-assign-form {
    margin-bottom: 0;
    position: sticky;
    top: 24px;
    align-self: start;
}

.selected-parcel-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 0.5px;
    font-family: monospace;
}

/* Improvements to Tables */
.table-wrap table {
    border-radius: 8px;
    overflow: hidden;
}

.table-wrap th {
    background: #f4f7f6;
    color: #556080;
    font-size: 0.78rem;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table-wrap td {
    border-bottom: 1px solid var(--border);
    color: #4a5568;
}

.table-wrap tr:last-child td {
    border-bottom: none;
}

/* ─── Mobile Responsiveness ──────────────────────── */
@media (max-width: 768px) {
    .owner-layout {
        flex-direction: column;
        min-height: auto;
    }
    
    .owner-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
        border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    
    .sidebar-brand {
        padding: 15px;
        justify-content: center;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        padding: 8px;
        gap: 4px;
        justify-content: center;
    }
    
    .sidebar-section-label {
        width: 100%;
        text-align: center;
        margin-top: 6px;
        padding: 4px 0;
        margin-bottom: 2px;
    }
    
    .sidebar-link {
        padding: 8px 12px;
        border-radius: 6px;
        border-left: none;
        border-bottom: 2px solid transparent;
        font-size: 13px;
        gap: 8px;
    }
    
    .sidebar-link.active {
        background: rgba(34, 139, 191, 0.1);
        border-bottom-color: var(--sidebar-active);
    }
    
    .sidebar-footer-links {
        display: flex;
        justify-content: center;
        gap: 8px;
        padding: 8px;
        border-top: 1px solid rgba(255,255,255,0.07);
        width: 100%;
    }
    
    .owner-content {
        width: 100%;
    }
    
    .dashboard-container {
        padding: 16px 12px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.78rem;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .filter-tabs {
        padding: 6px;
        gap: 4px;
    }
    
    .filter-tab {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar-nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sidebar-footer-links {
        flex-direction: column;
    }
}

/* ─── Pagination ─────────────────────────────────── */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    transition: all 0.15s;
}

.pagination-btn:hover:not(.disabled),
.pagination-num:hover:not(.active) {
    border-color: var(--brand-orange);
    color: var(--brand-orange);
}

.pagination-num.active {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #fff;
}

.pagination-btn.disabled,
.pagination-num.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.action-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
    border: none;
}

.btn-danger:hover {
    background: #c0392b;
    color: #fff;
}

