/* ==========================================================================
   Karbandhu Tax Platform - Core Scoped Public Stylesheet (v3.4.1)
   100% Compatible across PC, Tablet & Mobile with Zero Margin Loss
   Optimized 0-RTT, Zero Layout Shift, Fluid Responsive Containers
   ========================================================================== */

/* Universal Box Sizing & Fluid Reset */
*, *::before, *::after {
    box-sizing: border-box;
}

.kb-auth-container, .kb-sticky-banner, .kb-dashboard-wrapper, .kb-customer-dash, .kb-prof-dash, .kb-btn, .kb-fullbleed-wrapper {
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#wpadminbar { display: none !important; }
html { margin-top: 0px !important; }

/* Global Fluid Root Variables */
:root {
    --kb-gutter-pc: clamp(16px, 3vw, 32px);
    --kb-gutter-tablet: 20px;
    --kb-gutter-mobile: 14px;
    --kb-radius-lg: 16px;
    --kb-radius-md: 12px;
    --kb-radius-sm: 8px;
    --kb-primary: #1e40af;
    --kb-primary-hover: #1d4ed8;
    --kb-prof-primary: #7c3aed;
    --kb-prof-hover: #6d28d9;
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.kb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 44px; /* Accessible touch target */
    font-size: 14px;
    font-weight: 700;
    border-radius: var(--kb-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
    text-align: center;
}
.kb-btn-primary { background: #1e40af; color: #ffffff !important; }
.kb-btn-primary:hover { background: #1d4ed8; transform: translateY(-1px); }
.kb-btn-secondary { background: #7c3aed; color: #ffffff !important; }
.kb-btn-secondary:hover { background: #6d28d9; transform: translateY(-1px); }
.kb-btn-outline { background: transparent; border: 2px solid #cbd5e1; color: #334155; }
.kb-btn-outline:hover { background: #f1f5f9; border-color: #94a3b8; }
.kb-btn-sm { padding: 8px 14px; min-height: 36px; font-size: 12.5px; border-radius: 6px; }
.kb-btn-success { background: #059669; color: #fff !important; }
.kb-btn-danger { background: #dc2626; color: #fff !important; border: none; padding: 8px 14px; min-height: 36px; border-radius: 6px; cursor: pointer; }

/* ==========================================================================
   Sticky Top Banner (Responsive Header Overlay)
   ========================================================================== */
.kb-sticky-banner {
    position: sticky;
    top: 0;
    z-index: 99999;
    width: 100%;
    padding: 10px var(--kb-gutter-pc);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.kb-banner-customer { background: linear-gradient(90deg, #1e40af 0%, #0284c7 100%); color: #ffffff; }
.kb-banner-prof { background: linear-gradient(90deg, #5b21b6 0%, #7c3aed 100%); color: #ffffff; }
.kb-banner-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.kb-banner-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.kb-banner-badge { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 20px; font-size: 12px; text-transform: uppercase; font-weight: 700; white-space: nowrap; }
.kb-banner-greeting { font-size: 14px; font-weight: 600; }
.kb-banner-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.kb-banner-link { color: #ffffff; text-decoration: underline; font-size: 13px; font-weight: 600; white-space: nowrap; }
.kb-banner-logout { background: rgba(255,255,255,0.2); color: #ffffff; padding: 6px 14px; border-radius: 6px; text-decoration: none; font-size: 12px; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; }
.kb-banner-logout:hover { background: rgba(255,255,255,0.3); }

/* ==========================================================================
   Authentication Containers & Forms
   ========================================================================== */
.kb-auth-container {
    max-width: 520px;
    width: 100%;
    margin: 40px auto;
    background: #ffffff;
    border-radius: var(--kb-radius-lg);
    padding: clamp(20px, 4vw, 36px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}
.kb-card-glow { border-top: 4px solid #1e40af; }
.kb-prof-theme { border-top: 4px solid #7c3aed; }
.kb-auth-title { font-size: clamp(20px, 3vw, 26px); font-weight: 800; margin: 0 0 6px 0; color: #0f172a; }
.kb-auth-sub { font-size: 14px; color: #64748b; margin: 0 0 24px 0; }
.kb-form-group { margin-bottom: 18px; }
.kb-form-group label { display: block; font-size: 13.5px; font-weight: 700; color: #334155; margin-bottom: 6px; }
.kb-form-group input[type="text"],
.kb-form-group input[type="email"],
.kb-form-group input[type="password"],
.kb-form-group input[type="number"],
.kb-form-group input[type="date"],
.kb-form-group select,
.kb-form-group textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: var(--kb-radius-sm);
    font-size: 14px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    box-sizing: border-box;
}
.kb-form-group textarea { min-height: 90px; }
.kb-form-group input:focus, .kb-form-group select:focus, .kb-form-group textarea:focus {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.kb-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kb-checkbox-group { margin-bottom: 12px; }
.kb-custom-checkbox { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #475569; cursor: pointer; min-height: 36px; }
.kb-multiselect-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    background: #f1f5f9;
    padding: 12px;
    border-radius: var(--kb-radius-sm);
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   Dashboard Layout & Navigation
   ========================================================================== */
.kb-dashboard-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 30px auto;
    padding: 0 var(--kb-gutter-pc);
}
.kb-dash-header {
    background: #ffffff;
    border-radius: var(--kb-radius-lg);
    padding: clamp(18px, 3vw, 28px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 24px;
}
.kb-customer-banner-card { border-left: 6px solid #1e40af; }
.kb-prof-banner-card { border-left: 6px solid #7c3aed; }
.kb-dash-badge { display: inline-block; padding: 4px 12px; background: #e0f2fe; color: #0369a1; border-radius: 20px; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.kb-prof-badge { background: #f3e8ff; color: #6b21a8; }
.kb-dash-welcome { font-size: clamp(20px, 3.5vw, 28px); font-weight: 800; margin: 0 0 4px 0; color: #0f172a; }
.kb-dash-subid { font-size: 14px; color: #64748b; margin: 0; }

/* Dashboard Navigation Bar (Horizontal Touch Scrolling) */
.kb-dash-nav-grid, .kb-cust-nav-bar, .kb-prof-nav-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.kb-dash-nav-grid::-webkit-scrollbar, .kb-cust-nav-bar::-webkit-scrollbar, .kb-prof-nav-bar::-webkit-scrollbar {
    height: 4px;
}
.kb-dash-nav-grid::-webkit-scrollbar-thumb, .kb-cust-nav-bar::-webkit-scrollbar-thumb, .kb-prof-nav-bar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.kb-tab-content { display: none; }
.kb-tab-content.active { display: block; }
.kb-tab-btn {
    padding: 10px 18px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: var(--kb-radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    flex-shrink: 0;
}
.kb-tab-btn:hover, .kb-tab-btn.active { background: #1e40af; color: #ffffff; border-color: #1e40af; }
.kb-prof-nav .kb-tab-btn:hover, .kb-prof-nav .kb-tab-btn.active, .kb-prof-nav-bar .kb-tab-btn.active, .kb-prof-nav-bar .kb-prof-tab.active {
    background: #fff7ed !important;
    color: #ea580c !important;
    border-color: #fed7aa !important;
    box-shadow: 0 4px 12px rgba(234,88,12,0.18) !important;
}
.kb-prof-nav-bar .kb-tab-btn:hover:not(.active), .kb-prof-nav-bar .kb-prof-tab:hover:not(.active) { background: #fff7ed !important; color: #ea580c !important; }
.kb-tab-logout { margin-left: auto; background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.kb-tab-logout:hover { background: #dc2626; color: #ffffff; }

.kb-header-chat-btn .kb-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 10px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    font-family: 'Inter', system-ui, sans-serif;
    box-shadow: 0 2px 6px rgba(239,68,68,0.4);
}

/* Customer & Professional Specific Dash Buttons */
.kb-customer-dash .kb-tab-btn { background: #f1f5f9; border: 1px solid #cbd5e1; color: #1e40af; padding: 10px 20px; border-radius: 24px; font-size: 13.5px; }
.kb-customer-dash .kb-tab-btn:hover, .kb-customer-dash .kb-tab-btn.active { background: #1d4ed8; color: #ffffff; border-color: #1d4ed8; box-shadow: 0 4px 14px rgba(29,78,216,0.35); }
.kb-customer-dash .kb-tab-logout { background: rgba(239,68,68,0.1) !important; color: #dc2626 !important; border-color: #fca5a5 !important; }
.kb-customer-dash .kb-tab-logout:hover { background: #dc2626 !important; color: #ffffff !important; }

/* ==========================================================================
   Cards, Grids & Services
   ========================================================================== */
.kb-card {
    background: #ffffff;
    border-radius: var(--kb-radius-lg);
    padding: clamp(18px, 3vw, 28px);
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    margin-bottom: 24px;
    width: 100%;
}
.kb-card h2 { font-size: clamp(18px, 2.5vw, 22px); font-weight: 800; margin: 0 0 20px 0; color: #0f172a; }
.kb-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    width: 100%;
}
.kb-service-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: var(--kb-radius-md); padding: 24px; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.kb-service-card:hover { transform: translateY(-4px); background: #ffffff; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }
.kb-service-icon { font-size: 36px; margin-bottom: 12px; }
.kb-service-card h3 { font-size: 18px; font-weight: 800; margin: 0 0 8px 0; color: #0f172a; }
.kb-service-card p { font-size: 13px; color: #64748b; margin: 0 0 16px 0; line-height: 1.5; }

/* Progress Steppers */
.kb-tracker-card { background: #ffffff; border: 1px solid #e2e8f0; border-radius: var(--kb-radius-md); padding: clamp(16px, 3vw, 24px); margin-bottom: 16px; width: 100%; }
.kb-tracker-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; gap: 10px; }
.kb-progress-stepper { display: flex; justify-content: space-between; align-items: center; position: relative; padding: 0 10px; width: 100%; }
.kb-step { display: flex; flex-direction: column; align-items: center; z-index: 2; text-align: center; flex: 1; }
.kb-step-circle { width: 36px; height: 36px; border-radius: 50%; background: #e2e8f0; color: #64748b; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; margin-bottom: 8px; flex-shrink: 0; }
.kb-step.completed .kb-step-circle { background: #059669; color: #ffffff; }
.kb-step.active .kb-step-circle { background: #2563eb; color: #ffffff; }
.kb-step-label { font-size: 12px; font-weight: 600; color: #475569; max-width: 100px; line-height: 1.3; }
.kb-step-line { flex-grow: 1; height: 3px; background: #e2e8f0; margin: 0 8px; position: relative; top: -14px; }
.kb-step-line.active { background: #059669; }

/* ==========================================================================
   Responsive Tables & Vault Document Views
   ========================================================================== */
.kb-verif-table-wrap, .kb-table-responsive-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(15,23,42,0.06);
    width: 100%;
    max-width: 100%;
    margin-bottom: 18px;
}
.kb-verif-table, .kb-table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    background: #ffffff;
}
.kb-table th, .kb-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #e2e8f0; font-size: 13px; }
.kb-table th { background: #f8fafc; color: #475569; font-weight: 700; }
.kb-verif-table thead th { padding: 14px 16px; background: #f8fafc; color: #334155; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; border-bottom: 1px solid #e2e8f0; white-space: nowrap; }
.kb-verif-table tbody td { padding: 15px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; color: #475569; font-size: 14.5px; line-height: 1.5; text-align: center; }
.kb-verif-table tbody tr:last-child td { border-bottom: none; }
.kb-verif-table tbody tr { transition: background-color 0.12s ease; }
.kb-verif-table tbody tr:nth-child(even) { background: #fafbfc; }
.kb-col-sno { width: 60px; text-align: center !important; color: #94a3b8 !important; font-weight: 600; }
.kb-col-actions { width: 205px; text-align: center !important; }
.kb-verif-doc { display: flex; align-items: center; justify-content: center; gap: 10px; min-width: 0; }
.kb-verif-icon { font-size: 20px; line-height: 1; flex: 0 0 auto; }
.kb-verif-title { font-weight: 700; color: #0f172a; word-break: break-word; }
.kb-verif-fname { width: 22%; }
.kb-verif-fname-inner { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-verif-fname-inner a { color: #2563eb; text-decoration: none; font-weight: 600; }
.kb-verif-fname-inner a:hover { text-decoration: underline; }
.kb-verif-date { white-space: nowrap; color: #64748b; }
.kb-verif-badge { display: inline-block; padding: 5px 13px; border-radius: 20px; font-size: 13.5px; font-weight: 800; letter-spacing: 0.2px; white-space: nowrap; }
.kb-verif-badge-ok { background: #dcfce7; color: #15803d; }
.kb-verif-badge-pending { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.kb-verif-actions { display: inline-flex; gap: 10px; white-space: nowrap; }
.kb-verif-btn-view, .kb-verif-btn-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    line-height: 1.4;
    box-sizing: border-box;
}
.kb-verif-btn-view { background-color: transparent !important; color: #2563eb !important; border-color: #cbd5e1 !important; }
.kb-verif-btn-del { background-color: transparent !important; color: #dc2626 !important; border-color: #cbd5e1 !important; }

/* Status & Notices */
.kb-notice { padding: 12px 16px; border-radius: var(--kb-radius-sm); font-size: 13.5px; font-weight: 600; margin-top: 14px; line-height: 1.4; }
.kb-notice-success { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.kb-notice-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ==========================================================================
   Shortcode Embed Wrappers & Ancestor Neutralization
   ========================================================================== */
html body:has(.kb-fullbleed-wrapper) {
    background-color: #0b132b;
    background: #0b132b;
    overflow-x: hidden;
    overflow-x: clip;
}
body:has(.kb-fullbleed-wrapper) #page,
body:has(.kb-fullbleed-wrapper) #content,
body:has(.kb-fullbleed-wrapper) .site-content,
body:has(.kb-fullbleed-wrapper) .ast-container,
body:has(.kb-fullbleed-wrapper) #primary,
body:has(.kb-fullbleed-wrapper) .site-main,
body:has(.kb-fullbleed-wrapper) article,
body:has(.kb-fullbleed-wrapper) .entry-content,
body:has(.kb-fullbleed-wrapper) .post-content {
    background: transparent;
    box-shadow: none;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    max-width: 100%;
    width: 100%;
}
.kb-fullbleed-wrapper {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    box-sizing: border-box;
    padding: 0;
    overflow-x: hidden;
    overflow-x: clip;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
}
.kb-fullbleed-wrapper img,
.kb-fullbleed-wrapper svg,
.kb-fullbleed-wrapper video,
.kb-fullbleed-wrapper iframe {
    max-width: 100%;
    height: auto;
}
.kb-fullbleed-wrapper table {
    max-width: 100%;
}
.kb-fullbleed-wrapper td,
.kb-fullbleed-wrapper th {
    word-break: break-word;
}

/* ==========================================================================
   📱 ADAPTIVE MEDIA QUERIES (PC, TABLET, MOBILE)
   ========================================================================== */

/* 🖥️ 1. PC & Large Displays (>= 1024px) */
@media (min-width: 1024px) {
    .kb-svc-card {
        display: grid !important;
        grid-template-columns: 32px 32px minmax(120px,2fr) minmax(150px,3fr) minmax(90px,1fr) auto;
        align-items: center;
        gap: 14px;
    }
    .kb-prof-card {
        display: grid !important;
        grid-template-columns: 36px minmax(130px,2fr) minmax(160px,3fr) minmax(120px,2fr) auto;
        align-items: center;
        gap: 14px;
    }
    .kb-svc-card > div, .kb-prof-card > div { min-width: 0; }
    .kb-svc-card > div:last-child { justify-content: flex-end; flex-wrap: wrap; margin-left: 0 !important; }
    .kb-prof-card > div:last-child { margin-left: 0 !important; }
    .kb-svc-card > div[style*="flex:1 1 100%"], .kb-prof-card > div[style*="flex:1 1 100%"] { grid-column: 1 / -1; }
}

/* 📲 2. Tablet View (768px to 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .kb-dashboard-wrapper {
        padding: 0 var(--kb-gutter-tablet);
        margin: 20px auto;
    }
    .kb-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    .kb-banner-content {
        padding: 0 var(--kb-gutter-tablet);
    }
    .kb-form-row {
        gap: 10px;
    }
    .kb-auth-container {
        margin: 24px auto;
        padding: 28px 24px;
    }
}

/* 📱 3. Mobile View (< 768px down to 320px) — Zero Margin Loss */
@media (max-width: 767px) {
    .kb-dashboard-wrapper {
        padding: 0 var(--kb-gutter-mobile);
        margin: 14px auto;
        width: 100% !important;
    }
    .kb-dash-header {
        padding: 18px 14px;
        border-radius: var(--kb-radius-md);
        margin-bottom: 16px;
    }
    .kb-card {
        padding: 18px 14px;
        border-radius: var(--kb-radius-md);
        margin-bottom: 16px;
    }
    .kb-sticky-banner {
        padding: 8px var(--kb-gutter-mobile);
    }
    .kb-banner-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .kb-banner-right {
        width: 100%;
        justify-content: space-between;
    }
    .kb-auth-container {
        margin: 16px auto;
        padding: 20px 14px;
        border-radius: var(--kb-radius-md);
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }
    .kb-form-row {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .kb-multiselect-box {
        grid-template-columns: 1fr !important;
    }
    .kb-services-grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .kb-progress-stepper {
        flex-wrap: wrap;
        gap: 12px;
        padding: 0;
    }
    .kb-step-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .kb-step-label {
        font-size: 11px;
        max-width: 70px;
    }
    .kb-step-line {
        margin: 0 4px;
        top: -10px;
    }
    .kb-btn {
        width: 100%;
    }
    .kb-tab-btn {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 40px;
    }
    .kb-verif-table {
        min-width: 580px;
    }
    .kb-fin-card > div:first-child {
        grid-template-columns: 1fr !important;
        gap: 8px;
    }
}

/* 📱 4. Ultra-Small Mobile (< 480px) */
@media (max-width: 480px) {
    .kb-dashboard-wrapper {
        padding: 0 10px;
    }
    .kb-card, .kb-dash-header, .kb-auth-container {
        padding: 16px 12px;
    }
    .kb-dash-welcome {
        font-size: 19px;
    }
    .kb-auth-title {
        font-size: 19px;
    }
    .kb-step-line {
        display: none;
    }
    .kb-step {
        flex: 1 1 45%;
        margin-bottom: 8px;
    }
}

