/* ═══════════════════════════════════════════════════
   MIDNIGHT LEDGER — eBay Manager Design System
   A dark, refined financial-terminal aesthetic
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Core palette */
    --surface-0: #0f1117;
    --surface-1: #161821;
    --surface-2: #1c1f2b;
    --surface-3: #252836;
    --surface-4: #2e3245;

    /* Text hierarchy */
    --text-primary: #e8e6e1;
    --text-secondary: #9a9cab;
    --text-tertiary: #6b6d7b;
    --text-inverse: #0f1117;

    /* Accent: Warm amber/gold */
    --accent: #e4a853;
    --accent-muted: rgba(228, 168, 83, 0.15);
    --accent-glow: rgba(228, 168, 83, 0.3);
    --accent-hover: #f0be6e;

    /* Semantic colors */
    --positive: #5be5a9;
    --positive-muted: rgba(91, 229, 169, 0.12);
    --negative: #f06868;
    --negative-muted: rgba(240, 104, 104, 0.12);
    --info: #6dacf0;
    --info-muted: rgba(109, 172, 240, 0.12);
    --warning: #e4a853;
    --warning-muted: rgba(228, 168, 83, 0.12);

    /* Platform colors */
    --ebay-color: #6dacf0;
    --shopify-color: #8ec760;
    --both-color: #b495f0;

    /* Borders & dividers */
    --border: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.1);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(228, 168, 83, 0.08);

    /* Typography */
    --font-display: 'Outfit', sans-serif;
    --font-mono: 'DM Mono', 'Consolas', monospace;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition: all 0.2s var(--ease);
    --transition-slow: all 0.4s var(--ease);
}

/* ─── BASE ─────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--surface-0);
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
}

::selection {
    background: var(--accent);
    color: var(--text-inverse);
}

/* ─── NAVBAR ───────────────────────────────────── */

.navbar {
    background: #000 !important;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
    backdrop-filter: blur(12px);
}

.navbar-brand {
    transition: var(--transition);
    padding: 0.5rem 0;
}

.navbar-brand:hover {
    opacity: 0.85;
}

.navbar-logo {
    height: 36px;
    width: auto;
    display: block;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin: 0.25rem 0.125rem;
    letter-spacing: 0.01em;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--text-primary);
    background: var(--surface-3);
}

.navbar-dark .navbar-nav .nav-link.active,
.navbar-dark .navbar-nav .nav-link.show {
    color: var(--accent);
}

.navbar-toggler {
    border-color: var(--border);
}

.navbar-toggler-icon {
    filter: brightness(0.8);
}

/* ─── DROPDOWNS ────────────────────────────────── */

.dropdown-menu {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.25rem;
    animation: dropdown-enter 0.15s var(--ease);
}

@keyframes dropdown-enter {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--surface-3);
    color: var(--text-primary);
}

.dropdown-item i {
    opacity: 0.6;
}

.dropdown-divider {
    border-color: var(--border);
    margin: 0.375rem 0;
}

.dropdown-header {
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.75rem 0.25rem;
}

/* ─── CARDS ────────────────────────────────────── */

.card {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    color: var(--text-primary);
}

.card:hover {
    border-color: var(--border-strong);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-header i {
    color: var(--accent);
    font-size: 1rem;
}

.card-header.bg-primary {
    background: linear-gradient(135deg, rgba(109, 172, 240, 0.15) 0%, rgba(109, 172, 240, 0.05) 100%) !important;
    color: var(--ebay-color) !important;
    border-bottom-color: rgba(109, 172, 240, 0.1);
}

.card-header.bg-success {
    background: linear-gradient(135deg, rgba(142, 199, 96, 0.15) 0%, rgba(142, 199, 96, 0.05) 100%) !important;
    color: var(--shopify-color) !important;
    border-bottom-color: rgba(142, 199, 96, 0.1);
}

.card-header.bg-secondary {
    background: linear-gradient(135deg, rgba(154, 156, 171, 0.1) 0%, transparent 100%) !important;
    color: var(--text-secondary) !important;
    border-bottom-color: var(--border);
}

.card-body {
    padding: 1.25rem;
}

.card.bg-light {
    background: var(--surface-2) !important;
    border-color: var(--border);
}

/* ─── STAT CARDS (Dashboard & Reports) ────────── */

.stat-card {
    border: 1px solid var(--border);
    border-left: 3px solid;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    opacity: 0.04;
    transition: var(--transition-slow);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 0.08;
}

.stat-card.sales {
    border-left-color: var(--positive);
}
.stat-card.sales::before {
    background: var(--positive);
}

.stat-card.expenses {
    border-left-color: var(--negative);
}
.stat-card.expenses::before {
    background: var(--negative);
}

.stat-card.profit {
    border-left-color: var(--accent);
}
.stat-card.profit::before {
    background: var(--accent);
}

.stat-card.items {
    border-left-color: var(--info);
}
.stat-card.items::before {
    background: var(--info);
}

.stat-card .stat-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.03em;
    margin-bottom: 0.125rem;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-family: var(--font-display);
}

/* ─── STATUS BADGES ────────────────────────────── */

.badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.badge-unlisted {
    background: var(--surface-4);
    color: var(--text-tertiary);
}

.badge-queued {
    background: var(--warning-muted);
    color: var(--accent);
}

.badge-listed_ebay {
    background: var(--info-muted);
    color: var(--ebay-color);
}

.badge-listed_shopify {
    background: rgba(142, 199, 96, 0.12);
    color: var(--shopify-color);
}

.badge-listed_both {
    background: rgba(180, 149, 240, 0.12);
    color: var(--both-color);
}

.badge-sold {
    background: var(--positive-muted);
    color: var(--positive);
}

.badge-returned {
    background: var(--negative-muted);
    color: var(--negative);
}

/* Bootstrap badge overrides */
.badge.bg-primary {
    background: var(--info-muted) !important;
    color: var(--ebay-color) !important;
}

.badge.bg-success {
    background: var(--positive-muted) !important;
    color: var(--positive) !important;
}

.badge.bg-danger {
    background: var(--negative-muted) !important;
    color: var(--negative) !important;
}

.badge.bg-warning {
    background: var(--warning-muted) !important;
    color: var(--accent) !important;
}

.badge.bg-info {
    background: var(--info-muted) !important;
    color: var(--info) !important;
}

.badge.bg-secondary {
    background: var(--surface-4) !important;
    color: var(--text-secondary) !important;
}

/* ─── CONDITION BADGES ─────────────────────────── */

.condition-1000 {
    background: var(--positive-muted);
    color: var(--positive);
}

.condition-4000 {
    background: var(--info-muted);
    color: var(--info);
}

.condition-5000 {
    background: var(--warning-muted);
    color: var(--accent);
}

.condition-6000 {
    background: rgba(240, 160, 80, 0.12);
    color: #f0a050;
}

.condition-7000 {
    background: var(--negative-muted);
    color: var(--negative);
}

/* ─── TABLES ───────────────────────────────────── */

.table {
    color: var(--text-primary);
    margin-bottom: 0;
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-hover-color: var(--text-primary);
}

.table thead th {
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-strong);
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.875rem 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    white-space: nowrap;
}

.table tbody td:has(a:not(.btn)) {
    white-space: normal;
}

.table .btn-group {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.table .btn-group .btn,
.table .btn-group-sm .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    min-width: 32px;
    padding: 0.35rem 0.6rem;
}

.table-hover tbody tr {
    transition: var(--transition);
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-hover-color: var(--text-primary);
    background-color: var(--surface-2) !important;
    color: var(--text-primary);
}

.table-hover tbody tr:hover td,
.table-hover tbody tr:hover td a,
.table-hover tbody tr:hover td .btn {
    color: inherit;
}

.table tfoot {
    font-weight: 600;
}

.table tfoot th {
    padding: 1rem;
    background: var(--surface-2);
    border-top: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.table-light,
.table-light th {
    background-color: var(--surface-2) !important;
    color: var(--text-primary) !important;
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--text-primary);
}

.table-secondary > td,
.table-secondary > th,
tr.table-secondary {
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--text-tertiary);
    opacity: 0.6;
}

.table-sm td,
.table-sm th {
    padding: 0.625rem 1rem;
}

/* ─── FORMS ────────────────────────────────────── */

.form-label {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.375rem;
    font-size: 0.85rem;
}

.form-control,
.form-select {
    background-color: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    background-color: var(--surface-3);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-muted);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%239a9cab' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.form-select option {
    background: var(--surface-2);
    color: var(--text-primary);
}

.form-text {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.form-check-input {
    background-color: var(--surface-3);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px var(--accent-muted);
    border-color: var(--accent);
}

.form-check-label {
    color: var(--text-secondary);
}

.invalid-feedback {
    color: var(--negative);
}

.is-invalid {
    border-color: var(--negative) !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
}

.form-control-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8rem;
}

/* ─── BUTTONS ──────────────────────────────────── */

.btn {
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    letter-spacing: 0.01em;
    font-family: var(--font-display);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--text-inverse);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-muted);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-success {
    background: var(--positive);
    border-color: var(--positive);
    color: var(--text-inverse);
}

.btn-danger {
    background: var(--negative);
    border-color: var(--negative);
    color: #fff;
}

.btn-warning {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

.btn-secondary {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--surface-4);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-strong);
    background: transparent;
}

.btn-outline-secondary:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-outline-danger {
    color: var(--negative);
    border-color: rgba(240, 104, 104, 0.3);
}

.btn-outline-danger:hover {
    background: var(--negative);
    border-color: var(--negative);
    color: #fff;
}

.btn-close {
    filter: invert(1) grayscale(100%) brightness(0.8);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-group-sm > .btn {
    padding: 0.35rem 0.6rem;
}

/* ─── LOGIN PAGE ───────────────────────────────── */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-0);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(228, 168, 83, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(109, 172, 240, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(91, 229, 169, 0.03) 0%, transparent 50%);
    animation: login-glow 20s ease-in-out infinite alternate;
}

@keyframes login-glow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, -2%) rotate(3deg); }
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 2rem;
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-primary);
}

.login-card h1 i {
    color: var(--accent);
    display: block;
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

/* ─── PAGE HEADERS ─────────────────────────────── */

h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0;
    letter-spacing: -0.02em;
}

h1 i {
    color: var(--accent);
    margin-right: 0.5rem;
    font-size: 1.5rem;
}

h5 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

h6 {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ─── ALERTS ───────────────────────────────────── */

.alert {
    border: none;
    border-radius: var(--radius-md);
    border-left: 3px solid;
    font-size: 0.875rem;
}

.alert-success {
    background: var(--positive-muted);
    color: var(--positive);
    border-left-color: var(--positive);
}

.alert-danger {
    background: var(--negative-muted);
    color: var(--negative);
    border-left-color: var(--negative);
}

.alert-info {
    background: var(--info-muted);
    color: var(--info);
    border-left-color: var(--info);
}

.alert-warning {
    background: var(--warning-muted);
    color: var(--accent);
    border-left-color: var(--accent);
}

/* ─── SEARCH & FILTER BARS ─────────────────────── */

.search-form {
    background: var(--surface-1);
    padding: 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

/* ─── CODE / SKU DISPLAY ───────────────────────── */

code {
    font-family: var(--font-mono);
    background: var(--surface-3);
    color: var(--accent);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
}

/* ─── LINKS ────────────────────────────────────── */

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ─── TEXT UTILITIES ───────────────────────────── */

.text-success {
    color: var(--positive) !important;
}

.text-danger {
    color: var(--negative) !important;
}

.text-primary {
    color: var(--accent) !important;
}

.text-muted {
    color: var(--text-tertiary) !important;
}

.text-dark {
    color: var(--text-primary) !important;
}

.text-white {
    color: var(--text-primary) !important;
}

.fw-bold,
strong {
    font-weight: 600;
}

/* ─── PAGINATION ───────────────────────────────── */

.pagination {
    gap: 0.25rem;
}

.page-link {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    transition: var(--transition);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.page-link:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
    color: var(--accent);
}

.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--text-inverse);
}

/* ─── TABS ─────────────────────────────────────── */

.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-tertiary);
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--text-secondary);
    border-bottom-color: var(--surface-4);
}

.nav-tabs .nav-link.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
    background: transparent;
}

.tab-content .tab-pane {
    padding-top: 0;
}

/* ─── BULK ACTIONS BAR ─────────────────────────── */

.bulk-actions {
    background: var(--surface-2);
    border: 1px solid var(--accent-muted);
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    display: none;
}

.bulk-actions.show {
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slide-down 0.2s var(--ease);
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.selected-count {
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

/* ─── MODALS ───────────────────────────────────── */

.modal-content {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
}

.modal-backdrop.show {
    opacity: 0.7;
}

/* ─── TEMPLATE EDITOR ──────────────────────────── */

.template-editor {
    font-family: var(--font-mono);
    font-size: 13px;
    min-height: 400px;
    background: var(--surface-0) !important;
    border-color: var(--border-strong) !important;
    color: var(--text-primary);
    line-height: 1.6;
}

.template-preview {
    border: 1px solid var(--border);
    padding: 1rem;
    min-height: 400px;
    background: #fff;
    border-radius: var(--radius-sm);
    color: #333;
}

/* ─── ACTIVITY LOG ─────────────────────────────── */

.activity-item {
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    transition: var(--transition);
}

.activity-item:hover {
    border-left-color: var(--text-tertiary);
}

.activity-item.create {
    border-left-color: var(--positive);
}

.activity-item.update {
    border-left-color: var(--accent);
}

.activity-item.delete {
    border-left-color: var(--negative);
}

.activity-timeline h6 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    border-bottom-color: var(--border) !important;
}

/* ─── IMPORT OUTPUT ────────────────────────────── */

#importOutput {
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-all;
    background: var(--surface-0) !important;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.75rem !important;
    font-size: 0.8rem;
}

/* ─── QUICK ACTIONS (FAB) ──────────────────────── */

.quick-actions {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.quick-actions .btn {
    border-radius: 50%;
    width: 50px;
    height: 50px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.quick-actions .btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* ─── LIST GROUPS ──────────────────────────────── */

.list-group-item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.list-group-item:hover {
    background: var(--surface-2);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-flush > .list-group-item:first-child {
    border-top: none;
}

/* ─── LOADING STATES ───────────────────────────── */

.spinner-border {
    border-color: var(--accent);
    border-right-color: transparent;
}

/* ─── MAIN CONTENT AREA ───────────────────────── */

main.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
}

/* ─── INVENTORY STATUS LINKS ───────────────────── */

.card-body .row.text-center a {
    display: block;
    padding: 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    color: var(--text-primary);
}

.card-body .row.text-center a:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
}

.card-body .row.text-center a .h3 {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-primary);
}

/* ─── ITEM THUMBNAILS ──────────────────────────── */

.item-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* ─── RESPONSIVE TABLES ────────────────────────── */

@media (max-width: 768px) {
    main.container-fluid {
        padding: 1rem;
    }

    .table-responsive-stack thead {
        display: none;
    }

    .table-responsive-stack tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        background: var(--surface-1);
    }

    .table-responsive-stack tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem 1rem;
        border-bottom: 1px solid var(--border);
    }

    .table-responsive-stack tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: var(--text-tertiary);
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* ─── HORIZONTAL RULE ──────────────────────────── */

hr {
    border-color: var(--border);
    opacity: 1;
}

/* ─── CHART CONTAINER ──────────────────────────── */

.chart-container {
    position: relative;
    height: 300px;
}

/* ─── BORDER BOTTOM UTILITIES ──────────────────── */

.border-bottom {
    border-bottom-color: var(--border) !important;
}

/* ─── SCROLLBAR STYLING ────────────────────────── */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-0);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-4);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* ─── PAGE LOAD ANIMATION ──────────────────────── */

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

main > * {
    animation: fade-up 0.3s var(--ease) both;
}

main > *:nth-child(1) { animation-delay: 0s; }
main > *:nth-child(2) { animation-delay: 0.05s; }
main > *:nth-child(3) { animation-delay: 0.1s; }
main > *:nth-child(4) { animation-delay: 0.15s; }
main > *:nth-child(5) { animation-delay: 0.2s; }

/* ─── SORT LINK STYLING ────────────────────────── */

.table thead th a {
    color: var(--text-tertiary);
}

.table thead th a:hover {
    color: var(--accent);
}

/* ─── CARD TITLE ───────────────────────────────── */

.card-title {
    color: var(--text-primary);
}

/* ─── BG UTILITIES ─────────────────────────────── */

.bg-light {
    background-color: var(--surface-2) !important;
}

/* ─── INPUT GROUP OVERRIDES ────────────────────── */

.input-group .btn {
    border-color: var(--border-strong);
}

.input-group .form-control {
    border-color: var(--border-strong);
}

/* ─── DESCRIPTION LIST SPACING ─────────────────── */

dl.row dt {
    color: var(--text-tertiary);
    font-weight: 500;
}

dl.row dd {
    color: var(--text-primary);
}

/* ─── USER SELECT ALL ──────────────────────────── */

.user-select-all {
    cursor: pointer;
}

/* ─── TABLE RESPONSIVE WRAPPER ─────────────────── */

.table-responsive {
    border-radius: var(--radius-md);
}

/* ─── SMALL TEXT ───────────────────────────────── */

small, .small {
    color: var(--text-tertiary);
}

/* ─── NAV PILLS ────────────────────────────────── */

.nav-pills .nav-link {
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
}

.nav-pills .nav-link.active {
    background: var(--accent);
    color: var(--text-inverse);
}

/* ─── TITLE INPUT ──────────────────────────────── */

.form-control-title {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--font-display);
    padding: 0.6rem 0.85rem;
}

.form-control-title.over-limit {
    border-color: var(--negative) !important;
    box-shadow: 0 0 0 0.2rem rgba(240, 104, 104, 0.2);
}

.title-char-counter {
    font-family: var(--font-mono);
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.title-char-counter.over-limit {
    color: var(--negative);
    font-weight: 600;
}

/* ─── IMAGE UPLOAD ─────────────────────────────── */

.image-drop-zone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
    background: var(--surface-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.image-drop-zone:hover,
.image-drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-muted);
    color: var(--text-primary);
}

.image-drop-zone.drag-over i {
    color: var(--accent);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.image-card {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface-2);
    aspect-ratio: 1;
    cursor: grab;
    transition: var(--transition);
}

.image-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.image-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-primary-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--accent);
    color: var(--text-inverse);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-mono);
}

.image-card-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: var(--transition);
}

.image-card:hover .image-card-actions {
    opacity: 1;
}

.image-drag-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: var(--text-primary);
    padding: 0.5rem 0 0.25rem;
    opacity: 0;
    transition: var(--transition);
    font-size: 1.1rem;
}

.image-card:hover .image-drag-handle {
    opacity: 1;
}

/* ─── PRINT STYLES ─────────────────────────────── */

@media print {
    body {
        background: #fff;
        color: #000;
    }

    .navbar,
    .quick-actions,
    .bulk-actions,
    .btn {
        display: none !important;
    }

    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        background: #fff;
    }
}
