/**
 * PROMOTE UI System v1.4.0
 * Final cascade for cross-page alignment, responsiveness and accessibility.
 */

:root {
    --content-width: 1280px;
    --content-wide: 1600px;
    --site-header-height: 72px;
    --workspace-header-height: 64px;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-muted: #eef3f8;
    --text-strong: #172033;
    --text-body: #344054;
    --text-muted: #667085;
    --ui-border: #d9e2ec;
    --ui-border-strong: #c5d0dc;
    --ui-radius-sm: 6px;
    --ui-radius: 10px;
    --ui-radius-lg: 16px;
    --ui-shadow: 0 8px 24px rgba(23, 32, 51, 0.08);
    --ui-shadow-lg: 0 18px 45px rgba(23, 32, 51, 0.14);
    --focus-ring: 0 0 0 3px rgba(52, 152, 219, 0.22);
}

html {
    width: 100%;
    min-width: 320px;
    overflow-x: clip;
    scroll-padding-top: calc(var(--site-header-height) + 1rem);
}

body {
    width: 100%;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: clip;
    color: var(--text-body);
    background: var(--surface-soft);
}

body.menu-open,
body.sidebar-open {
    overflow: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
[role="button"] {
    touch-action: manipulation;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

:where(.header-content, .footer-content, .footer-bottom-content, .hero-content,
       .features-grid, .services-grid, .categories-grid, .steps-grid,
       .testimonials-grid, .quick-help-grid, .contact-layout, .checkout-layout,
       .services-layout, .kb-layout, .article-layout, .legal-layout,
       .dashboard-container, .dashboard-main, .admin-container, .admin-main,
       .stats-grid, .activity-grid, .actions-grid, .orders-grid, .users-grid,
       .filters-form, .form-row, .form-grid, .info-grid, .details-grid,
       .order-details-grid, .related-grid, .articles-grid) > * {
    min-width: 0;
}

.container {
    width: min(100%, var(--content-width));
    max-width: none;
    margin-inline: auto;
    padding-inline: clamp(1rem, 2.5vw, 2rem);
}

.container-fluid {
    width: 100%;
    padding-inline: clamp(1rem, 2.5vw, 2rem);
}

.main-content {
    min-height: calc(100vh - var(--site-header-height));
    overflow: clip;
}

.section {
    padding-block: clamp(3rem, 7vw, 5.5rem);
}

.section + .section {
    padding-top: 0;
}

.section-header {
    width: min(100%, 760px);
    margin: 0 auto clamp(1.75rem, 4vw, 3rem);
    text-align: center;
}

.section-header h2,
.section-header h1 {
    margin-bottom: .75rem;
}

.section-header p {
    margin: 0;
    color: var(--text-muted);
}

h1, h2, h3, h4, h5, h6 {
    overflow-wrap: anywhere;
    text-wrap: balance;
}

p, li, dd, td, th, label, .value {
    overflow-wrap: anywhere;
}

:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Header and navigation */
.site-header {
    min-height: var(--site-header-height);
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(217, 226, 236, .85);
    box-shadow: 0 2px 12px rgba(23, 32, 51, .05);
}

.header-content {
    min-height: var(--site-header-height);
    padding: .65rem 0;
    gap: 1.25rem;
}

.logo {
    flex: 0 1 auto;
    min-width: 0;
}

.logo a {
    min-width: 0;
}

.logo img {
    width: auto;
    height: clamp(38px, 4vw, 50px);
    max-width: min(320px, 48vw);
    object-fit: contain;
}

.main-nav {
    min-width: 0;
    margin-left: auto;
}

.nav-menu {
    margin: 0;
    padding: 0;
    gap: .25rem;
}

.nav-menu > li > a,
.nav-menu > li > .dropdown-toggle {
    min-height: 42px;
    justify-content: center;
    padding: .6rem .85rem;
    border: 0;
    border-radius: var(--ui-radius-sm);
    background: transparent;
    color: var(--gray-700);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active,
.nav-menu > li > .dropdown-toggle:hover,
.dropdown.active > .dropdown-toggle {
    color: var(--primary-color);
    background: rgba(52, 152, 219, .08);
}

.nav-menu .nav-action > .btn {
    padding-inline: 1rem;
}

.dropdown-toggle {
    appearance: none;
}

.dropdown-caret {
    font-size: .72rem;
    transition: transform .2s ease;
}

.dropdown.active .dropdown-caret,
.admin-user-menu.open .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    top: calc(100% + .55rem);
    width: max-content;
    max-width: min(320px, calc(100vw - 2rem));
    padding: .45rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-lg);
}

.dropdown-menu a {
    min-height: 42px;
    border-radius: var(--ui-radius-sm);
}

.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: var(--ui-radius-sm);
}

.mobile-menu-toggle:hover {
    background: var(--surface-muted);
}

/* Shared controls */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 42px;
    max-width: 100%;
    padding: .65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    font-weight: 650;
    line-height: 1.2;
    white-space: normal;
    vertical-align: middle;
}

.btn-sm {
    min-height: 36px;
    padding: .48rem .8rem;
    font-size: .875rem;
}

.btn-lg {
    min-height: 50px;
    padding: .8rem 1.35rem;
}

.btn-block {
    width: 100%;
}

.btn-outline {
    background: var(--surface);
    border-color: var(--ui-border-strong);
    color: var(--text-body);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(52, 152, 219, .06);
}

.btn-secondary {
    color: #fff;
}

.btn.loading,
.btn.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn.loading i,
.btn.is-loading i {
    visibility: hidden;
}

.form-group {
    min-width: 0;
    margin-bottom: 1.15rem;
}

.form-group > label,
.form-label {
    display: block;
    margin-bottom: .45rem;
    color: var(--text-strong);
    font-size: .925rem;
    font-weight: 650;
}

.form-control,
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], input[type="tel"], input[type="search"], input[type="date"],
input[type="datetime-local"], select, textarea {
    width: 100%;
    max-width: 100%;
    min-height: 44px;
    padding: .68rem .8rem;
    color: var(--text-strong);
    background: var(--surface);
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    line-height: 1.4;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

textarea,
textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-control:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: var(--focus-ring);
}

.form-control[disabled],
.form-control[readonly],
input[disabled], input[readonly],
select[disabled], textarea[disabled], textarea[readonly] {
    color: var(--text-muted);
    background: var(--surface-muted);
    cursor: not-allowed;
}

.form-control.error,
.form-control.is-invalid,
input.error,
select.error,
textarea.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, .12);
}

.form-text,
.help-text,
.field-help,
.character-counter {
    display: block;
    margin-top: .4rem;
    color: var(--text-muted);
    font-size: .82rem;
    line-height: 1.45;
}

.error-message,
.invalid-feedback {
    display: block;
    margin-top: .4rem;
    color: var(--danger-color);
    font-size: .82rem;
}

.form-row,
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.form-actions,
.header-actions,
.action-buttons,
.help-actions,
.hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}

.form-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    min-width: 0;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: .15rem;
    flex: 0 0 auto;
}

.input-group,
.password-input-wrapper,
.search-box,
.search-input-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
}

.input-group > .form-control,
.password-input-wrapper > .form-control,
.search-box > .form-control,
.search-input-wrapper > .form-control {
    min-width: 0;
    flex: 1 1 auto;
}

.input-group > *:not(:first-child),
.password-input-wrapper > *:not(:first-child) {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.input-group > *:not(:last-child),
.password-input-wrapper > *:not(:last-child) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Cards and content surfaces */
.card,
.feature-card,
.service-card,
.category-card,
.step-card,
.testimonial-card,
.info-card,
.filter-card,
.summary-card,
.features-card,
.help-card,
.kb-card,
.article-card,
.related-card,
.sidebar-card,
.profile-card,
.settings-card,
.activity-card,
.order-card,
.ticket-item,
.table-container,
.dashboard-section,
.contact-form-container,
.checkout-form,
.auth-card {
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    box-shadow: 0 3px 14px rgba(23, 32, 51, .055);
}

.card-header,
.form-header,
.payment-header,
.order-header,
.article-header,
.ticket-header {
    min-width: 0;
}

.card-header h2,
.card-header h3,
.form-header h2,
.form-header h3 {
    margin-bottom: .35rem;
}

.card-header p,
.form-header p {
    margin-bottom: 0;
    color: var(--text-muted);
}

.features-grid,
.services-grid,
.categories-grid,
.steps-grid,
.testimonials-grid,
.quick-help-grid,
.articles-grid,
.related-grid,
.actions-grid,
.orders-grid,
.users-grid,
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: clamp(1rem, 2vw, 1.5rem);
}

.service-card,
.feature-card,
.category-card,
.step-card,
.testimonial-card,
.article-card,
.related-card,
.action-card,
.stat-card,
.order-card {
    height: 100%;
}

/* Public page headers and hero */
.page-header,
.breadcrumb-section {
    background: linear-gradient(135deg, #f7fbff 0%, #eef5fb 100%);
    border-bottom: 1px solid var(--ui-border);
}

.page-header {
    padding-block: clamp(2.25rem, 6vw, 4rem);
}

.page-header h1 {
    margin-bottom: .65rem;
}

.page-header p {
    max-width: 760px;
    margin-bottom: 0;
    color: var(--text-muted);
}

.hero {
    min-height: min(720px, calc(100vh - var(--site-header-height)));
    display: grid;
    align-items: center;
    padding-block: clamp(4rem, 10vw, 7.5rem);
}

.hero-content {
    width: min(100%, 900px);
    margin-inline: auto;
}

.hero-content h1 {
    font-size: clamp(2.2rem, 5vw, 4.5rem);
    line-height: 1.05;
}

.hero-content > p {
    max-width: 760px;
}

.hero-actions {
    margin-top: 1.5rem;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: clamp(2rem, 5vw, 4rem);
}

.hero-stats .stat-item {
    min-width: 0;
}

.cta-section {
    padding-block: clamp(3rem, 7vw, 5rem);
}

/* Two-column public layouts */
.services-layout,
.kb-layout,
.article-layout,
.legal-layout,
.contact-layout,
.checkout-layout {
    display: grid;
    align-items: start;
    gap: clamp(1.25rem, 3vw, 2.25rem);
}

.services-layout,
.kb-layout {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
}

.article-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
}

.legal-layout {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.contact-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
}

.checkout-layout {
    grid-template-columns: minmax(0, 1fr) minmax(310px, 380px);
}

.services-sidebar,
.kb-sidebar,
.article-sidebar,
.legal-sidebar,
.contact-sidebar,
.checkout-sidebar {
    min-width: 0;
}

.services-sidebar,
.kb-sidebar,
.article-sidebar .sticky,
.legal-sidebar,
.checkout-sidebar {
    position: sticky;
    top: calc(var(--site-header-height) + 1.25rem);
}

.results-header,
.filters-section,
.pagination-container {
    min-width: 0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
}

/* Tables */
.table-responsive,
.table-container {
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.table-container {
    padding: 0;
}

table,
.data-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table th,
.data-table td,
table th,
table td {
    padding: .8rem .9rem;
    vertical-align: middle;
    text-align: left;
    border-bottom: 1px solid var(--ui-border);
}

.data-table th,
table th {
    color: var(--text-strong);
    background: var(--surface-soft);
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .02em;
    white-space: nowrap;
}

.data-table td,
table td {
    font-size: .9rem;
}

.data-table tbody tr:hover,
table tbody tr:hover {
    background: rgba(52, 152, 219, .035);
}

.data-table .action-buttons,
table .action-buttons {
    flex-wrap: nowrap;
    white-space: nowrap;
}

.pagination,
.pagination ul {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-link {
    min-width: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--surface);
}

/* Alerts */
.flash-messages {
    position: fixed;
    z-index: 1100;
    top: calc(var(--site-header-height) + 1rem);
    right: 0;
    left: 0;
    pointer-events: none;
}

.flash-messages .container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .6rem;
}

.flash-messages .alert {
    width: min(100%, 430px);
    margin: 0;
    pointer-events: auto;
}

.alert {
    min-width: 0;
    align-items: flex-start;
    padding: .9rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
}

.alert-close {
    min-width: 30px;
    min-height: 30px;
    margin: -.35rem -.35rem -.35rem auto;
    display: inline-grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

/* Footer */
.site-footer {
    margin-top: 0;
    padding-top: clamp(3rem, 7vw, 5rem);
}

.footer-content {
    grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(170px, 1fr));
    gap: clamp(1.5rem, 3vw, 2.75rem);
}

.footer-section,
.footer-section * {
    min-width: 0;
}

.footer-contact a,
.footer-contact span {
    overflow-wrap: anywhere;
}

.footer-bottom-content {
    align-items: flex-start;
}

.back-to-top {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    right: 1.25rem;
    bottom: 1.25rem;
}

/* Dashboard workspace */
.dashboard-page {
    background: var(--surface-soft);
}

.dashboard-page > .site-header {
    z-index: 1050;
}

.dashboard-container {
    width: 100%;
    min-height: calc(100vh - var(--site-header-height));
    align-items: stretch;
}

.dashboard-sidebar {
    flex: 0 0 270px;
    width: 270px;
    top: var(--site-header-height);
    height: calc(100vh - var(--site-header-height));
    border-right: 1px solid var(--ui-border);
    box-shadow: none;
}

.dashboard-main {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.dashboard-main > * {
    width: 100%;
    max-width: 1500px;
    margin-inline: auto;
}

.dashboard-main > .page-header,
.dashboard-main > .dashboard-header {
    padding: 0;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
    background: transparent;
    border: 0;
}

.dashboard-main > .page-header h1,
.dashboard-main > .dashboard-header h1 {
    margin-bottom: .35rem;
    font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.dashboard-section,
.profile-card {
    padding: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: 1.25rem;
}

.dashboard-main .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.dashboard-main .stat-card {
    min-height: 118px;
    padding: 1.1rem;
}

.sidebar-nav a,
.sidebar-nav .nav-item {
    min-height: 46px;
}

.workspace-sidebar-toggle {
    display: none;
    position: fixed;
    z-index: 1065;
    left: .75rem;
    bottom: .75rem;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--ui-shadow-lg);
    cursor: pointer;
}

.ui-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1055;
    background: rgba(15, 23, 42, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.ui-sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Admin workspace */
.admin-page {
    min-height: 100vh;
    background: var(--surface-soft);
}

.admin-header {
    min-height: var(--workspace-header-height);
    padding: .65rem clamp(1rem, 2.5vw, 1.5rem);
    gap: 1rem;
}

.header-left,
.header-right {
    min-width: 0;
}

.admin-header h1 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-container {
    width: 100%;
    min-height: calc(100vh - var(--workspace-header-height));
    align-items: stretch;
}

.admin-sidebar {
    flex: 0 0 260px;
    width: 260px;
    top: var(--workspace-header-height);
    height: calc(100vh - var(--workspace-header-height));
    border-right: 1px solid var(--ui-border);
    box-shadow: none;
}

.admin-main {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.admin-header-section {
    min-width: 0;
    gap: 1rem;
    flex-wrap: wrap;
}

.admin-header-section h1 {
    min-width: 0;
    font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.admin-main .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.admin-main .activity-grid,
.admin-main .settings-grid,
.admin-main .details-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
}

.admin-main .stat-card,
.admin-main .activity-card,
.admin-main .settings-card {
    min-width: 0;
}

.filters-section {
    padding: 1rem;
    margin-bottom: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
}

.filters-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    align-items: end;
    gap: .85rem;
}

.filters-form .form-group {
    margin-bottom: 0;
}

.admin-user-menu.open .user-menu-dropdown {
    display: block;
}

.user-menu-dropdown {
    border: 1px solid var(--ui-border);
    box-shadow: var(--ui-shadow-lg);
}

.info-row,
.detail-row,
.calc-row {
    min-width: 0;
    gap: 1rem;
}

.info-row .value,
.detail-row .detail-value,
.calc-row .calc-value {
    min-width: 0;
    text-align: right;
}

/* Authentication */
body.auth-page {
    min-height: 100vh;
    height: auto;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: clamp(4.5rem, 8vw, 6rem) 1rem 2rem !important;
}

.auth-page .auth-wrapper,
.auth-page .auth-container {
    width: min(100%, 1120px);
    max-width: 1120px;
    min-height: 0;
    margin: auto;
}

.auth-page .auth-card,
.auth-page .login-card,
.auth-page .register-card {
    width: min(100%, 540px);
    max-width: 100%;
    margin-inline: auto;
}

.auth-page .back-to-home {
    top: 1rem;
    left: 1rem;
}

.auth-page .flash-messages-container {
    top: 1rem;
    right: 1rem;
    left: auto;
    width: min(360px, calc(100vw - 2rem));
}

/* Tooltip */
.tooltip {
    position: fixed;
    z-index: 1200;
    max-width: min(260px, calc(100vw - 2rem));
    padding: .45rem .65rem;
    border-radius: var(--ui-radius-sm);
    background: #101828;
    color: #fff;
    font-size: .8rem;
    line-height: 1.35;
    pointer-events: none;
    box-shadow: var(--ui-shadow);
}

/* Responsive */
@media (max-width: 1100px) {
    .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-layout,
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    }
}

@media (max-width: 960px) {
    :root {
        --site-header-height: 68px;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        z-index: 1045;
        inset: var(--site-header-height) 0 auto 0;
        max-height: calc(100dvh - var(--site-header-height));
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: .25rem;
        padding: 1rem;
        background: var(--surface);
        border-top: 1px solid var(--ui-border);
        box-shadow: var(--ui-shadow-lg);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform .22s ease, opacity .22s ease, visibility .22s ease;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-menu > li,
    .nav-menu > li > a,
    .nav-menu > li > .dropdown-toggle,
    .nav-menu .nav-action > .btn {
        width: 100%;
    }

    .nav-menu > li > a,
    .nav-menu > li > .dropdown-toggle {
        justify-content: flex-start;
        min-height: 46px;
    }

    .nav-menu .nav-action {
        margin-top: .25rem;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        max-width: none;
        margin-top: .35rem;
        opacity: 0;
        visibility: hidden;
        display: none;
        transform: none;
        box-shadow: none;
        background: var(--surface-soft);
    }

    .dropdown.active .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
    }

    .services-layout,
    .kb-layout,
    .article-layout,
    .legal-layout,
    .contact-layout,
    .checkout-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .services-sidebar,
    .kb-sidebar,
    .article-sidebar .sticky,
    .legal-sidebar,
    .checkout-sidebar {
        position: static;
    }

    .dashboard-sidebar,
    .admin-sidebar {
        position: fixed;
        z-index: 1060;
        left: 0;
        bottom: 0;
        top: var(--site-header-height);
        width: min(86vw, 300px);
        height: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        box-shadow: var(--ui-shadow-lg);
    }

    .admin-sidebar {
        top: var(--workspace-header-height);
    }

    .dashboard-sidebar.active,
    .admin-sidebar.active {
        transform: translateX(0);
    }

    .workspace-sidebar-toggle,
    .admin-page .sidebar-toggle {
        display: grid;
    }

    .dashboard-main,
    .admin-main {
        width: 100%;
        padding-bottom: 5rem;
    }

    .admin-header-section {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .container,
    .container-fluid {
        padding-inline: 1rem;
    }

    .section {
        padding-block: 3rem;
    }

    .form-row,
    .form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .hero-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-content {
        grid-template-columns: minmax(0, 1fr);
    }

    .footer-bottom-content {
        flex-direction: column;
    }

    .footer-legal {
        justify-content: flex-start;
    }

    .admin-header {
        align-items: center;
    }

    .admin-header .header-right > .btn {
        display: none;
    }

    .user-menu-toggle span {
        display: none;
    }

    .admin-header-section,
    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions,
    .admin-header-section .header-actions,
    .form-actions,
    .help-actions,
    .hero-actions {
        width: 100%;
    }

    .header-actions .btn,
    .form-actions .btn,
    .hero-actions .btn {
        flex: 1 1 180px;
    }

    .info-row,
    .detail-row,
    .calc-row {
        align-items: flex-start;
        flex-direction: column;
        gap: .3rem;
    }

    .info-row .value,
    .detail-row .detail-value,
    .calc-row .calc-value {
        width: 100%;
        text-align: left;
    }

    .flash-messages {
        top: calc(var(--site-header-height) + .6rem);
    }

    .flash-messages .container {
        align-items: stretch;
    }

    .flash-messages .alert {
        width: 100%;
    }

    .data-table,
    table {
        min-width: 680px;
    }

    .auth-page .flash-messages-container {
        position: static;
        width: min(100%, 540px);
        margin: 0 auto 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-base: 16px;
    }

    .logo img {
        max-width: 62vw;
        height: 38px;
    }

    .btn,
    .btn-sm,
    .btn-lg {
        min-height: 44px;
    }

    .dashboard-main,
    .admin-main {
        padding-inline: 1rem;
    }

    .dashboard-section,
    .profile-card,
    .settings-card,
    .activity-card {
        padding: 1rem;
    }

    .stats-grid,
    .actions-grid,
    .orders-grid,
    .users-grid,
    .features-grid,
    .services-grid,
    .categories-grid,
    .steps-grid,
    .testimonials-grid,
    .quick-help-grid,
    .articles-grid,
    .related-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media print {
    .workspace-sidebar-toggle,
    .ui-sidebar-backdrop,
    .flash-messages {
        display: none !important;
    }
}

/* v1.3.0 corrective overrides after cross-viewport rendering tests */
.page-header {
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.page-header h1,
.page-header h2,
.page-header p,
.page-header .breadcrumb,
.page-header .breadcrumb a,
.page-header .breadcrumb span {
    color: #fff;
}

.page-header p,
.page-header .breadcrumb a {
    opacity: .9;
}

.dashboard-main > .page-header,
.dashboard-main > .dashboard-header {
    color: var(--text-body);
    background: transparent;
}

.dashboard-main > .page-header h1,
.dashboard-main > .page-header h2,
.dashboard-main > .page-header p,
.dashboard-main > .dashboard-header h1,
.dashboard-main > .dashboard-header p {
    color: inherit;
}

.feature-card,
.service-card,
.category-card,
.step-card,
.testimonial-card,
.article-card,
.related-card,
.action-card,
.stat-card,
.order-card {
    height: auto;
}

.btn.loading::after,
.btn.is-loading::after {
    border-color: rgba(255, 255, 255, .45);
    border-top-color: #fff;
}

.payment-status-section {
    min-height: calc(100vh - var(--site-header-height));
    display: grid;
    align-items: center;
    padding-block: clamp(3rem, 8vw, 6rem);
}

.status-card {
    width: min(100%, 780px);
    margin-inline: auto;
    padding: clamp(1.25rem, 4vw, 2.5rem);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    box-shadow: var(--ui-shadow-lg);
}

.status-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.25rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 2.5rem;
}

.status-icon.success {
    color: var(--success-color);
    background: rgba(39, 174, 96, .12);
}

.status-icon.cancelled {
    color: var(--warning-color);
    background: rgba(243, 156, 18, .12);
}

.status-message {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.status-details {
    margin-block: 1.5rem;
    text-align: left;
}

.status-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.status-info .info-item {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius);
    background: var(--surface-soft);
}

.status-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .75rem;
}

@media (max-width: 960px) {
    .services-sidebar,
    .kb-sidebar,
    .legal-sidebar,
    .checkout-sidebar {
        position: static;
        inset: auto;
        width: auto;
        height: auto;
        max-height: none;
        padding: 0;
        overflow: visible;
        background: transparent;
        box-shadow: none;
        transform: none;
    }

    .mobile-filter-toggle {
        display: none !important;
    }
}

@media (max-width: 720px) {
    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        flex: 0 0 auto;
    }

    .status-actions {
        flex-direction: column;
    }

    .status-actions .btn {
        width: 100%;
    }
}
.workspace-sidebar-toggle {
    position: static;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    color: var(--text-body);
    background: transparent;
    border: 0;
    border-radius: var(--ui-radius-sm);
    box-shadow: none;
}

.workspace-sidebar-toggle:hover {
    color: var(--primary-color);
    background: var(--surface-muted);
}

.workspace-sidebar-toggle.is-floating {
    position: fixed;
    left: .75rem;
    bottom: .75rem;
    color: #fff;
    background: var(--primary-color);
    border-radius: 50%;
    box-shadow: var(--ui-shadow-lg);
}

/* ============================================================================
   PROMOTE BRAND SYSTEM v1.4.0
   ========================================================================== */
:root {
    --primary-color: #69b831;
    --primary-dark: #3f8a25;
    --primary-light: #93d65e;
    --secondary-color: #173f45;
    --secondary-dark: #0b2d33;
    --info-color: #148d98;
    --success-color: #318f4e;
    --brand-green: #69b831;
    --brand-green-dark: #3f8a25;
    --brand-teal: #09a3ad;
    --brand-ink: #173f45;
    --brand-soft: #eef8e9;
    --focus-ring: 0 0 0 3px rgba(105, 184, 49, .23);
}

body {
    color: #35483f;
    background: #f7faf8;
}

.skip-link {
    position: fixed;
    z-index: 99999;
    top: .75rem;
    left: .75rem;
    padding: .7rem 1rem;
    color: #fff;
    border-radius: 8px;
    background: var(--brand-ink);
    box-shadow: var(--ui-shadow-lg);
    transform: translateY(-180%);
    transition: transform .18s ease;
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

:where(.btn, .nav-item, .sidebar-nav a, .dropdown-menu a, .footer-contact li,
       .admin-logo, .admin-brand, .user-menu-toggle, .action-card, .platform-card,
       .check-list li, .alert, .page-header h1, .admin-header-section h1) > i {
    flex: 0 0 auto;
    width: 1.15em;
    line-height: 1;
    text-align: center;
}

.site-header {
    border-bottom-color: rgba(210, 224, 215, .92);
}

.site-brand {
    min-width: 0;
}

.site-brand > a {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    min-width: 0;
}

.site-brand img {
    width: auto;
    height: 48px;
    max-width: 170px;
    object-fit: contain;
}

.site-brand-copy {
    display: none;
    min-width: 0;
    line-height: 1.05;
}

.site-brand-copy strong,
.site-brand-copy small {
    display: block;
}

.site-brand-copy strong {
    color: var(--brand-green-dark);
    font-size: 1.02rem;
    letter-spacing: .02em;
}

.site-brand-copy small {
    margin-top: .2rem;
    color: #65736c;
    font-size: .68rem;
    font-weight: 650;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active,
.nav-menu > li > .dropdown-toggle:hover,
.dropdown.active > .dropdown-toggle {
    color: var(--brand-green-dark);
    background: var(--brand-soft);
}

.btn-primary {
    color: #fff;
    border-color: var(--brand-green-dark);
    background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
    box-shadow: 0 6px 14px rgba(63, 138, 37, .16);
}

.btn-primary:hover {
    color: #fff;
    border-color: #34771e;
    background: linear-gradient(135deg, #76c93b, #34771e);
    box-shadow: 0 8px 18px rgba(63, 138, 37, .24);
}

.btn-outline:hover {
    border-color: var(--brand-green);
    color: var(--brand-green-dark);
    background: var(--brand-soft);
}

.site-footer {
    color: rgba(255,255,255,.76);
    border-top: 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(105,184,49,.16), transparent 22rem),
        linear-gradient(145deg, #0a2c32, #123d42 54%, #173c2b);
}

.site-footer .footer-content {
    grid-template-columns: minmax(250px, 1.35fr) repeat(3, minmax(150px, .75fr));
    align-items: start;
    gap: clamp(1.5rem, 4vw, 3.5rem);
}

.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    max-width: 100%;
    margin-bottom: 1rem;
    color: #fff;
}

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

.footer-brand img {
    width: min(180px, 100%);
    height: auto;
    object-fit: contain;
}

.footer-brand span {
    display: none;
}

.footer-brand strong,
.footer-brand small {
    display: block;
}

.footer-about p {
    max-width: 420px;
    color: rgba(255,255,255,.68);
    line-height: 1.7;
}

.footer-heading {
    margin: .35rem 0 1rem;
    color: #fff;
    font-size: .84rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.site-footer .footer-links,
.site-footer .footer-contact,
.site-footer .footer-legal {
    list-style: none;
    padding: 0;
}

.site-footer .footer-links li + li,
.site-footer .footer-contact li + li {
    margin-top: .62rem;
}

.site-footer .footer-links a,
.site-footer .footer-contact a,
.site-footer .footer-legal a {
    color: rgba(255,255,255,.72);
}

.site-footer .footer-links a:hover,
.site-footer .footer-contact a:hover,
.site-footer .footer-legal a:hover {
    color: #b7ef91;
}

.site-footer .footer-contact li {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    min-width: 0;
    color: rgba(255,255,255,.72);
}

.site-footer .footer-contact i {
    margin-top: .3rem;
    color: #9bdf70;
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin-top: 1.15rem;
}

.social-links a {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 11px;
    background: rgba(255,255,255,.07);
}

.social-links a:hover {
    color: #fff;
    border-color: rgba(183,239,145,.7);
    background: rgba(105,184,49,.25);
}

.site-footer .footer-bottom {
    margin-top: clamp(2rem, 5vw, 3.5rem);
    padding-top: 1.15rem;
    border-top: 1px solid rgba(255,255,255,.12);
}

.site-footer .footer-bottom-content {
    gap: 1rem 2rem;
}

.site-footer .footer-bottom p,
.site-footer .footer-credit {
    color: rgba(255,255,255,.55);
}

.site-footer .footer-credit {
    margin: .55rem 0 0;
    font-size: .78rem;
}

.back-to-top {
    border-color: var(--brand-green-dark);
    background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
}

/* Branded workspace headers */
.admin-header {
    border-bottom: 1px solid #d7e4dc;
    background: rgba(255,255,255,.97);
    box-shadow: 0 2px 12px rgba(20,53,39,.07);
}

.admin-brand,
.admin-logo.admin-brand {
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    min-width: 0;
    color: #263d32;
}

.admin-brand:hover,
.admin-logo.admin-brand:hover {
    color: #263d32;
}

.admin-brand img {
    width: auto;
    height: 38px;
    max-width: 145px;
    object-fit: contain;
}

.admin-brand-copy {
    display: block;
    min-width: 0;
    line-height: 1.05;
}

.admin-brand-copy strong,
.admin-brand-copy small {
    display: block;
}

.admin-brand-copy strong {
    color: var(--brand-green-dark);
    font-size: .92rem;
    letter-spacing: .04em;
}

.admin-brand-copy small {
    margin-top: .18rem;
    color: #6e7b74;
    font-size: .62rem;
    font-weight: 650;
    white-space: nowrap;
}

.admin-sidebar {
    border-right-color: #dbe7df;
    background: #102f34;
}

.admin-sidebar .sidebar-nav a {
    color: rgba(255,255,255,.73);
}

.admin-sidebar .sidebar-nav a:hover,
.admin-sidebar .sidebar-nav li.active > a {
    color: #fff;
    background: rgba(105,184,49,.20);
    box-shadow: inset 3px 0 0 #83d24a;
}

.dashboard-sidebar {
    border-right-color: #dbe7df;
}

.dashboard-sidebar .nav-item.active,
.dashboard-sidebar .nav-item:hover {
    color: var(--brand-green-dark);
    background: var(--brand-soft);
}

.stat-icon,
.feature-icon,
.service-icon,
.category-icon,
.step-icon,
.action-card > i,
.status-icon {
    line-height: 1;
}

/* Hide nonsensical empty contact elements generated by legacy data. */
.footer-contact li:empty,
.footer-links li:empty {
    display: none;
}

@media (min-width: 1180px) {
    .site-brand-copy {
        display: block;
    }
}

@media (max-width: 960px) {
    .site-footer .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .site-brand img {
        height: 43px;
        max-width: 155px;
    }

    .admin-brand-copy small {
        display: none;
    }
}

@media (max-width: 620px) {
    .site-footer .footer-content {
        grid-template-columns: 1fr;
    }

    .site-footer .footer-bottom-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-brand img {
        height: 34px;
        max-width: 118px;
    }

    .admin-brand-copy {
        display: none;
    }
}
