:root {
    --aui-purple: #6b5fa8;
    --aui-purple-dark: #51478d;
    --aui-teal: #18a999;
    --aui-blue: #247ba0;
    --aui-text: #1f2d3d;
    --aui-muted: #718096;
    --aui-bg: #f3f6fb;
    --aui-line: #d9e2ef;
    --aui-panel: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--aui-bg);
    color: var(--aui-text);
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 14px;
    letter-spacing: 0;
}

.aui-shell { min-height: 100vh; }

.aui-topbar {
    min-height: 76px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--aui-purple-dark), var(--aui-purple));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: 0 8px 24px rgba(31, 45, 61, .18);
}

.aui-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.aui-brand img {
    width: 142px;
    max-height: 48px;
    object-fit: contain;
    background: #fff;
    border-radius: 6px;
    padding: 5px 8px;
}

.aui-brand h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.aui-brand span {
    display: block;
    color: rgba(255,255,255,.78);
    font-size: 12px;
    font-weight: 600;
    margin-top: 3px;
}

.aui-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.aui-user-badge {
    display: inline-flex;
    align-items: center;
    min-height: 31px;
    padding: 0 10px;
    border-radius: 4px;
    background: rgba(255,255,255,.14);
    border: 1px solid rgba(255,255,255,.26);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

body.is-locked .aui-secured {
    filter: blur(1px);
    pointer-events: none;
    user-select: none;
}

.aui-lock-screen {
    display: none;
    position: fixed;
    inset: 76px 0 0 0;
    z-index: 1040;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(243,246,251,.78);
    backdrop-filter: blur(4px);
}

body.is-locked .aui-lock-screen {
    display: flex;
}

.aui-lock-card {
    width: min(430px, 100%);
    padding: 28px;
    border: 1px solid var(--aui-line);
    background: #fff;
    box-shadow: 0 18px 46px rgba(31,45,61,.18);
    text-align: center;
}

.aui-lock-card > i {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--aui-purple);
    font-size: 22px;
    margin-bottom: 12px;
}

.aui-lock-card h2 {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 800;
}

.aui-lock-card p {
    color: var(--aui-muted);
    margin: 0 0 18px;
}

.aui-main { padding: 24px 28px 44px; }

.aui-content-row {
    margin-left: 0;
    margin-right: 0;
}

.aui-content-row > [class^="col"],
.aui-content-row > [class*=" col"] {
    padding-left: 15px;
    padding-right: 15px;
}

.aui-hero {
    background: #fff;
    border-left: 4px solid var(--aui-teal);
    box-shadow: 0 6px 18px rgba(31,45,61,.08);
    padding: 20px 22px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.aui-hero h2 {
    margin: 0 0 6px;
    font-size: 25px;
    font-weight: 800;
}

.aui-hero p {
    margin: 0;
    color: var(--aui-muted);
}

.aui-hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
    gap: 10px;
}

.aui-hero-metrics div {
    background: #f7fafc;
    border: 1px solid var(--aui-line);
    padding: 10px 12px;
    border-radius: 6px;
    text-align: center;
}

.aui-hero-metrics strong {
    display: block;
    color: var(--aui-purple-dark);
    font-size: 15px;
}

.aui-hero-metrics span {
    color: var(--aui-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.aui-panel {
    background: var(--aui-panel);
    border: 1px solid var(--aui-line);
    box-shadow: 0 8px 22px rgba(31,45,61,.08);
    margin-bottom: 20px;
}

.aui-tabs {
    background: #f8fafc;
    border-bottom: 1px solid var(--aui-line);
    padding-left: 12px;
}

.aui-tabs .nav-link {
    border: 0;
    border-radius: 0;
    color: #405166;
    font-weight: 800;
    padding: 14px 18px;
}

.aui-tabs .nav-link.active {
    background: #fff;
    color: var(--aui-purple-dark);
    border-top: 3px solid var(--aui-teal);
}

.aui-tab-content { padding: 22px; }

.aui-form label {
    font-size: 12px;
    text-transform: uppercase;
    color: #55657a;
    font-weight: 800;
    margin-bottom: 7px;
}

.form-control {
    border-color: #cfd8e5;
    min-height: 40px;
    font-weight: 600;
}

.chosen-container { width: 100% !important; }
.chosen-container-single .chosen-single {
    min-height: 40px;
    line-height: 38px;
    border-color: #cfd8e5;
    border-radius: 4px;
    background: #fff;
    box-shadow: none;
    font-weight: 700;
}
.chosen-container-single .chosen-single div b { background-position-y: 10px; }
.chosen-container .chosen-results li.highlighted { background: var(--aui-purple); }

.chosen-container .chosen-results li .aui-sku-choice {
    align-items: center;
    display: flex;
    gap: 10px;
    min-height: 54px;
}

.aui-sku-choice-thumb {
    align-items: center;
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 4px;
    display: inline-flex;
    flex: 0 0 42px;
    height: 42px;
    justify-content: center;
    overflow: hidden;
    width: 42px;
}

.aui-sku-choice-thumb img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.aui-sku-choice-thumb i {
    color: #9aa8b8;
    font-size: 16px;
}

.aui-sku-choice-code {
    display: block;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

.aui-sku-choice-meta {
    color: #7b8794;
    display: block;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 2px;
}

.chosen-container .chosen-results li.highlighted .aui-sku-choice-meta {
    color: rgba(255,255,255,.78);
}

.aui-sku-preview {
    align-items: center;
    background: #f8fbff;
    border: 1px solid var(--aui-line);
    border-radius: 4px;
    display: flex;
    gap: 10px;
    margin-top: 9px;
    min-height: 76px;
    padding: 8px;
}

.aui-sku-preview-thumb {
    align-items: center;
    background: #fff;
    border: 1px solid #e5eaf1;
    border-radius: 4px;
    display: flex;
    flex: 0 0 58px;
    height: 58px;
    justify-content: center;
    overflow: hidden;
    width: 58px;
}

.aui-sku-preview-thumb img {
    display: none;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.aui-sku-preview-thumb i {
    color: #9aa8b8;
    font-size: 20px;
}

.aui-sku-preview-body {
    min-width: 0;
}

.aui-sku-preview-body strong {
    color: var(--aui-text);
    display: block;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
}

.aui-sku-preview-body span {
    color: var(--aui-muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    margin-top: 3px;
}

.aui-sku-preview:not(.is-empty) {
    background: #fff;
    border-color: #cfd8e5;
}

.aui-sku-preview:not(.is-empty) .aui-sku-preview-thumb img {
    display: block;
}

.aui-sku-preview:not(.is-empty) .aui-sku-preview-thumb i {
    display: none;
}

.aui-dropzone {
    border: 2px dashed #b9c9dc;
    background: #f8fbff;
    padding: 24px;
    text-align: center;
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.aui-dropzone.is-dragover {
    border-color: var(--aui-teal);
    background: #eefdf9;
    transform: translateY(-1px);
}

.aui-dropzone > i {
    display: block;
    font-size: 36px;
    color: var(--aui-blue);
    margin-bottom: 8px;
}

.aui-dropzone strong {
    display: block;
    font-size: 16px;
    font-weight: 800;
}

.aui-dropzone span {
    display: block;
    color: var(--aui-muted);
    margin: 4px 0 14px;
}

.aui-dropzone-compact {
    padding: 16px;
}

.aui-drop-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.aui-file-list {
    display: none;
    margin-top: 10px;
    border: 1px solid var(--aui-line);
    border-radius: 4px;
    max-height: 150px;
    overflow: auto;
}

.aui-file-list.is-visible { display: block; }

.aui-file-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 10px;
    border-bottom: 1px solid #edf2f7;
    font-size: 12px;
}

.aui-file-row:last-child { border-bottom: 0; }
.aui-file-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aui-file-row span:last-child { color: var(--aui-muted); font-weight: 700; }

.aui-submit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding-top: 4px;
}

.aui-customs-count {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #bdebdc;
    border-radius: 4px;
    background: #eafaf5;
    color: #146c5a;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.aui-customs-browser {
    border: 1px solid var(--aui-line);
    background: #fbfdff;
}

.aui-customs-empty {
    min-height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: var(--aui-muted);
    font-weight: 700;
    text-align: center;
    padding: 24px;
}

.aui-customs-empty i {
    font-size: 34px;
    color: var(--aui-blue);
}

.aui-customs-table {
    margin-bottom: 0;
    background: #fff;
}

.aui-customs-table thead th {
    border-top: 0;
    background: #f5f8fc;
    color: #405166;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 900;
}

.aui-customs-table td {
    vertical-align: middle;
    color: #2d3c4f;
    font-weight: 600;
}

.aui-custom-id {
    font-weight: 900;
    color: var(--aui-purple-dark);
}

.aui-custom-actions {
    display: inline-flex;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.aui-inline-editor {
    border: 1px solid var(--aui-line);
    background: #fff;
    margin-top: 14px;
    box-shadow: 0 8px 20px rgba(31,45,61,.08);
}

.aui-inline-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--aui-line);
}

.aui-inline-editor-header strong {
    display: block;
    color: var(--aui-text);
    font-size: 14px;
    font-weight: 900;
}

.aui-inline-editor-header span {
    display: block;
    color: var(--aui-muted);
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

.aui-inline-editor-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.aui-inline-editor iframe {
    width: 100%;
    height: min(840px, calc(100vh - 220px));
    min-height: 620px;
    border: 0;
    display: block;
    background: #fff;
}

.aui-summary {
    padding: 20px;
    position: sticky;
    top: 16px;
}

.aui-summary h3,
.aui-help h3 {
    margin: 0 0 16px;
    font-size: 17px;
    font-weight: 800;
}

.aui-summary label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 800;
    color: #55657a;
}

#shareMessage {
    resize: vertical;
    min-height: 160px;
    font-size: 13px;
    line-height: 1.45;
}

.aui-side-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.aui-status-box {
    border: 1px solid var(--aui-line);
    background: #f8fafc;
    color: #506176;
    padding: 11px 12px;
    border-radius: 4px;
    display: flex;
    gap: 9px;
    align-items: flex-start;
    font-weight: 700;
}

.aui-status-box.is-ok {
    background: #eafaf5;
    border-color: #bdebdc;
    color: #146c5a;
}

.aui-status-box.is-warn {
    background: #fff8e7;
    border-color: #ffe0a3;
    color: #845d12;
}

.aui-help {
    padding: 20px;
}

.aui-help ul {
    margin: 0;
    padding-left: 18px;
    color: var(--aui-muted);
}

.progress {
    height: 10px;
    border-radius: 20px;
    margin-top: 12px;
}

@media (max-width: 991px) {
    .aui-summary { position: static; }
    .aui-hero {
        display: block;
    }
    .aui-hero-metrics {
        margin-top: 16px;
    }
}

@media (max-width: 640px) {
    .aui-topbar {
        padding: 14px;
        align-items: flex-start;
        flex-direction: column;
    }
    .aui-lock-screen {
        inset: 137px 0 0 0;
        align-items: flex-start;
    }
    .aui-main {
        padding: 16px 12px 32px;
    }
    .aui-content-row > [class^="col"],
    .aui-content-row > [class*=" col"] {
        padding-left: 0;
        padding-right: 0;
    }
    .aui-brand img {
        width: 112px;
    }
    .aui-brand h1 {
        font-size: 19px;
    }
    .aui-hero {
        padding: 16px;
    }
    .aui-hero h2 {
        font-size: 20px;
    }
    .aui-hero-metrics {
        grid-template-columns: 1fr;
    }
    .aui-tabs {
        padding-left: 0;
    }
    .aui-tabs .nav-link {
        padding: 12px 10px;
        font-size: 12px;
    }
    .aui-tab-content {
        padding: 16px;
    }
    .aui-customs-table {
        min-width: 760px;
    }
    .aui-inline-editor-header {
        align-items: flex-start;
        flex-direction: column;
    }
    .aui-inline-editor-actions {
        width: 100%;
    }
    .aui-inline-editor iframe {
        height: 74vh;
        min-height: 520px;
    }
}
