/**
 * Modern, Mobile-First UI Stylesheet for 9th Pay Scale Arrear Bill Calculator
 * Font-family: 'Kalpurush', 'SolaimanLipi', 'Segoe UI', Tahoma, Arial, sans-serif
 */

@font-face {
    font-family: 'Kalpurush';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Kalpurush'),
        url('../assets/fonts/kalpurush.woff2') format('woff2');
}

:root {
    --primary: #006a4e;
    /* Bangladesh Green */
    --primary-hover: #00523c;
    --primary-light: #e8f5e9;
    --secondary: #dc2626;
    /* Bangladesh Crimson */
    --secondary-hover: #b91c1c;
    --accent: #f59e0b;
    /* Amber accent */
    --accent-light: #fef3c7;
    --dark: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-sheet: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --bottom-ad-offset: 75px;
}

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

body,
input,
select,
button,
textarea,
.tab-btn,
.badge,
.live-calc-strip {
    font-family: 'Kalpurush', 'SolaimanLipi', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* Strictly retain official Kalpurush for A4 print sheets and official reports */
.a4-sheet,
.a4-sheet *,
table.report-table,
.sheet-portrait,
.sheet-landscape {
    font-family: 'Kalpurush', 'SolaimanLipi', 'Segoe UI', Tahoma, Arial, sans-serif !important;
}

body {
    background-color: var(--bg-page);
    color: var(--dark);
    line-height: 1.6;
    font-size: 15px;
    padding-bottom: calc(60px + var(--bottom-ad-offset, 0px));
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #004d38 0%, #006a4e 50%, #008764 100%);
    color: #ffffff;
    padding: 28px 0 24px 0;
    text-align: center;
    border-bottom: 4px solid var(--secondary);
    box-shadow: 0 10px 25px -5px rgba(0, 106, 78, 0.25);
    position: relative;
}

.header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 16px;
    border-radius: 30px;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.header-title {
    font-size: 27px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.header-desc {
    font-size: 14.5px;
    color: #d1fae5;
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Tabs */
.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.tab-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

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

.tab-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 106, 78, 0.3);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 8px;
}

/* Card Header Flex with Title & Action Buttons */
.card-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.card-header-flex .card-title {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    border-bottom: none !important;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Subtle, unobtrusive button for Demo Data */
.btn-subtle {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-subtle:hover {
    background: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(0, 106, 78, 0.12);
}

.btn-subtle i {
    color: #64748b;
    font-size: 12px;
    transition: color 0.2s ease;
}

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

/* Subtle reset button */
.btn-subtle-reset {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-subtle-reset:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.12);
}

.btn-subtle-reset i {
    color: #94a3b8;
    font-size: 12px;
    transition: color 0.2s ease;
}

.btn-subtle-reset:hover i {
    color: #dc2626;
}

/* Top Bill Type Hero Selector */
.bill-type-banner {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 2px solid #006a4e;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 106, 78, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bill-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.bill-type-label {
    color: #006a4e;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0 !important;
}

.bill-type-label i {
    color: #006a4e;
    font-size: 18px;
}

.bill-type-badge {
    background: #dcfce7;
    color: #166534;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid #bbf7d0;
}

.bill-type-select {
    border: 2px solid #006a4e !important;
    font-weight: 700 !important;
    color: #006a4e !important;
    padding: 11px 14px !important;
    width: 100%;
    border-radius: 8px !important;
    font-size: 15px !important;
    background-color: #ffffff !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bill-type-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 106, 78, 0.2) !important;
}

.bill-type-note {
    font-size: 12.5px;
    color: #065f46;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Section Header & Card Blocks */
.form-section-block {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.form-section-block:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1.5px solid #f1f5f9;
}

.section-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e8f5e9;
    color: #006a4e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.section-heading-text {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.section-subheading-text {
    font-size: 12.5px;
    color: #64748b;
    margin-top: 2px;
}

/* Responsive Grids */
.grid-2-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3-col {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.col-span-full {
    grid-column: 1 / -1;
}

/* Optional Field Cards in TR-15 Section */
.optional-field-card {
    background: #ffffff;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.optional-field-card:hover {
    border-color: #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.optional-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.optional-field-label {
    font-weight: 600;
    font-size: 13.5px;
    color: #1e293b;
    margin-bottom: 0 !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.optional-field-label i {
    color: #006a4e;
}

/* Action Buttons Container */
.form-action-buttons {
    display: flex;
    gap: 14px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 13px 26px;
    font-size: 15.5px;
    border-radius: 8px;
    font-weight: 700;
}

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

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

.form-group label {
    font-size: 13.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: #006a4e;
    font-size: 13.5px;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-family: inherit;
    color: var(--dark);
    background-color: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 106, 78, 0.15);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Action Buttons */
.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.btn-danger {
    background-color: var(--secondary);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

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

/* Dropzone for Excel */
.dropzone-area {
    border: 2px dashed #94a3b8;
    border-radius: var(--radius-md);
    background-color: #f8fafc;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 20px;
}

.dropzone-area:hover,
.dropzone-area.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
}

.dropzone-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 8px;
}

.dropzone-title {
    font-size: 16px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 4px;
}

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

/* Bulk Table */
.bulk-table-container {
    overflow-x: auto;
    margin: 16px 0;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.bulk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    text-align: left;
}

.bulk-table th {
    background-color: #f1f5f9;
    color: #334155;
    padding: 10px 12px;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.bulk-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.bulk-table tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-success {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-error {
    background-color: #fee2e2;
    color: #b91c1c;
}

.badge-officer {
    background-color: #e0f2fe;
    color: #0369a1;
}

.badge-staff {
    background-color: #fef3c7;
    color: #b45309;
}

/* Report Preview Container */
.report-view-wrapper {
    background-color: #cbd5e1;
    padding: 24px 16px;
    border-radius: var(--radius-md);
    margin-top: 24px;
    overflow-x: auto;
}

.preview-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    background: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 12px;
}

.preview-title {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary);
}

/* Exact Official Document Styles (Matching PDF 1) */
.a4-sheet {
    width: 210mm !important;
    min-height: 296mm !important;
    margin: 0 auto 30px auto;
    padding: 15mm 15mm;
    box-sizing: border-box;
    page-break-after: always;
    background: #fff;
    box-shadow: var(--shadow-sheet);
    color: #000;
}

.sheet-portrait {
    width: 210mm !important;
    min-height: 296mm !important;
    margin: 0 auto 30px auto;
    padding: 10mm 15mm;
    box-sizing: border-box;
    page-break-after: always;
    background: #fff;
    display: block;
    box-shadow: var(--shadow-sheet);
    color: #000;
}

.sheet-landscape {
    width: 297mm !important;
    min-height: 209mm !important;
    margin: 0 auto 30px auto;
    padding: 15mm 15mm;
    box-sizing: border-box;
    page-break-after: always;
    background: #fff;
    display: block;
    box-shadow: var(--shadow-sheet);
    color: #000;
}

h2,
h3 {
    margin-top: 0;
    color: #000;
}

.report-header {
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
}

.meta-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: bold;
}

table {
    border-collapse: collapse;
    width: 100% !important;
    color: #000;
    margin-bottom: 15px;
}

th,
td {
    border: 1px solid #000;
    padding: 6px 5px;
    text-align: center;
    vertical-align: middle;
}

th {
    background-color: #f0f0f0 !important;
    font-weight: bold;
}

.styled-table {
    font-size: 14px;
}

.tr-unified-table {
    font-size: 12px;
    line-height: 1.4;
}

.tr-15-table {
    font-size: 11px;
    line-height: 1.35;
}

.tr-massive-table {
    font-size: 10px;
    table-layout: fixed;
}

.tr-massive-table tbody td {
    font-size: 1em;
    padding: 6px 2px;
}

.eco-code-tr-15 {
    font-size: 7px;
}

.col-check {
    width: 4%;
}

.col-code {
    width: 14%;
}

.col-desc {
    width: 38%;
    text-align: left !important;
    padding-left: 5px !important;
}

.col-tk {
    width: 15%;
}

.col-ps {
    width: 5%;
}

.col-serial {
    width: 3%;
}

.col-name {
    width: 12%;
    text-align: left !important;
}

.tr-top-bar {
    display: block !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    width: 100% !important;
    margin-bottom: 6px !important;
}

.tr-meta-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
}

.tr-meta-row>div {
    flex: 1 1 0 !important;
    min-width: 0 !important;
}

/* Accordion & FAQs */
.accordion-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    overflow: hidden;
    background: #ffffff;
}

.accordion-header {
    padding: 12px 16px;
    font-weight: 600;
    background: #f8fafc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.15s ease;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-header.active {
    background: var(--primary-light);
    color: var(--primary);
}

.accordion-content {
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.6;
    display: none;
    border-top: 1px solid var(--border);
}

.accordion-content.show {
    display: block;
}

/* Floating Action Bar */
.floating-bar {
    position: fixed;
    bottom: calc(20px + var(--bottom-ad-offset, 0px)) !important;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 8px 12px;
    border-radius: 40px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    transition: bottom 0.25s ease;
}

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

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.25s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.25s;
    border-radius: 50%;
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary);
}

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

/* Application Footer & Legal Disclaimer Shield */
.app-footer {
    background: #ffffff;
    border-top: 1px solid var(--border);
    padding: 30px 0 24px 0;
    margin-top: 48px;
    font-size: 13.5px;
    color: #64748b;
    box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.03);
}

.footer-disclaimer-wrapper {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 18px 22px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: all 0.25s ease;
}

.footer-disclaimer-wrapper:hover {
    border-color: #cbd5e1;
}

.disclaimer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 12px;
}

.disclaimer-title {
    font-size: 14.5px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}

.disclaimer-title i {
    color: #006a4e;
    font-size: 16px;
}

.btn-disclaimer-toggle {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #006a4e;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-disclaimer-toggle:hover {
    background: #f0fdf4;
    border-color: #006a4e;
    color: #00523c;
}

.btn-disclaimer-toggle i {
    font-size: 11px;
    transition: transform 0.25s ease;
}

.btn-disclaimer-toggle.active i {
    transform: rotate(180deg);
}

.disclaimer-summary {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13.5px;
    line-height: 1.6;
    color: #334155;
}

.disclaimer-summary i {
    margin-top: 3px;
    font-size: 16px;
}

.text-amber {
    color: #d97706 !important;
}

.disclaimer-full-content {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed #cbd5e1;
    animation: fadeIn 0.3s ease;
}

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

.disclaimer-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.disclaimer-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #006a4e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.disclaimer-item p {
    font-size: 12.8px;
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

.disclaimer-english-box {
    background: #ffffff;
    border-left: 4px solid #006a4e;
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.disclaimer-en-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.disclaimer-english-box p {
    font-size: 12.5px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 6px;
}

.disclaimer-english-box p:last-child {
    margin-bottom: 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-brand {
    font-weight: 700;
    color: var(--primary);
}

.footer-divider {
    color: #cbd5e1;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease, text-decoration 0.2s ease;
}

.footer-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .footer-left,
    .footer-right {
        justify-content: center;
    }

    .header-title {
        font-size: 20px;
    }

    .sheet-portrait,
    .a4-sheet {
        width: 100% !important;
        min-height: auto !important;
        padding: 10px !important;
        margin-bottom: 16px;
        font-size: 11px;
    }

    .sheet-landscape {
        width: 100% !important;
        min-height: auto !important;
        padding: 8px !important;
        margin-bottom: 16px;
        font-size: 8px;
        overflow-x: auto;
    }

    .card-header-flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .form-grid,
    .grid-2-col,
    .grid-3-col {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-section-block {
        padding: 16px 14px;
        margin-bottom: 16px;
    }

    .bill-type-banner {
        padding: 14px;
    }

    .form-action-buttons {
        flex-direction: column;
    }

    .form-action-buttons button {
        width: 100%;
    }

    .meta-info {
        flex-direction: column;
        gap: 6px;
    }
}

/* Live Instant Calculation Preview Strip */
.live-calc-strip {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #86efac;
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 20px 0 10px 0;
    box-shadow: 0 2px 8px rgba(0, 106, 78, 0.06);
}

.live-calc-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 12px;
}

.live-calc-badge i {
    color: var(--primary);
    font-size: 14px;
}

.live-calc-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.metric-item {
    background: #ffffff;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid #dcfce7;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.metric-item.highlight {
    background: #f0fdf4;
    border: 1.5px solid #22c55e;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.15);
}

.metric-label {
    font-size: 12px;
    color: #475569;
    font-weight: 600;
}

.metric-val {
    font-size: 16px;
    font-weight: 700;
}

.text-primary {
    color: #006a4e !important;
}

.text-danger {
    color: #dc2626 !important;
}

.text-success {
    color: #15803d !important;
}

/* Outer Layout Wrapper for Ad Rail Symmetry */
.app-layout-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    position: relative;
    gap: 16px;
    padding: 0 12px;
    box-sizing: border-box;
}

.app-main-layout {
    flex: 1 1 960px;
    max-width: 1080px;
    min-width: 0;
    margin: 0 auto;
    padding: 0 8px;
    width: 100%;
}

/* Side Rails: Sticky Skyscraper Ads (160x600) */
.ad-rail {
    display: none;
    width: 160px;
    min-width: 160px;
    flex-shrink: 0;
    align-self: stretch;
}

.ad-sticky-rail {
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.ad-rail-tag,
.ad-infeed-tag,
.ad-sticky-tag {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.ad-slot-rail {
    width: 160px;
    min-height: 600px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-sm);
}

/* Show Left & Right Side Rails on all standard Desktop & Laptop displays (>= 1080px) at 100% zoom */
@media (min-width: 1080px) {
    .ad-rail {
        display: block;
    }
}

/* On large / ultra-wide screens or when zoomed out, give an elegant centered width */
@media (min-width: 1600px) {
    .app-layout-wrapper {
        width: 80%;
        max-width: 1540px;
    }
}

/* In-Feed Ad Unit (Form to Results Transition) */
.ad-infeed-container {
    width: 100%;
    max-width: 1100px;
    margin: 28px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-slot-infeed {
    width: 100%;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
}

/* Placeholder styling inside ad slots */
.ad-placeholder-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #94a3b8;
    gap: 6px;
    padding: 10px;
}

.ad-placeholder-inner i {
    font-size: 26px;
    color: #cbd5e1;
}

.ad-placeholder-inner span {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.ad-placeholder-inner small {
    font-size: 11px;
    color: #94a3b8;
}

.ad-placeholder-inner.horizontal {
    flex-direction: row;
    gap: 14px;
}

.ad-placeholder-inner.compact {
    flex-direction: row;
    gap: 10px;
}

.ad-placeholder-inner.compact i {
    font-size: 18px;
}

.ad-placeholder-inner.compact span {
    font-size: 12.5px;
}

/* Dismissible Bottom Floating Sticky Ad Banner */
.ad-sticky-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
    border-top: 1px solid var(--border);
    z-index: 990;
    padding: 6px 12px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ad-sticky-bottom.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.ad-sticky-bottom-wrapper {
    position: relative;
    max-width: 970px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ad-close-btn {
    position: absolute;
    top: -12px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.ad-close-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
    transform: scale(1.08);
}

.ad-slot-bottom {
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Generating Bill Interstitial Modal & In-Progress Ad Placement */
.generating-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.generating-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
}

.generating-modal-card {
    position: relative;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    max-width: 680px;
    width: 100%;
    padding: 28px 24px 22px 24px;
    border: 1px solid #cbd5e1;
    z-index: 10;
    animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.generating-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.generating-spinner {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ecfdf5;
    color: #006a4e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    border: 1.5px solid #a7f3d0;
}

.generating-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.generating-subtitle {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.4;
}

.generating-progress-wrap {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.generating-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #006a4e 0%, #10b981 100%);
    border-radius: 10px;
    transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.generating-step-text {
    font-size: 13.5px;
    color: #047857;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.generating-step-text i {
    font-size: 13px;
    color: #10b981;
}

/* Ad Slot Below Generating Bill */
.ad-generating-slot {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.ad-slot-tag {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    font-weight: 600;
    text-transform: uppercase;
}

.ad-generating-content {
    width: 100%;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Monetag Smartlink / Direct Link Ad Cards (High-Converting & Beautiful UI)
   ========================================================================== */
.monetag-direct-card {
    display: flex;
    text-decoration: none !important;
    color: inherit;
    width: 100%;
    box-sizing: border-box;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    font-family: 'Hind Siliguri', sans-serif;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Vertical Skyscraper Card (160x600 for Left & Right Desktop Rails) */
.monetag-direct-card.vertical {
    flex-direction: column;
    justify-content: space-between;
    width: 160px;
    height: 600px;
    min-height: 600px;
    padding: 16px 12px 14px;
    background: linear-gradient(175deg, #091e2b 0%, #12283a 45%, #064e3b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-sm);
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.monetag-direct-card.vertical.alt-theme {
    background: linear-gradient(175deg, #063126 0%, #084c3e 45%, #0369a1 100%);
}

.monetag-direct-card.vertical:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
    border-color: rgba(56, 189, 248, 0.4);
}

.monetag-direct-card.vertical.alt-theme:hover {
    border-color: rgba(52, 211, 153, 0.4);
}

.mdc-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    margin: 0 auto 12px;
}

.mdc-badge.gold {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.mdc-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(15, 23, 42, 0.4) 80%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.25);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transition: transform 0.25s ease;
}

.monetag-direct-card:hover .mdc-icon-wrap {
    transform: scale(1.08);
}

.mdc-icon-wrap.gold {
    color: #fbbf24;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.2) 0%, rgba(15, 23, 42, 0.4) 80%);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.25);
    border-color: rgba(251, 191, 36, 0.3);
}

.mdc-title {
    font-size: 13.5px;
    font-weight: 800;
    line-height: 1.35;
    color: #ffffff;
    margin: 0 0 6px 0;
}

.mdc-desc {
    font-size: 11px;
    line-height: 1.4;
    color: #cbd5e1;
    margin: 0 0 12px 0;
}

.mdc-features {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin: 10px 0 14px;
    text-align: left;
    font-size: 11px;
    color: #e2e8f0;
}

.mdc-feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.25;
}

.mdc-feature-item i {
    color: #34d399;
    font-size: 11px;
    flex-shrink: 0;
}

.mdc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 700;
    color: #0f172a;
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.35);
    transition: all 0.2s ease;
    border: none;
    box-sizing: border-box;
}

.mdc-btn.emerald {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    color: #064e3b;
    box-shadow: 0 4px 12px rgba(52, 211, 153, 0.35);
}

.monetag-direct-card:hover .mdc-btn {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.5);
}

.monetag-direct-card:hover .mdc-btn.emerald {
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.5);
}

.mdc-footer-note {
    font-size: 9.5px;
    color: #94a3b8;
    margin-top: 6px;
}

/* 2. Horizontal Leaderboard / In-Feed / Modal Card */
.monetag-direct-card.horizontal {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(95deg, #0f172a 0%, #1e293b 55%, #064e3b 100%);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    width: 100%;
    gap: 16px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
}

.monetag-direct-card.horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
    border-color: rgba(56, 189, 248, 0.3);
}

.monetag-direct-card.horizontal .mdc-left {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

.monetag-direct-card.horizontal .mdc-icon-wrap {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 20px;
    margin: 0;
}

.monetag-direct-card.horizontal .mdc-content {
    display: flex;
    flex-direction: column;
}

.monetag-direct-card.horizontal .mdc-title {
    font-size: 14px;
    margin: 0 0 3px 0;
}

.monetag-direct-card.horizontal .mdc-desc {
    font-size: 11.5px;
    margin: 0;
    color: #94a3b8;
}

.monetag-direct-card.horizontal .mdc-btn {
    width: auto;
    padding: 8px 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 3. Compact Floating Bottom Dock Card */
.monetag-direct-card.dock {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: linear-gradient(90deg, #1e293b 0%, #0f172a 100%);
    border-radius: 30px;
    color: #ffffff;
    width: 100%;
    max-width: 820px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.monetag-direct-card.dock .mdc-dock-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.monetag-direct-card.dock .mdc-dock-badge {
    background: #0284c7;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.monetag-direct-card.dock .mdc-dock-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monetag-direct-card.dock .mdc-dock-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 100%);
    color: #0f172a;
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 10px;
    transition: transform 0.2s ease;
}

.monetag-direct-card:hover .mdc-dock-cta {
    transform: scale(1.05);
}

/* Mobile Responsive Tweaks for Ad Cards */
@media (max-width: 640px) {
    .monetag-direct-card.horizontal {
        flex-direction: column;
        text-align: center;
        padding: 12px 14px;
        gap: 10px;
    }
    .monetag-direct-card.horizontal .mdc-left {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    .monetag-direct-card.horizontal .mdc-btn {
        width: 100%;
    }
    .monetag-direct-card.dock {
        padding: 5px 10px;
    }
    .monetag-direct-card.dock .mdc-dock-text {
        font-size: 11px;
    }
    .monetag-direct-card.dock .mdc-dock-cta {
        font-size: 10.5px;
        padding: 4px 8px;
    }
}

/* Print Protection: Ensure ad widgets NEVER appear in official print */
@media print {
    .monetag-direct-card,
    .ad-rail,
    .ad-infeed-container,
    .ad-sticky-bottom,
    .generating-modal {
        display: none !important;
        visibility: hidden !important;
    }
}
