/* =============================================
   ERP System - Main Stylesheet
   Business Central Inspired Design
   ============================================= */

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

:root {
    --primary: #0078d4;
    --primary-dark: #005a9e;
    --secondary: #00b7c3;
    --bc-teal: #69797e;
    --bc-bg: #f5f5f5;
    --bc-banner-bg: #d4ecec;
    --bc-banner-dark: #5f9ea0;
    --bg-dark: #1e1e2d;
    --bg-sidebar: #1a1a2e;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #333333;
    --text-muted: #666666;
    --text-light: #b2bec3;
    --border: #e0e0e0;
    --success: #00b894;
    --danger: #e74c3c;
    --warning: #fdcb6e;
    --radius: 4px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, 0.12);
    --sidebar-width: 250px;
    --sidebar-collapsed: 60px;
    --topbar-height: 48px;
    --transition: 0.25s ease;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    color: var(--text-dark);
    background: var(--bc-bg);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- Auth Pages --- */
.auth-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #16213e 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 12px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dark);
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border var(--transition);
}

.input-icon input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-block {
    width: 100%;
}

/* --- Alerts --- */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- App Layout --- */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.sidebar-logo i {
    color: var(--secondary);
    font-size: 20px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
}

.sidebar-toggle:hover {
    color: white;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-section-title {
    padding: 14px 16px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    color: var(--text-light);
    transition: all var(--transition);
    font-size: 13px;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-link.active {
    background: rgba(0, 120, 212, 0.15);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 14px;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 13px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

.logout-link {
    margin-top: 4px;
    color: var(--danger) !important;
    font-size: 13px;
}

.logout-link:hover {
    background: rgba(231, 76, 60, 0.1) !important;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin var(--transition);
}

.top-bar {
    height: var(--topbar-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-date {
    color: var(--text-muted);
    font-size: 13px;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-dark);
}

.content-area {
    padding: 0;
}

/* =============================================
   BUSINESS CENTRAL DASHBOARD
   ============================================= */

/* --- Top Quick Navigation --- */
.bc-topnav {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    gap: 4px;
}

.bc-topnav-link {
    padding: 6px 12px;
    font-size: 13px;
    color: var(--primary);
    border-radius: 3px;
    transition: background var(--transition);
    white-space: nowrap;
}

.bc-topnav-link:hover {
    background: #e8f0fe;
    color: var(--primary-dark);
}

.bc-topnav-spacer {
    flex: 1;
}

.bc-topnav-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 6px 8px;
    border-radius: 3px;
}

.bc-topnav-icon:hover {
    background: #e8f0fe;
    color: var(--primary);
}

/* --- Welcome Banner --- */
.bc-welcome-banner {
    position: relative;
    background: linear-gradient(135deg, #d4ecec 0%, #b8dde0 40%, #8ec5c8 70%, #5f9ea0 100%);
    margin: 0;
    padding: 40px 40px 40px 48px;
    display: flex;
    align-items: center;
    min-height: 240px;
    overflow: hidden;
}

.bc-welcome-content {
    flex: 1;
    max-width: 480px;
    z-index: 2;
}

.bc-welcome-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bc-welcome-content h1 {
    font-size: 28px;
    font-weight: 300;
    color: #1a3a3a;
    margin-bottom: 10px;
    line-height: 1.3;
}

.bc-welcome-content p {
    font-size: 14px;
    color: #3a5a5a;
    margin-bottom: 20px;
    line-height: 1.6;
}

.bc-welcome-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #2d6b6b;
    color: white;
    border: 1px solid #2d6b6b;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.bc-welcome-btn:hover {
    background: #1a5252;
    border-color: #1a5252;
}

.bc-welcome-illustration {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.bc-illustration-graphic {
    position: relative;
    width: 280px;
    height: 180px;
}

.bc-illus-window {
    position: absolute;
    top: 10px;
    left: 20px;
    width: 160px;
    height: 110px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 10px;
}

.bc-illus-dots {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.bc-illus-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #b0c4c4;
}

.bc-illus-bars {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 60px;
}

.bc-illus-bar {
    flex: 1;
    background: linear-gradient(to top, #5f9ea0, #8ec5c8);
    border-radius: 3px 3px 0 0;
    min-width: 14px;
}

.bc-illus-circle {
    position: absolute;
    bottom: 20px;
    left: 60px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8ec5c8, #5f9ea0);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(95, 158, 160, 0.4);
}

.bc-illus-arrow {
    position: absolute;
    top: 0;
    right: 20px;
    font-size: 60px;
    color: #5f9ea0;
    opacity: 0.5;
}

.bc-welcome-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: #5a7a7a;
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 3;
}

.bc-welcome-close:hover {
    background: rgba(0,0,0,0.05);
    color: #333;
}

.bc-welcome-banner.hidden {
    display: none;
}

/* --- Activities Section --- */
.bc-section {
    padding: 0 24px;
    margin-top: 24px;
}

.bc-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 0;
    user-select: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.bc-section-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.bc-section-chevron {
    font-size: 11px;
    color: var(--text-muted);
    transition: transform var(--transition);
}

.bc-section-header.collapsed .bc-section-chevron {
    transform: rotate(-90deg);
}

.bc-activities-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}

.bc-activities-grid.collapsed {
    display: none;
}

.bc-activity-card {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    background: var(--bg-white);
    transition: background var(--transition);
    cursor: pointer;
    border-right: 1px solid var(--border);
}

.bc-activity-card:last-child {
    border-right: none;
}

.bc-activity-card:hover {
    background: #fafafa;
}

.bc-activity-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.4;
}

.bc-activity-value {
    font-size: 36px;
    font-weight: 300;
    color: var(--text-dark);
    margin-bottom: 8px;
    line-height: 1.2;
}

.bc-activity-bar {
    height: 3px;
    border-radius: 2px;
    width: 100%;
    margin-bottom: 10px;
}

.bc-activity-seemore {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.bc-activity-seemore i {
    font-size: 9px;
}

.bc-activity-card:hover .bc-activity-seemore {
    color: var(--primary);
}

/* --- Cues Section (Cards Row) --- */
.bc-cues-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 24px;
    padding: 24px;
    align-items: start;
}

.bc-cue-group {
    min-width: 0;
}

.bc-cue-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.bc-cue-cards {
    display: flex;
    gap: 0;
}

.bc-cue-card {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    min-width: 100px;
    flex: 1;
    color: white;
    cursor: pointer;
    transition: opacity var(--transition);
    position: relative;
}

.bc-cue-card:hover {
    opacity: 0.9;
}

.bc-cue-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    min-height: 28px;
    opacity: 0.95;
}

.bc-cue-value {
    font-size: 32px;
    font-weight: 300;
    line-height: 1.2;
    margin-bottom: 8px;
}

.bc-cue-bar {
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-bottom: 8px;
}

.bc-cue-arrow {
    font-size: 10px;
    opacity: 0.7;
}

.bc-cue-arrow i {
    font-size: 10px;
}

/* Blue cue cards */
.bc-cue-blue {
    background: #0078d4;
}

.bc-cue-blue:nth-child(2) {
    background: #106ebe;
}

.bc-cue-blue:nth-child(3) {
    background: #005a9e;
}

/* Green cue cards */
.bc-cue-green {
    background: #107c10;
}

.bc-cue-green:nth-child(2) {
    background: #0b6a0b;
}

.bc-cue-green:nth-child(3) {
    background: #085208;
}

/* Purple cue cards */
.bc-cue-purple {
    background: #5c2d91;
}

.bc-cue-purple:nth-child(2) {
    background: #4b2380;
}

.bc-cue-purple:nth-child(3) {
    background: #3a1a6e;
}

/* Scan Documents Card */
.bc-scan-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 130px;
    cursor: pointer;
    transition: all var(--transition);
}

.bc-scan-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.bc-scan-icon {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--text-muted);
    font-size: 20px;
}

.bc-scan-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* --- Module Pages --- */
.module-header {
    margin-bottom: 24px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border);
}

.module-header h2 {
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.module-header p {
    color: var(--text-muted);
}

.module-placeholder {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    border: 2px dashed var(--border);
    margin: 0 24px;
}

.module-placeholder > i {
    font-size: 48px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.module-placeholder h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.module-placeholder p {
    color: var(--text-muted);
    margin-bottom: 16px;
}

.module-placeholder ul {
    display: inline-block;
    text-align: left;
    list-style: disc;
    padding-left: 20px;
    color: var(--text-muted);
}

.module-placeholder ul li {
    padding: 4px 0;
}

/* --- Error Page --- */
.error-page {
    text-align: center;
    padding: 80px 20px;
}

.error-page h1 {
    font-size: 72px;
    color: var(--primary);
    margin-bottom: 8px;
}

.error-page p {
    font-size: 18px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* --- Tables (for future modules) --- */
.table-container {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

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

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.data-table tr:hover {
    background: rgba(0, 120, 212, 0.02);
}

/* --- Forms (for future modules) --- */
.form-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .bc-cues-row {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 992px) {
    .bc-activities-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bc-activity-card {
        border-bottom: 1px solid var(--border);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .bc-topnav {
        overflow-x: auto;
        padding: 6px 16px;
    }

    .bc-welcome-banner {
        flex-direction: column;
        padding: 24px;
        min-height: auto;
    }

    .bc-welcome-illustration {
        display: none;
    }

    .bc-activities-grid {
        grid-template-columns: 1fr;
    }

    .bc-activity-card {
        border-right: none;
    }

    .bc-cues-row {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .bc-cue-cards {
        flex-wrap: wrap;
    }

    .top-bar {
        padding: 0 16px;
    }
}

/* --- Sidebar Collapsed --- */
.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .sidebar-link span,
.sidebar.collapsed .sidebar-section-title,
.sidebar.collapsed .user-details {
    display: none;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

/* =============================================
   SALES MODULE - Business Central Style
   ============================================= */

/* --- Module Top Bar --- */
.bc-module-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.bc-module-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.bc-module-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-module-label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.bc-back-link {
    font-size: 13px;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.bc-back-link:hover {
    color: var(--primary-dark);
}

.bc-select-filter {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 13px;
    background: white;
    cursor: pointer;
}

.bc-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: white;
}

.bc-search-box i {
    color: var(--text-muted);
    font-size: 12px;
}

.bc-search-input {
    border: none;
    outline: none;
    font-size: 13px;
    width: 140px;
    background: transparent;
}

/* --- Analyze Toggle --- */
.bc-analyze-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bc-toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.bc-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.bc-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 20px;
    transition: var(--transition);
}

.bc-toggle-slider::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.bc-toggle-switch input:checked + .bc-toggle-slider {
    background: #00838f;
}

.bc-toggle-switch input:checked + .bc-toggle-slider::before {
    transform: translateX(20px);
}

.bc-toggle-label {
    font-size: 13px;
    color: var(--text-dark);
    font-weight: 500;
}

/* --- Tabs --- */
.bc-tabs {
    display: flex;
    align-items: center;
    gap: 0;
}

.bc-tab {
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: #f0f0f0;
    color: var(--text-dark);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}

.bc-tab:first-child {
    border-radius: 3px 0 0 3px;
}

.bc-tab:last-of-type {
    border-radius: 0 3px 3px 0;
}

.bc-tab.active {
    background: white;
    border-bottom-color: white;
    font-weight: 600;
    color: var(--primary);
}

.bc-tab:hover:not(.active) {
    background: #e8e8e8;
}

.bc-tab-add {
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 3px 3px 0;
    background: #f0f0f0;
}

.bc-icon-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 3px;
}

.bc-icon-btn:hover {
    background: #e8f0fe;
    color: var(--primary);
}

/* --- List Toolbar --- */
.bc-list-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    flex-wrap: wrap;
}

.bc-toolbar-spacer {
    flex: 1;
}

.btn-outline {
    background: white;
    border: 1px solid var(--border);
    color: var(--text-dark);
    padding: 6px 14px;
    font-size: 13px;
}

.btn-outline:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.bc-status-filters {
    display: flex;
    gap: 4px;
}

.bc-status-pill {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all var(--transition);
    white-space: nowrap;
}

.bc-status-pill:hover {
    background: #e8f0fe;
    color: var(--primary);
    border-color: var(--primary);
}

.bc-status-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Data Table (BC style) --- */
.bc-table-container {
    background: var(--bg-white);
    margin: 0;
    overflow-x: auto;
}

.bc-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bc-data-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-dark);
    background: #e8f4f8;
    border-bottom: 2px solid #b8d4da;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.bc-data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-dark);
    vertical-align: middle;
}

.bc-data-row {
    cursor: pointer;
    transition: background var(--transition);
}

.bc-data-row:hover {
    background: #f5fafc;
}

.bc-data-row:nth-child(even) {
    background: #fafafa;
}

.bc-data-row:nth-child(even):hover {
    background: #f0f7fa;
}

.bc-col-check {
    width: 36px;
    text-align: center;
}

.bc-col-right {
    text-align: right;
}

.bc-col-link a {
    color: var(--primary);
    font-weight: 500;
}

.bc-col-link a:hover {
    text-decoration: underline;
}

.bc-col-link {
    color: var(--primary);
    font-weight: 500;
}

.bc-col-actions {
    width: 40px;
    text-align: center;
}

.bc-action-btn {
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px;
}

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

.bc-action-danger:hover {
    color: var(--danger);
}

.bc-empty-row {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 12px !important;
}

/* --- Badges --- */
.bc-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.bc-badge-gray { background: #e0e0e0; color: #555; }
.bc-badge-blue { background: #d4e8f7; color: #0050a0; }
.bc-badge-green { background: #d4edda; color: #155724; }
.bc-badge-yellow { background: #fff3cd; color: #856404; }
.bc-badge-red { background: #f8d7da; color: #721c24; }

/* --- Bottom Stats --- */
.bc-bottom-stats {
    display: flex;
    gap: 24px;
    padding: 10px 20px;
    background: var(--bg-white);
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.bc-stat-item {
    display: flex;
    gap: 6px;
}

.bc-stat-label {
    color: var(--text-muted);
}

.bc-stat-value {
    font-weight: 600;
}

/* --- Analysis Mode --- */
.bc-analysis-wrapper {
    display: flex;
    min-height: calc(100vh - 160px);
}

.bc-analysis-container {
    flex: 1;
    background: var(--bg-white);
    overflow: auto;
}

.bc-analysis-years {
    display: flex;
    gap: 0;
    padding: 12px 20px;
    background: #e8f4f8;
    border-bottom: 1px solid #b8d4da;
}

.bc-year-header {
    padding: 4px 40px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
}

.bc-year-header i {
    font-size: 10px;
    margin-left: 4px;
}

.bc-analysis-table-wrap {
    overflow: auto;
}

.bc-analysis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.bc-analysis-head th {
    padding: 8px 16px;
    background: #e8f4f8;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-dark);
    border-bottom: 2px solid #b8d4da;
    text-align: right;
    white-space: nowrap;
}

.bc-col-order-no {
    text-align: left !important;
    min-width: 160px;
    padding-left: 20px !important;
}

.bc-col-amount {
    text-align: right;
    min-width: 130px;
}

.bc-analysis-row td {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-align: right;
}

.bc-analysis-row:hover {
    background: #f5fafc;
}

.bc-analysis-total td {
    padding: 10px 16px;
    border-top: 2px solid #b8d4da;
    text-align: right;
    background: #f5fafc;
}

/* Analysis sidebar */
.bc-analysis-sidebar {
    width: 36px;
    background: #f0f0f0;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 8px;
}

.bc-sidebar-tab-btn {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    padding: 12px 8px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bc-sidebar-tab-btn.active {
    background: white;
    color: var(--text-dark);
    font-weight: 600;
}

.bc-sidebar-tab-btn i {
    font-size: 12px;
}

.bc-sidebar-tab-btn span {
    font-size: 11px;
}

/* --- Form Styles --- */
.bc-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
}

.bc-form-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bc-form-header-left h2 {
    font-size: 16px;
    font-weight: 600;
}

.bc-back-btn {
    color: var(--primary);
    font-size: 16px;
    padding: 4px;
}

.bc-back-btn:hover {
    color: var(--primary-dark);
}

.bc-form-card {
    background: var(--bg-white);
    margin: 16px 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.bc-form-section {
    padding: 20px;
}

.bc-form-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dark);
}

.bc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}

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

.bc-form-group label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

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

.bc-form-full {
    grid-column: 1 / -1;
}

.bc-form-totals {
    padding: 16px 20px;
    background: #f8fafb;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 24px;
}

.bc-total-row {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.bc-total-grand {
    font-size: 15px;
    color: var(--text-dark);
}

.bc-form-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

/* Add Line Form */
.bc-add-line-section {
    padding: 16px 20px;
    background: #f8fafb;
    border-top: 1px solid var(--border);
}

.bc-add-line-section h4 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.bc-line-grid {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.bc-line-grid .bc-form-group {
    flex: 1;
    min-width: 120px;
}

.bc-line-grid .bc-form-group:first-child {
    flex: 2;
    min-width: 200px;
}

.bc-form-group-btn {
    flex: 0 !important;
    min-width: auto !important;
    padding-bottom: 2px;
}

/* --- Responsive for Sales --- */
@media (max-width: 768px) {
    .bc-module-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .bc-tabs {
        overflow-x: auto;
    }

    .bc-form-grid {
        grid-template-columns: 1fr;
    }

    .bc-line-grid {
        flex-direction: column;
    }

    .bc-analysis-sidebar {
        display: none;
    }

    .bc-form-totals {
        flex-direction: column;
        align-items: flex-end;
    }

    .bc-status-filters {
        flex-wrap: wrap;
    }
}
