:root {
    --meterpro-blue: #078fe7;
    --meterpro-blue-dark: #0564e8;
    --meterpro-green: #3cbd1f;
    --meterpro-navy: #062a5c;
    color: #17212b;
    background: #f1f5f9;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body, #app { min-height: 100%; }

body {
    margin: 0;
    background: #f1f5f9;
}

.volt-layout,
.volt-main-content {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgb(7 143 231 / 18%) 0, transparent 34%), radial-gradient(circle at top left, rgb(60 189 31 / 12%) 0, transparent 30%), #f5f9fd;
}

.volt-appbar {
    height: 68px;
    color: #17212b !important;
    background: rgb(255 255 255 / 94%) !important;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: none !important;
    backdrop-filter: blur(12px);
}

.volt-brand {
    font-weight: 800 !important;
    letter-spacing: -.03em;
}

.meterpro-header-logo { display: block; width: 144px; height: 40px; object-fit: contain; object-position: left center; }

.volt-page-container {
    padding: 92px 20px 32px !important;
}

.volt-page-card {
    width: 100%;
}

.mud-card,
.mud-paper {
    border: 1px solid #e2e8f0;
    border-radius: 16px !important;
    box-shadow: 0 12px 28px rgb(15 23 42 / 8%) !important;
}

.mud-card-content { padding: 24px !important; }
.mud-card-actions { padding: 0 24px 24px !important; }

.mud-typography-h4 {
    color: #17212b;
    font-weight: 800 !important;
    letter-spacing: -.035em;
}

.mud-typography-h6 {
    color: #17212b;
    font-weight: 750 !important;
}

.mud-button-root {
    min-height: 42px;
    border-radius: 9px !important;
    font-weight: 750 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.mud-button-filled-primary {
    color: #fff !important;
    background: linear-gradient(135deg, var(--meterpro-blue), var(--meterpro-blue-dark)) !important;
    box-shadow: none !important;
}

.mud-button-filled-primary:hover { background: var(--meterpro-blue-dark) !important; }

.mud-button-outlined-primary {
    color: var(--meterpro-blue) !important;
    border-color: var(--meterpro-blue) !important;
}

.mud-input-control { margin-top: 4px; }

.mud-input-outlined-border {
    border-color: #cbd5e1 !important;
    border-radius: 9px !important;
}

.mud-input:focus-within .mud-input-outlined-border {
    border-color: var(--meterpro-blue) !important;
    box-shadow: 0 0 0 3px rgb(7 143 231 / 18%);
}

.mud-input-label { color: #52606d !important; }

.mud-chip {
    border-radius: 999px !important;
    font-weight: 700;
}

.mud-alert {
    border-radius: 10px !important;
    box-shadow: none;
}

.mud-icon-button { border-radius: 9px !important; }

.customer-dashboard { padding-top: 16px; }

.customer-eyebrow {
    margin-bottom: -10px;
    color: var(--meterpro-green);
    font-size: .9rem;
    font-weight: 800;
    letter-spacing: .12em;
}

.customer-intro {
    margin-bottom: 8px;
    color: #52606d;
    line-height: 1.55;
}

.customer-action-card { overflow: hidden; }

.customer-action-card-highlight {
    border-color: #9ee2d1;
    background: linear-gradient(135deg, #ffffff, #f0fdf8);
}

.customer-meters-sheet {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #c7d9ec;
    border-radius: 12px;
    box-shadow: none !important;
}

.customer-meters-table { min-width: 920px; }
.customer-meters-table .mud-table-head { background: var(--meterpro-blue); }
.customer-meters-table .mud-table-cell {
    padding: 12px 16px;
    border-right: 1px solid #dce8f4;
    border-bottom: 1px solid #dce8f4;
    vertical-align: middle;
}

.customer-meters-table .mud-table-cell:last-child { border-right: 0; }
.customer-meters-table .mud-table-row:last-child .mud-table-cell { border-bottom: 0; }
.customer-meter-number { color: var(--meterpro-navy); font-weight: 800; }
.customer-meter-table-actions { min-width: 170px; }

.payout-payment-card {
    padding: 20px;
    border: 1px solid #cceee5;
    border-radius: 16px;
    background: linear-gradient(145deg, #ffffff, #f4fcf9);
    box-shadow: 0 10px 28px rgb(6 130 102 / 10%) !important;
}

.payout-reference-band {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--meterpro-blue-dark), var(--meterpro-green));
}

.payout-reference-band .mud-icon-root { color: #b8f5e4; }
.payout-reference-band .mud-typography-overline { color: #d9fff5; line-height: 1.2; }
.payout-reference { font-family: Consolas, "Courier New", monospace; letter-spacing: .07em; }

.payout-detail,
.payout-amount {
    min-height: 78px;
    padding: 12px 14px;
    border: 1px solid #e2eee9;
    border-radius: 10px;
    background: #ffffff;
}

.payout-detail .mud-typography-overline,
.payout-amount .mud-typography-overline {
    display: block;
    color: #58716a;
    line-height: 1.35;
}

.payout-amount { border-color: #a8dfd0; background: #eaf9f4; }
.payout-amount .mud-typography-h5 { color: #05765d; font-weight: 800; }

.owner-payout-summary-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 112px;
}

.admin-dashboard-hero {
    padding: 32px;
    overflow: hidden;
    color: #ffffff;
    border-color: #0564e8;
    background:
        radial-gradient(circle at 90% 10%, rgb(7 143 231 / 62%), transparent 34%),
        linear-gradient(135deg, #062a5c, #0755aa);
}

.admin-dashboard-hero .mud-typography-overline { color: #9cddff; font-weight: 800; letter-spacing: .12em; }
.admin-dashboard-hero .mud-typography-h4 { margin: 8px 0; color: #ffffff; }
.admin-dashboard-hero .mud-typography-body1 { max-width: 660px; color: #dceeff; line-height: 1.6; }

.admin-nav-card { height: 100%; border-color: #d9e8e4; }
.admin-nav-card .mud-card-content { display: flex; flex-direction: column; align-items: flex-start; height: 100%; gap: 16px; }
.admin-nav-card .mud-stack {
    align-items: stretch !important;
    align-self: stretch !important;
    width: 100% !important;
}
.admin-nav-card .mud-card-content > .mud-stack:first-of-type { min-height: 74px; }
.admin-nav-card .mud-button-root { width: 100% !important; }

.admin-nav-actions {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    width: 100%;
    gap: 4px;
}

.home-page {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 32px 20px;
    background:
        radial-gradient(circle at 8% 18%, rgb(60 189 31 / 34%), transparent 34%),
        radial-gradient(circle at 92% 82%, rgb(7 143 231 / 28%), transparent 39%),
        linear-gradient(135deg, #f3fbf2, #f6faff 54%, #edf7ff);
}

.home-container { width: 100%; }

.home-card {
    max-width: 480px;
    margin: 0 auto;
    padding: 52px 40px 40px;
    overflow: hidden;
    text-align: center;
    border-color: rgb(255 255 255 / 78%) !important;
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 24px 60px rgb(15 23 42 / 16%) !important;
    backdrop-filter: blur(18px);
}

.home-logo {
    display: block;
    width: min(220px, 72%);
    height: auto;
    margin: -20px auto 0;
}

.home-tagline {
    margin-top: 8px;
    color: var(--meterpro-blue) !important;
    font-weight: 800 !important;
    letter-spacing: -.025em;
}

.home-intro {
    max-width: 330px;
    margin: 18px auto 30px;
    color: #52606d;
    line-height: 1.65;
}

.home-login-button {
    min-height: 50px !important;
    font-size: 1rem;
}

.home-footer {
    display: block;
    margin-top: 22px;
    color: #64748b;
}

.login-page {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 32px 20px;
    background:
        radial-gradient(circle at 15% 12%, rgb(60 189 31 / 28%), transparent 34%),
        radial-gradient(circle at 91% 87%, rgb(7 143 231 / 26%), transparent 38%),
        linear-gradient(135deg, #f3fbf2, #f6faff 54%, #edf7ff);
}

.login-container { width: 100%; }

.login-card {
    max-width: 440px;
    margin: 0 auto;
    padding: 40px;
    overflow: hidden;
    border-color: rgb(255 255 255 / 78%) !important;
    background: rgb(255 255 255 / 88%);
    box-shadow: 0 24px 60px rgb(15 23 42 / 16%) !important;
    backdrop-filter: blur(18px);
}

.login-brand {
    display: grid;
    justify-items: center;
    margin-bottom: 10px;
    text-align: center;
}

.login-logo {
    display: block;
    width: min(220px, 72%);
    height: auto;
    margin: -16px auto 16px;
}

.login-subtitle {
    max-width: 270px;
    color: #52606d;
    line-height: 1.5;
}

.login-submit {
    min-height: 48px !important;
    margin-top: 4px;
    font-size: 1rem;
}

.login-footer {
    display: block;
    margin-top: 22px;
    color: #64748b;
}

.voucher-result-alert { padding: 18px !important; }

.voucher-result-message {
    font-weight: 800 !important;
    line-height: 1.4;
}

.voucher-token-block {
    display: grid;
    gap: 5px;
    margin-top: 16px;
    padding: 14px;
    color: #17212b;
    background: rgb(255 255 255 / 78%);
    border: 1px solid rgb(6 130 102 / 20%);
    border-radius: 10px;
}

.voucher-result-label {
    color: #52606d;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.voucher-token {
    color: #056b55;
    font-family: inherit;
    font-size: 1.18rem;
    font-weight: 850;
    letter-spacing: .055em;
    line-height: 1.45;
    word-spacing: .08em;
}

.voucher-units-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.purchase-history-token-block {
    padding: 2px 0 4px;
}

.purchase-history-icon {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: #068266;
    background: #f1f5f9;
    border-radius: 10px;
    place-items: center;
}

.purchase-history-token {
    margin-top: 4px;
}

.purchase-history-amount,
.purchase-history-units { text-align: right; }

.owner-customer-card { overflow: hidden; }

.owner-customer-header {
    gap: 16px;
    margin-bottom: 16px;
}

.owner-customer-summary,
.owner-customer-actions { flex-wrap: wrap; }

.owner-customer-summary { min-width: 0; }

.owner-customer-detail {
    color: #52606d;
    white-space: nowrap;
}

.owner-customer-detail .mud-icon-root { color: var(--meterpro-green); }

.owner-customer-icon {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    color: #068266;
    background: #f1f5f9;
    border-radius: 10px;
    place-items: center;
}

.owner-customer-action {
    min-width: 108px;
    justify-content: center;
}

@media (max-width: 800px) {
    .owner-customer-header { align-items: flex-start !important; }
    .owner-customer-summary,
    .owner-customer-actions { width: 100%; }
}

.owner-customer-meters-sheet {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #c7d9ec;
    border-radius: 12px;
}

.owner-customer-meters-table { min-width: 920px; }
.owner-customer-meters-table .mud-table-head { background: var(--meterpro-blue); }
.owner-customer-meters-table .mud-table-cell {
    padding: 12px 16px;
    border-right: 1px solid #dce8f4;
    border-bottom: 1px solid #dce8f4;
    vertical-align: middle;
}

.owner-customer-meters-table .mud-table-cell:last-child { border-right: 0; }
.owner-customer-meters-table .mud-table-row:last-child .mud-table-cell { border-bottom: 0; }
.owner-customer-meter-number { color: var(--meterpro-navy); font-weight: 800; }
.owner-customer-meter-table-actions { min-width: 140px; }

.owner-properties-sheet {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #c7d9ec;
    border-radius: 12px;
    box-shadow: none !important;
}

.owner-properties-table { min-width: 760px; }
.owner-properties-table .mud-table-head { background: var(--meterpro-blue); }
.owner-properties-table .mud-table-cell {
    padding: 12px 16px;
    border-right: 1px solid #dce8f4;
    border-bottom: 1px solid #dce8f4;
    vertical-align: middle;
}

.owner-properties-table .mud-table-cell:last-child { border-right: 0; }
.owner-properties-table .mud-table-row:last-child .mud-table-cell { border-bottom: 0; }
.owner-property-name { color: var(--meterpro-navy); font-weight: 800; }
.owner-property-table-actions { min-width: 176px; }

.owner-meters-heading {
    color: #17212b !important;
    font-weight: 800 !important;
}

.owner-meter-card {
    overflow: hidden;
    border-color: #dbe5ee !important;
    background: #fff;
    box-shadow: none !important;
}

.owner-meter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdf8 0%, #f8fbff 100%);
    border-bottom: 1px solid #dbe5ee;
}

.owner-meter-card-body { padding: 16px; }

.owner-meter-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #047857;
    background: #d1fae5;
    border-radius: 10px;
}

.owner-meter-label {
    color: #64748b !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
}

.owner-meter-model {
    color: #475569 !important;
    font-weight: 600 !important;
}

.owner-meter-actions { flex-wrap: wrap; }

.owner-meter-action {
    min-width: 148px;
    justify-content: center;
}

@media (max-width: 480px) {
    .owner-meter-card-header { align-items: flex-start; }
    .owner-meter-actions .mud-button-root { flex: 1 1 100%; }
}

.owner-status-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 800 !important;
}

.owner-status-active { background: #dcfce7; }

.owner-status-inactive { background: #fee2e2; }

.property-owner-tabs .mud-tab.mud-tab-active {
    color: #fff !important;
    background-color: #068266 !important;
}

.property-owner-tabs .mud-tab-slider {
    background-color: #068266 !important;
}

.markup-percentage-field input { text-align: right; }

.financial-transactions-total {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    padding: 14px 16px;
    color: #065f46;
    background: #f0fdf8;
    border-color: #bde8da !important;
}

.financial-transactions-total span { font-weight: 800; }

.purchase-history-grid .mud-table-head,
.purchase-history-grid .mud-table-head .mud-table-cell {
    color: #fff !important;
    background: #068266 !important;
}

.purchase-history-grid .mud-table-head .mud-table-sort-label,
.purchase-history-grid .mud-table-head .mud-icon-root {
    color: #fff !important;
}

/* MeterPro applies the brand blue to primary data actions and the supplied green as an accent. */
.mud-table-head,
.mud-table-head .mud-table-cell,
.purchase-history-grid .mud-table-head,
.purchase-history-grid .mud-table-head .mud-table-cell {
    color: #fff !important;
    font-weight: 400 !important;
    background: var(--meterpro-blue) !important;
}

.mud-table-head .mud-table-sort-label,
.mud-table-head .mud-icon-root {
    color: #fff !important;
    font-weight: 400 !important;
}

.mud-tabs-toolbar .mud-tab.mud-tab-active,
.property-owner-tabs .mud-tab.mud-tab-active {
    background-color: var(--meterpro-blue) !important;
}


#blazor-error-ui {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    padding: 12px 16px;
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgb(15 23 42 / 12%);
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    float: right;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 1rem;
    color: #fff;
    background: #9f1239;
    border-radius: 10px;
}

@media (max-width: 600px) {
    .volt-page-container { padding: 86px 16px 24px !important; }
    .mud-card-content { padding: 20px !important; }
    .mud-card-actions { padding: 0 20px 20px !important; }
    .home-page { padding: 24px 16px; }
    .home-card { padding: 42px 24px 28px; }
    .login-page { padding: 24px 16px; }
    .login-card { padding: 32px 24px; }
}
