:root {
    color-scheme: light;
    --bg: #eaf5fc;
    --card: #ffffff;
    --ink: #26313f;
    --muted: #667085;
    --line: #d6e7f4;
    --brand: #147fc3;
    --brand-dark: #0c67a3;
    --brand-soft: #e6f4fd;
    --brand-gray: #414955;
    --brand-cyan: #19a6df;
    --ok-bg: #e8f7ee;
    --ok: #166534;
    --err-bg: #fdecec;
    --err: #b42318;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(20, 127, 195, 0.18), transparent 26rem),
        radial-gradient(circle at 90% 18%, rgba(25, 166, 223, 0.12), transparent 22rem),
        linear-gradient(180deg, #fbfdff 0%, var(--bg) 48%, #eef8ff 100%);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

body.portal-authenticated {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
}

.client-portal {
    width: min(100% - 14px, 540px);
    margin: 0 auto;
    padding: max(12px, env(safe-area-inset-top)) 0 32px;
}

.portal-app {
    width: min(100% - 14px, 540px);
    margin: 0 auto;
    min-height: 100vh;
    padding: max(10px, env(safe-area-inset-top)) 0 12px;
}

.portal-app-header {
    margin-bottom: 10px;
    padding: 4px 2px 0;
    position: sticky;
    top: 0;
    z-index: 6;
    background: linear-gradient(180deg, rgba(251, 253, 255, 0.96) 70%, rgba(251, 253, 255, 0));
    backdrop-filter: blur(10px);
}

.brand-logo {
    display: block;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.portal-app-brand {
    align-items: center;
    display: flex;
    gap: 12px;
}

.app-logo {
    flex: 0 0 auto;
    width: 142px;
}

.portal-app-header h1 {
    font-size: 1.55rem;
    line-height: 1.05;
    margin: 0;
}

.portal-app-brand .eyebrow {
    margin-bottom: 4px !important;
}

.portal-screens {
    display: grid;
    gap: 12px;
}

.portal-screen {
    display: grid;
    gap: 12px;
    animation: portal-screen-in 0.22s ease;
}

.portal-screen[hidden] {
    display: none !important;
}

@keyframes portal-screen-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portal-toast {
    border-radius: 16px;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 0 2px 10px;
    padding: 12px 14px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.portal-toast.success {
    background: var(--ok-bg);
    border: 1px solid #bbf7d0;
    color: var(--ok);
}

.portal-toast.is-dismissed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
}

.section-label {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    margin: 2px 4px 0;
    text-transform: uppercase;
}

.section-label.inside {
    margin: 0 0 10px;
}

.home-hero h2 {
    font-size: 1.65rem;
    margin: 0 0 8px;
    position: relative;
    z-index: 1;
}

.home-greeting {
    color: #667085 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    margin-bottom: 2px !important;
}

.home-summary {
    margin-top: 12px !important;
    position: relative;
    z-index: 1;
}

.home-info {
    margin-top: 2px;
}

.install-card {
    align-items: center;
    background:
        linear-gradient(135deg, rgba(20, 127, 195, 0.08), rgba(25, 166, 223, 0.04)),
        #ffffff;
    display: flex;
    gap: 14px;
}

.install-card h2 {
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.install-button {
    margin-top: 14px;
    width: 100%;
}

.install-help {
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 16px;
    color: #475467 !important;
    font-size: 0.92rem !important;
    font-weight: 700;
    line-height: 1.4;
    margin-top: 12px !important;
    padding: 12px;
}

.quick-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(31, 45, 70, 0.08);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    gap: 12px;
    min-height: 88px;
    padding: 14px;
    text-align: left;
    width: 100%;
}

.quick-action:hover,
.quick-action:focus-visible {
    border-color: #b8cff5;
    box-shadow: 0 12px 28px rgba(9, 105, 218, 0.12);
    outline: none;
}

.quick-action-icon {
    align-items: center;
    background: var(--brand-soft);
    border-radius: 14px;
    color: var(--brand);
    display: inline-flex;
    flex: 0 0 auto;
    height: 44px;
    justify-content: center;
    width: 44px;
}

.quick-action-icon svg {
    height: 22px;
    width: 22px;
}

.quick-action-text {
    display: grid;
    gap: 3px;
}

.quick-action-text strong {
    font-size: 1rem;
    line-height: 1.15;
}

.quick-action-text small {
    color: #667085;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
}

.client-data.compact div {
    min-height: 56px;
}

.account-actions {
    padding: 16px 20px;
}

.account-logout {
    width: 100%;
}

.history-card,
.help-card {
    display: grid;
    gap: 12px;
}

.history-list,
.help-list {
    display: grid;
    gap: 10px;
}

.history-item {
    align-items: flex-start;
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 18px;
    display: grid;
    gap: 10px;
    padding: 13px;
}

.history-item strong {
    color: var(--brand-gray);
    display: block;
    font-size: 0.98rem;
    line-height: 1.25;
}

.history-item span {
    color: #667085;
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-top: 3px;
}

.history-meta {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
}

.status-chip {
    background: var(--brand-soft);
    border: 1px solid #b9e4fb;
    border-radius: 999px;
    color: var(--brand-dark) !important;
    display: inline-flex !important;
    font-size: 0.78rem !important;
    font-weight: 900 !important;
    margin-top: 0 !important;
    padding: 6px 9px;
    text-transform: uppercase;
}

.status-chip.ok {
    background: var(--ok-bg);
    border-color: #bbf7d0;
    color: var(--ok) !important;
}

.status-chip.danger {
    background: var(--err-bg);
    border-color: #fecaca;
    color: var(--err) !important;
}

.staff-client-item-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.staff-client-item-head strong {
    flex: 1;
    min-width: 0;
}

.empty-state {
    background: #f8fbff;
    border: 1px dashed #c9dff0;
    border-radius: 18px;
    color: #667085 !important;
    font-weight: 700;
    padding: 14px;
}

.payment-balance-card {
    background:
        linear-gradient(135deg, rgba(20, 127, 195, 0.1), rgba(255, 255, 255, 0.92)),
        #ffffff;
}

.balance-amount {
    color: var(--brand-dark);
    font-size: clamp(2.2rem, 12vw, 3.25rem);
    font-weight: 950;
    letter-spacing: -0.05em;
    line-height: 1;
    margin: 14px 0 18px;
}

.billing-summary-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    margin: 0 0 14px;
}

.billing-summary-grid div,
.invoice-status {
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 18px;
    padding: 13px;
}

.billing-summary-grid span,
.invoice-status span {
    color: #667085;
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
}

.billing-summary-grid strong,
.invoice-status strong {
    color: var(--brand-gray);
    display: block;
    font-size: 1.03rem;
    line-height: 1.25;
    margin-top: 4px;
    word-break: break-word;
}

.pay-online-card button:disabled {
    background: #d7e8f5;
    color: #6b8aa3;
}

.invoice-card {
    display: grid;
    gap: 12px;
}

.invoice-status.ok {
    background: var(--ok-bg);
    border-color: #bbf7d0;
}

.invoice-status.ok strong,
.invoice-status.ok span {
    color: var(--ok);
}

.invoice-status.warning {
    background: #fff7ed;
    border-color: #fed7aa;
}

.invoice-status.warning strong,
.invoice-status.warning span {
    color: #9a3412;
}

.help-item {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 18px;
    color: var(--ink);
    display: grid;
    justify-items: flex-start;
    min-height: auto;
    padding: 14px;
    text-align: left;
}

.help-item strong {
    color: var(--brand-gray);
    font-size: 1rem;
}

.help-item span {
    color: #667085;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 4px;
}

.help-item:hover,
.help-item:focus-visible {
    background: #f8fcff;
    border-color: #acd7f2;
    box-shadow: 0 10px 24px rgba(20, 127, 195, 0.1);
    color: var(--ink);
    outline: none;
}

.portal-bottom-nav {
    align-items: stretch;
    background: rgba(255, 255, 255, 0.94);
    border-top: 1px solid var(--line);
    bottom: 0;
    box-shadow: 0 -8px 28px rgba(31, 45, 70, 0.1);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    left: 50%;
    max-width: 540px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    position: fixed;
    transform: translateX(-50%);
    width: min(100% - 14px, 540px);
    z-index: 20;
    backdrop-filter: blur(16px);
}

.portal-nav-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 14px;
    color: #667085;
    cursor: pointer;
    display: grid;
    font-size: 0.68rem;
    font-weight: 800;
    gap: 4px;
    justify-items: center;
    min-height: auto;
    padding: 8px 2px;
    width: 100%;
}

.portal-nav-item svg {
    height: 22px;
    width: 22px;
}

.portal-nav-item.is-active {
    background: var(--brand-soft);
    color: var(--brand);
}

.portal-nav-item:hover,
.portal-nav-item:focus-visible {
    background: #f3f8ff;
    color: var(--brand);
    outline: none;
}

.portal-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 16px 36px rgba(31, 45, 70, 0.12);
    padding: 20px;
}

.brand-hero {
    overflow: hidden;
    text-align: center;
}

.brand-hero > div {
    width: 100%;
}

.portal-hero-logo {
    margin: 0 auto 14px;
    width: min(82vw, 360px);
}

.portal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    position: sticky;
    top: 8px;
    z-index: 5;
    backdrop-filter: blur(14px);
}

.portal-hero h1,
.portal-card h2 {
    margin: 0 0 8px;
}

.portal-hero p,
.portal-card p {
    margin: 0;
    color: #475467;
    font-size: 1rem;
    line-height: 1.42;
}

.portal-hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.25rem);
    line-height: 1.05;
}

.portal-card h2 {
    font-size: 1.42rem;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: var(--brand-gray);
}

.eyebrow {
    margin: 0 0 7px !important;
    color: var(--brand) !important;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.portal-alert {
    border-radius: 18px;
    margin: 0 0 12px;
    padding: 14px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.35;
}

.portal-alert.success {
    background: var(--ok-bg);
    color: var(--ok);
}

.portal-alert.error {
    background: var(--err-bg);
    color: var(--err);
}

.login-card {
    margin-top: 12px;
}

.staff-access-card {
    margin-top: 12px;
    padding: 16px 18px;
}

.staff-access-card summary {
    color: var(--brand-dark);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 900;
    list-style-position: inside;
}

.staff-access-card .card-subtitle {
    margin-top: 10px !important;
}

.staff-login-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.staff-login-form label {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 900;
}

.staff-login-form input {
    margin-top: 6px;
}

.staff-login-form button {
    margin-top: 2px;
}

.staff-stats-grid {
    margin: 0 2px;
}

.staff-client-list {
    display: grid;
    gap: 10px;
}

.staff-client-item {
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 16px;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    gap: 4px;
    padding: 14px;
    text-align: left;
    width: 100%;
}

.staff-client-item strong {
    font-size: 1rem;
}

.staff-client-item span {
    color: #667085;
    font-size: 0.92rem;
    font-weight: 700;
}

.staff-client-item.is-active {
    background: var(--brand-soft);
    border-color: #9cc9ea;
}

.staff-selected-card h2 {
    margin-bottom: 6px;
}

.staff-access-links {
    display: grid;
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.staff-access-links a {
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 14px;
    color: var(--brand-dark);
    font-weight: 900;
    padding: 12px 14px;
    text-align: center;
    text-decoration: none;
}

.staff-access-links a:hover,
.staff-access-links a:focus-visible {
    background: var(--brand-soft);
    outline: none;
}

.portal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.client-data {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
}

.client-data div {
    background: #f7faff;
    border: 1px solid #e5edf8;
    border-radius: 16px;
    display: grid;
    gap: 5px;
    min-height: 62px;
    padding: 12px 14px;
}

.client-data dt {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.client-data dd {
    margin: 0;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 800;
    max-width: 100%;
    text-align: left;
    word-break: break-word;
}

.stack {
    display: grid;
    gap: 15px;
    margin-top: 18px;
}

label {
    color: #1d2939;
    display: grid;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #c9d4e5;
    border-radius: 16px;
    background: #fbfdff;
    color: var(--ink);
    font: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    min-height: 56px;
    outline: none;
    padding: 15px 15px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(20, 127, 195, 0.14);
}

textarea {
    min-height: 116px;
    resize: vertical;
}

button,
.ghost-link {
    align-items: center;
    background: var(--brand);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 900;
    justify-content: center;
    min-height: 56px;
    padding: 16px 18px;
    text-decoration: none;
    width: 100%;
}

button:hover,
.ghost-link:hover {
    background: var(--brand-dark);
}

button:disabled {
    background: #98a2b3;
    cursor: not-allowed;
}

.ghost-link {
    background: var(--brand-soft);
    color: var(--brand);
    flex: 0 0 auto;
    font-size: 0.92rem;
    min-height: 42px;
    padding: 10px 14px;
    width: auto;
}

button.quick-action {
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 10px 24px rgba(31, 45, 70, 0.08);
    color: var(--ink);
    display: flex;
    font-size: 1rem;
    justify-content: flex-start;
    min-height: 88px;
    padding: 14px;
    width: 100%;
}

button.quick-action:hover,
button.quick-action:focus-visible {
    background: #ffffff;
    border-color: #acd7f2;
    box-shadow: 0 12px 28px rgba(20, 127, 195, 0.14);
    color: var(--ink);
}

button.portal-nav-item {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 14px;
    color: #667085;
    display: grid;
    font-size: 0.68rem;
    gap: 4px;
    justify-items: center;
    min-height: auto;
    padding: 8px 2px;
    width: 100%;
}

button.portal-nav-item.is-active {
    background: var(--brand-soft);
    color: var(--brand);
}

button.portal-nav-item:hover,
button.portal-nav-item:focus-visible {
    background: #f3faff;
    color: var(--brand);
}

.muted {
    color: #667085;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-top: 14px !important;
}

.disabled-card {
    opacity: 0.86;
}

.card-subtitle {
    color: #344054 !important;
    font-size: 1.03rem !important;
    font-weight: 600;
    line-height: 1.42;
    margin-top: 4px !important;
}

.service-card {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 252, 255, 0.94) 100%),
        url("cablenet-wave.png") right bottom / 170% auto no-repeat;
    overflow: hidden;
    position: relative;
}

.service-card::after {
    background: linear-gradient(90deg, rgba(255,255,255,0.92), rgba(255,255,255,0.55));
    content: "";
    inset: 0;
    pointer-events: none;
    position: absolute;
}

.service-card > * {
    position: relative;
    z-index: 1;
}

.status-pill {
    background: #e9f7ff;
    border: 1px solid #b9e4fb;
    border-radius: 999px;
    color: var(--brand-dark);
    display: inline-flex;
    font-size: 0.92rem;
    font-weight: 900;
    margin-top: 10px;
    padding: 9px 13px;
    text-transform: uppercase;
}

.secondary-button {
    background: #f0f6ff;
    color: var(--brand);
    margin-top: 14px;
}

.wifi-status {
    background: #f7faff;
    border: 1px solid #dbe7f7;
    border-radius: 18px;
    color: #344054;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
    margin-top: 16px;
    padding: 14px;
}

.wifi-status.loading {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.wifi-status.ok {
    background: var(--ok-bg);
    border-color: #bbf7d0;
    color: var(--ok);
}

.wifi-status.error {
    background: var(--err-bg);
    border-color: #fecaca;
    color: var(--err);
}

.wifi-current,
.wifi-editors {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.wifi-network-card,
.wifi-editor {
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 20px;
    padding: 15px;
}

.wifi-network-card header,
.wifi-editor legend {
    color: var(--brand);
    font-size: 1.05rem;
    font-weight: 900;
    margin-bottom: 12px;
}

.wifi-network-card dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.wifi-network-card dl div {
    display: grid;
    gap: 3px;
}

.wifi-network-card dt {
    color: #667085;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.wifi-network-card dd {
    color: var(--ink);
    font-size: 1.06rem;
    font-weight: 800;
    margin: 0;
    word-break: break-word;
}

.wifi-network-card dd span {
    color: #667085;
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 4px;
}

.wifi-editor {
    display: grid;
    gap: 13px;
    margin: 0;
}

.wifi-check {
    align-items: center;
    background: #fff;
    border: 1px solid #e5edf8;
    border-radius: 16px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 12px;
}

.wifi-check input {
    height: 22px;
    min-height: auto;
    width: 22px;
}

.wifi-check span {
    font-size: 1rem;
}

.wifi-field-help {
    color: #667085;
    display: block;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

/* Staff portal — layout compacto */
.portal-staff .portal-screens,
.portal-staff .portal-screen {
    gap: 8px;
}

.portal-staff .portal-app-header {
    margin-bottom: 6px;
}

.portal-staff .app-logo {
    width: 108px;
}

.portal-staff .portal-app-header h1 {
    font-size: 1.28rem;
}

.portal-staff .portal-card {
    border-radius: 18px;
    box-shadow: 0 10px 24px rgba(31, 45, 70, 0.08);
    padding: 14px 15px;
}

.portal-staff .portal-card h2 {
    font-size: 1.12rem;
    margin-bottom: 4px;
}

.portal-staff .eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    margin-bottom: 4px !important;
}

.portal-staff .quick-action {
    border-radius: 16px;
    min-height: 72px;
    padding: 11px;
}

.portal-staff .quick-action-icon {
    height: 38px;
    width: 38px;
}

.portal-staff .staff-stats-grid {
    margin: 0;
}

.portal-staff .staff-stats-grid div,
.portal-staff .billing-summary-grid div {
    border-radius: 12px;
    padding: 9px 10px;
}

.portal-staff .staff-panel-head {
    align-items: flex-start;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.portal-staff .staff-panel-head--tight {
    align-items: center;
    margin-bottom: 6px;
}

.portal-staff .staff-panel-head .eyebrow {
    margin-bottom: 0 !important;
}

.portal-staff .staff-panel-title {
    flex: 1;
    min-width: 0;
}

.portal-staff .staff-panel-meta {
    color: #667085;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 4px 0 0;
}

.portal-staff .staff-hint {
    color: #667085;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 10px;
}

.portal-staff .staff-chip-btn {
    background: var(--brand-soft);
    border: 1px solid #b9dff5;
    border-radius: 999px;
    color: var(--brand-dark);
    cursor: pointer;
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 900;
    min-height: 34px;
    padding: 7px 12px;
    width: auto;
}

.portal-staff .staff-chip-btn:hover,
.portal-staff .staff-chip-btn:focus-visible {
    background: #d9effc;
    outline: none;
}

.portal-staff .staff-chip-btn:disabled {
    background: #eef2f6;
    border-color: #dbe3ec;
    color: #98a2b3;
    cursor: not-allowed;
}

.portal-staff .staff-chip-btn--accent {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.portal-staff .staff-chip-btn--accent:hover,
.portal-staff .staff-chip-btn--accent:focus-visible {
    background: var(--brand-dark);
}

.portal-staff .staff-info-list {
    border: 1px solid #e5edf8;
    border-radius: 12px;
    display: grid;
    gap: 0;
    margin: 0;
    overflow: hidden;
}

.portal-staff .staff-info-list > div {
    align-items: center;
    background: #f8fbff;
    border-bottom: 1px solid #e5edf8;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 0;
    padding: 9px 11px;
}

.portal-staff .staff-info-list > div:last-child {
    border-bottom: 0;
}

.portal-staff .staff-info-list dt {
    color: #667085;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-staff .staff-info-list dd {
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
    margin: 0;
    text-align: right;
    word-break: break-word;
}

.portal-staff .staff-info-list--grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-staff .staff-info-list--grid > div {
    align-items: flex-start;
    border-bottom: 0;
    border-right: 1px solid #e5edf8;
    flex-direction: column;
    gap: 3px;
    justify-content: flex-start;
    padding: 8px 9px;
}

.portal-staff .staff-info-list--grid > div:last-child {
    border-right: 0;
}

.portal-staff .staff-info-list--grid dd {
    font-size: 0.84rem;
    text-align: left;
}

.portal-staff .balance-amount--staff {
    font-size: clamp(1.75rem, 9vw, 2.4rem);
    margin: 4px 0 10px;
}

.portal-staff .staff-search-form {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.portal-staff .staff-search-form input {
    min-height: 46px;
    padding: 11px 12px;
}

.portal-staff .staff-search-form button {
    min-height: 46px;
    padding: 11px 16px;
    width: auto;
}

.portal-staff .staff-search-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.portal-staff .staff-form.stack--compact {
    gap: 10px;
    margin-top: 10px;
}

.portal-staff .staff-form.stack--compact label {
    font-size: 0.9rem;
    gap: 6px;
}

.portal-staff .staff-form.stack--compact input {
    min-height: 46px;
    padding: 11px 12px;
}

.portal-staff .staff-form.stack--compact button[type="submit"] {
    margin-top: 2px;
    min-height: 46px;
    padding: 11px 16px;
}

.portal-staff .staff-muted {
    font-size: 0.88rem;
    margin-top: 8px !important;
}

.portal-staff .staff-inline-status {
    background: #f7faff;
    border: 1px solid #dbe7f7;
    border-radius: 12px;
    color: #344054;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.35;
    margin-top: 8px;
    padding: 9px 11px;
}

.portal-staff .staff-inline-status:empty {
    display: none;
}

.portal-staff .staff-inline-status.loading {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412;
}

.portal-staff .staff-inline-status.success {
    background: var(--ok-bg);
    border-color: #bbf7d0;
    color: var(--ok);
}

.portal-staff .staff-inline-status.error {
    background: var(--err-bg);
    border-color: #fecaca;
    color: var(--err);
}

.portal-staff .staff-client-item {
    border-radius: 12px;
    padding: 11px 12px;
}

.portal-staff .staff-results-panel {
    padding-top: 12px;
}

.portal-staff .empty-state {
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 11px;
}

.portal-staff .wifi-current--compact {
    gap: 8px;
    margin-top: 8px;
}

.portal-staff .wifi-network {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #dce8f7;
    border-radius: 12px;
    display: grid;
    gap: 2px 10px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 9px 11px;
}

.portal-staff .wifi-network-band {
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-staff .wifi-network-ssid {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-staff .wifi-network-tag {
    background: #eef6ff;
    border-radius: 999px;
    color: #475467;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 4px 8px;
    text-transform: uppercase;
}

.portal-staff .wifi-network--detail {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
}

.portal-staff .wifi-network-password {
    color: #344054;
    font-size: 0.86rem;
    font-weight: 700;
    grid-column: 1 / -1;
    line-height: 1.35;
    word-break: break-all;
}

.portal-staff .wifi-network-password strong {
    color: #667085;
    font-size: 0.72rem;
    font-weight: 900;
    margin-right: 6px;
    text-transform: uppercase;
}

.portal-staff .wifi-password-current {
    background: #f3f8ff;
    color: var(--ink);
    font-weight: 800;
}

.portal-staff .wifi-password-current[readonly] {
    cursor: text;
}

.portal-staff .wifi-editors--compact {
    gap: 8px;
    margin-top: 8px;
}

.portal-staff .wifi-editor {
    border-radius: 14px;
    gap: 10px;
    padding: 12px;
}

.portal-staff .wifi-editor h3 {
    color: var(--brand);
    font-size: 0.95rem;
    font-weight: 900;
    margin: 0;
}

.wifi-check {
    align-items: center;
    background: #fff;
    border: 1px solid #e5edf8;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    padding: 10px 12px;
}

.wifi-check input[type="checkbox"] {
    accent-color: var(--brand);
    flex: 0 0 auto;
    height: 20px;
    margin: 0;
    min-height: 20px;
    padding: 0;
    width: 20px;
}

.wifi-check span {
    font-size: 0.92rem;
    font-weight: 700;
}

.portal-staff .portal-bottom-nav {
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
}

.portal-staff .portal-nav-item {
    font-size: 0.62rem;
    gap: 3px;
    padding: 6px 1px;
}

.portal-staff .portal-nav-item svg {
    height: 20px;
    width: 20px;
}

.portal-staff .portal-nav-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 380px) {
    .portal-staff .staff-info-list--grid {
        grid-template-columns: 1fr;
    }

    .portal-staff .staff-info-list--grid > div {
        border-bottom: 1px solid #e5edf8;
        border-right: 0;
        flex-direction: row;
        justify-content: space-between;
    }

    .portal-staff .staff-info-list--grid > div:last-child {
        border-bottom: 0;
    }

    .portal-staff .staff-info-list--grid dd {
        text-align: right;
    }
}

@media (min-width: 900px) {
    .client-portal,
    .portal-app {
        width: min(100% - 40px, 560px);
    }

    .portal-bottom-nav {
        width: min(100% - 40px, 560px);
        max-width: 560px;
    }

    .portal-card {
        padding: 22px;
    }

    .quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .history-item {
        align-items: center;
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (max-width: 380px) {
    .client-portal,
    .portal-app {
        width: min(100% - 12px, 520px);
    }

    .portal-card {
        border-radius: 20px;
        padding: 17px;
    }

    .portal-hero h1 {
        font-size: 1.65rem;
    }

    .app-logo {
        width: 120px;
    }

    .portal-app-header h1 {
        font-size: 1.35rem;
    }
}
