/* KhataBahi Dashboard Styles */
:root {
    --kb-primary: #1e3a8a;
    --kb-primary-hover: #1d4ed8;
    --kb-secondary: #475569;
    --kb-bg: #f8fafc;
    --kb-surface: #ffffff;
    --kb-text: #0f172a;
    --kb-border: #e2e8f0;
    --kb-success: #16a34a;
    --kb-warning: #d97706;
    --kb-danger: #dc2626;
    --kb-info: #0284c7;
    --kb-radius: 8px;
    --kb-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

/* Elementor & Parent WordPress Theme Container Overrides */
.elementor-section:has(.kb-dashboard-container),
.elementor-container:has(.kb-dashboard-container),
.elementor-column:has(.kb-dashboard-container),
.elementor-widget-container:has(.kb-dashboard-container),
body:has(.kb-dashboard-container) .entry-content,
body:has(.kb-dashboard-container) .site-content,
body:has(.kb-dashboard-container) .post-inner,
body:has(.kb-dashboard-container) .wp-block-post-content,
body:has(.kb-dashboard-container) .site-main,
body:has(.kb-dashboard-container) .container,
body:has(.kb-dashboard-container) .ast-container,
body:has(.kb-dashboard-container) main,
body:has(.kb-dashboard-container) article {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Bulletproof Viewport Breakout for KhataBahi Dashboard */
.kb-dashboard-container {
    display: flex;
    min-height: 85vh;
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    background-color: var(--kb-bg);
    border-radius: 0px;
    overflow: hidden;
    box-shadow: none;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--kb-text);
    box-sizing: border-box !important;
}

/* Sidebar */
.kb-sidebar {
    width: 270px;
    min-width: 270px;
    background: linear-gradient(180deg, #0b1329 0%, #0f172a 100%);
    color: #f8fafc;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
}

.kb-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kb-brand-logo-wrapper {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.kb-brand-logo-img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.kb-brand-text h2 {
    color: #ffffff;
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.kb-brand-tag {
    font-size: 9px;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 1.5px;
    display: block;
    margin-top: 3px;
}

.kb-nav-section-title {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.kb-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kb-nav-item {
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 14px;
    position: relative;
    border: 1px solid transparent;
}

.kb-nav-svg {
    color: #64748b;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.kb-nav-text {
    flex: 1;
    white-space: nowrap;
}

.kb-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #f1f5f9;
    transform: translateX(3px);
}

.kb-nav-item:hover .kb-nav-svg {
    color: #38bdf8;
    transform: scale(1.1);
}

.kb-nav-item.active {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 8px 20px -4px rgba(37, 99, 235, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.kb-nav-item.active .kb-nav-svg {
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.kb-badge-pill {
    background: rgba(255, 255, 255, 0.12);
    color: #38bdf8;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 9px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    transition: all 0.2s ease;
    margin-left: auto;
}

.kb-nav-item.active .kb-badge-pill {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.4);
}

.kb-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-top: 24px;
    transition: all 0.2s ease;
}

.kb-user-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.kb-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #38bdf8, #0284c7);
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(2, 132, 199, 0.3);
    flex-shrink: 0;
}

.kb-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.kb-user-name {
    font-weight: 700;
    color: #ffffff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-logout-link {
    color: #f87171;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.kb-logout-link:hover {
    color: #ef4444;
    text-decoration: underline;
}

/* Main Content */
.kb-main-content {
    flex: 1;
    padding: 30px;
    background: #ffffff;
    overflow-y: auto;
}

.kb-tab-pane {
    display: none;
}

.kb-tab-pane.active {
    display: block;
}

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

.kb-page-header h1, .kb-page-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}

/* Stats Cards */
.kb-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kb-stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--kb-shadow);
}

.kb-stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
}

.kb-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--kb-primary);
    margin: 8px 0;
}

.kb-stat-success .kb-stat-value { color: var(--kb-success); }
.kb-stat-warning .kb-stat-value { color: var(--kb-warning); }

.kb-stat-sub {
    font-size: 12px;
    color: #94a3b8;
}

/* Tables */
.kb-table-responsive {
    overflow-x: auto;
}

.kb-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.kb-table th, .kb-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
}

.kb-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
}

/* Status Badges & Change Link */
.kb-badge {
    display: inline-block !important;
    padding: 4px 10px !important;
    border-radius: 9999px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    vertical-align: middle !important;
}

.kb-badge-paid, .kb-badge-approved { background: #dcfce7 !important; color: #15803d !important; }
.kb-badge-pending { background: #fef3c7 !important; color: #b45309 !important; }
.kb-badge-overdue, .kb-badge-rejected { background: #fee2e2 !important; color: #b91c1c !important; }
.kb-badge-cancelled { background: #e2e8f0 !important; color: #475569 !important; }

.kb-link-change-status {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #2563eb !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    margin-left: 6px !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    vertical-align: middle !important;
    text-decoration: none !important;
    box-shadow: none !important;
    height: auto !important;
    width: auto !important;
    line-height: 1.2 !important;
}

/* Overview Filter Group Styling */
.kb-filter-group {
    display: inline-flex !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    background: #ffffff !important;
    padding: 4px 12px !important;
    border-radius: 10px !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
    height: 40px !important;
    box-sizing: border-box !important;
}

.kb-filter-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

.kb-filter-icon {
    color: #2563eb !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    vertical-align: middle !important;
}

.kb-select-filter {
    height: 30px !important;
    line-height: 30px !important;
    padding: 0 26px 0 10px !important;
    border-radius: 6px !important;
    border: 1px solid #cbd5e1 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background-color: #f8fafc !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
    width: auto !important;
}

.kb-select-filter:hover {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
}

.kb-select-filter:focus {
    outline: none !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* Buttons */
.kb-btn {
    padding: 9px 18px;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
}

.kb-btn-primary { background: var(--kb-primary); color: #fff; }
.kb-btn-primary:hover { background: var(--kb-primary-hover); }
.kb-btn-secondary { background: #e2e8f0; color: #334155; }
.kb-btn-success { background: #25d366; color: #fff; }
.kb-btn-success:hover { background: #1da851; }
.kb-btn-info { background: #0284c7; color: #fff; }
.kb-btn-info:hover { background: #0369a1; }
.kb-btn-danger { background: #ef4444; color: #fff; }
.kb-btn-sm { padding: 5px 10px; font-size: 12px; }

/* Status Updater Dropdown */
.kb-status-updater {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    border: 1.5px solid #cbd5e1;
    cursor: pointer;
    background-color: #ffffff;
    color: #0f172a;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kb-status-updater:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.kb-status-updater option[value="Paid"] { color: #16a34a; font-weight: 700; }
.kb-status-updater option[value="Pending"] { color: #d97706; font-weight: 700; }
.kb-status-updater option[value="Overdue"] { color: #dc2626; font-weight: 700; }
.kb-status-updater option[value="Cancelled"] { color: #64748b; font-weight: 700; }

/* Forms */
.kb-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.kb-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.kb-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.kb-form-group input, .kb-form-group select, .kb-form-group textarea {
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.kb-card-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 20px;
}

.kb-totals-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.kb-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.kb-calc-row input {
    width: 120px;
    text-align: right;
    padding: 6px;
}

.kb-grand-total-row {
    font-weight: 700;
    font-size: 16px;
    border-top: 2px solid #cbd5e1;
    padding-top: 10px;
    color: var(--kb-primary);
}

.kb-words-preview {
    margin-top: 10px;
    padding: 10px;
    background: #e0f2fe;
    border-radius: 6px;
    font-size: 13px;
    color: #0369a1;
}

/* Vertex Dribbble Style Sign-In & Sign-Up Layout */
body:has(.kb-vertex-wrapper) .entry-content,
body:has(.kb-vertex-wrapper) .site-content,
body:has(.kb-vertex-wrapper) .post-inner,
body:has(.kb-vertex-wrapper) .wp-block-post-content,
body:has(.kb-vertex-wrapper) .site-main,
body:has(.kb-vertex-wrapper) main {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 40%, #0242a5 100%) !important;
    padding-top: 50px !important;
    padding-bottom: 50px !important;
}

.kb-vertex-wrapper {
    width: 100%;
    max-width: 960px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.kb-vertex-card {
    display: flex;
    background: #ffffff;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 60px -15px rgba(2, 66, 165, 0.4), 0 10px 25px rgba(0, 0, 0, 0.15);
    min-height: 520px;
    position: relative;
}

/* Left Side: Organic Blue Bubble Graphic Banner */
.kb-vertex-banner {
    flex: 1;
    background: linear-gradient(135deg, #0284c7 0%, #0242a5 100%);
    color: #ffffff;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.kb-vertex-bubble {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.kb-bubble-1 {
    width: 260px;
    height: 260px;
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.25) 0%, rgba(2, 132, 199, 0.8) 100%);
    top: -50px;
    left: -70px;
}

.kb-bubble-2 {
    width: 220px;
    height: 220px;
    background: linear-gradient(140deg, #38bdf8 0%, #0242a5 100%);
    bottom: -60px;
    right: -40px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.kb-bubble-3 {
    width: 150px;
    height: 150px;
    background: linear-gradient(140deg, #60a5fa 0%, #0284c7 100%);
    bottom: 30px;
    left: 20px;
}

.kb-vertex-banner-content {
    position: relative;
    z-index: 2;
}

.kb-vertex-logo-badge {
    margin-bottom: 22px;
}

.kb-vertex-logo-badge img {
    max-height: 95px;
    height: auto;
    width: 100%;
    max-width: 320px;
    object-fit: contain;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.4));
    border-radius: 8px !important;
    display: block;
}

.kb-vertex-form-logo {
    text-align: center;
    margin-bottom: 20px;
}

.kb-vertex-form-logo img {
    max-height: 75px;
    height: auto;
    width: 100%;
    max-width: 280px;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.15));
    border-radius: 8px !important;
    display: block;
    margin: 0 auto;
}

.kb-vertex-banner h2 {
    font-size: 32px;
    font-weight: 900;
    color: #ffffff !important;
    margin: 0 0 4px 0 !important;
    letter-spacing: 1px;
}

.kb-vertex-banner h3 {
    font-size: 14px;
    font-weight: 700;
    color: #7dd3fc !important;
    margin: 0 0 18px 0 !important;
    letter-spacing: 1.5px;
}

.kb-vertex-banner p {
    color: #e0f2fe !important;
    font-size: 14px !important;
    line-height: 1.6;
    margin: 0 !important;
    max-width: 340px;
}

/* Right Side: Vertex Form */
.kb-vertex-form-side {
    flex: 1.15;
    background: #ffffff;
    padding: 50px 45px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.kb-vertex-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a !important;
    margin: 0 0 6px 0 !important;
    letter-spacing: -0.5px;
}

.kb-vertex-subtitle {
    color: #64748b !important;
    font-size: 14px !important;
    margin: 0 0 24px 0 !important;
    line-height: 1.5;
}

.kb-vertex-input-group {
    background: #f1f5f9;
    border-radius: 12px;
    display: flex;
    align-items: center;
    padding: 2px 14px;
    margin-bottom: 16px;
    border: 1.5px solid transparent;
    transition: all 0.2s ease;
}

.kb-vertex-input-group:focus-within {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.15);
}

.kb-input-icon {
    font-size: 16px;
    margin-right: 10px;
    opacity: 0.7;
}

.kb-vertex-input-group input {
    border: none !important;
    background: transparent !important;
    padding: 12px 0 !important;
    font-size: 14px !important;
    color: #0f172a !important;
    font-weight: 500 !important;
    width: 100% !important;
    box-shadow: none !important;
    outline: none !important;
}

.kb-vertex-input-group input::placeholder {
    color: #64748b !important;
    font-weight: 500;
}

.kb-vertex-flex-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #64748b;
    margin: 6px 0 20px 0;
}

.kb-remember-me {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
}

.kb-vertex-btn {
    background: #0242a5;
    color: #ffffff;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    padding: 14px;
    width: 100%;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(2, 66, 165, 0.35);
    transition: all 0.2s ease;
}

.kb-vertex-btn:hover {
    background: #013385;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(2, 66, 165, 0.45);
}

.kb-vertex-footer {
    text-align: center;
    margin-top: 24px !important;
    font-size: 14px !important;
    color: #64748b !important;
}

.kb-vertex-footer a {
    color: #0284c7 !important;
    font-weight: 700;
    text-decoration: none;
}

.kb-vertex-footer a:hover {
    text-decoration: underline;
}

.kb-msg-box {
    display: none;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
}

.kb-msg-box.kb-msg-error {
    display: block;
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.kb-msg-box.kb-msg-success {
    display: block;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

@media (max-width: 768px) {
    .kb-vertex-card {
        flex-direction: column;
    }
    .kb-vertex-banner {
        padding: 35px 25px;
    }
    .kb-vertex-form-side {
        padding: 35px 25px;
    }
}

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

.kb-auth-form-side .kb-form-group label {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b !important;
    margin-bottom: 6px;
    display: block;
}

.kb-auth-form-side .kb-form-group input {
    padding: 12px 14px;
    border: 1.5px solid #94a3b8;
    border-radius: 8px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #0f172a !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.kb-auth-form-side .kb-form-group input::placeholder {
    color: #64748b !important;
    opacity: 0.9;
}

.kb-auth-form-side .kb-form-group input:focus {
    border-color: #2563eb;
    outline: none;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.kb-btn-block {
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 8px;
    margin-top: 10px;
    background: #2563eb;
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.kb-btn-block:hover {
    background: #1d4ed8;
}

.kb-auth-footer {
    text-align: center;
    margin-top: 22px !important;
    font-size: 14px !important;
    color: #475569 !important;
}

.kb-auth-footer a {
    color: #2563eb !important;
    font-weight: 700;
    text-decoration: none;
}

.kb-auth-footer a:hover {
    text-decoration: underline;
}

/* Logged-Out Portal Card Layout on Dashboard Page */
.kb-loggedout-portal-wrapper {
    width: 100%;
    max-width: 960px;
    margin: 40px auto;
    padding: 0 15px;
    box-sizing: border-box;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.kb-loggedout-portal-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 45px -10px rgba(15, 23, 42, 0.25), 0 10px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #cbd5e1;
}

.kb-portal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: #ffffff;
    padding: 50px 30px;
    text-align: center;
}

.kb-portal-logo-img {
    max-height: 95px;
    height: auto;
    width: auto;
    max-width: 280px;
    object-fit: contain;
    filter: drop-shadow(0 8px 25px rgba(0, 0, 0, 0.4));
    margin-bottom: 20px;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
}

.kb-portal-header h2 {
    font-size: 30px;
    font-weight: 800;
    color: #ffffff !important;
    margin: 0 0 10px 0 !important;
    letter-spacing: 0.5px;
}

.kb-portal-header p {
    color: #cbd5e1 !important;
    font-size: 16px !important;
    max-width: 680px;
    margin: 0 auto 30px auto !important;
    line-height: 1.6;
}

.kb-portal-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.kb-btn-lg {
    padding: 14px 30px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    display: inline-block !important;
}

.kb-btn-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.3) !important;
    transition: all 0.2s ease;
}

.kb-btn-outline:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: #ffffff !important;
}

.kb-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 40px 30px;
    background: #f8fafc;
}

.kb-portal-feature-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px 20px;
    text-align: left;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.kb-feat-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.kb-portal-feature-item h3 {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: 700;
    color: #0f172a;
}

.kb-portal-feature-item p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.kb-portal-footer {
    text-align: center;
    padding: 18px 30px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #64748b;
}

.kb-msg-box {
    margin-top: 15px;
    font-size: 13px;
}

.kb-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin: 20px auto;
    max-width: 600px;
}

.kb-alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.kb-alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Modals */
.kb-modal {
    display: none;
    position: fixed !important;
    z-index: 999999 !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(15, 23, 42, 0.75) !important;
    justify-content: center !important;
    align-items: center !important;
}

.kb-modal.active { display: flex !important; }

.kb-modal-content {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.kb-modal-lg { max-width: 900px; }

#kb-preview-modal .kb-modal-content {
    width: 95%;
    max-width: 860px;
    max-height: 94vh;
    overflow-y: auto;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.kb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kb-close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
}

.kb-approval-pending-card {
    text-align: center;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    border: 2px solid #fde68a;
    max-width: 600px;
    margin: 40px auto;
}

.kb-approval-pending-card .kb-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

/* Company Sub-Nav Filter Pills for TAB 3 */
.kb-pill-btn {
    padding: 8px 18px;
    border-radius: 20px;
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.kb-pill-btn:hover {
    border-color: #0284c7;
    color: #0284c7;
    background: #f0f9ff;
}

.kb-pill-btn.kb-pill-active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.kb-template-1 > div:first-child,
.kb-template-2 > div:first-child {
    flex: 0 0 auto !important;
    min-height: 108px !important;
}

.kb-invoice-body,
.kb-template-1 > div:nth-child(2),
.kb-template-2 > div:nth-child(2) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
}

/* Single-Page A4 Precision Print Styles */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }
    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        overflow: hidden !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    body * {
        visibility: hidden !important;
    }
    #kb-preview-modal,
    #kb-preview-modal *,
    #kb-invoice-print-area,
    #kb-invoice-print-area * {
        visibility: visible !important;
    }
    #kb-preview-modal {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 210mm !important;
        height: 297mm !important;
        background: transparent !important;
        display: block !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 999999 !important;
        overflow: hidden !important;
    }
    #kb-preview-modal .kb-modal-content {
        width: 210mm !important;
        max-width: 210mm !important;
        height: 297mm !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
        max-height: none !important;
        overflow: hidden !important;
    }
    .kb-modal-header,
    .kb-close-modal,
    #kb-btn-share-whatsapp,
    #kb-btn-share-email,
    #kb-btn-do-print,
    .kb-sidebar,
    .kb-header {
        display: none !important;
    }
    .kb-invoice-paper {
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        padding: 0 !important;
        margin: 0 auto !important;
        width: 210mm !important;
        max-width: 210mm !important;
        max-height: 297mm !important;
        height: 297mm !important;
        min-height: 297mm !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    .kb-template-1 > div:first-child,
    .kb-template-2 > div:first-child {
        flex: 0 0 auto !important;
        min-height: 108px !important;
    }
    .kb-template-1 > div:nth-child(2),
    .kb-template-2 > div:nth-child(2) {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow: hidden !important;
    }
    .kb-template-1 > div:last-child,
    .kb-template-2 > div:last-child {
        flex: 0 0 auto !important;
        margin-top: auto !important;
    }
}

/* ==========================================================================
   SEARCHABLE CUSTOMER COMBO SELECT COMPONENT (Invoice Builder)
   ========================================================================== */
.kb-customer-select-wrapper {
    position: relative;
    width: 100%;
    font-family: inherit;
}

.kb-customer-select-trigger {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 42px;
    outline: none;
    box-sizing: border-box;
}

.kb-customer-select-trigger:hover {
    border-color: #94a3b8;
}

.kb-customer-select-wrapper.is-open .kb-customer-select-trigger,
.kb-customer-select-trigger:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.kb-customer-trigger-content {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    min-width: 0;
    user-select: none;
}

.kb-customer-trigger-label {
    color: #64748b;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kb-customer-trigger-label.has-value {
    color: #0f172a;
    font-weight: 700;
    font-size: 14px;
}

.kb-customer-trigger-actions {
    display: flex;
    align-items: stretch;
}

.kb-customer-caret {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.kb-customer-select-wrapper.is-open .kb-customer-caret {
    transform: rotate(180deg);
}

.kb-customer-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #10b981;
    color: #ffffff;
    border: none;
    padding: 0 14px;
    border-top-right-radius: 6.5px;
    border-bottom-right-radius: 6.5px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.kb-customer-search-btn:hover {
    background: #059669;
}

/* Floating Dropdown Menu */
.kb-customer-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.15), 0 6px 12px -3px rgba(0, 0, 0, 0.08);
    z-index: 9999;
    display: none;
    overflow: hidden;
    box-sizing: border-box;
}

.kb-customer-select-wrapper.is-open .kb-customer-dropdown-menu {
    display: block;
    animation: kbDropdownFadeIn 0.15s ease-out;
}

@keyframes kbDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search input inside dropdown */
.kb-customer-dropdown-search {
    padding: 10px 12px 8px 12px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.kb-customer-search-input-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.kb-customer-search-input-box .kb-search-icon {
    position: absolute;
    left: 10px;
    pointer-events: none;
}

#kb-customer-search-input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13.5px;
    outline: none;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#kb-customer-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Scrollable Customer List */
.kb-customer-list {
    max-height: 250px;
    overflow-y: auto;
    padding: 4px 6px;
    margin: 0;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.kb-customer-list::-webkit-scrollbar {
    width: 6px;
}

.kb-customer-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.kb-customer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    margin: 2px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
}

.kb-customer-item:hover {
    background-color: #eff6ff;
}

/* Selected state matching screenshot */
.kb-customer-item.is-selected {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.kb-customer-item.is-selected .kb-customer-name {
    color: #ffffff !important;
}

.kb-customer-item.is-selected .kb-customer-subtitle {
    color: #dbeafe !important;
}

.kb-customer-item.is-selected .kb-customer-avatar {
    background-color: #ffffff !important;
    color: #2563eb !important;
}

.kb-customer-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: #f1f5f9;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13.5px;
    flex-shrink: 0;
    text-transform: uppercase;
    transition: all 0.15s ease;
}

.kb-customer-info {
    flex: 1;
    min-width: 0;
}

.kb-customer-name {
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.kb-customer-subtitle {
    font-size: 11.5px;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin-top: 2px;
    display: flex;
    align-items: center;
}

.kb-customer-no-results {
    padding: 16px 12px;
    text-align: center;
}

.kb-btn-quick-add-from-search {
    margin-top: 8px;
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.kb-btn-quick-add-from-search:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* Dropdown Footer Fixed Action */
.kb-customer-dropdown-footer {
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    padding: 8px 10px !important;
}

button.kb-btn-dropdown-new-customer {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 8px 14px !important;
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
    box-sizing: border-box !important;
    outline: none !important;
}

button.kb-btn-dropdown-new-customer:hover,
button.kb-btn-dropdown-new-customer:focus {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

button.kb-btn-dropdown-new-customer > span:not(.kb-new-cust-plus-icon) {
    color: inherit !important;
}

button.kb-btn-dropdown-new-customer span.kb-new-cust-plus-icon,
.kb-new-cust-plus-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border-radius: 50% !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

button.kb-btn-dropdown-new-customer span.kb-new-cust-plus-icon svg,
.kb-new-cust-plus-icon svg {
    display: block !important;
    width: 10px !important;
    height: 10px !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

button.kb-btn-dropdown-new-customer:hover span.kb-new-cust-plus-icon,
button.kb-btn-dropdown-new-customer:focus span.kb-new-cust-plus-icon,
button.kb-btn-dropdown-new-customer:hover .kb-new-cust-plus-icon,
button.kb-btn-dropdown-new-customer:focus .kb-new-cust-plus-icon {
    background-color: #ffffff !important;
    color: #2563eb !important;
}

button.kb-btn-dropdown-new-customer:hover span.kb-new-cust-plus-icon svg,
button.kb-btn-dropdown-new-customer:focus span.kb-new-cust-plus-icon svg,
button.kb-btn-dropdown-new-customer:hover .kb-new-cust-plus-icon svg,
button.kb-btn-dropdown-new-customer:focus .kb-new-cust-plus-icon svg {
    stroke: #2563eb !important;
    color: #2563eb !important;
}

/* Selected Customer Detail Card */
.kb-selected-customer-card {
    margin-top: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 3.5px solid #2563eb;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1.4;
    color: #334155;
    animation: kbFadeIn 0.2s ease-out;
}

.kb-sel-cust-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
}

.kb-sel-cust-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.kb-sel-cust-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 13px;
}

.kb-sel-cust-badge {
    font-size: 10.5px;
    font-family: monospace;
    background: #e0e7ff;
    color: #3730a3;
    padding: 1.5px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.kb-sel-cust-actions {
    display: flex;
    gap: 8px;
}

.kb-btn-link-edit {
    background: none;
    border: none;
    color: #2563eb;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.kb-btn-link-clear {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.kb-sel-cust-details {
    font-size: 11.5px;
    color: #64748b;
}

/* ==========================================================================
   SEARCHABLE ITEM DROPDOWN & BULK ITEMS MODAL (Invoice Builder)
   ========================================================================== */
#kb-items-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
}

#kb-items-table th, 
#kb-items-table td {
    overflow: visible !important;
}

#kb-items-table tbody tr.kb-item-row {
    position: relative;
    transition: background-color 0.15s;
}

#kb-items-table tbody tr.kb-item-row.is-open,
#kb-items-table tbody tr.kb-item-row:focus-within {
    z-index: 9999 !important;
}

.kb-item-search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.kb-item-desc {
    width: 100%;
    padding-right: 32px !important;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff;
}

.kb-item-search-wrapper.is-open .kb-item-desc,
.kb-item-desc:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2.5px rgba(37, 99, 235, 0.15) !important;
}

/* Caret Dropdown / Search Toggle Button */
.kb-item-dropdown-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 6px 4px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: color 0.15s, transform 0.2s;
    z-index: 3;
}

.kb-item-dropdown-toggle:hover {
    color: #2563eb;
}

.kb-item-search-wrapper.is-open .kb-item-dropdown-toggle {
    transform: translateY(-50%) rotate(180deg);
    color: #2563eb;
}

/* Floating Item Dropdown Menu matching screenshot */
.kb-item-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 320px;
    width: 100%;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: 0 14px 35px -4px rgba(0, 0, 0, 0.22), 0 8px 16px -4px rgba(0, 0, 0, 0.1) !important;
    z-index: 999999 !important;
    overflow: hidden;
    display: none;
    box-sizing: border-box;
}

.kb-item-search-wrapper.is-open .kb-item-dropdown-menu {
    display: block !important;
    animation: kbDropdownFadeIn 0.15s ease-out;
}

.kb-item-dropdown-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
    margin: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.kb-item-dropdown-list::-webkit-scrollbar {
    width: 6px;
}
.kb-item-dropdown-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.kb-item-option {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
}

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

.kb-item-option:hover {
    background-color: #eff6ff;
}

/* Selected / Active item in vibrant blue matching screenshot */
.kb-item-option.is-selected {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

.kb-item-opt-title {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
}

.kb-item-option.is-selected .kb-item-opt-title {
    color: #ffffff !important;
}

.kb-item-opt-rate {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.3;
}

.kb-item-option.is-selected .kb-item-opt-rate {
    color: #dbeafe !important;
}

.kb-item-dropdown-footer {
    border-top: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    padding: 8px 10px !important;
}

button.kb-btn-dropdown-new-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 8px 14px !important;
    background: #eff6ff !important;
    color: #2563eb !important;
    border: 1px solid #bfdbfe !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
    text-align: center !important;
    box-sizing: border-box !important;
    outline: none !important;
}

button.kb-btn-dropdown-new-item:hover,
button.kb-btn-dropdown-new-item:focus {
    background: #2563eb !important;
    color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

button.kb-btn-dropdown-new-item > span:not(.kb-dropdown-plus-icon) {
    color: inherit !important;
}

button.kb-btn-dropdown-new-item span.kb-dropdown-plus-icon,
.kb-dropdown-plus-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    border-radius: 50% !important;
    background-color: #2563eb !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

button.kb-btn-dropdown-new-item span.kb-dropdown-plus-icon svg,
.kb-dropdown-plus-icon svg {
    display: block !important;
    width: 10px !important;
    height: 10px !important;
    stroke: #ffffff !important;
    color: #ffffff !important;
}

button.kb-btn-dropdown-new-item:hover span.kb-dropdown-plus-icon,
button.kb-btn-dropdown-new-item:focus span.kb-dropdown-plus-icon,
button.kb-btn-dropdown-new-item:hover .kb-dropdown-plus-icon,
button.kb-btn-dropdown-new-item:focus .kb-dropdown-plus-icon {
    background-color: #ffffff !important;
    color: #2563eb !important;
}

button.kb-btn-dropdown-new-item:hover span.kb-dropdown-plus-icon svg,
button.kb-btn-dropdown-new-item:focus span.kb-dropdown-plus-icon svg,
button.kb-btn-dropdown-new-item:hover .kb-dropdown-plus-icon svg,
button.kb-btn-dropdown-new-item:focus .kb-dropdown-plus-icon svg {
    stroke: #2563eb !important;
    color: #2563eb !important;
}

/* Add Items in Bulk Button matching screenshot */
.kb-btn-add-bulk {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eef2ff;
    color: #2563eb;
    border: 1px solid #c7d2fe;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.kb-btn-add-bulk:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
    color: #1d4ed8;
}

.kb-bulk-plus-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #2563eb;
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

/* 2-Pane Add Items in Bulk Modal matching screenshot */
.kb-modal-bulk-items {
    max-width: 880px !important;
    width: 92% !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    max-height: 88vh !important;
    padding: 0 !important;
    background: #ffffff !important;
}

.kb-bulk-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 1;
    min-height: 400px;
    max-height: 520px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .kb-bulk-modal-body {
        grid-template-columns: 1fr;
        max-height: none;
    }
}

.kb-bulk-left-pane {
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.kb-bulk-search-box {
    padding: 14px 18px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    background: #ffffff !important;
}

.kb-bulk-search-icon {
    display: none !important;
}

#kb-bulk-search-input {
    width: 100% !important;
    padding: 9px 14px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    font-size: 13.5px !important;
    outline: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    background: #ffffff !important;
}

#kb-bulk-search-input:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.kb-bulk-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.kb-bulk-items-list::-webkit-scrollbar {
    width: 6px;
}
.kb-bulk-items-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 3px;
}

.kb-bulk-item-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 18px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    cursor: pointer !important;
    background-color: #ffffff !important;
    transition: background-color 0.15s ease !important;
}

.kb-bulk-item-row:hover {
    background-color: #f8fafc !important;
}

.kb-bulk-item-row.is-selected {
    background-color: #f0f7ff !important;
}

.kb-bulk-item-title {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    line-height: 1.3 !important;
}

.kb-bulk-item-row.is-selected .kb-bulk-item-title {
    color: #2563eb !important;
    font-weight: 700 !important;
}

.kb-bulk-item-rate {
    font-size: 12px !important;
    color: #64748b !important;
    margin-top: 3px !important;
}

/* Checkmark badge: HIDDEN on unselected items */
.kb-bulk-item-check {
    display: none !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    border-radius: 50% !important;
    background: #22c55e !important;
    border: none !important;
    color: #ffffff !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    box-shadow: 0 1px 3px rgba(34, 197, 94, 0.3) !important;
}

/* Shown ONLY when item is selected */
.kb-bulk-item-row.is-selected .kb-bulk-item-check {
    display: flex !important;
}

.kb-bulk-item-check svg {
    display: block !important;
    width: 14px !important;
    height: 14px !important;
    stroke: #ffffff !important;
}

.kb-bulk-right-pane {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.kb-bulk-selected-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 14px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

.kb-bulk-sel-title {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
}

.kb-bulk-count-pill {
    background: transparent !important;
    color: #2563eb !important;
    border: none !important;
    padding: 0 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
}

.kb-bulk-total-qty {
    font-size: 12.5px !important;
    color: #64748b !important;
}

.kb-bulk-total-qty strong {
    color: #0f172a !important;
}

.kb-bulk-selected-body {
    flex: 1;
    overflow-y: auto;
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.kb-bulk-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 220px;
    padding: 30px;
    text-align: center;
    color: #64748b;
    font-size: 13.5px;
}

.kb-bulk-empty-state.is-hidden {
    display: none !important;
}

.kb-bulk-selected-items-list {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kb-bulk-selected-items-list.is-hidden {
    display: none !important;
}

/* Individual Selected Item Row in Right Pane */
.kb-bulk-sel-row,
.kb-bulk-selected-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 16px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
    gap: 12px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.15s ease !important;
    box-sizing: border-box !important;
}

.kb-bulk-sel-row:hover,
.kb-bulk-selected-item:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06) !important;
}

.kb-bulk-sel-row-info,
.kb-bulk-sel-info {
    flex: 1 !important;
    min-width: 0 !important;
}

.kb-bulk-sel-row-name,
.kb-bulk-sel-name {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.kb-bulk-sel-row-sub,
.kb-bulk-sel-meta {
    font-size: 12px !important;
    color: #64748b !important;
    margin-top: 3px !important;
    line-height: 1.3 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

.kb-bulk-sel-controls {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

/* Stepper Pill Container */
.kb-bulk-stepper-pill {
    display: inline-flex !important;
    align-items: center !important;
    border: 1px solid #d1d5db !important;
    border-radius: 9999px !important;
    padding: 2px 5px !important;
    background: #ffffff !important;
    gap: 2px !important;
    box-sizing: border-box !important;
}

button.kb-bulk-stepper-btn {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    transition: transform 0.1s ease, opacity 0.15s ease !important;
}

button.kb-bulk-stepper-btn:hover {
    opacity: 0.8 !important;
    transform: scale(1.05) !important;
}

button.kb-bulk-stepper-btn svg {
    display: block !important;
    width: 20px !important;
    height: 20px !important;
}

/* Stepper Number Input */
input.kb-bulk-qty-val,
input.kb-bulk-qty-input {
    width: 38px !important;
    min-width: 32px !important;
    max-width: 48px !important;
    height: 22px !important;
    border: none !important;
    padding: 0 2px !important;
    margin: 0 !important;
    text-align: center !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    -moz-appearance: textfield !important;
}

input.kb-bulk-qty-val::-webkit-outer-spin-button,
input.kb-bulk-qty-val::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Circular Orange Remove Button */
button.kb-bulk-sel-row-remove,
button.kb-bulk-sel-remove {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    padding: 0 !important;
    margin: 0 0 0 2px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    border-radius: 50% !important;
    box-shadow: none !important;
    transition: transform 0.15s ease, opacity 0.15s ease !important;
}

button.kb-bulk-sel-row-remove:hover,
button.kb-bulk-sel-remove:hover {
    transform: scale(1.1) !important;
    opacity: 0.85 !important;
}

button.kb-bulk-sel-row-remove svg,
button.kb-bulk-sel-remove svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
}

/* Footer Buttons */
.kb-bulk-modal-footer {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 14px 22px !important;
    border-top: 1px solid #e2e8f0 !important;
    background: #ffffff !important;
}

button#kb-btn-apply-bulk-items {
    background: #10b981 !important;
    color: #ffffff !important;
    border: none !important;
    padding: 9px 22px !important;
    border-radius: 6px !important;
    font-size: 13.5px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3) !important;
    transition: background-color 0.15s ease !important;
}

button#kb-btn-apply-bulk-items:hover {
    background: #059669 !important;
}

.kb-bulk-modal-footer button.kb-close-modal {
    background: #ffffff !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
    padding: 8px 20px !important;
    border-radius: 6px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

.kb-bulk-modal-footer button.kb-close-modal:hover {
    background: #f9fafb !important;
    color: #111827 !important;
    border-color: #9ca3af !important;
}

/* ==========================================================================
   Edit Saved Invoice (Item & Description Table Only) Styles
   ========================================================================== */
.kb-btn-edit-inv {
    background: #f59e0b !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
    padding: 4px 10px !important;
    font-size: 11.5px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

.kb-btn-edit-inv:hover {
    background: #d97706 !important;
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.3) !important;
}

.kb-edit-mode-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    background: #fffbeb;
    border: 1.5px solid #fde68a;
    border-left: 5px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 18px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
    animation: kbDropdownFadeIn 0.2s ease-out;
    flex-wrap: wrap;
}

.kb-edit-mode-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.kb-edit-mode-badge {
    background: #f59e0b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.kb-edit-mode-inv-no {
    font-size: 14.5px;
    font-weight: 800;
    color: #78350f;
}

.kb-edit-mode-hint {
    font-size: 12.5px;
    color: #92400e;
}

#kb-btn-cancel-edit {
    background: #ffffff !important;
    color: #b45309 !important;
    border: 1.5px solid #fcd34d !important;
    font-weight: 700 !important;
    font-size: 12px !important;
    padding: 6px 14px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

#kb-btn-cancel-edit:hover {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
    color: #78350f !important;
}

/* Edit Mode Active State: Lock header fields and highlight item table */
.kb-edit-mode-active .kb-card-section:not(.kb-items-section) {
    position: relative;
}

.kb-edit-mode-active input.kb-locked-field,
.kb-edit-mode-active select.kb-locked-field,
.kb-edit-mode-active textarea.kb-locked-field,
.kb-edit-mode-active .kb-customer-select-wrapper.kb-locked-field {
    background-color: #f8fafc !important;
    color: #64748b !important;
    cursor: not-allowed !important;
    opacity: 0.82 !important;
    pointer-events: none !important;
    border-color: #cbd5e1 !important;
    user-select: none !important;
}

.kb-edit-mode-active #kb-btn-change-customer,
.kb-edit-mode-active #kb-btn-edit-selected-client {
    display: none !important;
}

/* Highlight Items Table in Edit Mode */
.kb-edit-mode-active #kb-items-table {
    box-shadow: 0 0 0 2px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.15) !important;
    border-radius: 8px !important;
}

.kb-edit-mode-active #kb-items-table thead th {
    background-color: #eff6ff !important;
    color: #1e40af !important;
}

.kb-edit-mode-active button[type="submit"] {
    background: #2563eb !important;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35) !important;
    font-size: 14px !important;
    padding: 10px 24px !important;
}


