:root {
    --commerce-brand: #0f766e;
    --commerce-brand-dark: #0b4f4a;
    --commerce-accent: #f59e0b;
    --commerce-surface: #f4f7f8;
}

body.admin-panel {
    font-family: "Figtree", "Segoe UI", sans-serif;
}

.app-sidebar .brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.app-sidebar .brand-link .brand-image {
    height: 40px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    border-radius: 0.4rem;
    background: #fff;
    padding: 0.2rem 0.35rem;
}

.auth-brand-logo {
    display: block;
    width: min(100%, 340px);
    height: auto;
    max-height: 96px;
    object-fit: contain;
    object-position: center;
}

.auth-card {
    overflow: hidden;
    border-radius: 1rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.75rem 1.5rem;
    background: #0a0a0a;
}

.kpi-card .kpi-label {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kpi-card .kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-card .kpi-delta {
    font-size: 0.8rem;
}

.table-toolbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    width: 100%;
}

.table-toolbar .filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.table-toolbar .filters > .form-control,
.table-toolbar .filters > input[type="search"],
.table-toolbar .filters > input[type="text"],
.card-body > form.d-flex:not(.flex-column) > .form-control,
.card-body > form.d-flex:not(.flex-column) > input[type="search"],
.card-body > form.d-flex:not(.flex-column) > input[type="text"] {
    flex: 1 1 220px;
    width: auto !important;
    min-width: 160px !important;
    max-width: 380px;
}

.table-toolbar .filters > .form-select,
.table-toolbar .filters > .btn,
.card-body > form.d-flex:not(.flex-column) > .form-select,
.card-body > form.d-flex:not(.flex-column) > .btn {
    flex: 0 0 auto;
    width: auto !important;
    white-space: nowrap;
}

.card-body > form.d-flex:not(.flex-column) {
    align-items: center;
    flex-wrap: nowrap !important;
}

@media (max-width: 767.98px) {
    .table-toolbar,
    .table-toolbar .filters,
    .card-body > form.d-flex:not(.flex-column) {
        flex-wrap: wrap !important;
    }
    .table-toolbar .filters > .form-control,
    .card-body > form.d-flex:not(.flex-column) > .form-control {
        max-width: none;
        flex-basis: 100%;
    }
}

.brand-logo-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--bs-border-color);
    background: #fff;
}

.dropzone-box {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    background: var(--bs-tertiary-bg);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone-box:hover,
.dropzone-box.is-dragover {
    border-color: var(--commerce-brand);
    background: color-mix(in srgb, var(--commerce-brand) 8%, white);
}

.page-empty {
    padding: 3rem 1rem;
    text-align: center;
}

.page-empty .empty-icon {
    font-size: 2.5rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.75rem;
}

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.18), transparent 40%),
        radial-gradient(circle at bottom right, rgba(245, 158, 11, 0.15), transparent 35%),
        linear-gradient(160deg, #0b1f1e 0%, #123433 45%, #0f766e 100%);
}

.auth-card-panel {
    max-width: 440px;
    width: 100%;
}

.nav-badge {
    font-size: 0.7rem;
}

.activity-item {
    border-left: 2px solid var(--bs-border-color);
    padding-left: 1rem;
    margin-left: 0.35rem;
    position: relative;
}

.activity-item::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--commerce-brand);
    position: absolute;
    left: -6px;
    top: 0.35rem;
}

.chart-box {
    min-height: 280px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active { background: #16a34a; }
.status-dot.inactive { background: #94a3b8; }

[data-bs-theme="dark"] .dropzone-box:hover,
[data-bs-theme="dark"] .dropzone-box.is-dragover {
    background: color-mix(in srgb, var(--commerce-brand) 20%, #1a1d20);
}

/* Full-screen POS: no sidebar / navbar chrome */
body.pos-mode.app-sidebar-open .app-main,
body.pos-mode .app-main {
    margin-left: 0 !important;
}

body.pos-mode .app-wrapper {
    min-height: 100vh;
}

body.pos-mode .app-content {
    padding-top: 0;
}

body.pos-mode .pos-side-col,
.pos-mode .pos-side-col,
.pos-side-col {
    width: 438px !important;
    max-width: 100% !important;
    flex: 0 0 438px !important;
}

body.pos-mode .pos-customer-payment,
body.pos-mode .pos-cart-panel,
body.pos-mode .pos-sales-channel,
.pos-customer-payment,
.pos-cart-panel,
.pos-sales-channel {
    width: 100% !important;
    max-width: 438px;
    padding: 0.55rem 0.65rem;
    box-sizing: border-box;
}

body.pos-mode .pos-customer-payment h4,
body.pos-mode .pos-cart-panel h4,
body.pos-mode .pos-sales-channel h4 {
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
}

body.pos-mode .pos-channel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}

body.pos-mode .pos-channel-option {
    margin: 0;
    cursor: pointer;
}

body.pos-mode .pos-channel-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.pos-mode .pos-channel-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: 100%;
    min-height: 2rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bs-body-bg);
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

body.pos-mode .pos-channel-option input:checked + span {
    border-color: var(--commerce-brand);
    background: color-mix(in srgb, var(--commerce-brand) 12%, transparent);
    color: var(--commerce-brand-dark);
}

body.pos-mode .pos-channel-option:hover span {
    border-color: var(--commerce-brand);
}

body.pos-mode .pos-customer-payment .pos-field {
    margin-bottom: 0.4rem;
}

body.pos-mode .pos-customer-payment .form-label {
    font-size: 0.72rem;
    margin-bottom: 0.1rem;
}

body.pos-mode .pos-customer-payment .form-control,
body.pos-mode .pos-customer-payment .form-select,
body.pos-mode .pos-cart-panel .form-control {
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
    min-height: calc(1.4em + 0.4rem);
}

body.pos-mode .pos-registered-search .form-label {
    font-size: 0.72rem;
    margin-bottom: 0.15rem;
}

body.pos-mode .pos-customer-results {
    position: absolute;
    z-index: 20;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.35rem;
    box-shadow: 0 0.35rem 0.75rem rgba(0, 0, 0, 0.08);
}

body.pos-mode .pos-customer-result {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
}

body.pos-mode .pos-customer-result:last-child {
    border-bottom: 0;
}

body.pos-mode .pos-customer-result:hover,
body.pos-mode .pos-customer-result:focus {
    background: color-mix(in srgb, var(--commerce-brand) 12%, transparent);
}

body.pos-mode .pos-customer-result .meta {
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
}

.app-footer .developed-by-codetral a,
.developed-by-codetral a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.wp-pager {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--bs-border-color);
}

.wp-pager__meta {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
}

.admin-compact-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
}

.admin-compact-pager .pagination {
    margin-bottom: 0;
}

.admin-compact-pager__jump {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-compact-pager__jump .form-select {
    width: auto;
    min-width: 4.5rem;
}

@media (min-width: 768px) {
    .wp-pager {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.email-template-designed-badge {
    display: none;
}

.email-template-card.is-designed .email-template-designed-badge {
    display: inline-block;
}

body.email-builder-open {
    overflow: hidden;
}

.email-builder-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    flex-direction: column;
    background: #1b1b1f;
    color: #f8fafc;
}

.email-builder-overlay.is-open {
    display: flex;
}

.email-builder-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #111215;
}

.email-builder-toolbar .btn-group .btn.active {
    background: var(--commerce-brand);
    border-color: var(--commerce-brand);
    color: #fff;
}

.email-builder-placeholders {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #16171b;
}

.email-builder-chip {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #22232a;
    color: #e5e7eb;
    border-radius: 999px;
    font-size: 0.75rem;
    padding: 0.2rem 0.65rem;
}

.email-builder-chip:hover {
    background: color-mix(in srgb, var(--commerce-brand) 35%, #22232a);
    border-color: var(--commerce-brand);
    color: #fff;
}

.email-builder-stage {
    position: relative;
    flex: 1;
    min-height: 0;
}

.email-builder-pane {
    position: absolute;
    inset: 0;
}

.email-builder-pane.is-hidden {
    visibility: hidden;
    pointer-events: none;
}

.email-builder-visual {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 260px;
    background: #111215;
}

.email-builder-palette,
.email-builder-inspector {
    padding: 1rem 0.85rem;
    overflow: auto;
    background: #16171b;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.email-builder-inspector {
    border-right: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.email-builder-palette-title,
.email-builder-inspector .fw-semibold {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 0.65rem;
}

.email-builder-palette-help {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.email-builder-block-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #22232a;
    color: #f3f4f6;
    border-radius: 0.45rem;
    padding: 0.5rem 0.7rem;
    font-size: 0.875rem;
}

.email-builder-block-btn:hover {
    border-color: var(--commerce-brand);
    background: color-mix(in srgb, var(--commerce-brand) 22%, #22232a);
}

.email-visual-frame {
    overflow: auto;
    padding: 1.25rem;
    background: #2a2b31;
}

.email-visual-card {
    min-height: 100%;
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    color: #111827;
    border-radius: 10px;
    padding: 1.5rem 1.25rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

.email-visual-empty {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 1.5rem;
}

.email-visual-block {
    position: relative;
    padding: 0.55rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
}

.email-visual-block + .email-visual-block {
    margin-top: 0.15rem;
}

.email-visual-block:hover,
.email-visual-block.is-drop-target {
    border-color: #99f6e4;
    background: #f0fdfa;
}

.email-visual-block.is-selected {
    border-color: var(--commerce-brand);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--commerce-brand) 25%, transparent);
}

.email-inspector-label {
    display: block;
    font-size: 0.75rem;
    color: #d1d5db;
    margin-bottom: 0.7rem;
}

.email-inspector-label .form-control,
.email-inspector-label .form-select {
    margin-top: 0.3rem;
}

.email-builder-html,
.email-builder-preview {
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 991.98px) {
    .email-builder-visual {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
}

.email-builder-html {
    resize: none;
    background: #0f1115;
    color: #e5e7eb;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
    padding: 1rem 1.15rem;
}

.email-builder-preview {
    background: #f3f4f6;
}

.email-builder-overlay .gjs-one-bg {
    background-color: #1b1b1f;
}

.email-builder-overlay .gjs-two-color {
    color: #e5e7eb;
}

[x-cloak] {
    display: none !important;
}

.support-page-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.support-desk-shell {
    display: grid;
    grid-template-columns: minmax(260px, 300px) 1fr;
    min-height: calc(100dvh - 230px);
    background: #fff;
    border: 1px solid var(--bs-border-color);
    border-radius: 1.1rem;
    overflow: hidden;
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.05);
}

.support-desk-shell.is-single {
    grid-template-columns: 1fr;
}

.support-desk-list {
    border-right: 1px solid var(--bs-border-color);
    background: #f8fafb;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.support-desk-thread {
    min-height: calc(100dvh - 230px);
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(180deg, #f8fafb 0%, #eef5f4 100%);
}

.support-thread-pane {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.support-desk-scroll {
    overflow: auto;
    flex: 1;
    min-height: 0;
    padding: 1.25rem 1.35rem;
}

.support-thread-item {
    cursor: pointer;
    border: 0;
    border-bottom: 1px solid var(--bs-border-color);
    background: transparent;
    text-align: left;
    width: 100%;
}

.support-thread-item:hover,
.support-thread-item.is-active {
    background: #fff;
}

.support-thread-item.is-active {
    box-shadow: inset 3px 0 0 var(--commerce-brand);
}

.support-desk-header {
    padding: 0.95rem 1.35rem;
    border-bottom: 1px solid var(--bs-border-color);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
}

.support-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    background: color-mix(in srgb, var(--commerce-brand) 14%, white);
    color: var(--commerce-brand-dark);
    flex-shrink: 0;
}

.support-avatar--sm {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}

.support-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    margin-bottom: 0.9rem;
    max-width: min(78%, 34rem);
}

.support-row.is-mine {
    margin-left: auto;
    justify-content: flex-end;
}

.support-bubble {
    min-width: 0;
    border-radius: 1.15rem 1.15rem 1.15rem 0.35rem;
    padding: 0.7rem 0.9rem 0.55rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    background: #fff;
}

.support-row.is-mine .support-bubble {
    border-radius: 1.15rem 1.15rem 0.35rem 1.15rem;
    background: linear-gradient(180deg, #12887e 0%, var(--commerce-brand) 100%);
    color: #fff;
}

.support-bubble p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.45;
}

.support-bubble small {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    margin-top: 0.4rem;
    font-size: 0.7rem;
    opacity: 0.72;
}

.support-row.is-theirs .support-bubble small {
    justify-content: flex-start;
}

.support-bubble__name {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    opacity: 0.92;
}

.support-photos {
    display: grid;
    gap: 0.4rem;
    margin: 0.15rem 0 0.35rem;
}

.support-photo {
    width: 148px;
    height: 148px;
    object-fit: cover;
    border-radius: 0.85rem;
    display: block;
}

.support-composer {
    border-top: 1px solid var(--bs-border-color);
    background: rgba(255, 255, 255, 0.94);
    padding: 0.85rem 1.1rem 1rem;
}

.support-composer-box {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: #f4f7f8;
    border: 1px solid transparent;
    border-radius: 1.4rem;
    padding: 0.4rem 0.45rem 0.4rem 0.55rem;
}

.support-composer-box:focus-within {
    background: #fff;
    border-color: color-mix(in srgb, var(--commerce-brand) 35%, white);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--commerce-brand) 12%, transparent);
}

.support-composer-box textarea {
    flex: 1;
    border: 0;
    background: transparent;
    box-shadow: none;
    resize: none;
    max-height: 140px;
    line-height: 1.4;
    padding: 0.45rem 0.2rem;
}

.support-composer-box textarea:focus {
    box-shadow: none;
}

.support-tool,
.support-send {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.support-tool {
    background: transparent;
    color: #64748b;
}

.support-tool:hover {
    background: #e8eef0;
    color: #0f172a;
}

.support-send {
    background: var(--commerce-brand);
    color: #fff;
}

.support-send:disabled {
    background: #cbd5e1;
    color: #fff;
}

.support-composer-hint {
    margin: 0.4rem 0 0 0.65rem;
    font-size: 0.72rem;
    color: var(--bs-secondary-color);
}

.support-choice {
    cursor: pointer;
    margin: 0;
}

.support-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.support-choice .card {
    height: 100%;
    border: 1px solid var(--bs-border-color);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.support-choice:hover .card {
    transform: translateY(-1px);
}

.support-choice input:checked + .card,
.support-choice:hover .card {
    border-color: var(--commerce-brand);
    box-shadow: 0 0 0 1px var(--commerce-brand);
}

.support-upload {
    border: 1px dashed #cbd5e1;
    border-radius: 1rem;
    padding: 1.25rem;
    background: #f8fafb;
    text-align: center;
}

.support-create-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--commerce-brand) 12%, white);
    color: var(--commerce-brand-dark);
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

@media (max-width: 767.98px) {
    .support-desk-shell,
    .support-desk-thread {
        grid-template-columns: 1fr;
        min-height: 520px;
    }

    .support-row {
        max-width: 88%;
    }

    .support-photo {
        width: 120px;
        height: 120px;
    }
}
