/* =============================================
   ERP MARKETPLACE - Main CSS
   Design: Dark Premium UI with Glassmorphism
   ============================================= */

/* -- Google Fonts & Reset -- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #6C63FF;
    --primary-dark: #554ED3;
    --primary-glow: rgba(108, 99, 255, 0.25);
    --success: #10B981;
    --success-glow: rgba(16, 185, 129, 0.25);
    --warning: #F59E0B;
    --warning-glow: rgba(245, 158, 11, 0.25);
    --danger: #EF4444;
    --danger-glow: rgba(239, 68, 68, 0.25);
    --purple: #8B5CF6;
    --purple-glow: rgba(139, 92, 246, 0.25);
    --info: #06B6D4;

    --bg: #0F1117;
    --bg-card: #1A1D27;
    --bg-card2: #1F2333;
    --border: rgba(255, 255, 255, 0.07);
    --border-light: rgba(255, 255, 255, 0.12);

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;

    --sidebar-w: 260px;
    --topbar-h: 64px;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);

    --shopee: #EE4D2D;
    --tiktok: #010101;
    --tokopedia: #03AC0E;
    --lazada: #0F146B;
    --blibli: #0085CA;
}

html {
    font-size: 14px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =============================================
   AUTH PAGES
   ============================================= */
.auth-body {
    background: #080B14;
}

.auth-bg {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 8s ease-in-out infinite;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: var(--purple);
    bottom: -100px;
    right: -100px;
    animation-delay: 3s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: var(--success);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 6s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-20px) scale(1.05);
    }
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: rgba(26, 29, 39, 0.85);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-brand-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 32px var(--primary-glow);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
}

.channel-logos {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.channel-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.shopee-pill {
    background: rgba(238, 77, 45, 0.15);
    color: var(--shopee);
    border: 1px solid rgba(238, 77, 45, 0.3);
}

.tiktok-pill {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.tokped-pill {
    background: rgba(3, 172, 14, 0.12);
    color: var(--tokopedia);
    border: 1px solid rgba(3, 172, 14, 0.3);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 0.9rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem 0.7rem 2.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(108, 99, 255, 0.06);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 0.9rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check-input {
    accent-color: var(--primary);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.check-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.btn-auth {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.8rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 20px var(--primary-glow);
    font-family: 'Inter', sans-serif;
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--primary-glow);
}

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

.auth-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    color: #FCA5A5;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-hint {
    margin-top: 1.25rem;
    text-align: center;
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.demo-hint strong {
    color: var(--primary);
}

/* =============================================
   MAIN APP LAYOUT
   ============================================= */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar {
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    padding: 1.5rem 1rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
}

.sidebar.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sidebar-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    z-index: 10000;
}

.sidebar-close-btn:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.sidebar-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0 0.5rem;
    border-bottom: none;
    margin-bottom: 1.5rem;
    text-align: left;
    width: 100%;
}

.brand-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.brand-text {
    line-height: 1.15;
}

.brand-name {
    display: block;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.brand-sub {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tenant-badge {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    margin: 0 0 1.5rem 0;
    width: 100%;
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: var(--radius-sm);
}

.tenant-avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
}

.tenant-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.tenant-role {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.sidebar-nav {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 1rem 0.5rem 0.5rem;
    text-align: left;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    margin-bottom: 0.15rem;
    justify-content: flex-start;
}

.nav-item i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.nav-item[aria-expanded="true"] .fa-chevron-down {
    transform: rotate(180deg);
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 0 0 0;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
    width: 100%;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.logout-btn i {
    width: 18px;
    text-align: center;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* --- TOPBAR --- */
.main-content {
    margin-left: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s;
}

.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s, background 0.2s;
}

.sidebar-toggle:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.topbar-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
}

/* --- PAGE CONTENT --- */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* --- ALERTS --- */
.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

/* =============================================
   DASHBOARD - COMPONENTS
   ============================================= */

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.25rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-primary .stat-icon {
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary);
}

.stat-success .stat-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.stat-purple .stat-icon {
    background: rgba(139, 92, 246, 0.15);
    color: var(--purple);
}

.stat-warning .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-weight: 500;
}

.stat-glow {
    position: absolute;
    right: -30px;
    top: -30px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    filter: blur(30px);
    opacity: 0.15;
}

.stat-primary .stat-glow {
    background: var(--primary);
}

.stat-success .stat-glow {
    background: var(--success);
}

.stat-purple .stat-glow {
    background: var(--purple);
}

.stat-warning .stat-glow {
    background: var(--warning);
}

/* Section Title */
.section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--primary);
}

/* Store Cards */
.stores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}

.store-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    transition: transform 0.2s, border-color 0.2s;
    cursor: default;
}

.store-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.store-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.channel-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.channel-shopee {
    background: rgba(238, 77, 45, 0.15);
    color: var(--shopee);
    border: 1px solid rgba(238, 77, 45, 0.25);
}

.channel-tiktok {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.channel-tokopedia {
    background: rgba(3, 172, 14, 0.12);
    color: var(--tokopedia);
    border: 1px solid rgba(3, 172, 14, 0.25);
}

.channel-lazada {
    background: rgba(15, 20, 107, 0.3);
    color: #5C6BFF;
    border: 1px solid rgba(92, 107, 255, 0.25);
}

.channel-blibli {
    background: rgba(0, 133, 202, 0.12);
    color: var(--blibli);
    border: 1px solid rgba(0, 133, 202, 0.25);
}

.store-status {
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.status-connected {
    color: var(--success);
}

.status-connected .status-dot {
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.status-disconnected {
    color: var(--danger);
}

.status-disconnected .status-dot {
    background: var(--danger);
}

.store-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
}

.store-stat {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Dashboard Bottom Grid */
.dashboard-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
}

@media (max-width: 900px) {
    .dashboard-bottom-grid {
        grid-template-columns: 1fr;
    }
}

.dashboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.card-header-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.card-header-line h3 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.view-all-link {
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Data Table */
.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.data-table thead th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
}

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

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.mono {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.8rem;
}

.fw-bold {
    font-weight: 700;
    color: var(--text-primary) !important;
}

/* Channel Tag (in table) */
.channel-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
}

/* Status Badges */
.badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-primary {
    background: rgba(108, 99, 255, 0.15);
    color: var(--primary);
}

.badge-info {
    background: rgba(6, 182, 212, 0.15);
    color: var(--info);
}

.badge-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

.badge-dark {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

/* Low Stock Items */
.stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

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

.stock-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stock-sku {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.stock-right {
    text-align: right;
    flex-shrink: 0;
}

.stock-number {
    font-size: 1.1rem;
    font-weight: 800;
}

.stock-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

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

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

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

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

.text-center {
    text-align: center;
}

/* Empty States */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
}

.empty-state i {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    display: block;
}

.empty-state p {
    font-size: 0.88rem;
    margin-bottom: 1rem;
}

.empty-mini {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-mini i {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    display: block;
}

.empty-mini p {
    font-size: 0.85rem;
}

/* Button */
.btn-primary-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    color: white;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Inter', sans-serif;
}

.btn-primary-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--primary-glow);
}

/* Collapsed sidebar */
.sidebar.collapsed {
    width: 0;
}

.sidebar.collapsed+.main-content {
    margin-left: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 10px;
}

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

/* =============================================
   FORM PAGES
   ============================================= */
.form-page-wrapper {
    max-width: 1100px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.btn-back:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form-row-2 {
        grid-template-columns: 1fr;
    }
}

.form-group+.form-group,
.form-row-2+.form-group,
.form-group+.form-row-2,
.form-row-2+.form-row-2 {
    margin-top: 1rem;
}

.form-row-2>.form-group+.form-group,
.form-row-3>.form-group+.form-group {
    margin-top: 0;
}

.field-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.field-error::before {
    content: '⚠ ';
}

.field-hint {
    font-size: 0.73rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.required {
    color: var(--danger);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-danger-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.btn-danger-sm:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Channel Selector Cards */
.channel-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.65rem;
}

.channel-select-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 0.5rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.03);
    position: relative;
}

.channel-select-card input[type="radio"] {
    display: none;
}

.channel-select-card:hover {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.07);
}

.channel-select-card.selected {
    border-color: var(--primary);
    background: rgba(108, 99, 255, 0.12);
}

.channel-select-card.selected::after {
    content: '✓';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--primary);
}

.channel-select-icon {
    font-size: 1.3rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.channel-shopee .channel-select-icon {
    background: rgba(238, 77, 45, 0.15);
    color: var(--shopee);
}

.channel-tiktok .channel-select-icon {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.channel-tokopedia .channel-select-icon {
    background: rgba(3, 172, 14, 0.12);
    color: var(--tokopedia);
}

.channel-lazada .channel-select-icon {
    background: rgba(92, 107, 255, 0.15);
    color: #5C6BFF;
}

.channel-blibli .channel-select-icon {
    background: rgba(0, 133, 202, 0.12);
    color: var(--blibli);
}

.channel-select-name {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Detail View Rows */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    gap: 1rem;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.detail-value {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

/* select style override */
select.form-input {
    cursor: pointer;
}

select.form-input option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* =============================================
   POS & FORM OVERRIDES
   ============================================= */

.pos-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.blue-total-box {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 8px;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
}

.blue-total-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    opacity: 0.2;
}

.total-label {
    font-size: 1rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 5px;
}

.total-amount {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.pos-table th {
    background-color: var(--bg-body);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 12px 10px;
    border-bottom: 2px solid var(--border);
}

.pos-table td {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.pos-summary {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    font-weight: 600;
    padding: 15px 10px;
    background-color: var(--bg-body);
    border-bottom: 1px solid var(--border);
}

.form-control-dark,
.form-select-dark {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

.form-control-dark:focus,
.form-select-dark:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(108, 99, 255, 0.25) !important;
}

.form-control-dark:disabled,
.form-control-dark[readonly],
.form-select-dark:disabled {
    background-color: var(--bg-body) !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
}

.form-label-pos {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.entry-bar-box {
    background-color: var(--bg-body);
    border: 1px solid var(--border);
}

/* Tweak Select2 Colors for Dark Theme */
.select2-container--bootstrap-5 .select2-selection--single {
    background-color: var(--bg-card) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border) !important;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
    color: var(--text-primary) !important;
}

/* Fix Select2 inside Bootstrap 5 input-group */
.input-group>.select2-container {
    flex: 1 1 auto !important;
    width: 1% !important;
}

.input-group>.select2-container .select2-selection--single {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    height: 38px !important;
    display: flex !important;
    align-items: center !important;
}

.input-group>.select2-container .select2-selection__rendered {
    line-height: 36px !important;
}

.input-group>.select2-container .select2-selection__arrow {
    height: 36px !important;
}

/* Tab Buttons and Navigation */
.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
}

.status-pending {
    background: rgba(234, 179, 8, 0.15);
    color: #ca8a04;
}

.status-processing {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.status-success {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.status-failed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.err-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.peta-form-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.peta-form-inline input[type="text"],
.peta-form-inline select {
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.8rem;
    min-width: 160px;
}

.peta-form-inline button {
    white-space: nowrap;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* =============================================
   TABLES - Global size
   ============================================= */
.table {
    font-size: 0.78rem;
}
.table th {
    font-size: 0.7rem;
}
.table td {
    font-size: 0.78rem;
}