﻿* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", "NotoSansDevanagari", "Nirmala UI", Mangal, Arial, sans-serif;
    background: #f4f7f7;
    color: #1f2933;
}
a { color: #0f766e; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: #0f766e;
    color: #fff;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.topbar-logo {
    width: 48px;
    height: 48px;
    background: #fff;
    border-radius: 8px;
    padding: 3px;
    object-fit: contain;
    flex-shrink: 0;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; }
.topbar .meta { font-size: 13px; opacity: 0.95; }
.nav {
    background: #115e59;
    padding: 0 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
}
.nav a, .nav .nav-drop > span {
    color: #fff;
    display: inline-block;
    padding: 10px 14px;
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
}
.nav a:hover, .nav a.active,
.nav .nav-drop:hover > span,
.nav .nav-drop.active > span { background: #0f766e; }
.nav-drop { position: relative; }
.nav-drop > span { cursor: pointer; }
.nav-drop-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #0f766e;
    z-index: 40;
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.nav-drop:hover > .nav-drop-menu,
.nav-drop:focus-within > .nav-drop-menu { display: block; }
.nav-drop-menu a {
    display: block;
    padding: 9px 14px;
    color: #fff;
    text-decoration: none;
}
.nav-drop-menu a:hover, .nav-drop-menu a.active { background: #115e59; }
.nav-drop-menu .nav-sub { display: block; position: relative; }
.nav-drop-menu .nav-sub > span {
    display: block;
    padding: 9px 14px;
    color: #fff;
    cursor: pointer;
}
.nav-drop-menu .nav-sub > span:after { content: " \25B8"; font-size: 11px; }
.nav-drop-menu .nav-sub > .nav-drop-menu {
    display: none;
    top: 0;
    left: 100%;
    min-width: 220px;
}
.nav-drop-menu .nav-sub:hover > .nav-drop-menu,
.nav-drop-menu .nav-sub:focus-within > .nav-drop-menu { display: block; }
.nav-drop-menu .nav-sub:hover > span,
.nav-drop-menu .nav-sub.active > span { background: #115e59; }

.page { padding: 20px 24px 40px; max-width: 1280px; margin: 0 auto; }
.card {
    background: #fff;
    border: 1px solid #d7e3e2;
    padding: 16px 18px;
    margin-bottom: 16px;
}
h2 { margin: 0 0 12px; font-size: 20px; color: #134e4a; }
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: flex-end;
}
.field { display: flex; flex-direction: column; min-width: 160px; }
.field label { font-size: 12px; margin-bottom: 4px; color: #52606d; }
.field .req { color: #b91c1c; font-weight: 700; }
.ward-list {
    min-height: 140px;
    width: 100%;
    max-width: 420px;
}
input[type=text], input[type=password], input[type=date], select {
    border: 1px solid #cbd5d1;
    padding: 7px 8px;
    font-size: 14px;
    min-width: 160px;
    font-family: "Segoe UI", "NotoSansDevanagari", "Nirmala UI", Mangal, Arial, sans-serif;
}
.btn {
    background: #0f766e;
    color: #fff;
    border: 0;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
}
.btn:hover { background: #115e59; }
.btn-light { background: #64748b; }
.msg { color: #b91c1c; margin: 8px 0; font-size: 14px; }
.ok { color: #166534; }
.count { font-size: 13px; color: #52606d; margin: 8px 0; }

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
table.data th, table.data td {
    border-bottom: 1px solid #e4eceb;
    padding: 7px 8px;
    text-align: left;
    vertical-align: top;
}
table.data th { background: #ecf5f4; color: #134e4a; font-weight: 600; }
table.data tr:hover td { background: #f8fbfb; }
table.data tr.bill-paid td { background: #dcfce7 !important; }
table.data tr.bill-paid:hover td { background: #bbf7d0 !important; }
.grid-wrap { overflow-x: auto; }

.login-wrap {
    max-width: 420px;
    margin: 80px auto;
    background: #fff;
    border: 1px solid #d7e3e2;
    padding: 28px;
    text-align: center;
}
.login-wrap h1 { margin: 0 0 6px; font-size: 20px; line-height: 1.3; color: #0f766e; }
.login-logo {
    display: block;
    width: 110px;
    height: auto;
    margin: 0 auto 14px;
}
.login-wrap p { margin: 0 0 18px; color: #334155; font-size: 15px; font-weight: 600; }
.login-wrap .field { margin-bottom: 12px; text-align: left; }
.login-wrap input { width: 100%; }
.login-wrap .otp-row { text-align: left; margin: 0 0 12px; }
.login-wrap .otp-row .btn { min-width: 120px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.home-grid a {
    display: block;
    background: #fff;
    border: 1px solid #d7e3e2;
    padding: 18px;
    color: #134e4a;
    text-decoration: none;
}
.home-grid a:hover { border-color: #0f766e; }
.home-grid strong { display: block; font-size: 16px; margin-bottom: 4px; }
.home-grid span { font-size: 13px; color: #52606d; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
    margin: 8px 0 18px;
}
.kpi {
    background: #fff;
    border: 1px solid #d7e3e2;
    padding: 16px 18px;
}
.kpi .label { display: block; font-size: 13px; color: #52606d; margin-bottom: 6px; }
.kpi .value { display: block; font-size: 24px; font-weight: 700; color: #0f766e; }
.kpi .sub { display: block; font-size: 12px; color: #64748b; margin-top: 4px; }
a.kpi-link { text-decoration: none; color: inherit; display: block; }
a.kpi-link:hover { border-color: #0f766e; }

h3 { margin: 0 0 12px; font-size: 16px; color: #134e4a; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px 16px;
}
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 24px;
}
.profile-grid .label { display: block; font-size: 12px; color: #52606d; margin-bottom: 4px; }
.profile-grid .value { display: block; font-size: 15px; font-weight: 600; color: #134e4a; }
input[readonly], input[disabled], select[disabled] {
    background: #f1f5f4;
    color: #334155;
}
.amount-value { font-size: 18px; font-weight: 700; color: #0f766e; }
.paying-amount { font-weight: 700; }
.collect-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 8px 0 14px;
}
.form-actions { margin-top: 14px; }
.form-actions .btn { margin-right: 8px; }
.hint { display: block; font-size: 11px; color: #64748b; margin-top: 4px; }
.btn-danger, a.danger { color: #b91c1c; }
.btn.btn-danger { background: #b91c1c; color: #fff; }
.btn.btn-danger:hover { background: #991b1b; }
table.data a { margin-right: 8px; white-space: nowrap; }
.action-btn {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 4px 4px 0;
    border: 0;
    border-radius: 4px;
    background: #0f766e;
    color: #fff !important;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
}
.action-btn:hover { background: #115e59; color: #fff !important; }
.action-btn.danger { background: #b91c1c; }
.action-btn.danger:hover { background: #991b1b; }
table.data a.action-btn { margin-right: 4px; }

.bill-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 900px;
    margin: 16px auto 8px;
}
.bill-sheet {
    max-width: 900px;
    margin: 0 auto 40px;
    background: #fff;
    border: 1px solid #d7e3e2;
    padding: 24px;
}
.bill-head { text-align: center; margin-bottom: 16px; }
.bill-head h1 { margin: 0; font-size: 22px; color: #0f766e; }
.bill-head h2 { margin: 4px 0 0; font-size: 16px; color: #134e4a; }
.bill-head p { margin: 6px 0 0; color: #52606d; }
.bill-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.bill-meta span { display: block; font-size: 11px; color: #64748b; }
.bill-info, .bill-tax {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}
.bill-info th, .bill-info td, .bill-tax th, .bill-tax td {
    border: 1px solid #d7e3e2;
    padding: 6px 8px;
    text-align: left;
}
.bill-info th { width: 18%; background: #ecf5f4; color: #134e4a; }
.bill-tax th { background: #0f766e; color: #fff; }
.bill-tax td:nth-child(2),
.bill-tax td:nth-child(3),
.bill-tax td:nth-child(4),
.bill-tax th:nth-child(2),
.bill-tax th:nth-child(3),
.bill-tax th:nth-child(4) { text-align: right; }
.bill-tax tr.total td { font-weight: 700; background: #ecf5f4; }
.bill-note { font-size: 12px; color: #64748b; }

body.mmc-bill-body {
    background: #e8eceb;
    font-family: "NotoSansDevanagari", "Nirmala UI", Mangal, "Segoe UI", Arial, sans-serif;
    padding: 16px;
    box-sizing: border-box;
    page: mmc-bill;
}
@font-face {
    font-family: "NotoSansDevanagari";
    src: url("fonts/NotoSansDevanagari-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "NotoSansDevanagari";
    src: url("fonts/NotoSansDevanagari-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
.mmc-sheet {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    width: 297mm;
    max-width: 100%;
    margin: 0 auto;
    min-height: 200mm;
    box-sizing: border-box;
}
.mmc-bill {
    flex: 1 1 50%;
    width: 50%;
    background: #fff;
    border: 1.5px solid #111;
    padding: 12px;
    box-sizing: border-box;
    font-size: 9px;
    line-height: 1.25;
    position: relative;
}
.mmc-logo {
    position: absolute;
    top: 4px;
    left: 6px;
    width: 82px;
    height: auto;
    z-index: 2;
}
.mmc-copy {
    text-align: right;
    font-size: 10px;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    min-height: 14px;
}
.mmc-head { text-align: center; margin-bottom: 4px; padding: 0 8px 0 90px; }
.mmc-org { font-size: 15px; font-weight: 700; }
.mmc-building { font-size: 10px; margin-top: 1px; }
.mmc-dept { font-size: 10px; font-weight: 700; }
.mmc-title { font-size: 12px; font-weight: 700; margin-top: 2px; text-decoration: underline; }
.mmc-law { font-size: 8px; margin-top: 2px; }
.mmc-year { font-size: 10px; font-weight: 700; margin-top: 2px; }
.mmc-info, .mmc-tax {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5px;
    margin-top: 4px;
}
.mmc-info th, .mmc-info td, .mmc-tax th, .mmc-tax td {
    border: 1px solid #111;
    padding: 2px 4px;
    vertical-align: top;
}
.mmc-info th { width: 22%; background: #f3f3f3; font-weight: 700; text-align: left; }
.mmc-tax th { background: #f3f3f3; text-align: center; font-weight: 700; }
.mmc-tax td:nth-child(1) { text-align: center; width: 28px; }
.mmc-tax td:nth-child(2) { text-align: left; }
.mmc-tax td:nth-child(3) { text-align: center; white-space: nowrap; }
.mmc-tax td:nth-child(4),
.mmc-tax td:nth-child(5),
.mmc-tax td:nth-child(6) { text-align: right; white-space: nowrap; }
.mmc-tax.mmc-receipt td:nth-child(3),
.mmc-tax.mmc-receipt td:nth-child(4),
.mmc-tax.mmc-receipt td:nth-child(5),
.mmc-tax.mmc-receipt td:nth-child(6) { text-align: right; white-space: nowrap; }
.mmc-tax tr.mmc-total td { font-weight: 700; background: #f3f3f3; }
.mmc-words { margin-top: 5px; font-size: 9px; font-weight: 700; }
.mmc-cheque { margin-top: 4px; font-size: 9px; font-weight: 700; min-height: 12px; }
.mmc-bill-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 6px; }
.mmc-foot-left { flex: 1; min-width: 0; }
.mmc-sign { margin-top: 0; text-align: right; font-size: 9px; font-weight: 700; flex-shrink: 0; }
.mmc-sign-img {
    display: block;
    margin: 0 0 2px auto;
    width: 118px;
    height: auto;
    max-height: 52px;
    object-fit: contain;
}
.mmc-ack { margin-top: 0; padding-top: 0; font-size: 9px; }
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}
.page-btn {
    display: inline-block;
    min-width: 32px;
    padding: 5px 9px;
    border: 1px solid #0f766e;
    background: #fff;
    color: #0f766e;
    text-align: center;
    cursor: pointer;
    font-size: 13px;
    text-decoration: none;
}
a.page-btn:hover, .page-btn:hover { background: #ecf5f4; text-decoration: none; }
.page-btn.current, a.page-btn.current {
    background: #0f766e;
    color: #fff;
}
.page-btn[disabled] { opacity: 0.45; cursor: default; }
.page-info { font-size: 13px; color: #52606d; margin-left: 6px; }
.mmc-ack div { margin-bottom: 4px; }
.mmc-slogan { font-weight: 700; text-align: left; margin-top: 0; }

.official-report { font-family: "Segoe UI", "NotoSansDevanagari", "Nirmala UI", Mangal, Arial, sans-serif; }
.official-report .org {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #134e4a;
    margin: 0 0 2px;
}
.official-report .title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
    text-decoration: underline;
}
.official-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 16px;
    font-size: 13px;
    margin-bottom: 12px;
}
.official-meta span { color: #64748b; }
.official-meta strong { font-weight: 600; color: #134e4a; }
.report-sign {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
    text-align: center;
    font-size: 13px;
}
.report-sign .sign-pad { height: 56px; }
.report-sign .line {
    border-top: 1px solid #111;
    padding-top: 6px;
    font-weight: 600;
}
.report-sign .note { font-size: 12px; color: #52606d; margin-top: 4px; }
.report-table.compact { font-size: 12px; }
.report-table .group { text-align: center; background: #0f766e; color: #fff; }
.report-table td.head-name {
    font-family: "NotoSansDevanagari", "Nirmala UI", Mangal, "Segoe UI", Arial, sans-serif;
}
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th, .report-table td {
    border: 1px solid #d7e3e2;
    padding: 6px 8px;
    text-align: left;
}
.report-table th { background: #ecf5f4; color: #134e4a; }
.report-table td.num, .report-table th.num { text-align: right; white-space: nowrap; }
.report-table tr.section td { background: #0f766e; color: #fff; font-weight: 700; }
.report-table tr.total td { background: #ecf5f4; font-weight: 700; }
.report-table tr.grand td { background: #134e4a; color: #fff; font-weight: 700; }
.report-kpis { margin-bottom: 12px; }

@page {
    size: A4 landscape;
    margin: 0;
}
@page mmc-bill {
    size: A4 landscape;
    margin: 12mm;
}
@page {
    @top-left { content: none; }
    @top-center { content: none; }
    @top-right { content: none; }
    @bottom-left { content: none; }
    @bottom-center { content: none; }
    @bottom-right { content: none; }
}

.print-edge-mask { display: none; }

@media print {
    .no-print, .topbar, .nav {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
        height: auto;
    }
    body.mmc-bill-body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        width: 100% !important;
        height: auto !important;
    }
    .page { max-width: none; padding: 14mm 10mm 10mm 10mm !important; margin: 0; }
    .card { border: 0; padding: 0; box-shadow: none; }
    .print-edge-mask { display: none !important; }
    .report-table th, .report-table tr.section td, .report-table tr.total td, .report-table tr.grand td,
    .report-table .group {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .report-sign { page-break-inside: avoid; }
    .report-sign .sign-pad { height: 16mm; }
    .consolidated-sheet {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
        max-height: 100%;
        overflow: visible;
    }
    .consolidated-main { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
    .consolidated-sheet .grid-wrap { flex: 1 1 auto; min-height: 0; overflow: hidden; }
    .consolidated-sheet .report-table { height: auto !important; }
    .consolidated-sheet .report-sign {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        flex: 0 0 auto !important;
        margin-top: auto;
        visibility: visible !important;
    }
    .mmc-sheet {
        width: 100%;
        max-width: 100%;
        height: auto;
        margin: 0;
        gap: 6px;
        box-sizing: border-box;
    }
    .mmc-bill {
        page-break-inside: avoid;
        height: 100%;
    }
    .mmc-sign-img, .mmc-logo {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
