:root {
    --surface: #ffffff;
    --background: #eef3f8;
    --text: #1c2736;
    --muted: #5f6f84;
    --primary: #184d73;
    --secondary: #2f7da8;
    --accent: #f2a43a;
    --border: #d4deea;
    --hero-start: rgba(24, 77, 115, 0.95);
    --hero-end: rgba(47, 125, 168, 0.92);
    --bg-glow-1: rgba(47, 125, 168, 0.16);
    --bg-glow-2: rgba(24, 77, 115, 0.1);
    --auth-hero-start: #1b547c;
    --auth-hero-end: #2e7eaa;
    --logo-slot-bg: #ffffff;
    --logo-slot-border: rgba(20, 33, 51, 0.14);
    --focus-ring: rgba(47, 125, 168, 0.28);
    --secondary-soft: rgba(47, 125, 168, 0.08);
    --table-striped-bg: #f4f8fc;
    --head-table-bg: #eaf3f9;
    --head-table-striped-bg: #ddebf5;
}

html[data-theme="blue"] {
    --surface: #ffffff;
    --background: #eef3f8;
    --text: #1c2736;
    --muted: #5f6f84;
    --primary: #184d73;
    --secondary: #2f7da8;
    --accent: #f2a43a;
    --border: #d4deea;
    --hero-start: rgba(24, 77, 115, 0.95);
    --hero-end: rgba(47, 125, 168, 0.92);
    --bg-glow-1: rgba(47, 125, 168, 0.16);
    --bg-glow-2: rgba(24, 77, 115, 0.1);
    --auth-hero-start: #1b547c;
    --auth-hero-end: #2e7eaa;
    --logo-slot-bg: #ffffff;
    --logo-slot-border: rgba(20, 33, 51, 0.14);
    --focus-ring: rgba(47, 125, 168, 0.28);
    --secondary-soft: rgba(47, 125, 168, 0.08);
    --table-striped-bg: #f4f8fc;
    --head-table-bg: #eaf3f9;
    --head-table-striped-bg: #ddebf5;
}

html[data-theme="green"] {
    --surface: #fbfdfb;
    --background: #edf5f1;
    --text: #1f2c26;
    --muted: #5b6a63;
    --primary: #1f6f52;
    --secondary: #2f8d68;
    --accent: #ef9f2f;
    --border: #cfddd4;
    --hero-start: rgba(31, 111, 82, 0.95);
    --hero-end: rgba(47, 141, 104, 0.92);
    --bg-glow-1: rgba(47, 141, 104, 0.15);
    --bg-glow-2: rgba(31, 111, 82, 0.08);
    --auth-hero-start: #1f6e52;
    --auth-hero-end: #2f8b67;
    --logo-slot-bg: #ffffff;
    --logo-slot-border: rgba(17, 38, 27, 0.14);
    --focus-ring: rgba(47, 141, 104, 0.28);
    --secondary-soft: rgba(47, 141, 104, 0.08);
    --table-striped-bg: #f2f8f4;
    --head-table-bg: #e6f2eb;
    --head-table-striped-bg: #d8eade;
}

body.portal-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 8% 12%, var(--bg-glow-1), transparent 34%),
        radial-gradient(circle at 85% 0%, var(--bg-glow-2), transparent 32%),
        var(--background);
}

.portal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 42%),
        linear-gradient(120deg, var(--hero-start), var(--hero-end));
    color: #fff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0;
    color: #fff;
}

.portal-badge-icon {
    width: 2.7rem;
    height: 2.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.96);
}

.portal-badge-icon svg {
    width: 1.95rem;
    height: 1.95rem;
}

.portal-badge-text {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.02;
}

.portal-badge-kicker {
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 0.08rem;
}

.portal-badge-title {
    font-size: 1.34rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
}

.portal-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
}

.portal-subtitle-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.72);
    flex-shrink: 0;
}

.portal-subtitle-icon svg {
    width: 1rem;
    height: 1rem;
}

.nav-actions {
    row-gap: 0.75rem;
}

.nav-action-btn {
    min-width: 148px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.45rem;
    white-space: nowrap;
    text-align: center;
    line-height: 1.15;
}

.nav-action-btn-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.nav-action-btn-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem;
    max-height: 1rem;
    display: block;
    flex-shrink: 0;
}

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-toggle-control {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.theme-toggle-control:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
}

.theme-toggle-control:active {
    transform: scale(0.96);
}

.theme-toggle-input:focus-visible + .theme-toggle-control {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
}

.theme-toggle-icon {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle-icon svg {
    width: 20px;
    height: 20px;
}

.theme-toggle-icon-green {
    color: #0f766e;
}

.theme-toggle-icon-blue {
    color: #2563eb;
}

html[data-theme="green"] .theme-toggle-icon-green,
html[data-theme="blue"] .theme-toggle-icon-blue {
    opacity: 1;
    transform: scale(1);
}

html[data-theme="green"] .theme-toggle-icon-blue,
html[data-theme="blue"] .theme-toggle-icon-green {
    opacity: 0;
    transform: scale(0.75);
}

.portal-footer {
    border-top: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--muted);
}

.portal-consent-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1085;
    padding: 0 0 1rem;
}

.portal-consent-banner-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-radius: 16px;
    background: rgba(28, 39, 54, 0.96);
    color: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.portal-consent-banner p {
    font-size: 0.96rem;
    line-height: 1.45;
}

.portal-consent-btn {
    min-width: 112px;
    min-height: 44px;
    flex-shrink: 0;
    font-weight: 700;
    border-radius: 12px;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
}

.portal-consent-btn:hover,
.portal-consent-btn:focus {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.62);
    color: #fff;
}

.portal-alert {
    border-width: 1px;
    box-shadow: 0 6px 16px rgba(31, 41, 55, 0.08);
}

.portal-toast-container {
    z-index: 1095;
    margin-top: 78px;
}

.portal-toast {
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
    min-width: 320px;
}

.footer-logo-icon {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.auth-card {
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    width: min(100%, 980px);
    margin-inline: auto;
}

.auth-page main.container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-login-col {
    display: flex;
    justify-content: center;
}

.auth-brand-side {
    position: relative;
    isolation: isolate;
    background: linear-gradient(160deg, var(--auth-hero-start), var(--auth-hero-end));
    color: #f8fbff;
}

.auth-brand-side::before {
    content: "";
    position: absolute;
    width: 240px;
    height: 240px;
    top: -70px;
    right: -80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    z-index: -1;
}

.auth-brand-side::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    bottom: -70px;
    left: -60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    z-index: -1;
}

.brand-wrap {
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
}

.auth-brand-side h1 {
    font-weight: 700;
}

.auth-brand-side p {
    line-height: 1.4;
}

.logo-slot {
    border: 1px solid var(--logo-slot-border);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--logo-slot-bg), #f4f7fb);
    min-height: 132px;
    display: grid;
    place-items: center;
    padding: 1.15rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.88),
        0 10px 24px rgba(15, 23, 42, 0.12);
}

.logo-slot img {
    max-width: 100%;
    max-height: 88px;
    object-fit: contain;
    filter: contrast(1.06) saturate(1.02);
}

.auth-brand-side .text-muted {
    color: rgba(244, 250, 255, 0.86) !important;
}

.auth-card .card-body {
    background-color: var(--surface);
}

.auth-card .form-label {
    font-weight: 600;
    color: var(--text);
}

.auth-card .form-control {
    min-height: 46px;
    border-color: var(--border);
}

.auth-card .btn-primary {
    min-height: 46px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.auth-link {
    color: var(--secondary);
    font-weight: 600;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 0.2rem var(--focus-ring);
}

.form-control[readonly] {
    background-color: #f3f6fa;
    cursor: not-allowed;
}

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

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

.nav-actions .btn-outline-secondary {
    border-color: rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.06);
}

.nav-actions .btn-outline-secondary:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background-color: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-actions .btn-outline-danger {
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    background: rgba(220, 38, 38, 0.1);
}

.nav-actions .btn-outline-danger:hover {
    border-color: rgba(254, 202, 202, 0.55);
    background: rgba(220, 38, 38, 0.2);
    color: #fff;
}

.dashboard-hero {
    border: 1px solid var(--border);
    border-radius: 16px;
    background:
        radial-gradient(circle at 90% 10%, rgba(245, 158, 11, 0.14), transparent 40%),
        linear-gradient(120deg, var(--hero-start), var(--hero-end));
    color: #fff;
    padding: 1.5rem;
}

.dashboard-hero p {
    color: rgba(255, 255, 255, 0.88);
}

.dashboard-hero-actions {
    align-items: stretch;
}

.dashboard-hero-action-btn {
    min-width: 172px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.55rem;
    font-weight: 700;
    border-radius: 12px;
    padding-inline: 1rem;
    white-space: nowrap;
    line-height: 1.15;
}

.dashboard-hero .dashboard-hero-action-btn.btn-outline-secondary,
.dashboard-hero .dashboard-hero-action-btn.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.dashboard-hero .dashboard-hero-action-btn.btn-outline-secondary:hover,
.dashboard-hero .dashboard-hero-action-btn.btn-outline-secondary:focus,
.dashboard-hero .dashboard-hero-action-btn.btn-outline-light:hover,
.dashboard-hero .dashboard-hero-action-btn.btn-outline-light:focus {
    border-color: rgba(255, 255, 255, 0.48);
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}

.dashboard-hero-action-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.dashboard-hero-action-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem;
    max-height: 1rem;
    display: block;
    flex-shrink: 0;
}

.metric-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background-color: var(--surface);
    padding: 1rem;
    height: 100%;
}

.metric-card .metric-label {
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.metric-card .metric-value {
    margin-top: 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.metric-card-link {
    display: block;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card-link:hover,
.metric-card-link:focus {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.section-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0)),
        var(--surface);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.section-card .card-body {
    padding: 1.2rem;
}

.section-card-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.section-card-heading-icon {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-soft);
    color: var(--primary);
    border: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
}

.section-card-heading-icon svg {
    width: 1.15rem !important;
    height: 1.15rem !important;
    min-width: 1.15rem;
    min-height: 1.15rem;
    max-width: 1.15rem;
    max-height: 1.15rem;
    display: block;
    flex-shrink: 0;
}

.section-card-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.action-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.action-list li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: flex-start;
}

.action-list li strong {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--text);
}

.action-list li div:last-child {
    color: var(--muted);
}

.action-list-marker {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
}

.section-card-footer,
.user-session-footer {
    margin-top: 1rem;
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.section-card-action-btn {
    min-width: 172px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.42rem 0.95rem;
    border-radius: 12px;
    font-size: 0.95rem;
    white-space: nowrap;
    line-height: 1.15;
    font-weight: 700;
}

.section-card-action-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.section-card-action-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem;
    max-height: 1rem;
    display: block;
    flex-shrink: 0;
}

.user-session-grid {
    display: grid;
    gap: 0.75rem;
}

.user-session-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.66);
    padding: 0.8rem 0.9rem;
}

.user-session-item strong {
    display: block;
    color: var(--text);
    line-height: 1.35;
    word-break: break-word;
}

.user-session-label {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.order-head-card .badge {
    background-color: var(--secondary-soft) !important;
    color: var(--primary) !important;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    font-weight: 700;
}

.order-detail-view .order-block-title,
.order-detail-card .order-block-title {
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text);
}

.order-detail-view .form-label,
.order-head-table th,
.order-items-table thead th {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
}

.order-detail-view .form-control,
.order-detail-view .form-select,
.order-head-table td,
.order-items-table tbody td {
    font-size: 1rem;
    font-weight: 500;
}

.order-head-table th {
    white-space: normal;
    width: 34%;
    vertical-align: top;
}

.order-head-table td {
    white-space: normal;
    word-break: break-word;
    width: 66%;
    vertical-align: top;
    line-height: 1.25;
}

.order-head-table {
    table-layout: fixed;
    --order-head-border: #d7dde3;
    --order-head-bg: #ffffff;
}

.order-head-table tr:last-child th,
.order-head-table tr:last-child td {
    border-bottom: 0;
}

.order-head-table th,
.order-head-table td {
    background-color: var(--order-head-bg);
    border-bottom-color: var(--order-head-border);
}

.input-group-text {
    border-color: var(--border);
    background-color: #f3f6fa;
    color: var(--muted);
    font-weight: 700;
}

.order-page-title {
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--text);
}

.order-list-page-title {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--primary);
    font-size: 1.78rem;
}

.order-list-page-title-icon {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--primary);
    background: var(--secondary-soft);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.order-list-page-title-icon svg {
    width: 1.15rem;
    height: 1.15rem;
}

.order-detail-page-title {
    font-size: 1.9rem;
}

.order-detail-actions form {
    margin: 0;
}

.order-detail-action-btn {
    width: 180px;
    min-height: 44px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-weight: 700;
    border-radius: 12px;
    padding-inline: 1rem;
    white-space: nowrap;
    line-height: 1.15;
}

.order-detail-action-btn-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.order-detail-action-btn-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem;
    max-height: 1rem;
    display: block;
    flex-shrink: 0;
}

.order-list-action-btn {
    min-width: 172px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-weight: 700;
    border-radius: 12px;
    padding-inline: 1rem;
    white-space: nowrap;
    line-height: 1.15;
}

.order-list-action-btn-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.order-list-action-btn-icon svg {
    width: 1rem !important;
    height: 1rem !important;
    min-width: 1rem;
    min-height: 1rem;
    max-width: 1rem;
    max-height: 1rem;
    display: block;
    flex-shrink: 0;
}

.order-title-container {
    max-width: 100%;
}

.order-detail-card {
    border: 1px solid var(--border) !important;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0)),
        var(--surface);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
}

.order-detail-card .card-body {
    padding: 1.25rem;
}

.order-section-heading {
    gap: 0.75rem;
}

.order-section-heading-icon {
    width: 2.15rem;
    height: 2.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--primary);
    background: var(--secondary-soft);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.order-section-heading-icon svg {
    width: 1.1rem;
    height: 1.1rem;
}

.ai-vector-why-btn {
    color: var(--muted);
    font-weight: 600;
    padding: 0;
}

.ai-vector-why-btn:hover,
.ai-vector-why-btn:focus {
    color: var(--primary);
}

.ai-chat-message-body p {
    margin: 0 0 0.35rem;
}

.ai-chat-message-body p:last-child {
    margin-bottom: 0;
}

.ai-chat-message-body ul,
.ai-chat-message-body ol {
    margin: 0.2rem 0 0.35rem 1.1rem;
    padding: 0;
}

.ai-chat-message-body li {
    margin-bottom: 0.2rem;
}

.ai-chat-message-body code {
    padding: 0.08rem 0.32rem;
    border-radius: 6px;
    background: color-mix(in srgb, var(--primary) 8%, #ffffff);
    color: var(--primary);
    font-size: 0.92em;
}

.ai-chat-message-body pre {
    margin: 0.25rem 0 0.45rem;
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 6%, #ffffff);
    border: 1px solid var(--border);
    overflow-x: auto;
}

.ai-chat-message-body pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}

.ai-chat-message-body blockquote {
    margin: 0.25rem 0 0.45rem;
    padding: 0.35rem 0.7rem;
    border-left: 3px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 5%, #ffffff);
    border-radius: 6px;
}

.ai-chat-table-wrap {
    margin: 0.35rem 0 0.45rem;
}

.ai-chat-table {
    margin-bottom: 0;
    font-size: 0.92rem;
}

.ai-chat-table th {
    background: color-mix(in srgb, var(--primary) 10%, #ffffff);
    white-space: nowrap;
}

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

.order-head-item {
    display: grid;
    gap: 0.28rem;
    min-height: 76px;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0)),
        var(--surface);
}

.order-head-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.01em;
}

.order-head-value {
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    word-break: break-word;
}

.order-head-item .form-control,
.order-head-item .form-select {
    margin-top: 0.2rem;
    min-height: 40px;
    font-size: 0.98rem;
}

.order-head-item .lookup-status {
    margin-top: 0.32rem;
    min-height: 1rem;
    font-size: 0.74rem;
    line-height: 1.2;
}

#order-header-edit-form .order-detail-action-btn {
    min-width: 220px;
}

.order-detail-pages-nav {
    gap: 0.45rem;
}

.order-detail-pages-nav .nav-link {
    width: 180px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.42rem;
    padding: 0.45rem 0.95rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    color: var(--primary);
    background: var(--surface);
    font-size: 0.96rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: nowrap;
}

.order-detail-pages-nav .nav-link.active,
.order-detail-pages-nav .show > .nav-link {
    color: #fff !important;
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

.order-detail-pages-nav .nav-link .order-tax-row-icon {
    width: 1rem;
    height: 1rem;
    color: currentColor;
}

.order-detail-pages-nav .nav-link .order-tax-row-icon svg {
    width: 0.92rem;
    height: 0.92rem;
}
.order-tax-card .order-block-title {
    font-size: 1.08rem;
}

.order-tax-title-icon,
.order-tax-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    color: var(--primary);
}

.order-tax-title-icon svg,
.order-tax-row-icon svg {
    width: 1rem;
    height: 1rem;
}

.order-tax-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.order-tax-table td,
.order-tax-table th {
    white-space: nowrap;
}
.order-head-value--numeric {
    text-align: right;
}

.order-items-table.table-striped {
    --bs-table-bg: var(--surface);
    --bs-table-striped-bg: var(--table-striped-bg);
    --bs-table-striped-color: var(--text);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
}

.order-items-check-col {
    width: 44px;
}

.order-bulk-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.order-items-bulk-btn {
    min-width: 176px;
    min-height: 40px;
    border-radius: 12px;
    padding: 0.42rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.order-item-row-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.order-item-row-actions form {
    margin: 0;
}

.order-items-action-btn {
    min-width: 94px;
    min-height: 38px;
    border-radius: 12px;
    padding: 0.38rem 0.78rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
#order-bulk-delete-count {
    white-space: nowrap;
}

.order-items-table thead th {
    border-bottom: 1px solid var(--border);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.58rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background-color: var(--secondary-soft);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.1;
}

.order-total-summary {
    margin-left: auto;
    width: min(100%, 420px);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    padding: 0.85rem 1rem;
    display: grid;
    gap: 0.35rem;
}

.order-total-summary > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
}

.order-total-summary span {
    color: var(--muted);
    font-weight: 600;
}

.order-total-summary strong {
    font-size: 1.02rem;
}

.lookup-status {
    min-height: 1.15rem;
}

@media (max-width: 767px) {
    .brand-wrap {
        padding: 1.25rem;
    }

    .nav-actions {
        width: 100%;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-action-btn {
        min-width: 0;
        flex: 1 1 calc(50% - 0.5rem);
    }

    .portal-badge {
        gap: 0.65rem;
    }

    .portal-badge-icon {
        width: 2.2rem;
        height: 2.2rem;
    }

    .portal-badge-icon svg {
        width: 1.55rem;
        height: 1.55rem;
    }

    .portal-badge-kicker {
        font-size: 0.78rem;
    }

    .portal-badge-title {
        font-size: 1.12rem;
    }

    .theme-toggle {
        margin-left: auto;
        flex: 0 0 auto;
    }

    .dashboard-hero-action-btn {
        width: 100%;
        min-width: 0;
    }

    .portal-toast {
        min-width: 0;
        width: calc(100vw - 2rem);
    }

    .portal-consent-banner {
        padding: 0 0 0.75rem;
    }

    .portal-consent-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.8rem;
        border-radius: 14px;
        padding: 0.95rem 1rem;
    }

    .portal-consent-btn {
        width: 100%;
    }

    .order-detail-action-btn {
        width: 100%;
        min-width: 0;
    }

    .order-bulk-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    #order-bulk-delete-count {
        align-self: flex-end;
    }

    .order-items-bulk-btn {
        width: 100%;
        min-width: 0;
        min-height: 42px;
    }

    .order-item-row-actions {
        flex-direction: column;
        align-items: stretch;
        min-width: 112px;
    }

    .order-item-row-actions .order-items-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 40px;
    }
    .order-head-grid {
        grid-template-columns: 1fr;
    }

    .order-list-action-btn {
        min-width: 0;
        width: 100%;
    }

    .section-card-footer,
    .user-session-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .section-card-action-btn {
        width: 100%;
        min-width: 0;
    }

}












