﻿:root {
    --font-sans: "Inter", "Segoe UI", sans-serif;
    --color-bg: #0f172a;
    --color-surface: #111827;
    --color-card: rgba(15, 23, 42, 0.85);
    --color-border: rgba(148, 163, 184, 0.2);
    --color-text: #f8fafc;
    --color-muted: #94a3b8;
    --color-primary: #38bdf8;
    --color-primary-dark: #0ea5e9;
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --shadow-elevated: 0 20px 45px rgba(15, 23, 42, 0.35);
    font-family: var(--font-sans);
}

.hidden {
    display: none !important;
}

.theme-light {
    --color-bg: #eef2f8;
    --color-surface: #f7f9fc;
    --color-card: rgba(255, 255, 255, 0.94);
    --color-border: rgba(15, 23, 42, 0.12);
    --color-text: #111827;
    --color-muted: #5b6472;
    --color-primary: #2563eb;
    --color-primary-dark: #1e40af;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --shadow-elevated: 0 18px 38px rgba(15, 23, 42, 0.12);
}

* {
    box-sizing: border-box;
}

body.app-body {
    margin: 0;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0ea5e9 100%);
    color: var(--color-text);
    min-height: 100vh;
    color-scheme: dark;
    font-size: 15px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.theme-light.app-body {
    background:
        radial-gradient(circle at 10% 0%, rgba(59, 130, 246, 0.22), transparent 45%),
        radial-gradient(circle at 90% 12%, rgba(16, 185, 129, 0.18), transparent 45%),
        radial-gradient(circle at 50% 90%, rgba(236, 72, 153, 0.12), transparent 50%),
        linear-gradient(135deg, #eef2f8 0%, #f8fbff 55%, #e6eef8 100%);
    color: var(--color-text);
    color-scheme: light;
}

body.gradient-bg {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header,
.app-footer {
    width: 100%;
}

.app-footer {
    text-align: center;
    padding: 2rem;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.app-footer a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.app-footer a:hover {
    text-decoration: underline;
}

.app-footer__support {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
    color: var(--color-muted);
}

.app-footer__support a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.app-footer__support a:hover {
    text-decoration: underline;
}

.app-main {
    width: 100%;
    padding: clamp(1.6rem, 2.5vw, 2.8rem) clamp(1.4rem, 3vw, 3rem) clamp(2.4rem, 4vw, 4rem);
    max-width: 1440px;
    margin: 0 auto;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 0.75rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    border: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    border-radius: 18px;
    margin-bottom: 2rem;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.2);
}

.theme-light .top-nav {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(235, 242, 255, 0.92));
    border-color: rgba(37, 99, 235, 0.16);
    box-shadow: 0 14px 30px rgba(30, 41, 59, 0.12);
}

.top-nav__brand {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.cbai-header-logo {
    display: block;
    width: 190px;
    max-width: 38vw;
    height: auto;
    border-radius: 8px;
}

.cbai-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.cbai-brand__logo {
    display: block;
    height: 32px;
    width: auto;
    border-radius: 8px;
}

.cbai-brand__logo--light {
    display: none;
}

.theme-light .cbai-brand__logo--dark {
    display: none;
}

.theme-light .cbai-brand__logo--light {
    display: block;
}

.cbai-brand__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 0.1rem;
}

.cbai-brand__title {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text);
}

.cbai-brand__subtitle {
    font-size: 0.78rem;
    color: var(--color-muted);
    letter-spacing: 0.02em;
}

.top-nav__links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    row-gap: 0.5rem;
}

.nav-link {
    color: var(--color-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text);
    background: rgba(56, 189, 248, 0.12);
}

.theme-light .nav-link:hover,
.theme-light .nav-link.active {
    color: #0f172a;
    background: rgba(37, 99, 235, 0.12);
}

.nav-link--danger:hover {
    color: var(--color-danger);
}

.auth-card {
    width: min(420px, 92vw);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 28px;
    padding: 2.75rem;
    box-shadow: var(--shadow-elevated);
}

.auth-card__header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.9rem;
}

.auth-card__header {
    text-align: center;
}

.auth-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.auth-brand__logo {
    display: block;
    width: min(260px, 100%);
    height: auto;
    border-radius: 12px;
}

.auth-card__header p {
    margin: 0 auto 2rem;
    color: var(--color-muted);
    font-size: 0.88rem;
    max-width: 320px;
}

.form {
    display: grid;
    gap: 1.1rem;
}

.form-label {
    font-size: 0.88rem;
    color: var(--color-muted);
    display: block;
    margin-bottom: 0.35rem;
}

.form-input,
.form textarea,
.form select {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.55);
    color: var(--color-text);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-input--compact {
    padding: 0.45rem 0.6rem;
    font-size: 0.85rem;
    border-radius: 10px;
    max-width: 140px;
    margin-left: auto;
}

.app-body:not(.theme-light) select option {
    background: #1b2b40;
    color: #e2e8f0;
}

.app-body:not(.theme-light) select option:checked,
.app-body:not(.theme-light) select option:hover {
    background: #243449;
    color: #f8fafc;
}

.input-with-icon {
    position: relative;
}

.input-with-icon .form-input {
    padding-left: 2.6rem;
}

.input-with-icon::before {
    content: "";
    position: absolute;
    left: 0.9rem;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    background-repeat: no-repeat;
    background-size: 16px 16px;
    opacity: 0.7;
    pointer-events: none;
}

.app-body:not(.theme-light) .input-with-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

.theme-light .input-with-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='20' y1='20' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

.theme-light .form-input,
.theme-light .form textarea,
.theme-light .form select {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(30, 41, 59, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.form-input:focus,
.form textarea:focus,
.form select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.password-field {
    position: relative;
}

.password-field .form-input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: rgba(15, 23, 42, 0.8);
    color: var(--color-muted);
    font-size: 0.85rem;
    padding: 0.3rem;
    width: 34px;
    height: 28px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2);
}

.password-toggle:hover,
.password-toggle.password-toggle--active {
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.password-toggle__icon {
    width: 18px;
    height: 18px;
    display: flex;
}

.password-toggle__icon--hide {
    display: none;
}

.password-toggle--active .password-toggle__icon--show {
    display: none;
}

.password-toggle--active .password-toggle__icon--hide {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.form-group--full {
    grid-column: span 2;
}

.form-group--inline {
    align-items: center;
}

.form--inline {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--color-border);
}

.form.form--inline {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    align-items: flex-start;
    gap: 1.25rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    grid-column: 1 / -1;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 38px;
    padding: 0 14px;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1;
    text-decoration: none;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #0a172b;
    border-color: var(--color-primary-dark);
    box-shadow: 0 10px 22px rgba(14, 165, 233, 0.22);
}

.btn-primary:hover {
    box-shadow: 0 12px 26px rgba(14, 165, 233, 0.26);
}

.btn-secondary {
    background: rgba(14, 165, 233, 0.22);
    color: var(--color-text);
    border: 1px solid rgba(14, 165, 233, 0.55);
    box-shadow: 0 8px 18px rgba(14, 165, 233, 0.2);
}

.btn-secondary:hover {
    background: rgba(14, 165, 233, 0.3);
    border-color: var(--color-primary);
}

.btn-danger {
    background: #d64545;
    color: #fff;
    border: 1px solid #b73a3a;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.btn-danger:hover {
    background: #c13a3a;
    border-color: #a83232;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.btn-sm {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.86rem;
    border-radius: 10px;
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.45rem 0.75rem;
    border-radius: 10px;
    background: rgba(56, 189, 248, 0.18);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
}

.btn-link:hover {
    text-decoration: none;
    background: rgba(56, 189, 248, 0.24);
    border-color: rgba(56, 189, 248, 0.45);
}

.panel {
    background: var(--color-card);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    border: 1px solid var(--color-border);
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    box-shadow: 0 20px 38px rgba(15, 23, 42, 0.22);
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 0%, rgba(56, 189, 248, 0.16), transparent 55%),
        radial-gradient(circle at 10% 100%, rgba(99, 102, 241, 0.12), transparent 60%);
    opacity: 0.55;
    pointer-events: none;
}

.theme-light .panel::before {
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.18), transparent 55%),
        radial-gradient(circle at 85% 100%, rgba(16, 185, 129, 0.15), transparent 60%);
    opacity: 0.7;
}

.panel>* {
    position: relative;
    z-index: 1;
}

.theme-light .panel,
.theme-light .stat-card,
.theme-light .info-card,
.theme-light .auth-card {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(230, 240, 255, 0.9));
    border-color: rgba(37, 99, 235, 0.14);
    box-shadow: 0 18px 36px rgba(30, 41, 59, 0.12);
    position: relative;
}

.panel,
.stat-card,
.info-card,
.plan-card,
.auth-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.stat-card:hover,
.info-card:hover,
.plan-card:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 24px 42px rgba(15, 23, 42, 0.22);
}

.theme-light .stat-card:hover,
.theme-light .info-card:hover,
.theme-light .plan-card:hover {
    border-color: rgba(37, 99, 235, 0.35);
    box-shadow: 0 20px 36px rgba(30, 41, 59, 0.16);
}

.panel--wide {
    max-width: 1080px;
    margin: 0 auto;
}

.panel--narrow {
    max-width: 600px;
    margin: 0 auto;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.panel__header>div {
    max-width: 720px;
}

.panel__header h2,
.panel__header h3 {
    margin: 0 0 0.4rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.panel__header h2 {
    font-size: 1.2rem;
}

.panel__header h3 {
    font-size: 1.05rem;
}

.panel__header p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.panel__actions {
    display: flex;
    gap: 0.75rem;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-form .form-input {
    min-width: 220px;
}

.btn-link--danger {
    background: rgba(214, 69, 69, 0.16);
    color: #b73a3a;
    border-color: rgba(214, 69, 69, 0.4);
}

.btn-link--danger:hover {
    color: #a83232;
    background: rgba(214, 69, 69, 0.24);
    border-color: rgba(214, 69, 69, 0.6);
}

.user-edit-form {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    gap: 1.25rem;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.user-edit-form .form-group--inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-edit-form .form-help {
    margin-top: 0.25rem;
}

.user-edit-form .form-actions {
    justify-content: flex-end;
}

.panel__footer {
    display: flex;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.panel__stat span {
    display: block;
    color: var(--color-muted);
    font-size: 0.82rem;
    margin-bottom: 0.25rem;
}

.panel__stat strong {
    font-size: 1.4rem;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1rem;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.2rem;
    border-radius: 18px;
    border: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.45);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.theme-light .plan-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 252, 0.94));
    border-color: rgba(30, 41, 59, 0.14);
    box-shadow: 0 16px 30px rgba(30, 41, 59, 0.12);
}

.plan-card--active {
    border-color: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.plan-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.plan-card__title {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.plan-card__meta {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.plan-card__price {
    font-size: 1.4rem;
    font-weight: 700;
    white-space: nowrap;
}

.plan-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
    color: var(--color-muted);
    display: grid;
    gap: 0.35rem;
    font-size: 0.92rem;
}

.plan-card__actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: space-between;
}

.table-wrapper {
    overflow-x: auto;
}

.table-wrapper .table {
    min-width: 640px;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-light .table {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: 0 10px 22px rgba(30, 41, 59, 0.08);
}

.table thead th {
    background: rgba(15, 23, 42, 0.55);
}

.theme-light .table thead th {
    background: rgba(37, 99, 235, 0.08);
}

.table th,
.table td {
    padding: 0.75rem 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    text-align: left;
    vertical-align: top;
    line-height: 1.3;
}

.table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--color-muted);
}

.table td {
    font-variant-numeric: tabular-nums;
}

.table th.text-right,
.table td.text-right {
    text-align: right;
    padding-right: 1rem;
    white-space: nowrap;
}

.table__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    flex-wrap: wrap;
}

.table__actions form {
    display: inline;
}

.table__actions .btn-link {
    padding: 0.35rem 0.65rem;
}

.package-actions {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.package-actions .form-input,
.package-actions select {
    min-height: 36px;
    padding: 0.45rem 0.85rem;
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(14, 165, 233, 0.35);
    color: var(--color-text);
    font-weight: 700;
    width: 120px;
}

.package-actions .btn {
    min-height: 36px;
    min-width: 90px;
}

.package-actions .btn.btn-sm {
    padding: 0 12px;
    min-width: 70px;
}

.package-actions form,
.package-actions .action-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.packages-table th:last-child,
.packages-table td:last-child {
    width: 280px !important;
}

.services-actions .btn {
    min-width: 92px;
}

.services-status .badge {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 88px;
}

.product-line .btn-danger,
.include-line .btn-danger {
    min-height: 32px;
    padding: 0.35rem 0.9rem;
}

.table th:last-child,
.table td:last-child {
    width: 140px;
}

.table.table-alerts th:last-child,
.table.table-alerts td:last-child {
    width: auto;
    min-width: 320px;
    max-width: 520px;
    white-space: normal;
    line-height: 1.4;
}

.table tbody tr:hover {
    background: rgba(148, 163, 184, 0.08);
}

.table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.18);
}

.theme-light .table tbody tr:nth-child(even) {
    background: rgba(37, 99, 235, 0.04);
}

.grid {
    display: grid;
}

.gap-lg {
    gap: 1.8rem;
}

.grid--stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
}

.grid--two {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.grid--three {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.gap-sm {
    gap: 1rem;
}

.stat-card {
    background: var(--color-card);
    border-radius: 20px;
    border: 1px solid var(--color-border);
    padding: 1.4rem;
    box-shadow: 0 18px 35px rgba(15, 23, 42, 0.25);
    position: relative;
    overflow: hidden;
}

.stat-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--color-muted);
}

.stat-card__value {
    font-size: clamp(1rem, 1.25vw, 1.2rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.1;
    white-space: nowrap;
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    font-variant-numeric: tabular-nums;
}

.stat-card small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.72rem;
    color: var(--color-muted);
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.16), transparent 55%);
    opacity: 0.6;
    pointer-events: none;
}

.theme-light .stat-card::before {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.2), transparent 55%),
        radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.14), transparent 60%);
    opacity: 0.7;
}

.stat-card>* {
    position: relative;
    z-index: 1;
}

.info-card {
    background: var(--color-card);
    border-radius: 18px;
    padding: 1rem 1.15rem;
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.info-card__label {
    color: var(--color-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-card .table th,
.info-card .table td {
    padding: 0.55rem 0.55rem;
    font-size: 0.82rem;
}

.info-card .table th {
    font-size: 0.68rem;
}

.info-card__value {
    font-size: clamp(0.95rem, 1.2vw, 1.08rem);
    letter-spacing: 0.02em;
}

.info-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 60%);
    opacity: 0.45;
    pointer-events: none;
}

.theme-light .info-card::before {
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.16), transparent 60%),
        radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.12), transparent 65%);
    opacity: 0.55;
}

.info-card>* {
    position: relative;
    z-index: 1;
}

.color-preview {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
}

.color-preview__item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--color-muted);
}

.color-preview__swatch {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: var(--swatch, #38bdf8);
}

.alert {
    padding: 1rem 1.15rem;
    border-radius: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

.alert-error {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(248, 113, 113, 0.5);
}

.billing-alert {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.6rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.35);
}

.theme-light .billing-alert {
    background: rgba(15, 23, 42, 0.04);
}

.billing-alert__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.88rem;
}

.billing-alert__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-muted);
}

.billing-alert__meta a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.billing-alert__meta a:hover {
    text-decoration: underline;
}

.billing-alert__code {
    display: inline-flex;
    padding: 0.15rem 0.45rem;
    border-radius: 8px;
    background: rgba(148, 163, 184, 0.2);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.8rem;
}

.billing-alert--warning {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.08);
}

.billing-alert--grace {
    border-color: rgba(14, 165, 233, 0.35);
    background: rgba(14, 165, 233, 0.08);
}

.billing-alert--limited {
    border-color: rgba(249, 115, 22, 0.45);
    background: rgba(249, 115, 22, 0.12);
}

.billing-alert--blocked {
    border-color: rgba(239, 68, 68, 0.55);
    background: rgba(239, 68, 68, 0.16);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge-success {
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
}

.badge-muted {
    background: rgba(148, 163, 184, 0.2);
    color: var(--color-muted);
}

.text-muted {
    color: var(--color-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.form-help,
.form-hint,
.form-note {
    color: var(--color-muted);
    font-size: 0.72rem;
    line-height: 1.4;
}

@media (max-width: 960px) {
    .app-main {
        padding: 1.5rem;
    }

    .top-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-group--full,
    .form-actions {
        grid-column: span 1;
    }
}

.text-right {
    text-align: right;
}

.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 500;
    color: var(--color-muted);
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}


details summary {
    cursor: pointer;
    color: var(--color-primary);
    font-weight: 600;
}

details[open] summary {
    color: var(--color-text);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.pill:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.theme-toggle-btn {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 999;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0.55rem 0.9rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow-elevated);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle-btn:hover {
    transform: translateY(-2px);
}

@media (max-width: 1024px) {

    .form.form--inline,
    .user-edit-form {
        grid-template-columns: 1fr;
    }
}

.consultor-strip {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(1.4rem, 3vw, 3rem);
    margin-top: 0.85rem;
    margin-bottom: 0.35rem;
}

body.is-modal .consultor-strip {
    display: none !important;
}

.consultor-strip__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
    padding: 0.85rem 0.95rem;
}

.theme-light .consultor-strip__inner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(236, 243, 255, 0.92));
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.1);
}

.consultor-strip__lead {
    min-width: 240px;
    flex: 1 1 50%;
}

.consultor-strip__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 0.25rem;
}

.consultor-strip__title strong {
    font-size: 1.02rem;
}

.consultor-strip__status {
    font-size: 0.74rem;
    color: var(--color-success);
    font-weight: 600;
}

.consultor-strip__status--error {
    color: var(--color-danger);
}

.consultor-strip__orientation {
    margin: 0;
    font-size: 0.92rem;
    color: var(--color-muted);
    line-height: 1.45;
    white-space: pre-line;
}

.consultor-strip__composer {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 1 1 46%;
    min-width: 420px;
}

.consultor-strip__input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.62);
    color: var(--color-text);
    padding: 0.6rem 0.8rem;
    line-height: 1.35;
}

.theme-light .consultor-strip__input {
    background: rgba(255, 255, 255, 0.9);
}

.consultor-strip__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.consultor-strip__reply {
    margin-top: 0.5rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
    color: var(--color-text);
    padding: 0.75rem 0.9rem;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-line;
}

.theme-light .consultor-strip__reply {
    background: rgba(255, 255, 255, 0.9);
}

.consultor-strip__reply[hidden] {
    display: none;
}

.consultor-strip--waiting {
    opacity: 0.9;
}

.consultor-quick-btn {
    position: fixed;
    right: 18px;
    bottom: 62px;
    z-index: 1001;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0.36rem 0.72rem;
    min-height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: var(--shadow-elevated);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.consultor-quick-btn:hover {
    transform: translateY(-2px);
}

body.portal-modern .consultor-quick-btn {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    box-shadow: var(--shadow-panel);
}

body.portal-modern.in-modal .consultor-quick-btn,
body.portal-modern.in-section .consultor-quick-btn,
body.is-modal .consultor-quick-btn {
    display: none !important;
}

body.portal-modern .consultor-strip {
    max-width: 1400px;
    padding: 0 1.5rem;
    margin-top: 0.8rem;
    margin-bottom: 0.6rem;
}

body.portal-modern .consultor-strip__inner {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: var(--shadow-panel) !important;
}

body.portal-modern .consultor-strip__orientation {
    color: var(--text-secondary) !important;
}

body.portal-modern .consultor-strip__status {
    color: var(--success) !important;
}

body.portal-modern .consultor-strip__status--error {
    color: var(--danger) !important;
}

body.portal-modern .consultor-strip__input {
    background: var(--bg-panel-alt) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-primary) !important;
}

body.portal-modern .consultor-strip__input::placeholder {
    color: var(--text-muted);
}

body.portal-modern .consultor-strip__reply {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-subtle) !important;
    color: var(--text-primary) !important;
}

body.portal-modern .consultor-strip__composer .btn {
    border-radius: 10px !important;
    padding: 0.56rem 1rem !important;
}

body.portal-modern .consultor-strip__composer .btn-secondary {
    border-color: var(--border-strong) !important;
    color: var(--text-primary) !important;
}

body.portal-modern .consultor-strip__composer .btn-primary {
    background: var(--accent-primary) !important;
    color: #fff !important;
    border-color: transparent !important;
}

@media (max-width: 960px) {
    .consultor-strip__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .consultor-strip__composer {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .consultor-strip {
        padding: 0 1rem;
    }

    .consultor-strip__composer {
        flex-wrap: wrap;
    }

    .consultor-strip__composer .btn {
        flex: 1;
        min-width: 120px;
    }

    .consultor-quick-btn {
        right: 14px;
        bottom: 56px;
    }

    body.portal-modern .consultor-strip {
        padding: 0 1rem;
    }
}

.support-chat-toggle {
    position: fixed;
    right: 18px;
    bottom: 62px;
    z-index: 1001;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0.35rem 0.65rem;
    min-height: 30px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    box-shadow: var(--shadow-elevated);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.support-chat-toggle:hover {
    transform: translateY(-2px);
}

.support-chat {
    position: fixed;
    right: 18px;
    bottom: 120px;
    width: min(300px, 90vw);
    max-height: 380px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: var(--shadow-elevated);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1002;
}

.support-chat[hidden] {
    display: none;
}

.support-chat__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.support-chat__status {
    margin-left: 0.6rem;
    font-size: 0.72rem;
    color: var(--color-success);
    font-weight: 600;
}

.support-chat__status--offline {
    color: var(--color-muted);
}

.support-chat__close {
    background: transparent;
    border: none;
    color: var(--color-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.support-chat__messages {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    flex: 1;
}

.support-chat__message {
    padding: 0.65rem 0.8rem;
    border-radius: 14px;
    line-height: 1.35;
    font-size: 0.92rem;
    max-width: 85%;
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.support-chat__message--assistant {
    align-self: flex-start;
    background: rgba(15, 23, 42, 0.6);
}

.support-chat__message--user {
    align-self: flex-end;
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.35);
}

.support-chat__message--typing {
    opacity: 0.7;
    font-style: italic;
}

.support-chat__footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.support-chat__input {
    flex: 1;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: rgba(15, 23, 42, 0.55);
    color: var(--color-text);
    padding: 0.6rem 0.75rem;
    resize: none;
}

.support-chat__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.support-chat__handoff {
    display: flex;
    justify-content: flex-start;
    padding-left: 0.2rem;
}

.theme-light .support-chat__message--assistant {
    background: rgba(255, 255, 255, 0.9);
}

.theme-light .support-chat__input {
    background: rgba(255, 255, 255, 0.92);
}

@media (max-width: 720px) {
    .support-chat-toggle {
        right: 14px;
        bottom: 56px;
    }

    .support-chat {
        right: 14px;
        bottom: 110px;
    }
}
