@import 'bootstrap/dist/css/bootstrap.min.css';
@import 'bootstrap-icons/font/bootstrap-icons.css';
@import 'datatables.net-bs5/css/dataTables.bootstrap5.min.css';
@import 'select2/dist/css/select2.min.css';
@import '@fontsource/manrope/400.css';
@import '@fontsource/manrope/500.css';
@import '@fontsource/manrope/600.css';
@import '@fontsource/manrope/700.css';
@import '@fontsource/manrope/800.css';

:root {
    --sidebar-width: 268px;

    --brand-primary: #f9b233;
    --brand-primary-dark: #c9860f;
    --brand-primary-light: #fdf1dc;
    --brand-accent: #f9b233;
    --brand-accent-dark: #e69a1a;
    --brand-accent-text: #23180a;

    --brand-gold: #f9b233;
    --brand-gold-dark: #e69a1a;
    --sidebar-bg: #1a1510;
    --sidebar-bg-active: rgba(249, 178, 51, .14);
    --sidebar-text: rgba(255, 255, 255, .68);
    --sidebar-text-muted: rgba(255, 255, 255, .38);
    --sidebar-border: rgba(255, 255, 255, .08);

    --bs-primary: #6366f1;
    --bs-primary-rgb: 99, 102, 241;
    --bs-success: #22c55e;
    --bs-success-rgb: 34, 197, 94;
    --bs-info: #0ea5e9;
    --bs-info-rgb: 14, 165, 233;
    --bs-warning: #f97316;
    --bs-warning-rgb: 249, 115, 22;
    --bs-danger: #ef4444;
    --bs-danger-rgb: 239, 68, 68;
    --bs-secondary: #8b5cf6;
    --bs-secondary-rgb: 139, 92, 246;

    --bs-body-bg: #f6f7fb;
    --bs-border-radius: .65rem;
    --bs-border-radius-sm: .5rem;
    --bs-border-radius-lg: .85rem;
    --bs-body-font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html {
    font-size: 14.5px;
}

body {
    background-color: var(--bs-body-bg);
    color: #1f2430;
    font-family: var(--bs-body-font-family);
}

/* ---------- Sidebar ---------- */
.app-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    overflow-y: auto;
    z-index: 1030;
    border-right: 1px solid var(--sidebar-border);
    transition: transform .2s ease-in-out;
}

.app-sidebar .nav-link {
    color: var(--sidebar-text);
    font-size: .9rem;
    border-radius: .6rem;
    margin: 1px 12px;
    padding: .55rem .8rem;
    display: flex;
    align-items: center;
    transition: background-color .15s ease, color .15s ease;
}

.app-sidebar .nav-link i {
    font-size: 1.05rem;
    width: 1.4rem;
}

.app-sidebar .nav-link.active,
.app-sidebar .nav-link:hover {
    color: var(--brand-gold);
    background-color: var(--sidebar-bg-active);
}

.app-sidebar .nav-link.active {
    font-weight: 600;
}

.app-sidebar .nav-header {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--sidebar-text-muted);
    padding: 1.1rem 1.25rem .35rem;
}

.app-sidebar .sidebar-brand {
    border-bottom: 1px solid var(--sidebar-border);
}

.app-sidebar .sidebar-brand .fw-semibold {
    color: #fff;
}

/* ---------- Buttons & links ---------- */
.btn-primary {
    --bs-btn-color: #23180a;
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-color: #23180a;
    --bs-btn-hover-bg: var(--brand-accent-dark);
    --bs-btn-hover-border-color: var(--brand-accent-dark);
    --bs-btn-focus-shadow-rgb: 249, 178, 51;
    --bs-btn-active-color: #23180a;
    --bs-btn-active-bg: var(--brand-accent-dark);
    --bs-btn-active-border-color: var(--brand-accent-dark);
    --bs-btn-disabled-color: #23180a;
    --bs-btn-disabled-bg: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
}

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

a:hover {
    color: var(--brand-accent-dark);
}

/* ---------- Content / topbar ---------- */
.app-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-topbar {
    background: #fff;
    border-bottom: 1px solid #eef0f5;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.app-topbar h5 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2430;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f6f7fb;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: background-color .15s ease;
}

.icon-btn:hover {
    background: var(--brand-primary-light);
    color: var(--brand-primary-dark);
}

.user-chip {
    border: none;
    background: #f6f7fb;
    border-radius: 999px;
    padding: .3rem .9rem .3rem .3rem;
}

.user-chip:hover {
    background: var(--brand-primary-light);
}

/* ---------- Cards ---------- */
.card {
    border: 1px solid #eef0f5;
    border-radius: 1rem;
}

.card.shadow-sm {
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04), 0 1px 2px rgba(16, 24, 40, .06) !important;
}

/* ---------- KPI stat cards ---------- */
.kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #eef0f5;
    border-radius: .85rem;
    background: #fff;
    padding: 1.1rem 1.3rem;
    height: 100%;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04), 0 1px 2px rgba(16, 24, 40, .06);
    transition: transform .15s ease, box-shadow .15s ease;
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, .1);
}

.kpi-card .kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.kpi-card .kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #1f2430;
}

.kpi-card .kpi-label {
    font-size: .8rem;
    color: #8b909e;
    margin-top: .1rem;
}

.region-bar {
    height: 8px;
    border-radius: 999px;
    background: #eef0f5;
    overflow: hidden;
}

.region-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-gold), var(--brand-gold-dark));
}

.status-badge {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ---------- Journey tracker (Flipkart-style step tracker) ---------- */
.journey-tracker {
    display: flex;
    align-items: flex-start;
    overflow-x: auto;
    padding: .5rem .25rem 1rem;
}

.journey-tracker .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    min-width: 92px;
}

.journey-tracker .step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    background: #eef0f5;
    color: #a0a5b1;
    border: 2px solid #eef0f5;
    transition: all .15s ease;
}

.journey-tracker .step.completed .step-circle {
    background: var(--bs-success);
    color: #fff;
    border-color: var(--bs-success);
}

.journey-tracker .step.current .step-circle {
    background: var(--brand-gold);
    color: #23180a;
    border-color: var(--brand-gold);
    animation: journey-pulse 1.8s ease-in-out infinite;
}

@keyframes journey-pulse {
    0% { box-shadow: 0 0 0 0 rgba(249, 178, 51, .45); }
    70% { box-shadow: 0 0 0 8px rgba(249, 178, 51, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 178, 51, 0); }
}

.journey-tracker .step-label {
    font-size: .7rem;
    margin-top: .5rem;
    text-align: center;
    color: #a0a5b1;
    max-width: 92px;
    line-height: 1.25;
}

.journey-tracker .step.completed .step-label,
.journey-tracker .step.current .step-label {
    color: #1f2430;
    font-weight: 600;
}

.journey-tracker .step-line {
    flex: 1 1 auto;
    height: 3px;
    min-width: 24px;
    background: #eef0f5;
    margin-top: 16px;
}

.journey-tracker .step-line.completed {
    background: var(--bs-success);
}

/* ---------- Vertical tracking timeline (Flipkart-style order detail) ---------- */
.tracking-timeline-item {
    position: relative;
}

.tracking-timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 13px;
    top: 28px;
    bottom: -4px;
    width: 2px;
    background: #eef0f5;
}

.tracking-timeline-item.completed:not(:last-child)::before {
    background: var(--bs-success);
}

.tracking-timeline-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .78rem;
    background: #eef0f5;
    color: #a0a5b1;
    z-index: 1;
}

.tracking-timeline-item.completed .tracking-timeline-dot {
    background: var(--bs-success);
    color: #fff;
}

.tracking-timeline-item.current .tracking-timeline-dot {
    background: var(--brand-gold);
    color: #23180a;
    animation: journey-pulse 1.8s ease-in-out infinite;
}

.table-light,
.table > :not(caption) > * > * {
    background-color: transparent;
}

.table {
    font-size: .87rem;
    margin-bottom: 0;
}

.table thead th {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #97a0ae;
    font-weight: 700;
    background: #fbfbfd;
    border-bottom: 1px solid #eef0f5;
    padding: .85rem 1rem;
    white-space: nowrap;
}

.table thead th:first-child,
.table > tbody > tr > td:first-child {
    padding-left: 1.25rem;
}

.table thead th:last-child,
.table > tbody > tr > td:last-child {
    padding-right: 1.25rem;
}

.table > tbody > tr > td {
    padding: .8rem 1rem;
    border-bottom-color: #f1f2f6;
    vertical-align: middle;
}

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

.table > tbody > tr:hover > td {
    background-color: #fbf8f1;
    transition: background-color .1s ease;
}

.table .cell-primary {
    font-weight: 600;
    color: #1f2430;
}

.table .cell-amount {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-content {
        margin-left: 0;
    }
}

/* ---------- Form sections (accent-bar heading + uppercase labels) ---------- */
.form-section + .form-section {
    margin-top: 2rem;
}

.form-section-heading {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #1f2430;
    margin-bottom: 1.25rem;
}

.form-section-heading::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: var(--brand-gold);
}

.form-label-caps {
    display: block;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    margin-bottom: .4rem;
}

/* ---------- List page toolbar (search/filter + result count) ---------- */
.list-toolbar {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: var(--bs-border-radius-lg);
    padding: 1.1rem 1.25rem;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .04), 0 1px 2px rgba(16, 24, 40, .06);
}

.list-result-count {
    font-size: .82rem;
    color: #8b909e;
    margin: 1rem 0 .6rem;
}

.table thead th .bi {
    color: #c3c7d1;
    margin-right: .35rem;
    font-size: .85rem;
}

/* ---------- Solid stat cards (bright summary tiles, brand-gold shades) ---------- */
.stat-card {
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem 1.5rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-card .stat-label {
    font-size: .85rem;
    font-weight: 500;
    opacity: .92;
    margin-top: .25rem;
}

.stat-card-gold { background: linear-gradient(135deg, #f9b233, #e69a1a); }
.stat-card-amber { background: linear-gradient(135deg, #fbc02d, #f57f17); }
.stat-card-mustard { background: linear-gradient(135deg, #d4a017, #a67c00); }
.stat-card-dark-gold { background: linear-gradient(135deg, #23180a, #4a3418); }
