/* ==========================================================================
   Flipkart Label Crop - dark "glass" theme
   ========================================================================== */
:root {
    --bg: #080c1a;
    --glass: rgba(255, 255, 255, .06);
    --glass-hover: rgba(255, 255, 255, .10);
    --glass-brd: rgba(255, 255, 255, .13);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .08);
    --blue: #4f8cff;
    --violet: #9b6bff;
    --gold: #ffd23f;
    --green: #2fd18a;
    --red: #ff5d6c;
    --muted: #9aa6c4;
    --radius: 18px;
}

html, body { min-height: 100%; }
body {
    background: var(--bg);
    color: #e9edf8;
    font-size: 14px;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    position: relative;
}
/* soft colour orbs behind the glass */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(620px 420px at 8% 6%, rgba(79, 140, 255, .38), transparent 70%),
        radial-gradient(560px 460px at 92% 12%, rgba(155, 107, 255, .32), transparent 70%),
        radial-gradient(640px 520px at 78% 98%, rgba(255, 210, 63, .14), transparent 70%),
        radial-gradient(520px 420px at 12% 92%, rgba(47, 209, 138, .16), transparent 70%);
}
a { color: #86b0ff; text-decoration: none; }
a:hover { color: #b3ccff; }
.text-muted, .text-secondary { color: var(--muted) !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
.sidebar {
    width: 240px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    margin: 14px 0 14px 14px; height: calc(100vh - 28px);
    background: var(--glass); backdrop-filter: blur(22px) saturate(150%); -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--glass-brd); border-radius: 22px; box-shadow: var(--glass-shadow);
}
.sidebar .brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px; color: #fff; font-size: 20px; border-bottom: 1px solid var(--glass-brd); }
.sidebar .brand i {
    background: linear-gradient(135deg, #ffe66d, #ffb703); color: #1b1f33; width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center; font-size: 19px; box-shadow: 0 6px 18px rgba(255, 183, 3, .4);
}
.sidebar .brand span { line-height: 1.1; font-weight: 600; }
.sidebar .brand b { background: linear-gradient(90deg, #ffe66d, #ffb703); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sidebar .brand small { display: block; font-size: 10px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; font-weight: 500; }
.sidebar .nav { padding: 16px 12px; gap: 6px; }
.sidebar .nav-link { color: #c3cce3; border-radius: 12px; padding: 11px 14px; display: flex; gap: 12px; align-items: center; font-weight: 500; transition: .18s; }
.sidebar .nav-link:hover { background: var(--glass-hover); color: #fff; }
.sidebar .nav-link.active { background: linear-gradient(135deg, rgba(79, 140, 255, .85), rgba(155, 107, 255, .85)); color: #fff; box-shadow: 0 8px 22px rgba(79, 140, 255, .35); }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar-foot { margin-top: auto; padding: 18px 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--glass-brd); }

/* ---------- content ---------- */
.content { flex: 1; padding: 24px 30px 50px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -.3px; }

/* ---------- glass surfaces ---------- */
.card, .toolbar, .glass, .modal-content {
    background: var(--glass) !important;
    backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--glass-brd) !important; border-radius: var(--radius) !important;
    box-shadow: var(--glass-shadow); color: inherit;
}
.toolbar { padding: 14px 16px; }
.card-header { background: rgba(255, 255, 255, .04) !important; border-bottom: 1px solid var(--glass-brd) !important; font-weight: 600; border-radius: var(--radius) var(--radius) 0 0 !important; color: #fff; }
.list-group-item { background: transparent; border-color: var(--glass-brd); color: inherit; }
.alert { border-radius: 14px; backdrop-filter: blur(14px); border: 1px solid var(--glass-brd); }
.alert-success { background: rgba(47, 209, 138, .16); color: #aef0d2; }
.alert-danger { background: rgba(255, 93, 108, .16); color: #ffc2c8; }

/* ---------- stat cards ---------- */
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; transition: .2s; }
.stat:hover { transform: translateY(-3px); background: var(--glass-hover) !important; }
.stat .icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 23px; color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.stat .num { font-size: 27px; font-weight: 700; line-height: 1.1; color: #fff; }
.stat .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.bg-fk { background: linear-gradient(135deg, #4f8cff, #2a5bd7); }
.bg-green { background: linear-gradient(135deg, #2fd18a, #14946a); }
.bg-orange { background: linear-gradient(135deg, #ffb703, #fb8500); }
.bg-purple { background: linear-gradient(135deg, #9b6bff, #6a3de8); }
.bg-red { background: linear-gradient(135deg, #ff5d6c, #d12a4a); }
.bg-teal { background: linear-gradient(135deg, #22d3ee, #0891b2); }

/* ---------- buttons ---------- */
.btn { border-radius: 11px; font-weight: 500; transition: .18s; }
.btn-fk, .btn-primary { background: linear-gradient(135deg, #4f8cff, #8a5cff); color: #fff; border: 0; box-shadow: 0 6px 20px rgba(100, 110, 255, .38); }
.btn-fk:hover, .btn-primary:hover { background: linear-gradient(135deg, #6a9fff, #9d73ff); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(100, 110, 255, .5); }
.btn-yellow { background: linear-gradient(135deg, #ffe66d, #ffb703); color: #1b1f33; border: 0; font-weight: 600; box-shadow: 0 6px 20px rgba(255, 183, 3, .32); }
.btn-yellow:hover { color: #1b1f33; transform: translateY(-1px); filter: brightness(1.06); }
.btn-outline-primary { color: #9cbcff; border-color: rgba(134, 176, 255, .45); background: rgba(79, 140, 255, .07); }
.btn-outline-primary:hover { background: rgba(79, 140, 255, .28); border-color: #86b0ff; color: #fff; }
.btn-outline-secondary { color: #c3cce3; border-color: var(--glass-brd); background: rgba(255, 255, 255, .04); }
.btn-outline-secondary:hover { background: var(--glass-hover); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn-outline-danger { color: #ff8e99; border-color: rgba(255, 93, 108, .45); background: rgba(255, 93, 108, .06); }
.btn-outline-danger:hover { background: rgba(255, 93, 108, .3); color: #fff; }
.btn-outline-success { color: #6fe3b0; border-color: rgba(47, 209, 138, .5); }
.btn-outline-success:hover { background: rgba(47, 209, 138, .25); color: #fff; }
.btn-success { background: linear-gradient(135deg, #2fd18a, #14946a); border: 0; }
.btn-light { background: rgba(255, 255, 255, .1); color: #e9edf8; border: 1px solid var(--glass-brd); }
.btn-light:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.btn:disabled { opacity: .45; }

/* ---------- forms ---------- */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, .06); border: 1px solid var(--glass-brd); color: #fff; border-radius: 11px;
}
.form-control::placeholder { color: #7f8bab; }
.form-control:focus, .form-select:focus { background-color: rgba(255, 255, 255, .1); border-color: var(--blue); box-shadow: 0 0 0 .22rem rgba(79, 140, 255, .25); color: #fff; }
.form-select option { background: #131a33; color: #fff; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85); cursor: pointer; }
.form-label { color: var(--muted); }
.form-check-input { background-color: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .3); cursor: pointer; }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-check-input:indeterminate { background-color: var(--violet); border-color: var(--violet); }
.form-switch .form-check-input:checked { background-color: var(--green); border-color: var(--green); }

/* ---------- tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: #e9edf8; --bs-table-hover-bg: rgba(255, 255, 255, .06); --bs-table-hover-color: #fff; --bs-table-border-color: rgba(255, 255, 255, .08); --bs-table-striped-bg: transparent; }
.table > :not(caption) > * > * { padding: .65rem .85rem; vertical-align: middle; }
.table thead th { background: rgba(255, 255, 255, .05); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); white-space: nowrap; font-weight: 600; border-bottom-color: var(--glass-brd); }
.table-light, .table-light > td, tr.table-light > * { --bs-table-bg: rgba(255, 255, 255, .06); --bs-table-color: #fff; color: #fff; }
.table-responsive { border-radius: var(--radius); }

/* ---------- pills / badges ---------- */
.nav-pills .nav-link { color: #c3cce3; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-brd); margin-right: 6px; backdrop-filter: blur(12px); }
.nav-pills .nav-link:hover { background: var(--glass-hover); color: #fff; }
.nav-pills .nav-link.active { background: linear-gradient(135deg, #4f8cff, #8a5cff); color: #fff; box-shadow: 0 6px 20px rgba(100, 110, 255, .4); border-color: transparent; }
.sku-badge { background: rgba(79, 140, 255, .18); color: #b9d0ff; border: 1px solid rgba(79, 140, 255, .35); padding: 4px 11px; border-radius: 9px; font-weight: 600; display: inline-block; }
.qty-badge { background: linear-gradient(135deg, #ffe66d, #ffb703); color: #1b1f33; padding: 2px 10px; border-radius: 20px; font-weight: 700; }
.seller-badge { background: rgba(155, 107, 255, .18); color: #d2bcff; border: 1px solid rgba(155, 107, 255, .35); padding: 2px 9px; border-radius: 8px; font-size: 12px; display: inline-block; }
.pay { padding: 2px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; }
.cod { background: rgba(255, 159, 28, .18); color: #ffc477; }
.prepaid { background: rgba(47, 209, 138, .18); color: #7fe6b8; }

/* ---------- upload dropzone ---------- */
.dropzone { border: 2px dashed rgba(134, 176, 255, .45); border-radius: 22px; background: rgba(255, 255, 255, .04); padding: 54px 20px; text-align: center; cursor: pointer; transition: .2s; display: block; }
.dropzone:hover, .dropzone.drag { border-color: var(--gold); background: rgba(255, 210, 63, .07); transform: scale(1.005); }
.dropzone i { font-size: 54px; background: linear-gradient(135deg, #86b0ff, #b48cff); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- chart ---------- */
.bars { display: flex; align-items: flex-end; gap: 9px; height: 190px; padding-top: 10px; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bars .bar { width: 100%; max-width: 34px; background: linear-gradient(180deg, #86b0ff, #4f8cff 55%, #3a5fe0); border-radius: 8px 8px 0 0; min-height: 3px; box-shadow: 0 0 18px rgba(79, 140, 255, .35); }
.bars .bar.today { background: linear-gradient(180deg, #ffe66d, #ffb703); box-shadow: 0 0 20px rgba(255, 183, 3, .5); }
.bars .val { font-size: 11px; font-weight: 600; margin-bottom: 3px; color: #fff; }
.bars .day { font-size: 10px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

/* ---------- labels page: tabs + groups ---------- */
.tab-switch { display: inline-flex; padding: 5px; gap: 5px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-brd); backdrop-filter: blur(16px); }
.tab-switch a { padding: 10px 22px; border-radius: 12px; color: #c3cce3; font-weight: 600; display: flex; align-items: center; gap: 9px; transition: .18s; }
.tab-switch a:hover { color: #fff; background: var(--glass-hover); }
.tab-switch a.active { background: linear-gradient(135deg, #4f8cff, #8a5cff); color: #fff; box-shadow: 0 8px 22px rgba(100, 110, 255, .45); }
.tab-switch .cnt { background: rgba(255, 255, 255, .2); padding: 1px 9px; border-radius: 20px; font-size: 12px; }
.tab-switch a.active.old { background: linear-gradient(135deg, #2fd18a, #0f9d8a); box-shadow: 0 8px 22px rgba(47, 209, 138, .35); }

.sticky-actions { position: sticky; top: 10px; z-index: 30; }

.group { margin-bottom: 12px; overflow: hidden; transition: .2s; }
.group:hover { border-color: rgba(255, 255, 255, .25) !important; }
.group-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px; cursor: pointer; flex-wrap: wrap; }
.group-head .chev { transition: transform .2s; color: var(--muted); font-size: 16px; }
.group.open .group-head .chev { transform: rotate(90deg); color: #fff; }
.group-head .sku-title { font-size: 16px; font-weight: 600; color: #fff; }
.group-head .qty-chip { background: linear-gradient(135deg, #ffe66d, #ffb703); color: #1b1f33; padding: 3px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; }
.day-block { position: relative; }
.day-head {
    position: sticky; top: 0; z-index: 4;
    padding: 14px 18px; margin-bottom: 12px;
    border-radius: 16px;
    background: rgba(20, 24, 45, .78);
    border: 1px solid rgba(255, 255, 255, .1);
    backdrop-filter: blur(14px);
}
.day-title { font-size: 1.15rem; font-weight: 700; color: #fff; }
.day-stats { color: var(--muted); font-size: 13px; }
.day-stats > span { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.05); }
.cost-card .card-header { font-weight: 600; }
.cost-table input.form-control-sm { min-width: 70px; }
.cost-table .lot-row input.lot-qty { min-width: 64px; }
.cost-table .lot-row input.lot-price { min-width: 80px; }
.cost-table .lot-add { margin-top: 2px; font-weight: 700; letter-spacing: .5px; }
.cost-table .avg-buy { color: #9ec1ff; font-size: 13px; }

.group-head .money-chip { margin-left: auto; text-align: right; line-height: 1.2; }
.group-head .money-chip b { font-size: 17px; color: #fff; display: block; }
.group-head .money-chip small { font-size: 11px; font-weight: 600; }
.group-head .orders-count { margin-left: 14px; text-align: right; line-height: 1.1; }
.group-head .orders-count b { font-size: 26px; color: #fff; display: block; }
.group-head .orders-count small { color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-size: 10px; }
.group-body { display: none; border-top: 1px solid var(--glass-brd); background: rgba(0, 0, 0, .16); }
.group.open .group-body { display: block; }
.group.done { opacity: .55; }
.thumb { width: 54px; height: 72px; object-fit: cover; object-position: top; border: 1px solid var(--glass-brd); border-radius: 8px; background: #fff; cursor: zoom-in; transition: .2s; }
.thumb:hover { transform: scale(1.08); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state i { font-size: 54px; display: block; margin-bottom: 8px; opacity: .6; }
.hint { color: var(--muted); font-size: 12px; }

.modal-backdrop.show { opacity: .7; }
.btn-close { filter: invert(1); }
.dropdown-menu { background: #151b33; border: 1px solid var(--glass-brd); }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .content { padding: 14px; }
    .group-head .orders-count { margin-left: 0; }
    .group-head .money-chip { margin-left: 0; text-align: left; }
}
