@font-face {
    font-family: KalpurushLocal;
    src: local("Kalpurush"), local("Noto Sans Bengali"), local("Vrinda");
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eef2f5;
    color: #222;
    font-family: KalpurushLocal, "Noto Sans Bengali", Arial, sans-serif;
    font-size: 14px;
}

a {
    color: inherit;
}

.topbar {
    align-items: center;
    background: #136f63;
    color: #fff;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 24px;
}

.brand {
    font-size: 19px;
    font-weight: 700;
}

.hidden-admin-profile-link {
    align-self: stretch;
    align-items: center;
    color: rgba(255, 255, 255, 0.1);
    display: flex;
    font-size: 9px;
    margin-right: auto;
    padding: 0 3px;
    text-decoration: none;
}

.hidden-admin-profile-link:focus,
.hidden-admin-profile-link:hover {
    color: rgba(255, 255, 255, 0.55);
}

.nav-actions {
    display: flex;
    gap: 8px;
}

.button,
button {
    align-items: center;
    background: #136f63;
    border: 1px solid #136f63;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    gap: 6px;
    min-height: 36px;
    padding: 7px 14px;
    text-decoration: none;
}

.button.secondary {
    background: #fff;
    border-color: #cbd5d1;
    color: #1c3430;
}

.button.danger {
    background: #a33b36;
    border-color: #a33b36;
}

.button.print {
    background: #2563eb;
    border-color: #2563eb;
}

.receipt-print-button {
    background: #3b82f6;
    border-color: #3b82f6;
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    font-size: 13px;
    font-weight: 600;
    min-height: 28px;
    padding: 4px 12px;
}

.page {
    margin: 24px auto;
    max-width: 1180px;
    padding: 0 16px;
}

.receipt-page {
    background: #f3ffe8;
}

.receipt-page-wrap {
    margin: 0 auto;
    max-width: none;
    padding: 0 16px 80px;
}

.receipt-shell {
    display: flex;
    justify-content: center;
}

#printArea.content {
    margin: 0 auto;
    width: 815px;
}

#printArea .col-md-12 {
    box-sizing: border-box;
    min-height: 1116px;
    padding: 0 15px;
    width: 815px;
}

.receipt {
    background: #fff;
    border: 1px dotted #333;
    border-radius: 10px;
    color: #333;
    font-size: 14px;
    min-height: 1060px;
    line-height: 1.22;
    margin: 30px auto 60px;
    padding: 10px;
    position: relative;
    width: 100%;
}

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

.receipt td,
.receipt th {
    padding: 3px 5px;
}

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

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.input_bangla {
    font-size: 90%;
}

.dotted-bottom {
    border-bottom: 1px dotted #000;
}

.info-table {
    margin-top: 5px;
    width: 100%;
}

.receipt .info-table:first-of-type {
    margin-top: 0;
}

.receipt .top-info-table td {
    font-size: 14px !important;
    line-height: 1.2 !important;
    padding: 0 !important;
}

.receipt .info-table td {
    font-weight: 400;
    line-height: 1.05;
    padding: 0 5px;
    vertical-align: bottom;
    white-space: nowrap;
}

.receipt .info-table .dotted-bottom,
.receipt .office-line-table .dotted-bottom {
    background-color: #fff;
    border: none;
    border-bottom: 1px dotted #000;
    font-weight: 400;
    line-height: 1.05;
    padding: 0 10px 0 5px;
}

.receipt .serial-cell {
    font-size: 90%;
    line-height: 1.2;
    padding: 0;
    text-align: right;
    white-space: nowrap;
}

.numeric-line-table td {
    height: 16.8px;
}

.numeric-line-table .dotted-bottom {
    padding: 0 0 0 10px;
    text-align: left;
}

.numeric-line-table td:first-child {
    width: 225px;
}

.khatian-line-table td:first-child {
    width: 75px;
}

.office-line-table {
    margin-top: 0;
    width: 100%;
}

.office-line-table td {
    line-height: 1.05;
    padding: 0 5px;
    vertical-align: bottom;
}

.office-line-table td:first-child {
    white-space: nowrap;
    width: 320px;
}

.office-line-table .dotted-bottom {
    padding: 0 10px 0 5px;
    white-space: nowrap;
}

.receipt > table:not([class]) td:first-child,
.receipt > p.dotted-bottom,
.receipt-bottom p {
    font-weight: 400;
}

.receipt > p.dotted-bottom {
    margin: 10px 2px 0 !important;
}

.cell-border {
    border: 1px dotted #333;
}

.b1 {
    border: 1px dotted;
    padding: 2px;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0;
    padding: 0;
    text-align: center;
    text-decoration: underline;
    white-space: nowrap;
}

.owner-tables {
    display: block;
    margin: 0;
}

.owner-tables::after {
    clear: both;
    content: "";
    display: table;
}

.owner-mini-table {
    border: 1px dotted #333;
    border-collapse: collapse;
    float: left;
    font-size: 11px !important;
    line-height: 1.2;
    margin: 10px 2px;
    width: 49%;
}

.owner-mini-table:nth-child(even) {
    float: right;
}

.owner-mini-table.single {
    float: none;
    width: 100%;
}

.owner-mini-table th,
.owner-mini-table td {
    line-height: 1.2;
    padding: 2px;
    vertical-align: middle;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

.owner-mini-table tbody tr {
    height: 21px;
}

.owner-mini-table .input_bangla {
    font-size: 90%;
}

.owner-mini-table th {
    font-weight: 700;
    text-align: center;
}

.plot-tables {
    display: block;
    margin: 0;
}

.plot-tables::after {
    clear: both;
    content: "";
    display: table;
}

.land-table {
    border: 1px dotted #333;
    border-collapse: collapse;
    float: left;
    font-size: 11px !important;
    line-height: 1.2;
    margin: 10px 2px;
    width: 49%;
}

.land-table:nth-child(even) {
    float: right;
}

.land-table.single {
    float: none;
    width: 100%;
}

.land-table th,
.land-table td {
    line-height: 1.2;
    padding: 2px;
    vertical-align: middle;
    white-space: nowrap;
}

.land-table tbody tr {
    height: 21px;
}

.land-table .input_bangla {
    font-size: 90%;
}

.land-table th:nth-child(3),
.land-table th:nth-child(4),
.land-table td:nth-child(3),
.land-table td:nth-child(4) {
    text-align: left;
}

.land-table th,
.total-land-table td:first-child,
.collection th {
    font-weight: 700;
}

.total-land-table {
    border: 1px dotted #333;
    border-collapse: collapse;
    clear: both;
    font-size: 12px;
    margin: 0 2px 10px;
    width: 100%;
}

.collection {
    font-size: 14px !important;
    margin: 0 2px 10px !important;
    width: 100% !important;
}

.collection td,
.collection th {
    border: 1px solid #ddd;
    line-height: 1.42857143;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

.collection td {
    font-weight: 400;
}

.collection th {
    font-weight: 700;
}

.receipt-footer {
    bottom: 0;
    left: 10px;
    position: absolute;
    right: 10px;
}

.footer-line {
    border-top: 1px dotted #999;
    margin-top: 15px;
    padding: 4px 0;
    text-align: right;
}

.receipt-bottom {
    display: block;
    line-height: 1.2;
    margin-top: 8px;
    width: 100%;
}

.receipt-bottom::after {
    clear: both;
    content: "";
    display: table;
}

.receipt-bottom p {
    margin: 0 0 10px;
}

.qrcode-slot {
    line-height: 1;
    margin-top: 0;
    padding-top: 0;
}

#qrcode {
    height: 75px;
    margin: 0 auto;
    width: 75px;
}

.qrcode-print {
    background-repeat: no-repeat;
    display: block;
    height: 75px;
    width: 75px;
}

.admin-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr;
}

.panel {
    background: #fff;
    border: 1px solid #d9e2df;
    border-radius: 8px;
    padding: 18px;
}

.panel h2 {
    font-size: 18px;
    margin: 0 0 14px;
}

.form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

input,
textarea {
    border: 1px solid #cbd5d1;
    border-radius: 5px;
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

textarea {
    min-height: 70px;
    resize: vertical;
}

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

.entry-table th,
.entry-table td {
    border: 1px solid #d9e2df;
    padding: 8px;
    text-align: left;
}

.entry-table th {
    background: #f4f7f6;
}

.data-list th,
.data-list td {
    vertical-align: middle;
}

.list-header {
    align-items: end;
    display: grid;
    gap: 14px;
    grid-template-columns: 220px 1fr;
    margin-bottom: 14px;
}

.list-header h2 {
    margin: 0;
}

.search-form {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(130px, 1fr)) auto auto;
}

.row-actions {
    white-space: nowrap;
}

.muted {
    color: #66746f;
    font-size: 12px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 18px;
}

.notice {
    background: #e7f7ef;
    border: 1px solid #abd8c2;
    border-radius: 6px;
    color: #13583f;
    margin-bottom: 14px;
    padding: 10px 12px;
}

.danger-notice {
    background: #fff1f0;
    border-color: #e4aaa5;
    color: #8a2f2f;
}

.receipt-toolbar {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 58px auto 50px;
}

.login-box {
    background: #fff;
    border: 1px solid #d9e2df;
    border-radius: 8px;
    margin: 80px auto;
    max-width: 420px;
    padding: 24px;
}

.login-box > p:last-child {
    display: none;
}

.receipt-not-found {
    padding: 22px 0;
}

.receipt-not-found-page {
    background: #fff;
}

.receipt-not-found h1 {
    font-size: 34px;
    font-weight: 500;
    margin: 0;
}

.receipt-not-found ~ .panel.no-print {
    display: none;
}

.admin-page {
    background:
        linear-gradient(180deg, #eef8f5 0, #f7faf9 260px, #f3f7f5 100%);
    color: #17211f;
}

.admin-topbar {
    background: linear-gradient(90deg, #0b4f47, #13766a);
    box-shadow: 0 8px 24px rgba(13, 54, 48, 0.18);
    position: sticky;
    top: 0;
    z-index: 10;
}

.admin-topbar .brand {
    letter-spacing: 0;
}

.admin-page-content {
    max-width: 1280px;
    padding: 18px 18px 44px;
}

.admin-overview {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 16px;
}

.admin-stat {
    background: #fff;
    border: 1px solid #d9e2df;
    border-left: 4px solid #136f63;
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(20, 45, 39, 0.08);
    display: grid;
    gap: 4px;
    padding: 14px 16px;
}

.admin-stat span {
    color: #66746f;
    font-size: 13px;
}

.admin-stat strong {
    color: #102f2a;
    font-size: 22px;
    line-height: 1.1;
}

.admin-form-panel,
.admin-list-panel,
.database-tools-panel,
.import-panel,
.admin-profile-panel {
    border-color: #dbe5e1;
    border-top: 4px solid #136f63;
    box-shadow: 0 16px 36px rgba(20, 45, 39, 0.08);
    margin-bottom: 18px;
    overflow: hidden;
}

.admin-profile-panel {
    background: #fbfdfc;
    border-top-color: #283d3a;
}

.admin-profile-form {
    display: grid;
    gap: 14px;
}

.import-form {
    display: grid;
    gap: 12px;
}

.import-form textarea {
    min-height: 220px;
    resize: vertical;
}

.database-tools-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
}

.database-tool-card {
    background: linear-gradient(180deg, #fbfdfc, #f3faf7);
    border: 1px solid #d7e5e0;
    border-radius: 8px;
    display: grid;
    gap: 12px;
    padding: 16px;
}

.database-tool-card h3 {
    color: #123d36;
    font-size: 18px;
    margin: 0 0 4px;
}

.database-tool-card p {
    color: #66746f;
    margin: 0;
}

.database-tool-card code {
    background: #e9f3ef;
    border: 1px solid #d3e4dd;
    border-radius: 4px;
    padding: 1px 5px;
}

.restore-card {
    border-color: #e0c6c3;
    background: linear-gradient(180deg, #fffdfc, #fff7f5);
}

.delete-confirm-panel {
    border-color: #e4aaa5;
    box-shadow: 0 10px 30px rgba(138, 47, 47, 0.08);
    margin-bottom: 18px;
}

.delete-confirm-form {
    display: grid;
    gap: 12px;
}

.panel-heading {
    align-items: flex-start;
    background: #f8fbfa;
    border-bottom: 1px solid #e3ebe8;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    margin: -18px -18px 16px;
    padding: 16px 18px 14px;
}

.panel-heading h2,
.list-header h2 {
    color: #102f2a;
    margin: 0 0 4px;
}

.panel-heading p,
.list-header p {
    color: #66746f;
    margin: 0;
}

.form-section-title {
    border-top: 1px solid #edf2f0;
    color: #123d36;
    padding-top: 16px;
}

.admin-page label {
    color: #263d38;
    font-size: 13px;
    letter-spacing: 0;
}

.admin-page input,
.admin-page textarea {
    background: #fbfdfc;
    border-color: #c7d5d0;
    border-radius: 6px;
    min-height: 40px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.admin-page input:focus,
.admin-page textarea:focus {
    background: #fff;
    border-color: #136f63;
    box-shadow: 0 0 0 3px rgba(19, 111, 99, 0.12);
    outline: none;
}

.admin-page input[readonly] {
    background: #eef5f2;
    color: #44524f;
}

.admin-page .entry-table th {
    background: #eef6f3;
    color: #18352f;
    font-size: 13px;
}

.admin-page .entry-table td {
    background: #fff;
}

.admin-page .table-wrap {
    border: 1px solid #e2ebe8;
    border-radius: 8px;
    overflow: auto;
    width: 100%;
}

.admin-page .data-list {
    border-collapse: separate;
    border-spacing: 0;
    font-size: 12px;
    table-layout: fixed;
    width: 100%;
}

.admin-page .data-list th {
    background: #ecf5f1;
    border-bottom: 1px solid #d5e3df;
    color: #163932;
    padding: 8px 7px;
    position: static;
    z-index: auto;
}

.admin-page .data-list th {
    white-space: nowrap;
}

.admin-page .data-list td {
    border-color: #e7efec;
    line-height: 1.25;
    padding: 8px 7px;
    vertical-align: top;
}

.admin-page .data-list th:nth-child(1),
.admin-page .data-list td:nth-child(1) {
    width: 128px;
}

.admin-page .data-list th:nth-child(2),
.admin-page .data-list td:nth-child(2) {
    width: 165px;
}

.admin-page .data-list th:nth-child(3),
.admin-page .data-list td:nth-child(3),
.admin-page .data-list th:nth-child(4),
.admin-page .data-list td:nth-child(4),
.admin-page .data-list th:nth-child(5),
.admin-page .data-list td:nth-child(5),
.admin-page .data-list th:nth-child(6),
.admin-page .data-list td:nth-child(6) {
    width: 82px;
}

.admin-page .data-list th:nth-child(7),
.admin-page .data-list td:nth-child(7) {
    width: 130px;
}

.admin-page .data-list th:nth-child(8),
.admin-page .data-list td:nth-child(8) {
    width: 86px;
}

.admin-page .data-list th:nth-child(9),
.admin-page .data-list td:nth-child(9) {
    width: 115px;
}

.admin-page .data-list th:nth-child(10),
.admin-page .data-list td:nth-child(10) {
    width: 165px;
}

.admin-page .list-owner {
    display: -webkit-box;
    max-height: 48px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.admin-page .list-challan,
.admin-page .data-list td:nth-child(3),
.admin-page .data-list td:nth-child(4),
.admin-page .data-list td:nth-child(5),
.admin-page .data-list td:nth-child(6),
.admin-page .data-list td:nth-child(8),
.admin-page .data-list td:nth-child(9) {
    word-break: break-word;
}

.admin-page .data-list tr:nth-child(even) td {
    background: #fbfdfc;
}

.admin-page .data-list tr:hover td {
    background: #f0f8f5;
}

.admin-page .list-actions {
    align-items: center;
    display: flex;
    gap: 5px;
    white-space: nowrap;
}

.admin-page .list-actions .button {
    min-height: 32px;
    padding: 5px 8px;
}

.admin-page .search-form {
    align-items: end;
}

.admin-page .form-actions {
    border-top: 1px solid #edf2f0;
    padding-top: 14px;
}

.admin-page .button,
.admin-page button {
    border-radius: 6px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-page .button.secondary:hover,
.admin-page button:hover,
.admin-page .button:hover {
    box-shadow: 0 6px 14px rgba(20, 45, 39, 0.12);
    filter: brightness(0.99);
    transform: translateY(-1px);
}

@media print {
    @page {
        margin: 0;
        size: A4;
    }

    html,
    body {
        background: #fff;
        height: 297mm;
        margin: 0;
        overflow: hidden;
        width: 210mm;
    }

    .topbar,
    .no-print {
        display: none !important;
    }

    .page {
        margin: 0;
        max-width: none;
        padding: 0;
    }

    .receipt {
        box-sizing: border-box;
        border-radius: 10px;
        break-after: avoid;
        break-inside: avoid;
        height: 11in;
        margin: 30px auto 0;
        min-height: 0;
        overflow: hidden;
        page-break-after: avoid;
        page-break-inside: avoid;
        width: 7.9in;
    }

    #printArea.content {
        break-after: avoid;
        margin: 0 auto !important;
        page-break-after: avoid;
        width: 7.9in !important;
    }

    #printArea .col-md-12 {
        break-after: avoid;
        min-height: 0 !important;
        page-break-after: avoid;
        padding: 0 !important;
        width: 7.9in !important;
    }

    .receipt-page-wrap {
        padding: 0;
    }

    .receipt-shell {
        display: block;
    }
}

@media (max-width: 760px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 16px;
    }

    .receipt-shell {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .form-grid,
    .form-grid.two {
        grid-template-columns: 1fr;
    }

    .entry-table {
        min-width: 620px;
    }

    .data-list {
        min-width: 1120px;
    }

    .list-header,
    .search-form {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow-x: auto;
    }

    .admin-page-content {
        padding: 0 14px 32px;
    }

    .admin-overview,
    .database-tools-grid,
    .panel-heading {
        grid-template-columns: 1fr;
    }

    .admin-overview {
        display: grid;
    }

    .panel-heading {
        display: grid;
    }
}
