/* Theme */

:root {
    --portal-primary: #0d6f8f;
    --portal-primary-dark: #084f66;
    --portal-accent: #1e8e72;
    --portal-surface: rgba(255, 255, 255, 0.94);
    --portal-surface-muted: #eef6f8;
    --portal-border: rgba(13, 111, 143, 0.12);
    --portal-text: #16303a;
    --portal-text-muted: #627984;
    --portal-shadow: 0 24px 60px rgba(10, 53, 73, 0.12);
}

body {
    color: var(--portal-text);
    background:
        radial-gradient(circle at top left, rgba(38, 144, 181, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(30, 142, 114, 0.12), transparent 24%),
        linear-gradient(180deg, #f4fbfc 0%, #eaf4f7 46%, #f7fbfc 100%);
}

.g-bg-darkblue-v2,
.g-bg-teal,
.list-group-item.active,
.u-btn-primary {
    background-color: var(--portal-primary) !important;
}

.list-group-item.active {
    border-color: var(--portal-primary) !important;
}

.u-btn-primary {
    color: #fff;
}

.u-btn-outline-teal {
    color: var(--portal-accent);
    border-color: var(--portal-accent);
    background-color: transparent;
}

.u-btn-outline-teal.u-btn-hover-v2-1::after,
.u-btn-outline-teal.u-btn-hover-v2-1:hover::after,
.u-btn-outline-teal:focus,
.u-btn-outline-teal.active,
.u-btn-outline-teal:hover {
    background-color: var(--portal-accent);
}

.u-btn-outline-teal:focus,
.u-btn-outline-teal.active,
.u-btn-outline-teal:hover {
    color: #fff;
}

.a-wamasys-orange {
    color: var(--portal-accent) !important;
    outline: none;
}

.u-pagination-v1-2--active,
.u-pagination-v1-2--nav {
    background-color: var(--portal-primary);
    color: #fff;
    border-color: var(--portal-primary-dark);
}

.u-pagination-v1-2:hover,
.u-pagination-v1-2:focus {
    color: var(--portal-primary);
    border-color: var(--portal-primary-dark);
}

.ct-series-a .ct-bar,
.ct-series-a .ct-line,
.ct-series-a .ct-point,
.ct-series-a .ct-slice-donut {
    stroke: var(--portal-primary) !important;
}

.ct-chart {
    margin: auto !important;
    height: 320px !important;
}

/* Header */

.portal-header {
    border-bottom: 1px solid rgba(1, 127, 188, 0.08);
    box-shadow: 0 10px 24px rgba(12, 44, 66, 0.05);
}

.portal-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-brand__logo {
    width: auto;
    max-width: 180px;
    height: 42px;
    object-fit: contain;
}

.portal-header__meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-header__operator {
    max-width: 16rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--portal-text-muted);
    text-align: right;
}

.portal-language-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem;
    border: 1px solid var(--portal-border);
    border-radius: 999px;
    background: var(--portal-surface-muted);
}

.portal-language-switch__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    color: var(--portal-text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
}

.portal-language-switch__link.is-active {
    background: var(--portal-primary);
    color: #fff;
}

/* Shared layout */

.portal-page {
    min-height: 100vh;
}

.portal-shell {
    padding-top: 2rem;
}

.portal-sidebar__card,
.portal-card,
.portal-login-card,
.portal-form-card,
.portal-summary-card,
.portal-preference-card {
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 1.25rem;
    box-shadow: var(--portal-shadow);
}

.portal-sidebar__card,
.portal-card,
.portal-summary-card,
.portal-preference-card {
    padding: 1.25rem;
}

.portal-content {
    display: block;
}

.portal-content > .row:last-child,
.portal-content > .portal-card:last-child {
    margin-bottom: 0;
}

.portal-section-title {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.portal-section-subtitle {
    color: var(--portal-text-muted);
    margin-bottom: 1rem;
}

/* Sidebar */

.portal-sidebar {
    align-self: flex-start;
}

.portal-sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.portal-sidebar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    border-radius: 0.9rem !important;
    font-weight: 700;
}

.portal-nav-link {
    display: flex;
    align-items: center;
    min-height: 3rem;
    border: 1px solid transparent;
    border-radius: 0.9rem !important;
    color: var(--portal-text);
    background: var(--portal-surface-muted);
    font-weight: 600;
}

.portal-nav-link:not(.active):hover {
    border-color: rgba(1, 127, 188, 0.15);
    color: var(--portal-primary);
}

.portal-logout-btn {
    border-color: rgba(1, 127, 188, 0.25);
}

/* Home */

.portal-hero-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, var(--portal-primary) 0%, #1ba8d9 100%);
    color: #fff;
    box-shadow: 0 20px 36px rgba(1, 127, 188, 0.2);
}

.portal-hero-card__eyebrow {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.8;
}

.portal-hero-card__title {
    margin: 0;
    font-size: 1.85rem;
    font-weight: 700;
}

.portal-hero-card__text {
    margin: 0;
    max-width: 38rem;
    opacity: 0.9;
}

.portal-summary-card__label {
    margin-bottom: 0.35rem;
    color: var(--portal-text-muted);
    font-weight: 600;
}

.portal-summary-card__value {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--portal-text);
}

.portal-summary-card--hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.portal-summary-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-summary-card--hero .portal-summary-card__label,
.portal-summary-card--hero .portal-form-note {
    margin-bottom: 0;
}

.portal-summary-card--hero .portal-summary-card__value {
    margin-left: auto;
}

.portal-meter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    width: 100%;
}

.portal-meter-item {
    padding: 1rem 1.05rem;
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
}

.portal-meter-item__label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--portal-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-meter-item__value {
    display: block;
    color: var(--portal-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
}

.portal-balance-alert {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(198, 127, 16, 0.18);
    border-radius: 0.9rem;
    background: rgba(255, 248, 230, 0.92);
    color: #8a5a13;
    font-size: 0.95rem;
    font-weight: 600;
}

/* Tables */

.portal-table-card .table-responsive {
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    overflow: hidden;
}

.portal-table-card table {
    margin-bottom: 0;
}

.portal-table-card thead th {
    background: var(--portal-surface-muted);
    border-bottom: 1px solid var(--portal-border);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--portal-text-muted);
}

.portal-table-card tbody td {
    vertical-align: middle;
}

.portal-empty-state {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--portal-text-muted);
}

/* Forms */

.portal-form-card,
.portal-login-card {
    padding: 1.5rem;
}

.portal-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.portal-form-note {
    color: var(--portal-text-muted);
    font-size: 0.95rem;
}

/* Notification center */

.portal-preference-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.portal-contact-fields {
    display: grid;
    gap: 1rem;
}

.portal-preference-channels {
    display: grid;
    gap: 0.75rem;
}

.portal-channel-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    background: var(--portal-surface-muted);
}

.g-gap-10 {
    gap: 0.625rem;
}

.portal-channel-card__meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portal-channel-card__label {
    font-weight: 700;
}

.portal-channel-card__value {
    color: var(--portal-text-muted);
    font-size: 0.92rem;
}

.portal-channel-card__status {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-text-muted);
}

.portal-channel-card__status.is-available {
    color: var(--portal-primary-dark);
}

.portal-preference-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    overflow: hidden;
    background: #fff;
}

.portal-preference-table th,
.portal-preference-table td {
    padding: 0.95rem 0.85rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-preference-table th {
    background: var(--portal-surface-muted);
    color: var(--portal-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-preference-table tr:last-child td {
    border-bottom: 0;
}

.portal-preference-table__label {
    min-width: 14rem;
    font-weight: 600;
}

.portal-preference-table__description {
    color: var(--portal-text-muted);
    font-size: 0.95rem;
}

.portal-preference-table__checkbox {
    text-align: center;
}

.portal-preference-table__checkbox .font-weight-600 {
    display: none;
    color: var(--portal-text-muted);
    font-size: 0.83rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-preference-table input[type="checkbox"],
.portal-channel-card input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--portal-primary);
}

.portal-preference-help {
    color: var(--portal-text-muted);
    font-size: 0.95rem;
}

.portal-messenger-card {
    height: 100%;
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-badge--active {
    color: #0f6d47;
    background: rgba(15, 109, 71, 0.12);
}

.portal-badge--muted {
    color: var(--portal-text-muted);
    background: rgba(102, 120, 138, 0.12);
}

/* Footer */

.portal-footer .u-list-inline {
    margin-bottom: 0;
}

/* Responsive */

@media (max-width: 991.98px) {
    .portal-brand__logo {
        max-width: 145px;
        height: 36px;
    }

    .portal-header__inner,
    .portal-header__meta {
        align-items: flex-start;
    }

    .portal-header__inner {
        flex-direction: column;
    }

    .portal-header__meta {
        width: 100%;
        justify-content: space-between;
    }

    .portal-header__operator {
        max-width: none;
        text-align: left;
    }

    .portal-sidebar__card {
        margin-top: 0.75rem;
    }

    .portal-hero-card__title {
        font-size: 1.45rem;
    }

    .portal-summary-card__value {
        font-size: 1.55rem;
    }

    .portal-preference-grid {
        grid-template-columns: 1fr;
    }

    .portal-preference-table,
    .portal-preference-table thead,
    .portal-preference-table tbody,
    .portal-preference-table tr,
    .portal-preference-table th,
    .portal-preference-table td {
        display: block;
        width: 100%;
    }

    .portal-preference-table thead {
        display: none;
    }

    .portal-preference-table tr {
        padding: 0.85rem;
        border-bottom: 1px solid var(--portal-border);
    }

    .portal-preference-table tr:last-child {
        border-bottom: 0;
    }

    .portal-preference-table td {
        padding: 0.4rem 0;
        border: 0;
    }

    .portal-preference-table__checkbox {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .portal-preference-table__checkbox .font-weight-600 {
        display: inline-block;
    }

    .portal-form-card,
    .portal-login-card,
    .portal-sidebar__card,
    .portal-card,
    .portal-summary-card,
    .portal-preference-card {
        padding: 1rem;
        border-radius: 1rem;
    }

    .ct-chart {
        height: 240px !important;
    }
}

/* Permanent modern layer */

.portal-page {
    position: relative;
}

.portal-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 40%),
        repeating-linear-gradient(135deg, rgba(13, 111, 143, 0.025) 0, rgba(13, 111, 143, 0.025) 1px, transparent 1px, transparent 18px);
    pointer-events: none;
    opacity: 0.8;
}

.portal-shell {
    padding-top: 2.5rem;
}

.u-header__section--light {
    background: rgba(247, 251, 252, 0.88) !important;
    backdrop-filter: blur(18px);
}

.portal-header {
    border-bottom-color: rgba(13, 111, 143, 0.08);
    box-shadow: 0 12px 40px rgba(7, 44, 59, 0.08);
}

.portal-language-switch {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
}

.portal-sidebar__card,
.portal-card,
.portal-login-card,
.portal-form-card,
.portal-summary-card,
.portal-preference-card {
    border-color: rgba(255, 255, 255, 0.72);
    box-shadow: 0 22px 54px rgba(10, 53, 73, 0.12);
    backdrop-filter: blur(12px);
}

.portal-nav-link {
    background: rgba(238, 246, 248, 0.8);
    transition: all 0.2s ease;
}

.portal-nav-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(13, 111, 143, 0.15);
    box-shadow: 0 12px 24px rgba(10, 53, 73, 0.08);
}

.portal-nav-link.active {
    background: linear-gradient(135deg, #0d6f8f 0%, #1592ae 100%);
    border-color: transparent !important;
    box-shadow: 0 14px 28px rgba(13, 111, 143, 0.22);
}

.portal-logout-btn {
    border-width: 0;
    background: rgba(13, 111, 143, 0.08);
    color: var(--portal-primary-dark);
}

.portal-hero-card {
    position: relative;
    overflow: hidden;
    padding: 1.9rem;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.26), transparent 30%),
        linear-gradient(135deg, #0c5e79 0%, #137ea0 52%, #1f9d8d 100%);
    box-shadow: 0 28px 60px rgba(12, 94, 121, 0.24);
}

.portal-hero-card::after {
    content: "";
    position: absolute;
    right: -3rem;
    bottom: -4rem;
    width: 12rem;
    height: 12rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.portal-summary-card__value {
    font-size: 2.25rem;
    line-height: 1.05;
}

.portal-summary-card--hero .portal-summary-card__value {
    font-size: 2.6rem;
}

.portal-table-card .table-responsive,
.portal-channel-card,
.portal-preference-table {
    background: rgba(255, 255, 255, 0.9);
}

.portal-table-card thead th {
    background: #f1f8fa;
}

.portal-table-card tbody tr {
    transition: background-color 0.18s ease;
}

.portal-table-card tbody tr:hover {
    background: rgba(13, 111, 143, 0.03);
}

.form-control {
    min-height: 3.2rem;
    border-color: rgba(13, 111, 143, 0.14);
    border-radius: 1rem;
    box-shadow: inset 0 1px 2px rgba(10, 53, 73, 0.02);
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: rgba(13, 111, 143, 0.34);
    box-shadow: 0 0 0 0.22rem rgba(13, 111, 143, 0.08);
}

.u-btn-primary,
.btn.u-btn-primary {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #0d6f8f 0%, #1793af 100%);
    box-shadow: 0 18px 30px rgba(13, 111, 143, 0.18);
    transition: all 0.2s ease;
}

.u-btn-primary:hover,
.btn.u-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(13, 111, 143, 0.24);
}

.u-btn-outline-teal {
    border-radius: 999px;
}

.portal-chart-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.portal-chart-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.portal-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.portal-chart-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--portal-text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.portal-chart-legend__swatch {
    width: 2rem;
    border-top: 3px solid var(--portal-primary);
    border-radius: 999px;
}

.portal-chart-legend__item--compare .portal-chart-legend__swatch {
    border-top-style: dashed;
    border-top-color: var(--portal-accent);
}

.portal-chart-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--portal-text);
    font-size: 0.92rem;
    font-weight: 600;
}

.portal-chart-toggle input[type="checkbox"] {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--portal-primary);
}

.portal-chart-summary__item {
    padding: 1rem 1.05rem;
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.72);
}

.portal-chart-summary__label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--portal-text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-chart-summary__value {
    display: block;
    color: var(--portal-text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.portal-chart-panel {
    padding: 0.5rem 0.25rem 0;
}

.portal-consumption-chart {
    height: 320px !important;
    padding-top: 0.25rem;
}

.ct-series-a .ct-line {
    stroke-width: 3px;
}

.ct-series-a .ct-point {
    stroke-width: 8px;
}

.ct-series-a .ct-area {
    fill: rgba(13, 111, 143, 0.16);
}

.ct-series-b .ct-line,
.ct-series-b .ct-point {
    stroke: var(--portal-accent) !important;
}

.ct-series-b .ct-line {
    stroke-width: 3px;
    stroke-dasharray: 8px 6px;
}

.ct-series-b .ct-point {
    stroke-width: 7px;
}

.ct-series-b .ct-area {
    display: none;
}

.ct-grid {
    stroke: rgba(13, 111, 143, 0.08);
    stroke-dasharray: 3px;
}

.ct-label {
    color: var(--portal-text-muted);
    fill: var(--portal-text-muted);
}

.portal-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--portal-border);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 14px 32px rgba(10, 53, 73, 0.08);
}

.portal-pagination__status {
    color: var(--portal-text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.portal-pagination__nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.portal-pagination__pages {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.portal-pagination__control,
.portal-pagination__page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.8rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(13, 111, 143, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--portal-text);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.portal-pagination__page {
    min-width: 2.8rem;
    padding-left: 0.85rem;
    padding-right: 0.85rem;
}

.portal-pagination__control:hover,
.portal-pagination__page:hover {
    color: var(--portal-primary);
    border-color: rgba(13, 111, 143, 0.22);
    box-shadow: 0 10px 22px rgba(10, 53, 73, 0.08);
    text-decoration: none;
}

.portal-pagination__page.is-active {
    background: linear-gradient(135deg, #0d6f8f 0%, #1592ae 100%);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 16px 28px rgba(13, 111, 143, 0.2);
}

.portal-pagination__control.is-disabled {
    opacity: 0.45;
    cursor: default;
    box-shadow: none;
}

@media (max-width: 991.98px) {
    .portal-header__meta {
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .portal-meter-grid,
    .portal-chart-summary {
        grid-template-columns: 1fr;
    }

    .portal-summary-card--hero {
        align-items: flex-start;
    }

    .portal-chart-tools {
        align-items: flex-start;
    }

    .portal-summary-card--hero .portal-summary-card__value {
        margin-left: 0;
        font-size: 2.05rem;
    }

    .portal-pagination {
        align-items: stretch;
    }

    .portal-pagination__nav {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .portal-pagination__control {
        flex: 1 1 auto;
    }

    .portal-pagination__pages {
        gap: 0.35rem;
    }

    .portal-consumption-chart {
        height: 240px !important;
    }
}
