:root {
    --portal-ink: #132238;
    --portal-muted: #69788c;
    --portal-blue: #0b6fbf;
    --portal-cyan: #18a7d5;
    --portal-green: #31b77a;
    --portal-bg: #f4f8fb;
    --portal-line: #dbe6ef;
    --portal-sidebar: #071827;
    --portal-sidebar-2: #0c263b;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--portal-ink);
    background: var(--portal-bg);
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

body.auth-body {
    background:
        radial-gradient(circle at top left, rgba(24, 167, 213, 0.12), transparent 30%),
        var(--portal-bg);
}

a {
    text-decoration: none;
}

.portal-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 280px minmax(0, 1fr);
    transition: grid-template-columns 0.18s ease;
}

html.sidebar-minimized .portal-shell {
    grid-template-columns: 92px minmax(0, 1fr);
}

.portal-shell--auth {
    display: block;
}

.portal-sidebar {
    position: sticky;
    top: 0;
    z-index: 1200;
    display: flex;
    height: 100vh;
    flex-direction: column;
    gap: 28px;
    padding: 28px 22px;
    background: linear-gradient(160deg, var(--portal-sidebar), var(--portal-sidebar-2));
    color: #fff;
    overflow: visible;
    transition: padding 0.18s ease;
}

.portal-sidebar__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.portal-sidebar__close,
.portal-menu-toggle,
.portal-menu-backdrop {
    border: 0;
}

.portal-sidebar__close,
.portal-menu-toggle {
    display: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.portal-sidebar__close {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-menu-toggle {
    flex: 0 0 44px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.45rem;
}

.portal-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    display: none;
    background: rgba(7, 24, 39, 0.54);
    backdrop-filter: blur(2px);
}

.portal-mobile-actions {
    display: none;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.portal-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.86);
    font-weight: 800;
}

.portal-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.portal-brand:hover {
    color: #fff;
}

.portal-brand__mark {
    display: inline-grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--portal-blue), var(--portal-cyan));
    color: #fff;
    font-weight: 800;
}

.portal-brand__dice {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    object-fit: contain;
}

.portal-brand small {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
}

.portal-nav {
    display: grid;
    gap: 8px;
}

.portal-nav__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 600;
}

.portal-nav__link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-nav__link.is-active {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    box-shadow: inset 4px 0 0 var(--portal-cyan);
}

.portal-nav__link.is-active .nav-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.portal-nav__link--danger {
    color: #ffd6dc;
}

html.sidebar-minimized .portal-sidebar {
    align-items: center;
    padding: 28px 18px;
}

html.sidebar-minimized .portal-sidebar__head {
    justify-content: center;
}

html.sidebar-minimized .portal-brand span,
html.sidebar-minimized .portal-nav__link span,
html.sidebar-minimized .portal-sidebar-toggle span {
    display: none;
}

html.sidebar-minimized .portal-brand {
    justify-content: center;
}

html.sidebar-minimized .portal-nav {
    width: 100%;
}

html.sidebar-minimized .portal-nav__link {
    justify-content: center;
    padding: 12px;
}

html.sidebar-minimized .portal-nav__link.is-active {
    box-shadow: inset 0 -3px 0 var(--portal-cyan);
}

html.sidebar-minimized .portal-nav__link::after {
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    z-index: 5000;
    display: none;
    width: max-content;
    max-width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #071827;
    color: #fff;
    content: attr(data-title);
    font-size: 0.82rem;
    font-weight: 800;
    box-shadow: 0 12px 30px rgba(7, 24, 39, 0.24);
    transform: translateY(-50%);
}

html.sidebar-minimized .portal-nav__link::before {
    position: absolute;
    top: 50%;
    left: calc(100% + 5px);
    z-index: 5001;
    display: none;
    border-top: 6px solid transparent;
    border-right: 7px solid #071827;
    border-bottom: 6px solid transparent;
    content: "";
    transform: translateY(-50%);
}

html.sidebar-minimized .portal-nav__link:hover::after,
html.sidebar-minimized .portal-nav__link:hover::before {
    display: block;
}

html.sidebar-minimized .portal-sidebar-toggle {
    width: 44px;
    padding: 0;
}

.nav-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.portal-main {
    min-width: 0;
}

.portal-topbar {
    display: flex;
    min-height: 116px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 36px;
    background: #0f77bd;
    color: #fff;
}

.portal-topbar h1 {
    margin: 4px 0 0;
    font-size: clamp(1.45rem, 2.8vw, 2.1rem);
    font-weight: 800;
}

.portal-kicker {
    color: var(--portal-green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.portal-user {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
}

.portal-user span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.portal-content {
    padding: 36px;
}

.login-page {
    min-height: calc(100vh - 72px);
}

.portal-shell--auth .portal-content {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-page--simple {
    display: flex;
    width: 100%;
    min-height: auto;
    align-items: center;
    justify-content: center;
}

.login-hero h2,
.portal-panel h2 {
    max-width: 680px;
    margin: 10px 0 14px;
    color: var(--portal-ink);
    font-size: clamp(2rem, 4vw, 3.6rem);
    font-weight: 850;
    line-height: 1.04;
}

.login-hero p,
.portal-panel p {
    max-width: 560px;
    color: var(--portal-muted);
    font-size: 1.05rem;
}

.login-card,
.portal-panel,
.portal-stat {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 64, 98, 0.09);
}

.login-card {
    width: min(100%, 420px);
    padding: 34px 32px;
}

.login-card__brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: min(100%, 230px);
    height: auto;
}

.login-dice {
    display: block;
    width: 46px;
    height: 46px;
    object-fit: contain;
    margin: 14px auto 0;
}

.login-card__intro {
    margin-bottom: 28px;
    text-align: center;
}

.login-card__intro h2 {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 800;
}

.login-card__intro p {
    margin: 6px 0 0;
    color: var(--portal-muted);
}

.floating-field {
    position: relative;
    margin-bottom: 22px;
}

.floating-field label {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 2;
    max-width: calc(100% - 26px);
    padding: 0 4px;
    background: transparent;
    color: var(--portal-muted);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    pointer-events: none;
    transform: translateY(-50%);
    transition: top 0.15s ease, transform 0.15s ease, color 0.15s ease, font-size 0.15s ease, background 0.15s ease;
}

.floating-field input,
.floating-field select,
.floating-field textarea,
.form-control {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px 10px;
    border: 1px solid var(--portal-line);
    border-color: var(--portal-line);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-ink);
    outline: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.floating-field select {
    padding-right: 36px;
}

.floating-field textarea {
    min-height: 120px;
    resize: vertical;
}

.floating-field input:focus,
.floating-field select:focus,
.floating-field textarea:focus,
.form-control:focus {
    border-color: var(--portal-cyan);
    box-shadow: 0 0 0 0.2rem rgba(24, 167, 213, 0.16);
}

.floating-field.is-focused label,
.floating-field.is-filled label,
.floating-field:has(input:focus) label,
.floating-field:has(textarea:focus) label,
.floating-field:has(select:focus) label,
.floating-field:has(input:not(:placeholder-shown)) label,
.floating-field:has(textarea:not(:placeholder-shown)) label {
    top: -9px;
    padding: 0 7px;
    background: #fff;
    color: var(--portal-blue);
    font-size: 0.78rem;
    font-weight: 700;
    transform: translateY(0);
}

.floating-field.select label {
    top: -9px;
    padding: 0 7px;
    background: #fff;
    color: var(--portal-blue);
    font-size: 0.78rem;
    font-weight: 700;
    transform: translateY(0);
}

.floating-field.has-error input,
.floating-field.has-error select,
.floating-field.has-error textarea {
    border-color: #dc3545;
}

.floating-field.checkbox,
.floating-field.radio {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.floating-field.checkbox label,
.floating-field.radio label {
    position: static;
    max-width: none;
    padding: 0;
    background: transparent;
    color: var(--portal-ink);
    font-size: 0.95rem;
    font-weight: 500;
    pointer-events: auto;
}

.floating-field.checkbox input,
.floating-field.radio input {
    width: auto;
    min-height: 0;
    padding: 0;
}

.login-card__options {
    display: flex;
    justify-content: space-between;
    margin: -2px 0 20px;
}

.btn-primary {
    --bs-btn-bg: var(--portal-blue);
    --bs-btn-border-color: var(--portal-blue);
    --bs-btn-hover-bg: #085d9f;
    --bs-btn-hover-border-color: #085d9f;
    min-height: 48px;
    border-radius: 8px;
    font-weight: 800;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
}

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

.ops-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: stretch;
    margin-bottom: 20px;
}

.ops-hero__copy,
.main-number-card,
.kpi-card,
.ops-panel {
    border: 1px solid rgba(219, 230, 239, 0.9);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 64, 98, 0.08);
}

.ops-hero__copy {
    padding: 26px 28px;
    background:
        linear-gradient(135deg, rgba(11, 111, 191, 0.08), rgba(49, 183, 122, 0.08)),
        #fff;
}

.ops-hero__copy h2 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 3.4vw, 3rem);
    font-weight: 850;
}

.ops-hero__copy p {
    max-width: 720px;
    margin: 0;
    color: var(--portal-muted);
    font-size: 1rem;
}

.main-number-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px;
    background: #071827;
    color: #fff;
}

.main-number-card__icon {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.35rem;
}

.main-number-card span,
.main-number-card small {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 800;
    text-transform: uppercase;
}

.main-number-card strong {
    display: block;
    margin: 10px 0;
    font-size: 1.8rem;
    line-height: 1;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.kpi-card {
    position: relative;
    min-height: 166px;
    overflow: hidden;
    padding: 18px;
}

.kpi-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 8px;
    background: #eef6fb;
    color: var(--portal-blue);
    font-size: 1.2rem;
}

.kpi-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    content: "";
    background: var(--portal-blue);
}

.kpi-card__top {
    display: flex;
    min-height: 34px;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.kpi-card span,
.kpi-card small,
.call-row span,
.snapshot-list span {
    color: var(--portal-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.kpi-card__top small {
    padding: 4px 7px;
    border-radius: 999px;
    background: #f1f6fa;
    color: var(--portal-ink);
}

.kpi-card strong {
    display: block;
    margin-top: 18px;
    font-size: clamp(1.9rem, 3vw, 2.6rem);
    line-height: 1;
}

.kpi-card p {
    margin: 12px 0 0;
    color: var(--portal-muted);
    font-size: 0.9rem;
}

.kpi-card--red::before {
    background: #d83b4a;
}

.kpi-card--red .kpi-icon {
    background: #fdecef;
    color: #b42335;
}

.kpi-card--red strong {
    color: #b42335;
}

.kpi-card--green::before {
    background: var(--portal-green);
}

.kpi-card--green .kpi-icon {
    background: #e9f8f0;
    color: #14734a;
}

.kpi-card--cyan::before {
    background: var(--portal-cyan);
}

.kpi-card--cyan .kpi-icon {
    background: #e8f8fc;
    color: #087c9f;
}

.kpi-card--violet::before {
    background: #7464d4;
}

.kpi-card--violet .kpi-icon {
    background: #f0eefc;
    color: #5948b8;
}

.kpi-card--gold::before {
    background: #d99b2b;
}

.kpi-card--gold .kpi-icon {
    background: #fff5df;
    color: #a66b04;
}

.ops-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
}

.ops-panel {
    padding: 22px;
}

.ops-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.ops-panel__header h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
    font-weight: 850;
}

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

.call-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.9fr 0.7fr auto;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8fbfd;
}

.call-row strong {
    display: block;
    margin-top: 4px;
}

.call-row__time {
    display: block;
}

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

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #e8f1f8;
    color: var(--portal-ink);
    font-size: 0.82rem;
}

.status-pill--completed {
    background: #e9f8f0;
    color: #14734a;
}

.status-pill--abandoned {
    background: #fdecef;
    color: #b42335;
}

.ai-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: max-content;
    padding: 6px 9px;
    border-radius: 999px;
    background: #eef7ff;
    color: var(--portal-blue);
    font-size: 0.78rem;
    font-weight: 850;
    white-space: nowrap;
}

.ai-score-pill--empty {
    background: #f3f6f8;
    color: var(--portal-muted);
}

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

.snapshot-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8fbfd;
}

.snapshot-list strong {
    font-size: 1.15rem;
}

.snapshot-list strong small {
    display: block;
    margin-top: 4px;
    color: var(--portal-muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: right;
    text-transform: uppercase;
}

.snapshot-list span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.snapshot-list div.snapshot-list__storage {
    align-items: flex-start;
}

.snapshot-list__label {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.snapshot-list__label small {
    max-width: 160px;
    overflow-wrap: anywhere;
    color: var(--portal-muted);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: none;
}

.dashboard-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.dashboard-hero h2 {
    margin: 6px 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 850;
}

.dashboard-hero p {
    max-width: 720px;
    margin: 0;
    color: var(--portal-muted);
}

.dashboard-hero__meta {
    min-width: 180px;
    padding: 14px 16px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
}

.dashboard-hero__meta span,
.metric-tile span,
.mini-stat span {
    display: block;
    color: var(--portal-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard-hero__meta strong {
    display: block;
    margin-top: 4px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-tile {
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 64, 98, 0.08);
}

.metric-tile strong {
    display: block;
    margin-top: 12px;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1;
}

.metric-tile small {
    display: block;
    margin-top: 12px;
    color: var(--portal-muted);
}

.metric-tile--danger {
    border-color: #f2c5ca;
    background: #fff8f8;
}

.metric-tile--danger strong {
    color: #b42335;
}

.metric-tile--accent {
    border-color: rgba(49, 183, 122, 0.34);
    background: #f7fdf9;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
}

.dashboard-side-panel {
    align-self: start;
}

.mini-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--portal-line);
}

.mini-stat:last-child {
    border-bottom: 0;
}

.mini-stat strong {
    font-size: 1.4rem;
}

.portal-panel {
    padding: 28px;
}

.portal-page-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 16px;
}

.portal-page-actions--split {
    align-items: center;
    justify-content: space-between;
}

.portal-page-actions__left,
.portal-page-actions__right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-page-actions__right {
    justify-content: flex-end;
}

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

.portal-table th {
    color: var(--portal-muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    text-decoration: none;
}

.portal-sort-link:hover,
.portal-sort-link.is-active {
    color: var(--portal-blue);
}

.portal-sort-icons {
    display: inline-grid;
    gap: 0;
    line-height: 0.72;
}

.portal-sort-icons i {
    color: #c3cfda;
    font-size: 0.72rem;
}

.portal-sort-icons i.is-active {
    color: var(--portal-blue);
}

.portal-filter-panel {
    overflow-x: auto;
    margin-bottom: 16px;
    padding: 18px;
}

.portal-filter-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    min-width: max-content;
}

.portal-filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    justify-content: flex-end;
}

.portal-call-search {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.portal-call-search__bar {
    display: none;
    align-items: stretch;
    width: clamp(300px, 28vw, 430px);
    min-width: 300px;
}

.portal-call-search.is-open .portal-call-search__bar {
    display: flex;
}

.portal-call-search__field,
.portal-call-search__input,
.portal-call-search__status {
    min-height: 48px;
    border: 1px solid var(--portal-line);
    color: var(--portal-ink);
    outline: 0;
}

.portal-call-search__field {
    width: 124px;
    flex: 0 0 124px;
    padding: 0 12px;
    border-radius: 8px 0 0 8px;
    background: #f3f8fc;
    font-weight: 800;
}

.portal-call-search__input,
.portal-call-search__status {
    min-width: 0;
    flex: 1 1 auto;
    padding: 0 14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    background: #fff;
}

.portal-call-search__status[disabled],
.portal-call-search__input[disabled] {
    display: none;
}

.portal-call-search__submit {
    border-radius: 0 8px 8px 0;
}

.portal-filter-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 220px)) auto;
    gap: 14px;
    align-items: start;
    justify-content: start;
    flex: 0 0 auto;
}

.portal-filter-form .floating-field {
    margin-bottom: 0;
}

.portal-filter-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.portal-empty-cell {
    padding: 34px 16px !important;
    color: var(--portal-muted);
    font-weight: 800;
    text-align: center;
}

.portal-empty-cell i {
    margin-right: 6px;
    color: var(--portal-blue);
}

.mobile-card-list {
    display: none;
}

.mobile-card {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 64, 98, 0.08);
}

.mobile-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--portal-line);
}

.mobile-card__header strong {
    display: block;
    margin-top: 3px;
    font-size: 1.15rem;
    line-height: 1.2;
    word-break: break-word;
}

.mobile-card__eyebrow,
.mobile-card__body span {
    color: var(--portal-muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.mobile-card__body {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.mobile-card__body div {
    display: grid;
    gap: 3px;
}

.mobile-card__body strong,
.mobile-card__body code {
    word-break: break-word;
}

.mobile-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 16px;
}

.mobile-card--empty {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 18px;
    color: var(--portal-muted);
    text-align: center;
}

.mobile-card--empty i {
    color: var(--portal-blue);
    font-size: 1.8rem;
}

.portal-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(15, 64, 98, 0.07);
}

.portal-pagination__count {
    color: var(--portal-muted);
    font-weight: 800;
}

.portal-pagination__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.portal-page-size-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-page-size-form label {
    color: var(--portal-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-page-size-form .form-select {
    width: auto;
    min-width: 92px;
    border-color: var(--portal-line);
    border-radius: 8px;
    font-weight: 700;
}

.portal-page-links ul {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.portal-page-links li a {
    display: inline-grid;
    min-width: 36px;
    height: 36px;
    place-items: center;
    padding: 0 10px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-ink);
    font-weight: 800;
}

.portal-page-links li a:hover {
    border-color: var(--portal-blue);
    color: var(--portal-blue);
}

.portal-page-links li.active a {
    border-color: var(--portal-blue);
    background: var(--portal-blue);
    color: #fff;
}

.portal-page-links li.disabled a {
    color: #aab5c2;
    pointer-events: none;
}

.portal-form-panel {
    max-width: 980px;
}

.portal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
}

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

.portal-check {
    display: flex;
    min-height: 48px;
    align-items: center;
    gap: 8px;
}

.portal-detail-grid {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 10px 18px;
    margin: 0;
}

.portal-detail-grid dt {
    color: var(--portal-muted);
    font-weight: 800;
}

.portal-detail-grid dd {
    margin: 0;
    word-break: break-word;
}

.portal-audio {
    width: 100%;
}

.portal-pre {
    max-height: 420px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-radius: 8px;
    background: #071827;
    color: #d7edf7;
    font-size: 0.85rem;
}

.ivr-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 18px;
    align-items: stretch;
    margin-bottom: 18px;
}

.ivr-hero > div,
.ivr-source-card,
.ivr-flow-card {
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 64, 98, 0.08);
}

.ivr-hero > div:first-child {
    padding: 26px;
}

.ivr-hero h2 {
    margin: 8px 0 10px;
    font-size: clamp(2rem, 3vw, 2.8rem);
    font-weight: 850;
}

.ivr-hero p {
    max-width: 820px;
    margin: 0;
    color: var(--portal-muted);
}

.ivr-source-card {
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 22px;
}

.ivr-source-card span,
.ivr-flow-card__digit span,
.ivr-flow-card__route span {
    color: var(--portal-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ivr-source-card strong {
    font-size: 1.25rem;
}

.ivr-source-card small {
    color: var(--portal-muted);
}

.ivr-flow-grid,
.ivr-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ivr-flow-card {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    overflow: hidden;
}

.ivr-flow-card__digit {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 4px;
    padding: 18px;
    border-right: 1px solid var(--portal-line);
    background: linear-gradient(160deg, rgba(11, 111, 191, 0.1), rgba(49, 183, 122, 0.1));
}

.ivr-flow-card__digit strong {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    border-radius: 50%;
    background: var(--portal-blue);
    color: #fff;
    font-size: 1.25rem;
}

.ivr-flow-card__body {
    padding: 18px;
}

.ivr-flow-card__body h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 850;
}

.ivr-flow-card__body p {
    margin: 0 0 12px;
    color: var(--portal-muted);
}

.ivr-flow-card__route {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--portal-line);
}

.ivr-flow-card__route span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ivr-flow-card__route strong {
    text-align: right;
    word-break: break-word;
}

.ivr-note {
    display: flex;
    gap: 6px;
    margin-top: 10px !important;
    font-size: 0.92rem;
}

.portal-section-title {
    margin: 24px 0 12px;
}

.portal-section-title h2 {
    margin: 4px 0 0;
    font-size: 1.35rem;
    font-weight: 850;
}

.sip-credentials {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.sip-credentials div {
    padding: 14px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8fbfd;
}

.sip-credentials span {
    display: block;
    color: var(--portal-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.sip-credentials strong {
    display: block;
    margin-top: 4px;
    word-break: break-word;
}

.portal-panel--wide {
    grid-column: 1 / -1;
}

.portal-stat {
    padding: 22px;
}

.portal-stat span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--portal-muted);
    font-weight: 700;
}

.portal-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 1.6rem;
}

.portal-loader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    place-items: center;
    background: rgba(7, 24, 39, 0.54);
    backdrop-filter: blur(3px);
}

.portal-loader.is-active {
    display: grid;
}

.portal-loader__panel {
    display: flex;
    min-width: 180px;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 22px;
    border-radius: 8px;
    background: #fff;
    color: var(--portal-ink);
    font-weight: 800;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.recording-modal {
    display: grid;
    gap: 18px;
    justify-items: center;
    padding: 4px 0 8px;
}

.recording-modal .portal-audio {
    width: 100%;
}

.recording-modal__download {
    width: fit-content;
}

.ai-summary-action {
    margin-top: 16px;
}

.ai-summary-panel h2,
.ai-summary-panel h3 {
    margin: 0 0 10px;
    font-weight: 850;
}

.ai-summary-panel h3 {
    margin-top: 18px;
    font-size: 1.05rem;
}

.ai-summary-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.ai-summary-panel__actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-score {
    display: grid;
    width: 72px;
    height: 72px;
    place-items: center;
    border-radius: 50%;
    background: var(--portal-blue);
    color: #fff;
    font-size: 1.2rem;
}

.ai-summary-grid {
    display: grid;
    grid-template-columns: 190px 190px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 10px;
}

.ai-summary-grid div {
    padding: 14px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8fbfd;
}

.ai-summary-grid span,
.ai-result-modal span {
    display: block;
    color: var(--portal-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.ai-summary-panel--failed {
    border-color: #f2c5ca;
}

.ai-progress-steps {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    text-align: left;
}

.ai-progress-steps div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    color: var(--portal-muted);
}

.ai-progress-steps .is-active {
    border-color: rgba(11, 111, 191, 0.32);
    background: #f3f9ff;
    color: var(--portal-blue);
    font-weight: 800;
}

.ai-progress-steps .is-active i {
    animation: ai-spin 1s linear infinite;
}

.ai-progress-steps .is-done {
    border-color: rgba(49, 183, 122, 0.32);
    background: #f3fbf7;
    color: #14734a;
    font-weight: 800;
}

.ai-result-modal {
    display: grid;
    gap: 12px;
    text-align: left;
}

.ai-result-modal > div {
    padding: 12px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #f8fbfd;
}

.ai-result-modal h3 {
    margin: 8px 0 0;
    font-size: 1rem;
    font-weight: 850;
}

.ai-result-modal p {
    margin: 0;
    color: var(--portal-muted);
}

.ai-consent-modal {
    display: grid;
    gap: 10px;
    text-align: left;
}

.ai-consent-modal p {
    margin: 0;
    color: var(--portal-muted);
}

.ai-chat-modal {
    display: grid;
    max-height: min(68vh, 640px);
    gap: 12px;
    overflow-y: auto;
    padding: 8px 6px;
    text-align: left;
}

.ai-chat-empty {
    margin: 0;
    color: var(--portal-muted);
}

.ai-chat-message {
    display: flex;
}

.ai-chat-message__bubble {
    max-width: 76%;
    padding: 11px 13px;
    border: 1px solid var(--portal-line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.ai-chat-message__bubble span {
    display: block;
    margin-bottom: 5px;
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.ai-chat-message__bubble p {
    margin: 0;
    color: var(--portal-ink);
    line-height: 1.45;
}

.ai-chat-message--customer {
    justify-content: flex-start;
}

.ai-chat-message--customer .ai-chat-message__bubble {
    border-top-left-radius: 5px;
    background: #f4f8fb;
}

.ai-chat-message--customer .ai-chat-message__bubble span {
    color: var(--portal-blue);
}

.ai-chat-message--agent,
.ai-chat-message--unknown {
    justify-content: flex-end;
}

.ai-chat-message--agent .ai-chat-message__bubble,
.ai-chat-message--unknown .ai-chat-message__bubble {
    border-color: rgba(49, 183, 122, 0.28);
    border-top-right-radius: 5px;
    background: #eaf8f2;
}

.ai-chat-message--agent .ai-chat-message__bubble span,
.ai-chat-message--unknown .ai-chat-message__bubble span {
    color: #14734a;
}

.ai-chat-message--ivr,
.ai-chat-message--system {
    justify-content: center;
}

.ai-chat-message--ivr .ai-chat-message__bubble,
.ai-chat-message--system .ai-chat-message__bubble {
    max-width: 88%;
    border-style: dashed;
    background: #fff8ec;
    text-align: center;
}

.ai-chat-message--ivr .ai-chat-message__bubble span,
.ai-chat-message--system .ai-chat-message__bubble span {
    color: #986200;
}

@keyframes ai-spin {
    to {
        transform: rotate(360deg);
    }
}

.error-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.error-panel {
    width: min(100%, 680px);
}

@media (max-width: 900px) {
    .portal-shell {
        grid-template-columns: 1fr;
    }

    html.sidebar-minimized .portal-shell {
        grid-template-columns: 1fr;
    }

    .portal-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 1040;
        width: min(88vw, 360px);
        height: 100vh;
        padding: 22px 18px;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.22s ease;
    }

    html.sidebar-minimized .portal-sidebar {
        align-items: stretch;
        padding: 22px 18px;
    }

    html.sidebar-minimized .portal-brand span,
    html.sidebar-minimized .portal-nav__link span,
    html.sidebar-minimized .portal-sidebar-toggle span {
        display: inline;
    }

    html.sidebar-minimized .portal-nav__link {
        justify-content: flex-start;
        padding: 12px 14px;
    }

    html.sidebar-minimized .portal-nav__link::after,
    html.sidebar-minimized .portal-nav__link::before {
        display: none;
    }

    html.sidebar-minimized .portal-sidebar-toggle {
        display: none;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    body.mobile-menu-open .portal-sidebar {
        transform: translateX(0);
    }

    body.mobile-menu-open .portal-menu-backdrop {
        display: block;
    }

    .portal-sidebar__close,
    .portal-menu-toggle {
        display: grid;
    }

    .portal-mobile-actions {
        display: grid;
    }

    .portal-sidebar-toggle {
        display: none;
    }

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

    .portal-topbar {
        align-items: center;
        flex-direction: row;
        padding: 24px;
    }

    .portal-topbar > div:first-child {
        min-width: 0;
    }

    .portal-user {
        display: none;
    }

    .portal-content {
        padding: 24px;
    }

    .login-page,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
    }

    .metric-grid,
    .ops-hero,
    .kpi-grid,
    .ops-layout,
    .dashboard-columns,
    .ivr-hero,
    .ivr-flow-grid,
    .ivr-code-grid {
        grid-template-columns: 1fr;
    }

    .ivr-flow-card {
        grid-template-columns: 1fr;
    }

    .ivr-flow-card__digit {
        border-right: 0;
        border-bottom: 1px solid var(--portal-line);
    }

    .call-row {
        grid-template-columns: 1fr;
    }

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

    .portal-form-grid,
    .portal-detail-grid,
    .sip-credentials {
        grid-template-columns: 1fr;
    }

    .portal-page-actions,
    .portal-form-actions {
        justify-content: flex-start;
    }

    .portal-page-actions--split {
        justify-content: space-between;
    }

    .portal-page-actions__right {
        margin-left: auto;
    }

    .portal-filter-form {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

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

    .portal-filter-tabs {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .portal-call-search,
    .portal-call-search.is-open .portal-call-search__bar {
        display: grid;
        gap: 8px;
    }

    .portal-call-search__bar {
        min-width: 0;
    }

    .portal-call-search__field,
    .portal-call-search__input,
    .portal-call-search__status,
    .portal-call-search__submit {
        width: 100%;
        border: 1px solid var(--portal-line);
        border-radius: 8px;
    }

    .portal-pagination,
    .portal-pagination__controls {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-page-size-form {
        justify-content: space-between;
    }

    .ai-summary-grid {
        grid-template-columns: 1fr;
    }

    .ai-summary-panel__header,
    .ai-summary-panel__actions {
        align-items: flex-start;
    }

    .ai-summary-panel__actions {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .ai-chat-message__bubble {
        max-width: 88%;
    }

    .portal-page-links ul {
        flex-wrap: wrap;
    }

    .portal-table-panel {
        display: none;
    }

    .mobile-card-list {
        display: grid;
        gap: 14px;
    }
}
