@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --at-primary: #2563eb;
    --at-primary-hover: #1d4ed8;
    --at-primary-soft: #eef4ff;
    --at-accent: #f59e0b;
    --at-success: #059669;
    --at-success-soft: #ecfdf5;
    --at-danger: #dc2626;
    --at-warn-soft: #fffbeb;
    --at-bg: #f6f8fb;
    --at-surface: #ffffff;
    --at-border: #e7edf3;
    --at-border-strong: #cdd7e2;
    --at-text: #11203a;
    --at-text-muted: #667892;
    --at-header-bg: #0f1b30;
    --at-header-text: #f8fafc;
    --at-radius: 14px;
    --at-radius-sm: 9px;
    --at-shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05);
    --at-shadow: 0 6px 28px rgb(15 23 42 / 0.07);
    --at-shadow-lg: 0 20px 40px rgb(15 23 42 / 0.12);
    --at-font: 'Inter', system-ui, -apple-system, sans-serif;
    --at-header-h: 64px;
    --at-content-max: 1140px;
    --at-content-max-xl: 2280px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--at-font);
    color: var(--at-text);
    background: var(--at-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--at-primary);
    text-decoration: none;
}

a:hover {
    color: var(--at-primary-hover);
}

/* --- Header --- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--at-header-h);
    background: var(--at-header-bg);
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
    box-shadow: var(--at-shadow-sm);
}

.app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--at-content-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.layout-xl .app-header__inner {
    max-width: min(var(--at-content-max-xl), calc(100vw - 2.5rem));
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--at-header-text) !important;
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.app-brand:hover {
    color: #fff !important;
}

.app-brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--at-primary) 0%, #3b82f6 100%);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-nav__link {
    display: inline-block;
    padding: 0.5rem 0.875rem;
    border-radius: var(--at-radius-sm);
    color: rgb(248 250 252 / 0.78) !important;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.app-nav__link:hover,
.app-nav__link.is-active {
    background: rgb(255 255 255 / 0.08);
    color: #fff !important;
}

.app-nav__link--cta {
    background: var(--at-primary);
    color: #fff !important;
    margin-left: 0.5rem;
}

/* Language switcher (landing + guest header) */
.lang-switcher {
    display: inline-flex;
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: 999px;
    overflow: hidden;
    background: rgb(255 255 255 / 0.04);
}

.lang-switcher__btn {
    padding: 0.3125rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8 !important;
    transition: background 0.15s, color 0.15s;
}

.lang-switcher__btn:hover {
    color: #e2e8f0 !important;
    background: rgb(255 255 255 / 0.06);
}

.lang-switcher__btn.is-active {
    background: var(--at-primary);
    color: #fff !important;
}

.app-nav__link--cta:hover {
    background: var(--at-primary-hover);
    color: #fff !important;
}

.app-nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: var(--at-radius-sm);
    color: #fff;
    padding: 0.375rem 0.625rem;
}

@media (max-width: 767.98px) {
    .app-nav-toggle {
        display: block;
    }

    .app-nav {
        display: none;
        position: absolute;
        top: var(--at-header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 0.75rem;
        background: var(--at-header-bg);
        border-bottom: 1px solid rgb(255 255 255 / 0.06);
        box-shadow: var(--at-shadow);
    }

    .app-nav.is-open {
        display: flex;
    }

    .app-nav__link--cta {
        margin-left: 0;
        text-align: center;
    }
}

/* --- Main --- */
.app-main {
    flex: 1;
    padding-top: calc(var(--at-header-h) + 2rem);
    padding-bottom: 3rem;
}

.app-container {
    max-width: var(--at-content-max);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.app-container--xl,
.layout-xl .app-container {
    max-width: min(var(--at-content-max-xl), calc(100vw - 2.5rem));
}

.app-container--narrow {
    max-width: 480px;
}

.app-container--medium {
    max-width: 640px;
}

.app-container--wide {
    max-width: 800px;
}

/* --- Footer --- */
.app-footer {
    background: var(--at-header-bg);
    color: rgb(248 250 252 / 0.65);
    padding: 1.5rem 0;
    margin-top: auto;
    border-top: 1px solid rgb(255 255 255 / 0.06);
}

.app-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--at-content-max);
    margin: 0 auto;
    padding: 0 1.25rem;
    font-size: 0.8125rem;
}

.layout-xl .app-footer__inner {
    max-width: min(var(--at-content-max-xl), calc(100vw - 2.5rem));
}

.app-footer a {
    color: rgb(248 250 252 / 0.75);
}

.app-footer a:hover {
    color: #fff;
}

.app-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

/* --- Page header --- */
.page-header {
    margin-bottom: 1.75rem;
}

.page-header__title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 0.375rem;
    color: var(--at-text);
}

.page-header__subtitle {
    color: var(--at-text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

/* --- Cards --- */
.at-card {
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    box-shadow: var(--at-shadow-sm);
}

.at-card__body {
    padding: 1.5rem;
}

.at-card__header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--at-border);
}

.at-card__title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

/* --- Auth --- */
.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--at-header-h) - 8rem);
    padding: 1rem 0;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    box-shadow: var(--at-shadow);
    overflow: hidden;
}

.auth-card--wide {
    max-width: 520px;
}

.auth-card__header {
    padding: 2rem 2rem 0;
    text-align: center;
}

.auth-card__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--at-primary) 0%, #3b82f6 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
}

.auth-card__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin: 0 0 0.375rem;
}

.auth-card__subtitle {
    color: var(--at-text-muted);
    font-size: 0.875rem;
    margin: 0;
}

.auth-card__body {
    padding: 1.75rem 2rem 2rem;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--at-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--at-border);
}

.auth-social-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.auth-social-list li {
    margin-bottom: 0.625rem;
}

.auth-social-list a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.6875rem 1rem;
    border: 1px solid var(--at-border-strong);
    border-radius: var(--at-radius-sm);
    text-decoration: none;
    color: var(--at-text);
    background: var(--at-surface);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.auth-social-list a:hover {
    background: var(--at-bg);
    border-color: var(--at-border-strong);
    box-shadow: var(--at-shadow-sm);
    color: var(--at-text);
}

.auth-footer-links {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--at-border);
    text-align: center;
    font-size: 0.875rem;
    color: var(--at-text-muted);
}

.auth-footer-links p {
    margin: 0 0 0.375rem;
}

.auth-footer-links p:last-child {
    margin-bottom: 0;
}

/* --- Forms --- */
.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--at-text);
    margin-bottom: 0.375rem;
}

.form-control {
    border: 1px solid var(--at-border-strong);
    border-radius: var(--at-radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--at-primary);
    box-shadow: 0 0 0 3px rgb(29 78 216 / 0.15);
}

.form-check-input:checked {
    background-color: var(--at-primary);
    border-color: var(--at-primary);
}

.btn {
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--at-radius-sm);
    padding: 0.625rem 1.25rem;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn-primary {
    background: var(--at-primary);
    border-color: var(--at-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--at-primary-hover);
    border-color: var(--at-primary-hover);
}

.btn-success {
    background: var(--at-success);
    border-color: var(--at-success);
}

.btn-success:hover {
    background: #047857;
    border-color: #047857;
}

.btn-lg-block {
    width: 100%;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.invalid-feedback {
    font-size: 0.8125rem;
}

/* --- Alerts & flash --- */
.app-flash {
    border: none;
    border-radius: var(--at-radius-sm);
    font-size: 0.875rem;
    padding: 0.875rem 1.125rem;
    margin-bottom: 1.25rem;
    border-left: 4px solid;
}

.app-flash.alert-success {
    background: #ecfdf5;
    color: #065f46;
    border-left-color: var(--at-success);
}

.app-flash.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: var(--at-danger);
}

.app-flash.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: var(--at-accent);
}

.app-flash.alert-info {
    background: var(--at-primary-soft);
    color: #1e40af;
    border-left-color: var(--at-primary);
}

/* Prominent, hard-to-miss limit flash (non-AJAX submits). */
.app-flash--limit {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: #fee2e2;
    color: #7f1d1d;
    border-left-width: 6px;
    border-left-color: var(--at-danger);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.18);
}

.app-flash--limit__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--at-danger);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
}

.app-flash--limit__body {
    flex: 1 1 auto;
    min-width: 0;
}

.app-flash--limit .btn-light {
    flex: 0 0 auto;
}

/* Floating red toasts for AJAX limit errors. */
.plan-limit-toasts {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: min(560px, calc(100vw - 2rem));
    pointer-events: none;
}

.plan-limit-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--at-radius-sm, 10px);
    background: var(--at-danger, #dc3545);
    color: #fff;
    box-shadow: 0 12px 32px rgba(220, 38, 38, 0.35);
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.plan-limit-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.plan-limit-toast.is-leaving {
    opacity: 0;
    transform: translateY(-12px);
}

.plan-limit-toast__icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    font-weight: 700;
    line-height: 1;
}

.plan-limit-toast__body {
    flex: 1 1 auto;
    min-width: 0;
}

.plan-limit-toast__title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.plan-limit-toast__text {
    font-size: 0.875rem;
    line-height: 1.35;
}

.plan-limit-toast__cta {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3125rem 0.75rem;
    border-radius: 999px;
    background: #fff;
    color: var(--at-danger, #b91c1c);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.plan-limit-toast__cta:hover {
    background: #fff5f5;
    color: #991b1b;
}

.plan-limit-toast__close {
    flex: 0 0 auto;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
    padding: 0 0.125rem;
}

.plan-limit-toast__close:hover {
    opacity: 1;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
}

.breadcrumb-item a {
    color: var(--at-text-muted);
}

.breadcrumb-item.active {
    color: var(--at-text);
}

/* --- Profile & lists --- */
.profile-meta {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.profile-meta__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.75rem;
}

.profile-meta__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--at-text-muted);
    min-width: 5rem;
}

.profile-meta__value {
    font-size: 0.9375rem;
    font-weight: 500;
}

.account-list .list-group-item {
    border-color: var(--at-border);
    padding: 1rem 1.25rem;
}

.badge-active {
    background: var(--at-primary-soft) !important;
    color: var(--at-primary) !important;
    font-weight: 500;
}

/* --- Static content --- */
.content-markdown {
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    padding: 2rem;
    box-shadow: var(--at-shadow-sm);
    line-height: 1.7;
}

.content-markdown h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
}

.content-markdown h2 {
    margin-top: 2rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.content-markdown h3 {
    margin-top: 1.5rem;
    font-size: 1.0625rem;
    font-weight: 600;
}

.content-markdown ul {
    padding-left: 1.25rem;
}

.content-markdown p {
    color: var(--at-text);
}

/* --- Empty / placeholder --- */
.placeholder-page {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--at-surface);
    border: 1px dashed var(--at-border-strong);
    border-radius: var(--at-radius);
}

.placeholder-page__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: var(--at-primary-soft);
    color: var(--at-primary);
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

/* --- Impersonation banner --- */
.impersonation-banner {
    background: #fffbeb;
    color: #92400e;
    text-align: center;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-bottom: 1px solid #fde68a;
}

/* --- Error page --- */
.error-panel {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    box-shadow: var(--at-shadow-sm);
}

.error-panel__code {
    font-size: 3rem;
    font-weight: 700;
    color: var(--at-border-strong);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.grecaptcha-badge {
    visibility: hidden;
}

/* --- M1 Products --- */
.page-header--split {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.page-header__meta {
    margin: 0.35rem 0 0;
    color: var(--at-text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.data-card {
    background: var(--at-surface);
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius);
    box-shadow: var(--at-shadow-sm);
    overflow: hidden;
}

.data-table {
    font-size: 0.9375rem;
}

.data-table thead th {
    background: #f8fafc;
    border-bottom-width: 1px;
    color: var(--at-text-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
}

.data-table tbody td {
    vertical-align: middle;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
}

.data-table code {
    font-size: 0.875em;
}

.product-table__name {
    font-weight: 500;
    line-height: 1.4;
}

.product-table__meta {
    margin-top: 0.35rem;
    color: var(--at-text-muted);
    font-size: 0.8125rem;
    line-height: 1.45;
}

.product-table__child td:first-child {
    padding-left: 2rem;
}

.product-table__child code {
    opacity: 0.85;
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
}

.product-actions form {
    margin: 0;
}

.product-panel-tabs .nav-link {
    font-size: 0.875rem;
}

.product-panel-tabs__content .tab-pane {
    max-width: 100%;
}

.schedule-hours {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.55rem;
}

.schedule-hours__item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius-sm);
    background: #fff;
    font-size: 0.8125rem;
    color: var(--at-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.schedule-hours__item:has(input:checked) {
    border-color: var(--at-primary);
    background: var(--at-primary-soft);
    color: var(--at-primary);
}

.schedule-hours__item input {
    margin: 0;
}

.keyword-star {
    font-size: 1.125rem;
    line-height: 1;
}

.keyword-cell {
    max-width: 32rem;
    word-break: break-word;
}

.col-star {
    width: 3rem;
}

.modal-lg .modal-body {
    padding-top: 0.5rem;
}

@media (max-width: 768px) {
    .page-toolbar {
        width: 100%;
    }

    .page-toolbar .btn {
        flex: 1 1 auto;
    }

    .product-actions {
        justify-content: flex-start;
    }
}

/* --- Product thumbnails --- */
.product-thumb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f4f7fb;
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius-sm);
    flex: 0 0 auto;
    color: var(--at-text-muted);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.product-thumb__placeholder {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #9fb0c3;
}

.product-thumb--sm {
    width: 56px;
    height: 56px;
}

.product-thumb--md {
    width: 72px;
    height: 72px;
    border-radius: var(--at-radius);
}

.product-thumb--lg {
    width: 200px;
    height: 200px;
    border-radius: var(--at-radius);
}

a.product-thumb {
    transition: border-color 0.15s, box-shadow 0.15s;
}

a.product-thumb:hover {
    border-color: var(--at-primary);
    box-shadow: 0 0 0 3px rgb(37 99 235 / 0.12);
}

/* --- Products table refinements --- */
.product-table__media-col {
    width: 72px;
}

.product-row__media {
    width: 72px;
}

.product-row__name {
    display: inline-block;
    font-weight: 600;
    color: var(--at-text);
    line-height: 1.35;
}

.product-row__name:hover {
    color: var(--at-primary);
}

.product-row__sub {
    margin-top: 0.3rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--at-text-muted);
}

.product-row__sub code {
    font-size: 0.8125rem;
    color: var(--at-text-muted);
}

.product-row--child .product-row__media {
    padding-left: 1.25rem;
}

.product-row--child .product-row__name {
    font-weight: 500;
}

.kw-count {
    font-variant-numeric: tabular-nums;
    font-size: 0.9375rem;
}

.kw-count__active {
    color: var(--at-success);
    font-weight: 600;
}

.kw-count__sep {
    color: var(--at-border-strong);
    margin: 0 0.15rem;
}

.kw-count__total {
    color: var(--at-text-muted);
}

.row-actions {
    display: inline-flex;
    gap: 0.4rem;
    justify-content: flex-end;
}

/* Action menu */
.row-actions .dropdown-menu {
    --bs-dropdown-min-width: 12rem;
    padding: 0.375rem;
    font-size: 0.875rem;
    border: 1px solid var(--at-border);
    border-radius: var(--at-radius-sm);
    box-shadow: var(--at-shadow);
}

.row-actions .dropdown-menu form {
    margin: 0;
}

/* Make both link items and form submit buttons identical, tidy rows */
.row-actions .dropdown-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 0;
    border-radius: var(--at-radius-sm);
    background: none;
    font: inherit;
    font-weight: 500;
    text-align: left;
    color: var(--at-text);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.row-actions .dropdown-item:hover,
.row-actions .dropdown-item:focus {
    background: var(--at-primary-soft);
    color: var(--at-primary-hover);
}

.row-actions .dropdown-item.text-danger:hover,
.row-actions .dropdown-item.text-danger:focus {
    background: #fef2f2;
    color: var(--at-danger) !important;
}

.row-actions .dropdown-divider {
    margin: 0.375rem 0.25rem;
    border-color: var(--at-border);
}

.row-actions .dropdown-toggle::after {
    margin-left: 0.45rem;
}

/* --- Badges --- */
.badge-soft,
.badge-ok,
.badge-warn,
.badge-muted {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-soft {
    background: var(--at-primary-soft);
    color: var(--at-primary-hover);
}

.badge-ok {
    background: var(--at-success-soft);
    color: #047857;
}

.badge-warn {
    background: var(--at-warn-soft);
    color: #b45309;
}

.badge-muted {
    background: #eef1f6;
    color: var(--at-text-muted);
}

/* --- Product context header + sub-nav --- */
.product-context {
    margin-bottom: 1.5rem;
}

.product-context__main {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.product-context__identity {
    flex: 1 1 240px;
    min-width: 0;
}

.product-context__title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 0.35rem;
    line-height: 1.25;
}

.product-context__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--at-text-muted);
}

.product-context__asin code {
    font-size: 0.8125rem;
}

.product-context__price {
    font-weight: 600;
    color: var(--at-text);
}

.product-context__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-left: auto;
}

.product-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 1.1rem;
    border-bottom: 1px solid var(--at-border);
}

.product-subnav__link {
    position: relative;
    padding: 0.6rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--at-text-muted);
    border-radius: var(--at-radius-sm) var(--at-radius-sm) 0 0;
}

.product-subnav__link:hover {
    color: var(--at-primary);
    background: var(--at-primary-soft);
}

.product-subnav__link.is-active {
    color: var(--at-primary);
}

.product-subnav__link.is-active::after {
    content: '';
    position: absolute;
    left: 0.6rem;
    right: 0.6rem;
    bottom: -1px;
    height: 2px;
    background: var(--at-primary);
    border-radius: 2px;
}

/* --- Product card page --- */
.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.product-card__hero {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.product-card__hero .fact-list {
    flex: 1 1 280px;
    min-width: 0;
}

.fact-list {
    margin: 0;
    display: grid;
    gap: 0;
}

.fact-list__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--at-border);
}

.fact-list__row:last-child {
    border-bottom: 0;
}

.fact-list__label {
    color: var(--at-text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.fact-list__value {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: right;
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .product-thumb--lg {
        width: 100%;
        height: 220px;
    }

    .product-context__actions {
        margin-left: 0;
        width: 100%;
    }
}

/* --- Tariff / plan cards (M8 billing) --- */
.card-grid--plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.plan-card {
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.plan-card--featured {
    border-color: var(--at-primary);
    box-shadow: var(--at-shadow);
}

.plan-card--current {
    border-color: var(--at-success);
}

.plan-card__name {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.plan-card__price {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.plan-card__amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--at-text);
}

.plan-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: grid;
    gap: 0.4rem;
}

.plan-card__features li {
    font-size: 0.875rem;
    color: var(--at-text);
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--at-border);
}

.plan-card__features li:last-child {
    border-bottom: 0;
}

.plan-card__action {
    margin-top: auto;
}

.plan-locked-hint {
    font-size: 0.8125rem;
    color: var(--at-text-muted);
}
