:root {
    color-scheme: light;
    --bg: #eaf4ff;
    --surface: rgba(255, 255, 255, .92);
    --surface-solid: #ffffff;
    --surface-2: #edf5ff;
    --line: rgba(81, 144, 255, .22);
    --text: #071b4f;
    --muted: #5a719b;
    --brand: #086fff;
    --brand-2: #1fb6ff;
    --brand-dark: #0b2fbe;
    --brand-deep: #071c7d;
    --accent: #e31f3d;
    --danger: #c9162f;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 22px 55px rgba(0, 70, 180, .16);
    --shadow-soft: 0 14px 34px rgba(16, 77, 163, .1);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    text-rendering: geometricPrecision;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 18% -8%, rgba(31, 182, 255, .34), transparent 34%),
        radial-gradient(circle at 92% 4%, rgba(8, 111, 255, .22), transparent 26%),
        linear-gradient(180deg, #f8fbff 0%, #eaf4ff 48%, #f7fbff 100%);
    color: var(--text);
    font-family: "IBM Plex Sans Thai", "Noto Sans Thai", "Sarabun", Arial, Helvetica, sans-serif;
    display: grid;
    grid-template-columns: 286px minmax(0, 1fr);
}

a {
    color: inherit;
}

.sidebar {
    position: sticky;
    top: 0;
    min-height: 100vh;
    background: #5E9EFF;
    color: #ffffff;
    padding: 24px 18px;
    box-shadow: 18px 0 46px rgba(30, 95, 190, .2);
}

.sidebar::after {
    content: "";
    position: absolute;
    inset: auto 18px 24px 18px;
    height: 1px;
    background: rgba(255, 255, 255, .28);
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 30px;
    padding: 8px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff 0%, #ddecff 100%);
    color: var(--brand-dark);
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 16px 32px rgba(0, 18, 90, .22);
}

.brand strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
}

.brand small {
    display: block;
    color: #d8e8ff;
    font-size: 12px;
    margin-top: 4px;
}

nav {
    display: grid;
    gap: 8px;
}

nav a {
    position: relative;
    text-decoration: none;
    color: #eef6ff;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 600;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

nav a:hover {
    background: rgba(11, 47, 190, .13);
    border-color: rgba(255, 255, 255, .28);
    transform: translateX(2px);
}

nav a.active {
    background: rgba(11, 47, 190, .18);
    border-color: rgba(255, 255, 255, .34);
    color: #ffffff;
    box-shadow:
        inset 4px 0 0 rgba(255, 255, 255, .78),
        0 14px 28px rgba(30, 95, 190, .18);
    transform: none;
}

nav a.active:hover {
    background: rgba(11, 47, 190, .18);
    border-color: rgba(255, 255, 255, .34);
    color: #ffffff;
    transform: none;
}

.main {
    min-width: 0;
    padding: 30px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 24px;
    background: rgba(255, 255, 255, .66);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.topbar-card {
    min-width: 220px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #e7f2ff 100%);
    box-shadow: 0 14px 28px rgba(0, 86, 210, .1);
}

.topbar-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.topbar-card strong {
    display: block;
    color: var(--brand-dark);
    font-size: 16px;
    margin-top: 3px;
}

.eyebrow {
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 6px;
}

h1,
h2 {
    margin: 0;
}

h1 {
    color: var(--brand-deep);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    color: var(--brand-deep);
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stats article,
.panel {
    position: relative;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.stats article::before,
.panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 72%, var(--accent) 100%);
}

.stats article {
    padding: 18px;
    min-height: 112px;
}

.stats span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
}

.stats strong {
    color: var(--brand-dark);
    font-size: 31px;
    font-weight: 700;
    line-height: 1;
}

.stat-grid,
.quick-link-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card,
.quick-link-card {
    position: relative;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.stat-card::before,
.quick-link-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 72%, var(--accent) 100%);
}

.stat-card span,
.quick-link-card span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}

.stat-card strong {
    color: var(--brand-dark);
    font-size: 30px;
    line-height: 1;
}

.quick-link-card {
    min-height: 118px;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.quick-link-card strong {
    display: block;
    color: var(--brand-deep);
    font-size: 18px;
    line-height: 1.35;
}

.quick-link-card:hover {
    border-color: rgba(8, 111, 255, .35);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.meter-page-head p {
    max-width: 760px;
    color: var(--muted);
    margin: 0;
}

.billing-cycle-filter {
    display: flex;
    align-items: end;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.billing-cycle-filter label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.billing-cycle-filter select {
    min-width: 220px;
}

.meter-table-panel table {
    min-width: 980px;
}

.meter-table-panel .billing-table-button {
    width: auto;
    min-width: 82px;
    min-height: 42px;
    white-space: nowrap;
}

.disabled-button {
    opacity: .45;
    cursor: not-allowed;
    pointer-events: none;
    box-shadow: none;
}

.table-total-row td {
    background: #edf6ff;
    border-top: 2px solid rgba(8, 111, 255, .25);
    color: var(--brand-deep);
}

.total-cell {
    color: var(--brand-dark);
    font-weight: 800;
}

.meter-current-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #f7fbff 0%, #e7f2ff 100%);
}

.meter-calc-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
}

.meter-calc-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(237, 245, 255, .8);
}

.meter-calc-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 5px;
}

.meter-calc-grid strong {
    color: var(--brand-dark);
    font-size: 20px;
}

.premium-upload {
    cursor: pointer;
}

.premium-upload-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.premium-upload-box {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    margin-top: 8px;
    padding: 16px;
    border: 1px dashed rgba(8, 111, 255, .42);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .9) 0%, rgba(231, 242, 255, .92) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .85), 0 12px 28px rgba(0, 86, 210, .08);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.premium-upload:hover .premium-upload-box,
.premium-upload-box.has-file {
    border-color: rgba(8, 111, 255, .72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 18px 34px rgba(0, 86, 210, .14);
    transform: translateY(-1px);
}

.premium-upload-icon {
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 12px 24px rgba(8, 111, 255, .24);
}

.premium-upload-box strong,
.premium-upload-box small {
    display: block;
}

.premium-upload-box strong {
    color: var(--brand-deep);
    font-size: 16px;
}

.premium-upload-box small {
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.premium-upload-preview {
    display: block;
    margin-top: 12px;
    border: 1px solid rgba(8, 111, 255, .22);
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(0, 86, 210, .12);
}

.premium-upload-preview img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.premium-upload-preview.is-hidden {
    display: none;
}

.meter-existing-photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 14px;
}

.meter-existing-photos figure {
    margin: 0;
    border: 1px solid rgba(8, 111, 255, .2);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 16px 34px rgba(0, 86, 210, .12);
}

.meter-existing-photos img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}

.meter-existing-photos figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
}

.meter-existing-photos figcaption span {
    color: var(--brand-deep);
    font-weight: 700;
}

.auth-body {
    display: block;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 10%, rgba(31, 182, 255, .28), transparent 28%),
        linear-gradient(135deg, #eaf4ff 0%, #f8fbff 48%, #dcecff 100%);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(380px, 1.1fr);
    min-height: 100vh;
}

.auth-hero {
    display: grid;
    align-items: center;
    padding: 44px;
    color: #ffffff;
    background: #5E9EFF;
}

.auth-hero-content {
    display: grid;
    gap: 34px;
    max-width: 560px;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.auth-brand strong,
.auth-brand small {
    display: block;
}

.auth-brand strong {
    font-size: 19px;
}

.auth-brand small {
    color: rgba(255, 255, 255, .78);
    margin-top: 4px;
}

.auth-copy {
    max-width: 540px;
}

.auth-copy .eyebrow {
    color: rgba(255, 255, 255, .82);
}

.auth-copy h1 {
    color: #ffffff;
    font-size: 42px;
    line-height: 1.12;
    margin-bottom: 14px;
}

.auth-copy p {
    color: rgba(255, 255, 255, .82);
    font-size: 16px;
    line-height: 1.65;
    margin: 0;
}

.auth-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.auth-highlights span {
    padding: 9px 12px;
    border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .9);
    font-size: 13px;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18);
}

.auth-card {
    align-self: center;
    justify-self: center;
    width: min(560px, calc(100% - 48px));
    padding: 32px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 26px;
    background: rgba(255, 255, 255, .74);
    box-shadow: 0 28px 70px rgba(0, 70, 180, .18);
    backdrop-filter: blur(18px);
}

.auth-card-head {
    margin-bottom: 18px;
}

.auth-card-head h2 {
    font-size: 30px;
}

.auth-form {
    gap: 16px;
}

.auth-switch {
    margin: 18px 0 0;
    color: var(--muted);
    font-weight: 600;
    text-align: center;
}

.auth-switch a {
    color: var(--brand);
    font-weight: 800;
    text-decoration: none;
}

.meter-current-summary span {
    color: var(--muted);
    font-weight: 700;
}

.meter-current-summary strong {
    color: var(--brand-dark);
    font-size: 22px;
}

.panel {
    padding: 22px;
    overflow-x: auto;
}

.panel.narrow {
    max-width: 640px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .7);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(16px);
}

.page-actions h2 {
    margin-bottom: 4px;
}

.page-actions p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.page-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.grid {
    display: grid;
    gap: 20px;
}

.grid.two {
    grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
}

.form {
    display: grid;
    gap: 14px;
    align-content: start;
}

.project-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.span-all {
    grid-column: 1 / -1;
}

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

.contract-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}

.contract-action-row form {
    margin: 0;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal:target {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 24, 95, .48);
    backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(880px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 26px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .98) 0%, rgba(232, 243, 255, .96) 100%);
    box-shadow: 0 30px 80px rgba(0, 40, 140, .32);
}

.modal-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 72%, var(--accent) 100%);
}

.modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #ffffff;
    color: var(--brand-deep);
    font-size: 28px;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 10px 20px rgba(0, 72, 190, .08);
}

.modal-close:hover {
    color: var(--accent);
}

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 13px;
    color: var(--text);
    background: rgba(255, 255, 255, .9);
    font: inherit;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--brand);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(8, 111, 255, .14);
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid rgba(8, 111, 255, .36);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--brand);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 72, 190, .08);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.button.primary {
    background: linear-gradient(180deg, #1f85ff 0%, #005fe8 100%);
    border-color: #005fe8;
    color: #fff;
    box-shadow: 0 16px 30px rgba(0, 87, 220, .28);
}

.button:hover {
    border-color: var(--brand-dark);
    color: var(--brand-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(0, 72, 190, .14);
}

.button.primary:hover {
    color: #fff;
}

.danger-button {
    border-color: rgba(227, 31, 61, .36);
    color: var(--danger);
}

.danger-button:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.line-send-button {
    border-color: rgba(6, 199, 85, .36);
    color: #06a848;
}

.line-send-button:hover {
    border-color: #06c755;
    color: #048d3d;
}

.table-button {
    width: 72px;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: none;
}

.no-wrap-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
}

.print-body {
    display: block;
}

.invoice-print-shell {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 22px;
    background: #d9dce3;
}

.invoice-paper {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
}

.invoice-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.invoice-half-a4 {
    width: 210mm;
    min-height: 138mm;
    max-height: 145mm;
    margin: 0 auto;
    padding: 6mm 10mm 4mm;
    background: #ffffff;
    color: #111111;
    font-family: "IBM Plex Sans Thai", "Noto Sans Thai", Arial, sans-serif;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}

.invoice-half-a4,
.invoice-half-a4 * {
    box-sizing: border-box;
}

.invoice-half-a4 h1 {
    color: #111111;
    text-align: center;
    font-size: 20px;
    margin: 0 0 4mm;
}

.invoice-head-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7mm;
    margin-bottom: 4mm;
}

.invoice-head-grid h2 {
    color: #111111;
    font-size: 14px;
    margin: 0 0 2mm;
}

.invoice-head-grid p {
    margin: 0 0 1.5mm;
    font-size: 11px;
    line-height: 1.35;
}

.invoice-tenant {
    align-self: end;
    text-align: center;
    font-weight: 700;
}

.invoice-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 10.5px;
}

.invoice-table th,
.invoice-table td {
    padding: 1.2mm 1.5mm;
    border: 1px solid #222222;
    color: #111111;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.invoice-table th:nth-child(1),
.invoice-table td:nth-child(1) {
    width: 22%;
}

.invoice-table th:nth-child(2),
.invoice-table td:nth-child(2),
.invoice-table th:nth-child(3),
.invoice-table td:nth-child(3) {
    width: 16%;
}

.invoice-table th:nth-child(4),
.invoice-table td:nth-child(4),
.invoice-table th:nth-child(5),
.invoice-table td:nth-child(5) {
    width: 13%;
}

.invoice-table th:nth-child(6),
.invoice-table td:nth-child(6) {
    width: 20%;
}

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

.invoice-total-row td {
    font-weight: 800;
}

.invoice-payment-grid {
    display: grid;
    grid-template-columns: 1fr 30mm;
    align-items: start;
    gap: 4mm;
    margin-top: 1mm;
}

.invoice-payment-grid.has-signature {
    grid-template-columns: 78mm 1fr 28mm;
    grid-template-rows: auto auto;
    align-items: start;
    gap: 1.5mm 5mm;
}

.invoice-bank p {
    margin: 0 0 1.5mm;
    font-size: 11px;
    font-weight: 700;
}

.invoice-payment-grid.has-signature .invoice-bank {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
}

.invoice-payment-grid.has-signature .invoice-signature {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
}

.invoice-payment-grid.has-signature .invoice-meter-note {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
}

.invoice-payment-grid.has-signature .invoice-qr {
    grid-column: 3;
    grid-row: 1 / span 2;
    align-self: start;
}

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

.invoice-qr img {
    width: 23mm;
    height: 23mm;
    object-fit: contain;
}

.invoice-qr span {
    display: block;
    color: #111111;
    font-size: 12px;
    font-weight: 700;
}

.invoice-note {
    margin: 1mm 0 0;
    color: #ff0000;
    text-align: center;
    font-size: 15px;
    font-weight: 800;
}

.invoice-meter-note {
    margin: 0;
    color: #ff0000;
    text-align: center;
    font-size: 10.5px;
    line-height: 1.25;
    font-weight: 800;
}

.receipt-sign-row {
    display: grid;
    grid-template-columns: 1fr 42mm;
    gap: 8mm;
    margin-top: 0;
    color: #111111;
    font-size: 11px;
    font-weight: 700;
}

.receipt-sign-row p {
    margin: 0 0 1.5mm;
}

.receipt-remain {
    color: #c9162f;
}

.receipt-signature {
    display: grid;
    align-content: end;
    min-height: 13mm;
    border-bottom: 1px solid #111111;
    text-align: center;
    transform: translateY(-1.5mm);
}

.receipt-signature span {
    transform: translateY(6mm);
}

.receipt-signature img,
.invoice-signature img {
    justify-self: center;
    max-width: 30mm;
    max-height: 9mm;
    object-fit: contain;
}

.invoice-signature {
    display: grid;
    justify-content: center;
    gap: 1mm;
    color: #111111;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.mobile-meter-body {
    display: block;
    min-height: 100vh;
    background: linear-gradient(180deg, #5e9eff 0%, #e8f4ff 42%, #f6fbff 100%);
}

.mobile-meter-app {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 14px 12px 96px;
}

.mobile-meter-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -14px -12px 14px;
    padding: 18px 14px 14px;
    background: rgba(94, 158, 255, .94);
    color: #ffffff;
    backdrop-filter: blur(16px);
    box-shadow: 0 14px 34px rgba(0, 72, 190, .18);
}

.mobile-meter-header p,
.mobile-meter-header h1,
.mobile-meter-header span {
    margin: 0;
}

.mobile-meter-header p {
    font-size: 12px;
    font-weight: 800;
    opacity: .9;
}

.mobile-meter-header h1 {
    color: #ffffff;
    font-size: 24px;
    line-height: 1.25;
}

.mobile-meter-header span {
    display: block;
    margin-top: 3px;
    font-size: 13px;
    font-weight: 700;
    opacity: .9;
}

.mobile-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .54);
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
}

.mobile-meter-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.mobile-meter-summary div,
.mobile-cycle-filter,
.mobile-room-card,
.mobile-empty {
    border: 1px solid rgba(255, 255, 255, .78);
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 18px 38px rgba(0, 72, 190, .12);
}

.mobile-meter-summary div {
    padding: 12px;
    border-radius: 18px;
}

.mobile-meter-summary span,
.mobile-cycle-filter label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mobile-meter-summary strong {
    display: block;
    margin-top: 5px;
    color: var(--brand-deep);
    font-size: 26px;
    line-height: 1;
}

.mobile-cycle-filter {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 20px;
}

.mobile-cycle-filter label {
    display: grid;
    gap: 8px;
}

.mobile-cycle-filter select {
    width: 100%;
    min-height: 48px;
}

.mobile-room-list {
    display: grid;
    gap: 12px;
}

.mobile-room-card {
    overflow: hidden;
    border-radius: 24px;
}

.mobile-room-card summary {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    list-style: none;
}

.mobile-room-card summary::-webkit-details-marker {
    display: none;
}

.mobile-room-card summary strong {
    color: var(--brand-deep);
    font-size: 24px;
    line-height: 1.2;
}

.mobile-room-card summary small {
    grid-column: 2;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.mobile-room-status {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 58px;
    min-height: 32px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.mobile-room-status.done {
    background: #e7f8ef;
    color: #128447;
}

.mobile-room-status.pending {
    background: #fff4dc;
    color: #b86b00;
}

.mobile-meter-form {
    display: grid;
    gap: 14px;
    padding: 0 16px 18px;
}

.mobile-meter-grid,
.mobile-upload-grid,
.mobile-calc-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-meter-grid label,
.mobile-note {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.mobile-meter-grid input,
.mobile-note textarea {
    width: 100%;
    min-height: 48px;
    font-size: 18px;
}

.mobile-note textarea {
    min-height: 86px;
    font-size: 16px;
}

.mobile-upload-grid {
    grid-template-columns: 1fr;
}

.mobile-upload-grid .premium-upload-box {
    min-height: 90px;
}

.mobile-upload-grid .premium-upload-preview img {
    max-height: 220px;
}

.mobile-existing-photos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mobile-existing-photos figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.mobile-existing-photos img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.mobile-existing-photos figcaption {
    padding: 8px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mobile-calc-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 10px;
    border-radius: 18px;
    background: #e8f3ff;
}

.mobile-calc-strip div {
    display: grid;
    gap: 4px;
}

.mobile-calc-strip span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.mobile-calc-strip strong {
    color: var(--brand-deep);
    font-size: 18px;
    line-height: 1.2;
}

.mobile-save-button {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    width: 100%;
    min-height: 54px;
    border-radius: 18px;
    font-size: 17px;
}

.mobile-empty {
    display: grid;
    gap: 12px;
    padding: 22px;
    border-radius: 24px;
    text-align: center;
}

.mobile-empty h1,
.mobile-empty h2,
.mobile-empty p {
    margin: 0;
}

.mobile-logo {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: 20px;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 34px;
    font-weight: 900;
}

.line-profile-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 190px;
}

.line-profile-chip img {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid #06c755;
}

.line-profile-chip strong,
.line-profile-chip span {
    display: block;
}

.line-profile-chip strong {
    color: var(--brand-deep);
    font-size: 13px;
}

.line-profile-chip span {
    max-width: 150px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.liff-tenant-app {
    width: min(100%, 520px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 14px 12px 56px;
    background: linear-gradient(180deg, #5e9eff 0%, #eaf5ff 38%, #f7fbff 100%);
}

.liff-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 4px 14px;
    color: #ffffff;
}

.liff-brand-mark {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .95);
    color: var(--brand-dark);
    font-size: 30px;
    font-weight: 900;
}

.liff-hero p,
.liff-hero h1,
.liff-profile-card span,
.liff-profile-card strong,
.liff-profile-card small,
.liff-section-head p,
.liff-section-head h2 {
    margin: 0;
}

.liff-hero p {
    font-size: 12px;
    font-weight: 800;
    opacity: .9;
}

.liff-hero h1 {
    color: #ffffff;
    font-size: 24px;
    line-height: 1.25;
}

.liff-profile-card,
.liff-panel {
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 24px;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 18px 38px rgba(0, 72, 190, .12);
}

.liff-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 14px;
}

.liff-profile-image {
    width: 58px;
    height: 58px;
    border-radius: 999px;
    object-fit: cover;
    background: #e8f3ff;
    border: 3px solid #06c755;
}

.liff-profile-card span,
.liff-section-head p {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.liff-profile-card strong {
    display: block;
    color: var(--brand-deep);
    font-size: 18px;
    line-height: 1.25;
}

.liff-profile-card small {
    display: block;
    color: #06a848;
    font-size: 12px;
    font-weight: 800;
}

.liff-panel {
    margin-bottom: 12px;
    padding: 16px;
}

.liff-panel h2 {
    color: var(--brand-deep);
    font-size: 22px;
    line-height: 1.25;
}

.liff-panel p {
    color: var(--muted);
    font-weight: 700;
    line-height: 1.55;
}

.liff-bind-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.liff-bind-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.liff-bind-form input,
.liff-bind-form button {
    width: 100%;
    min-height: 50px;
    font-size: 16px;
}

.liff-tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(14px);
}

.liff-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border-radius: 12px;
    background: #e8f3ff;
    color: var(--brand-dark);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.liff-section-head {
    margin-bottom: 12px;
}

.liff-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.liff-info-grid div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f4f9ff;
}

.liff-info-grid span,
.liff-list-item span,
.liff-list-side small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.liff-info-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--brand-deep);
    font-size: 18px;
}

.liff-note {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff6df;
    color: #8d5a00;
}

.liff-list {
    display: grid;
    gap: 10px;
}

.liff-list-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #ffffff;
}

.liff-list-item strong {
    color: var(--brand-deep);
    font-size: 15px;
}

.liff-list-side {
    text-align: right;
}

.liff-list-side b {
    display: block;
    color: var(--brand-dark);
    font-size: 17px;
}

.liff-list-item .button {
    grid-column: 1 / -1;
    width: 100%;
}

.liff-empty {
    margin: 0;
    padding: 16px;
    border-radius: 16px;
    background: #f4f9ff;
    text-align: center;
}

@page {
    size: A4 portrait;
    margin: 0;
}

@media print {
    .invoice-toolbar {
        display: none;
    }

    .invoice-print-shell {
        padding: 0;
        background: #ffffff;
    }

    .invoice-paper,
    .invoice-half-a4 {
        width: 210mm;
    }

    .invoice-paper {
        min-height: 297mm;
    }

    .invoice-half-a4 {
        width: 210mm;
        min-height: 138mm;
        max-height: 145mm;
        padding: 6mm 10mm 4mm;
        box-shadow: none;
    }

    .invoice-paper-batch .invoice-half-a4 {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .invoice-paper-batch .invoice-half-a4:nth-of-type(2n) {
        break-after: page;
        page-break-after: always;
    }
}

.small-button {
    min-height: 36px;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 13px;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 680px;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid rgba(129, 177, 255, .24);
    padding: 13px 12px;
    vertical-align: middle;
}

th {
    color: var(--brand-deep);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    background: #e8f3ff;
}

th:first-child {
    border-top-left-radius: 12px;
}

th:last-child {
    border-top-right-radius: 12px;
}

tbody tr {
    transition: background .18s ease;
}

tbody tr:hover {
    background: rgba(232, 243, 255, .55);
}

.right {
    text-align: right;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.id-card-preview {
    margin-bottom: 18px;
}

.id-card-preview span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.id-card-preview img {
    display: block;
    width: min(360px, 100%);
    aspect-ratio: 1.58 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 14px 30px rgba(0, 72, 190, .12);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border: 1px solid rgba(8, 111, 255, .18);
    border-radius: 999px;
    padding: 4px 11px;
    background: #e8f3ff;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
}

.badge-success {
    border-color: rgba(22, 163, 74, .2);
    background: #dcfce7;
    color: #15803d;
}

.badge-danger {
    border-color: rgba(227, 31, 61, .2);
    background: #ffe4e9;
    color: var(--danger);
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 24px 10px;
}

.notice {
    padding: 13px 14px;
    border: 1px solid rgba(8, 111, 255, .18);
    border-radius: var(--radius-sm);
    background: #e8f3ff;
    color: var(--brand-dark);
    font-weight: 600;
}

.is-hidden {
    display: none !important;
}

.danger-notice {
    margin-bottom: 18px;
    border-color: rgba(227, 31, 61, .22);
    background: #fff0f3;
    color: var(--danger);
}

.project-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.room-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 560px;
}

.search-box input {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .9);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    box-shadow: var(--shadow-soft);
}

.search-box .button {
    flex: 0 0 82px;
    width: 82px;
    min-height: 46px;
    justify-content: center;
}

.settings-divider {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.settings-divider h2 {
    margin-bottom: 0;
}

.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.payment-summary-grid div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #e8f3ff;
}

.payment-summary-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.payment-summary-grid strong {
    color: var(--brand-dark);
    font-size: 18px;
}

.payment-history {
    margin-top: 18px;
}

.payment-history h3 {
    margin: 0 0 10px;
    color: var(--brand-deep);
    font-size: 16px;
}

.payment-history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, .74);
}

.payment-history-row + .payment-history-row {
    margin-top: 10px;
}

.payment-history-row strong,
.payment-history-row span {
    display: block;
}

.payment-history-row span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-top: 3px;
}

.project-card {
    position: relative;
    display: grid;
    gap: 16px;
    min-height: 330px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .96) 0%, rgba(232, 243, 255, .92) 100%);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.project-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 72%, var(--accent) 100%);
}

.project-card::after {
    content: "";
    position: absolute;
    right: -44px;
    top: -44px;
    width: 142px;
    height: 142px;
    border-radius: 999px;
    background: rgba(8, 111, 255, .08);
}

.project-card-top,
.project-card-footer,
.project-rates {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.project-type {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(0, 78, 210, .08);
}

.project-card h3 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: var(--brand-deep);
    font-size: 24px;
    line-height: 1.28;
}

.project-card p {
    position: relative;
    z-index: 1;
    min-height: 44px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

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

.project-metrics div {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .72);
}

.project-metrics span,
.project-card-footer span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.project-metrics strong {
    display: block;
    color: var(--brand-dark);
    font-size: 26px;
    line-height: 1;
    margin-top: 8px;
}

.project-rates {
    align-items: stretch;
}

.project-rates span {
    flex: 1;
    padding: 10px 12px;
    border-radius: 14px;
    background: #e8f3ff;
    color: var(--brand-deep);
    font-size: 13px;
    font-weight: 700;
}

.project-card-footer {
    margin-top: auto;
    padding-top: 4px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
}

.empty-state p {
    margin: -6px 0 18px;
    color: var(--muted);
}

.room-card {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 24px;
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
}

.room-photo {
    position: relative;
    min-height: 168px;
    background:
        linear-gradient(135deg, rgba(8, 111, 255, .12) 0%, rgba(31, 182, 255, .18) 100%);
}

.room-photo img {
    display: block;
    width: 100%;
    height: 178px;
    object-fit: cover;
}

.room-photo .badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(255, 255, 255, .92);
}

.room-photo-placeholder {
    display: grid;
    place-items: center;
    height: 178px;
    color: var(--muted);
    font-weight: 700;
}

.room-card-body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.room-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.room-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.room-title-row span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.room-title-row h3 {
    margin: 0;
    color: var(--brand-deep);
    font-size: 22px;
}

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

.tenant-strip {
    padding: 9px 11px;
    border: 1px solid rgba(227, 31, 61, .18);
    border-radius: 14px;
    background: #fff0f3;
}

.tenant-strip span {
    display: block;
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.tenant-strip strong {
    display: block;
    color: var(--brand-deep);
    font-size: 15px;
    margin-top: 2px;
}

.tenant-strip p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.room-price-grid div {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #e8f3ff;
}

.room-price-grid span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.room-price-grid strong {
    display: block;
    color: var(--brand-dark);
    font-size: 18px;
    margin-top: 5px;
}

.room-card-body p {
    min-height: 44px;
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.55;
}

.room-modal-card {
    width: min(980px, 100%);
}

.room-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.room-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 10px 22px rgba(0, 72, 190, .08);
}

.room-gallery-item {
    display: grid;
    gap: 8px;
    margin: 0;
}

.room-gallery-item form {
    margin: 0;
}

.room-gallery-item .button {
    width: 100%;
}

.tenant-current {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(227, 31, 61, .18);
    border-radius: 18px;
    background: #fff0f3;
}

.tenant-current img {
    display: block;
    width: 100%;
    aspect-ratio: 1.58 / 1;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(227, 31, 61, .18);
}

.tenant-current span {
    display: block;
    color: var(--danger);
    font-size: 13px;
    font-weight: 700;
}

.tenant-current strong {
    display: block;
    color: var(--brand-deep);
    font-size: 22px;
    margin-top: 4px;
}

.tenant-current p {
    margin: 6px 0 0;
    color: var(--muted);
}

.tenant-preview {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #e8f3ff;
}

.tenant-preview span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.tenant-preview img {
    display: block;
    width: min(360px, 100%);
    aspect-ratio: 1.58 / 1;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(0, 72, 190, .12);
}

.meter-preview {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #e8f3ff;
}

.meter-preview span {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.meter-preview img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 14px 30px rgba(0, 72, 190, .12);
}

@media (max-width: 1120px) {
    .stats {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 1040px) {
    body {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

    .sidebar::after {
        display: none;
    }

    nav {
        grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    }

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

@media (max-width: 720px) {
    .main,
    .sidebar {
        padding: 16px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .topbar-card {
        width: 100%;
    }

    .stats {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    h1 {
        font-size: 25px;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-actions {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .form-actions {
        flex-direction: column-reverse;
        justify-content: stretch;
    }

    .contract-action-row {
        flex-direction: column;
    }

    .contract-action-row .button {
        width: 100%;
    }

    .form-actions .button,
    .page-actions .button {
        width: 100%;
    }

    .modal {
        padding: 14px;
        align-items: flex-start;
    }

    .modal-card {
        max-height: calc(100vh - 28px);
        padding: 20px;
        border-radius: 22px;
    }

    .tenant-current {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr;
    }
}
