:root {
    /* Colors */
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;

    /* Deep Corporate Blue */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    --border: #e2e8f0;
    --border-light: #f1f5f9;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-subtle: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 72px;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-light);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 20px;
}

.nav-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-top: 8px;
    background-color: var(--bg-main);
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.user-profile .info {
    display: flex;
    flex-direction: column;
}

.user-profile .name {
    font-weight: 600;
    font-size: 14px;
}

.user-profile .role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 5;
}

.search-container {
    display: flex;
    align-items: center;
    background-color: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 16px;
    width: 480px;
    height: 44px;
    transition: var(--transition);
}

.search-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-container i {
    color: var(--text-tertiary);
    font-size: 20px;
}

.search-container input {
    border: none;
    background: transparent;
    padding: 0 12px;
    width: 100%;
    height: 100%;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-family: inherit;
}

.search-container input::placeholder {
    color: var(--text-tertiary);
}

.search-shortcut {
    font-size: 12px;
    color: var(--text-tertiary);
    background-color: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

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

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--bg-card);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative !important;
    /* Ensure children can position relative to this */
}

.icon-btn:hover {
    background-color: var(--bg-main);
    color: var(--primary);
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0 20px;
    height: 44px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

/* Views */
.views-container {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    position: relative;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

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

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

.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-card.warning .stat-icon {
    background-color: var(--warning-light);
    color: var(--warning);
}

.stat-info h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-info .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.placeholder-content {
    background-color: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 64px;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 16px;
}

/* Document Engine (Quotes/Invoices) */
.doc-actions-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    background: var(--bg-card);
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

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

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.secondary-btn {
    background-color: var(--bg-main);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0 16px;
    height: 40px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.secondary-btn:hover {
    background-color: var(--border-light);
}

.doc-editor {
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 48px;
    max-width: 900px;
    margin: 0 auto;
}

.doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 24px;
}

.company-details h2 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.company-details p {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.doc-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.meta-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: flex-end;
}

.meta-item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.meta-item label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.clean-input {
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    background: transparent;
    width: 140px;
}

.clean-input:hover,
.clean-input:focus {
    border-color: var(--border);
    background: var(--bg-main);
    outline: none;
}

.bill-to-section {
    margin-bottom: 40px;
}

.bill-to-section h3 {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.client-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
}

.items-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid var(--border);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.items-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
}

.items-table .clean-input {
    width: 100%;
}

.amount-cell {
    font-weight: 600;
    text-align: right;
    padding-right: 16px !important;
}

.icon-btn-small {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.icon-btn-small:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.add-row-btn {
    margin-top: 16px;
    height: 36px;
    font-size: 13px;
}

.totals-section {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 40px;
    padding-top: 24px;
    border-top: 2px solid var(--border-light);
}

.notes-block {
    flex: 1;
}

.notes-block label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.calculation-block {
    width: 300px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.calc-row.total-row {
    border-top: 2px solid var(--border);
    margin-top: 8px;
    padding-top: 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}

/* Print Styles */
@media print {
    @page {
        margin: 0;
    }

    body * {
        visibility: hidden;
    }

    .main-content {
        overflow: visible;
        background: white;
    }

    .views-container {
        overflow: visible;
        padding: 0;
        background: white;
    }

    .sidebar,
    .topbar,
    .doc-actions-bar,
    .delete-row-btn,
    .add-row-btn {
        display: none !important;
    }

    #printable-doc,
    #printable-doc * {
        visibility: visible;
    }

    #printable-doc {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 40px;
        box-shadow: none;
        border: none;
        background: white;
    }

    .clean-input,
    .form-control {
        border: none !important;
        background: transparent !important;
        padding: 0 !important;
        resize: none;
    }

    .clean-input:hover,
    .clean-input:focus,
    .form-control:focus {
        box-shadow: none;
    }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .3s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

input:checked+.slider {
    background-color: var(--success);
}

input:checked+.slider:before {
    transform: translateX(16px);
}

/* Notification Dropdown */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-main);
}

.notification-dropdown {
    position: absolute;
    top: 50px;
    right: 0;
    width: 320px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.notification-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.dropdown-header .mark-read {
    font-size: 12px;
    color: var(--primary);
    cursor: pointer;
}

.dropdown-list {
    max-height: 300px;
    overflow-y: auto;
}

.notif-item {
    padding: 16px;
    display: flex;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

.notif-item:hover {
    background: var(--primary-light);
}

.notif-item.unread {
    background: #f8fafc;
    border-left: 3px solid var(--primary);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    color: var(--primary);
    flex-shrink: 0;
}

.notif-item:nth-child(2) .notif-icon {
    background: var(--warning-light);
    color: var(--warning);
}

.notif-item:nth-child(3) .notif-icon {
    background: var(--success-light);
    color: var(--success);
}

.notif-item.unread .notif-icon {
    background: var(--primary);
    color: white;
}

.notif-content p {
    font-size: 13px;
    margin-bottom: 4px;
    line-height: 1.4;
}

.notif-content span {
    font-size: 11px;
    color: var(--text-tertiary);
}

/* Data Table (Inventory & Leads) */
.inventory-table-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

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

.data-table th {
    background: var(--bg-main);
    text-align: left;
    padding: 16px 24px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: middle;
}

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

.data-table tr:hover {
    background: var(--bg-main);
}

.stock-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.stock-available {
    background: var(--success-light);
    color: var(--success);
}

.stock-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.stock-reserved {
    background: var(--primary-light);
    color: var(--primary);
}

.stock-defective {
    background: var(--danger-light);
    color: var(--danger);
}

.stock-return {
    background: var(--border-light);
    color: var(--text-secondary);
}

/* Modal */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--bg-card);
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    transform: translateY(20px);
    transition: var(--transition);
    overflow: hidden;
}

.modal-overlay.show .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 20px;
    height: calc(100vh - 220px);
    overflow-x: auto;
    padding-bottom: 20px;
}

.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: transparent;
}

.kanban-board::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 4px;
}

.kanban-col {
    min-width: 300px;
    width: 300px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.col-header {
    padding: 16px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.col-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.col-header .count {
    background: var(--bg-main);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
}

.col-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-main);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    transition: background 0.2s ease;
    min-height: 150px;
}

.col-body.drag-over {
    background: var(--primary-light);
    border: 2px dashed var(--primary);
}

.kanban-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    cursor: grab;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.kanban-card:active {
    cursor: grabbing;
}

.kanban-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    align-items: center;
}

.card-id {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge.priority-high {
    background: var(--danger-light);
    color: var(--danger);
}

.badge.priority-medium {
    background: var(--warning-light);
    color: var(--warning);
}

.card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 12px;
    margin-top: auto;
}

.card-footer .amount {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
}

.avatar-sm {
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* --- Premium Login UI --- */
.login-wrapper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-card);
    font-family: 'Inter', sans-serif;
    display: none;
    /* Controlled by JS */
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 64px;
    color: white;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(37, 99, 235, 0.15) 0%, transparent 50%);
    z-index: 0;
}

.login-decor-circle {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 1;
}

.login-visual-container {
    position: relative;
    z-index: 2;
    max-width: 480px;
}

.login-visual-icon {
    font-size: 64px;
    color: var(--primary);
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.1);
    width: 96px;
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-visual-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-visual-subtitle {
    font-size: 20px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 48px;
}

.login-visual-footer {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    border-left: 3px solid var(--primary);
    padding-left: 16px;
}

.login-right {
    flex: 1;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 460px;
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
}

.login-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
}

.login-logo-img {
    height: 48px;
    object-fit: contain;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.login-input-wrapper {
    position: relative;
    width: 100%;
}

.login-input-wrapper i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 20px;
}

.login-input-wrapper input {
    padding-left: 48px;
    height: 52px;
    border-radius: 12px;
    font-size: 15px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    transition: var(--transition);
    width: 100%;
    box-sizing: border-box;
}

.login-input-wrapper input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.login-btn {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: var(--transition);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

@media (max-width: 900px) {
    .login-left {
        display: none;
    }
}

/* --- Mobile Responsiveness --- */
.mobile-toggle-btn {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    z-index: 2000;
    font-size: 24px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100%;
        transition: 0.3s ease;
        z-index: 1000;
    }

    .sidebar.mobile-active {
        left: 0;
    }

    .mobile-toggle-btn {
        display: flex;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .search-container {
        width: 44px;
        padding: 0;
        justify-content: center;
        border: none;
        background: none;
    }

    .search-container input,
    .search-shortcut {
        display: none;
    }

    .topbar {
        padding: 0 16px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .icon-btn .notification-badge {
        right: -2px;
        top: -2px;
    }

    .views-container {
        padding: 24px 16px;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .inventory-table-wrapper {
        width: calc(100vw - 32px);
        /* 100vw minus views-container padding */
        max-width: 100%;
        overflow-x: auto;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .primary-btn {
        width: 100%;
        justify-content: center;
    }

    .stat-card {
        padding: 16px;
    }

    .modal {
        width: 95%;
        padding: 20px;
        margin: 10px;
    }

    .client-grid {
        grid-template-columns: 1fr;
    }

    .form-group.full-width {
        grid-column: span 1;
    }

    .doc-header {
        flex-direction: column;
        gap: 24px;
    }

    .doc-title {
        text-align: left;
    }

    .meta-grid {
        align-items: flex-start;
    }

    .doc-editor {
        padding: 24px 16px;
    }

    .doc-actions-bar {
        flex-direction: column;
        gap: 16px;
    }

    .doc-actions-bar .form-control {
        width: 100% !important;
    }

    .action-buttons {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .action-buttons button {
        flex: 1;
    }

    /* Ensure items table is scrollable on small screens */
    .items-table-wrapper {
        width: 100%;
        overflow-x: auto;
    }

    .items-table {
        min-width: 600px;
    }

    .data-table {
        min-width: 800px;
    }

    .doc-actions-bar select {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px;
    }

    .login-visual-title {
        font-size: 32px;
    }

    .stat-info .value {
        font-size: 20px;
    }
}

/* --- Added for Multi-Item Leads --- */
.primary-btn-small {
    padding: 6px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.primary-btn-small:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

#leadItemsContainer {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

#leadItemsContainer::-webkit-scrollbar {
    width: 4px;
}

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