@font-face {
    font-family: 'BYekan';
    src: url('/static/fonts/BYekan.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'BYekan', 'IRANSans', Tahoma, sans-serif;
    background: #1a1d2e;
    min-height: 100vh;
    padding: 20px;
    color: #e8eaf0;
}

body:has(.app-sidebar) {
    padding-right: 292px;
}

body.modal-open {
    overflow: hidden;
}

body.modal-open .mobile-sidebar-toggle {
    opacity: 0;
    pointer-events: none;
}

body.route-loading .app-main {
    opacity: 0.62;
    pointer-events: none;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #252938;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    border: 1px solid #3a3f52;
}

h1 {
    color: #ffffff;
    margin-bottom: 30px;
    text-align: center;
    font-size: 2.5em;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 300;
}

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.toolbar-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.toolbar-middle {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-bottom {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}

.bulk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -12px 0 18px;
    padding: 12px;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    background: #202436;
}

.bulk-toolbar-info {
    display: grid;
    gap: 3px;
}

.bulk-toolbar-info small {
    color: #9ca3af;
}

.bulk-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bulk-toolbar select {
    min-width: 190px;
}

.btn {
    padding: 10px 20px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #3a3f52;
    color: #e8eaf0;
}

.btn:hover {
    background: #4a5068;
    border-color: #6a7288;
    color: #ffffff;
}

.app-main {
    transition: opacity 0.16s ease;
}

.app-sidebar {
    position: fixed;
    inset: 20px 20px 20px auto;
    z-index: 900;
    width: 248px;
    max-height: calc(100vh - 40px);
    background: #111827;
    border: 1px solid #2f3748;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.34);
    transition: width 0.2s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin-bottom: 14px;
    color: #fff;
    flex: 0 0 auto;
}

.sidebar-brand strong,
.sidebar-brand span {
    display: block;
}

.sidebar-brand span {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 3px;
}

.sidebar-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1f2937;
    color: #fff;
    cursor: pointer;
}

.mobile-sidebar-toggle,
.sidebar-backdrop {
    display: none;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-left: 2px;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #4b5563 transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 999px;
}

.sidebar-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 10px;
    background: transparent;
    color: #dbe4f0;
    text-decoration: none;
    cursor: pointer;
    text-align: right;
    font-size: 14px;
    position: relative;
}

.sidebar-link:hover {
    background: #1f2937;
    border-color: #374151;
    color: #fff;
}

.sidebar-link.is-active {
    background: #1d4ed8;
    border-color: #60a5fa;
    color: #fff;
}

.sidebar-group {
    display: grid;
    gap: 6px;
}

.sidebar-parent {
    margin-bottom: 0;
}

.sidebar-submenu {
    display: grid;
    gap: 4px;
    margin-right: 40px;
    padding: 2px 10px 6px 0;
    border-right: 1px solid #334155;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 7px;
    color: #aab8cc;
    text-decoration: none;
    font-size: 12px;
    line-height: 1.4;
}

.sidebar-sublink:hover {
    background: #1f2937;
    color: #fff;
}

.sidebar-sublink.is-active {
    background: #1d4ed8;
    color: #fff;
}

.sidebar-link.danger {
    color: #fecaca;
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: #253044;
    color: #e5e7eb;
    font-size: 15px;
}

.order-badge,
.order-count-inline {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.sidebar-link .order-badge {
    margin-right: auto;
    box-shadow: 0 0 0 2px #111827;
}

body.sidebar-collapsed .sidebar-link .order-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-size: 10px;
}

body.sidebar-collapsed {
    padding-right: 104px;
}

body.sidebar-collapsed .app-sidebar {
    width: 76px;
}

body.sidebar-collapsed .sidebar-brand div,
body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .sidebar-submenu {
    display: none;
}

.route-preloader {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
    pointer-events: none;
    background: rgba(17, 24, 39, 0.18);
}

body.route-loading .route-preloader {
    display: grid;
    place-items: center;
}

.route-preloader span {
    width: 42px;
    height: 42px;
    border: 4px solid #94a3b8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.btn.is-loading,
.btn:disabled {
    opacity: 0.72;
    cursor: wait;
}

.btn.is-loading::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    animation: spin 0.8s linear infinite;
}

.form-busy {
    pointer-events: none;
    opacity: 0.82;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-primary {
    background: #3a3f52;
    color: #ffffff;
    border-color: #5a6278;
}

.btn-primary:hover {
    background: #4a5068;
    border-color: #6a7288;
}

.btn-secondary {
    background: #2a2f42;
    color: #e8eaf0;
    border-color: #5a6278;
}

.btn-secondary:hover {
    background: #3a3f52;
    border-color: #6a7288;
}

.btn-edit {
    padding: 5px 15px;
    font-size: 12px;
    background: #3a3f52;
    color: #e8eaf0;
    border-color: #5a6278;
}

.btn-edit:hover {
    background: #4a5068;
    border-color: #6a7288;
}

.btn-delete {
    padding: 5px 15px;
    font-size: 12px;
    background: #2a2f42;
    color: #e8eaf0;
    border-color: #5a6278;
}

.btn-delete:hover {
    background: #4a3030;
    border-color: #8a5050;
    color: #ffb0b0;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-form input {
    padding: 10px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    width: 250px;
    background: #1a1d2e;
    color: #e8eaf0;
}

.search-form input::placeholder {
    color: #8a90a8;
}

.filters {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    flex: 1;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    text-decoration: none;
    color: #e8eaf0;
    transition: all 0.3s;
    font-size: 13px;
    background: #3a3f52;
    white-space: nowrap;
}

.filter-btn:hover, .filter-btn.active {
    background: #4a5068;
    border-color: #6a7288;
    color: #ffffff;
}

.sort {
    display: flex;
    gap: 10px;
    align-items: center;
    white-space: nowrap;
}

.sort select {
    padding: 8px 15px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    cursor: pointer;
    background: #1a1d2e;
    color: #e8eaf0;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.inventory-table th {
    background: #1a1d2e;
    color: #ffffff;
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #5a6278;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.inventory-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #3a3f52;
    text-align: right;
    color: #e8eaf0;
}

.inventory-table tr:hover {
    background: #3a3f52;
}

.inventory-table .select-column {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.inventory-table .select-column input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #38bdf8;
    cursor: pointer;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #5a6278;
}

.no-image {
    width: 60px;
    height: 60px;
    background: #1a1d2e;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 10px;
    color: #8a90a8;
    border: 1px solid #5a6278;
}

.status-toggle {
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
}

.status-available {
    color: #e8eaf0;
}

.status-unavailable {
    color: #8a90a8;
}

.status-toggle:hover {
    background: #3a3f52;
}

.links {
    font-size: 20px;
}

.links a {
    margin: 0 5px;
    text-decoration: none;
    transition: transform 0.2s;
    display: inline-block;
    color: #e8eaf0;
}

.links a:hover {
    transform: scale(1.2);
    color: #ffffff;
}

.product-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ffffff;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    font-size: 14px;
    background: #1a1d2e;
    color: #e8eaf0;
}

.form-group input:focus {
    outline: none;
    border-color: #6a7288;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid;
}

.alert-success {
    background: #2a3a2a;
    color: #e8eaf0;
    border-color: #5a6278;
}

.alert-error {
    background: #3a2a2a;
    color: #e8eaf0;
    border-color: #5a6278;
}

.no-products {
    text-align: center;
    padding: 40px;
    color: #8a90a8;
    font-size: 18px;
}

.settings-section {
    background: #252938;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #3a3f52;
}

.settings-section h2 {
    margin-top: 0;
    color: #ffffff;
    border-bottom: 1px solid #5a6278;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
}

.export-section, .import-section {
    margin: 20px 0;
}

.export-section h3, .import-section h3 {
    color: #ffffff;
    margin-bottom: 10px;
    font-weight: 500;
}

.export-section p, .import-section p {
    color: #e8eaf0;
    margin: 10px 0;
}

.note {
    background: #3a3f52;
    padding: 10px;
    border-radius: 4px;
    border-right: 2px solid #6a7288;
    font-size: 0.9em;
    color: #e8eaf0;
}

input[type="file"] {
    display: block;
    margin: 15px 0;
    padding: 10px;
    border: 1px dashed #5a6278;
    border-radius: 4px;
    width: 100%;
    background: #1a1d2e;
    color: #e8eaf0;
}

.field-hint {
    display: block;
    margin-top: 6px;
    color: #9aa3b8;
    font-size: 12px;
    line-height: 1.7;
}

.channel-meta,
.sell-product-name {
    display: block;
    margin-top: 6px;
    color: #9aa3b8;
    font-size: 12px;
    line-height: 1.7;
    word-break: break-word;
}

.label-with-help,
.title-with-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.title-with-help {
    margin: 0 0 8px;
}

.help-tooltip {
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 1px solid #4b5568;
    border-radius: 50%;
    background: #1f2937;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
    cursor: help;
}

.help-tooltip.status-tooltip {
    border-color: #64748b;
    background: #253044;
    color: #f8fafc;
}

.help-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 50%;
    bottom: calc(100% + 8px);
    z-index: 2200;
    width: max-content;
    max-width: min(320px, calc(100vw - 48px));
    padding: 9px 11px;
    border: 1px solid #4b5568;
    border-radius: 8px;
    background: #111827;
    color: #f8fafc;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    line-height: 1.8;
    font-size: 12px;
    font-weight: 400;
    text-align: right;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateX(50%) translateY(4px);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.help-tooltip:hover::after,
.help-tooltip:focus-visible::after {
    opacity: 1;
    transform: translateX(50%) translateY(0);
}

.ltr-text {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.file-drop {
    display: flex;
    min-height: 86px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    border: 1px dashed #64748b;
    border-radius: 8px;
    background: #111827;
    color: #e8eaf0;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.file-drop:hover,
.file-drop.is-dragging {
    border-color: #cbd5e1;
    background: #1f2937;
}

.file-drop input[type="file"] {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    opacity: 0;
    pointer-events: none;
}

.file-drop span {
    font-weight: 700;
}

.file-drop small {
    color: #9aa3b8;
    line-height: 1.6;
}

hr {
    border: none;
    border-top: 1px solid #3a3f52;
    margin: 30px 0;
}

.btn-success {
    background-color: #3a3f52;
    border-color: #5a6278;
}

.btn-success:hover {
    background-color: #4a5068;
    border-color: #6a7288;
}

.excel-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #252938;
    margin: 16px auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 32px);
    overflow: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    animation: slideDown 0.3s ease;
    border: 1px solid #5a6278;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #5a6278;
}

.modal-header h2 {
    color: #ffffff;
    font-size: 24px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
}

.close {
    color: #8a90a8;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close:hover {
    color: #ffffff;
}

.modal-body {
    margin-bottom: 20px;
    min-height: 0;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-sell {
    background: #3a3f52;
    color: #ffffff;
    padding: 5px 15px;
    font-size: 12px;
    border: 1px solid #5a6278;
}

.btn-sell:hover {
    background: #4a5068;
    border-color: #6a7288;
}

.sold-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #252938;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.sold-table thead {
    background: #1a1d2e;
    color: #ffffff;
}

.sold-table th,
.sold-table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #3a3f52;
}

.sold-table th {
    font-weight: 500;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sold-table td {
    color: #e8eaf0;
}

.sold-table tbody tr {
    transition: background-color 0.3s ease;
}

.sold-table tbody tr:hover {
    background-color: #3a3f52;
}

.sold-table img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #5a6278;
}

.sort-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sort-controls select {
    padding: 10px 15px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background: #1a1d2e;
    color: #e8eaf0;
}

.sort-controls select:focus {
    outline: none;
    border-color: #6a7288;
}

.status-sold {
    color: #e8eaf0;
    font-weight: 500;
}

.status-returned {
    color: #8a90a8;
    font-weight: 500;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }

    .sold-table {
        font-size: 14px;
    }

    .sold-table th,
    .sold-table td {
        padding: 10px;
    }
}

.btn-return {
    background: #3a3f52;
    color: #e8eaf0;
    padding: 5px 15px;
    font-size: 12px;
    border: 1px solid #5a6278;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-return:hover {
    background: #4a5068;
    border-color: #6a7288;
    color: #ffffff;
}
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #2a3150;
}

.page-header h1 {
    margin: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.settings-card {
    background: #1a1f3a;
    border: 1px solid #2a3150;
    border-radius: 8px;
    padding: 2rem;
}

.settings-card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 400;
    color: #7986cb;
    letter-spacing: 0.5px;
}

.excel-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.excel-actions form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.file-upload-wrapper {
    position: relative;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: block;
    padding: 0.75rem 1.5rem;
    background: #2a3150;
    border: 1px solid #4a5578;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #e0e0e0;
}

.file-label:hover {
    background: #4a5578;
    border-color: #7986cb;
}

@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .page-title-row,
    .category-layout,
    .form-grid-2 {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .page-title-row {
        align-items: stretch;
    }
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: #1a1d2e;
    border: 1px solid #5a6278;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
}

.summary-card:hover {
    border-color: #6a7288;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.summary-label {
    color: #8a90a8;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: 500;
}

.summary-value {
    color: #ffffff;
    font-size: 32px;
    font-weight: 300;
    letter-spacing: 1px;
}
/* استایل صفحه تنظیمات چاپ */
.product-selection {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #4a5578;
    border-radius: 4px;
    padding: 10px;
}

.products-list {
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: #2a3150;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.product-item {
    border-bottom: 1px solid #2a3150;
}

.product-item:last-child {
    border-bottom: none;
}

.btn-secondary {
    background: #4a5578;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-block;
    transition: background 0.3s;
}

.btn-secondary:hover {
    background: #7986cb;
}

.filter-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: #1a1d2e;
    border: 1px solid #5a6278;
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    padding: 8px;
    cursor: pointer;
    transition: background 0.2s;
    color: #e8eaf0;
}

.checkbox-label:hover {
    background: #2a2f42;
    border-radius: 4px;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.settings-card form {
    margin: 0;
}

.settings-card .btn {
    margin-top: 10px;
}

.page-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title-row h1 {
    margin-bottom: 8px;
    text-align: right;
}

.category-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.category-form,
.category-danger-zone,
.category-table-card {
    margin: 0 0 18px;
}

.category-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.category-form-head h2 {
    margin: 0;
}

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

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 14px;
    color: #e8eaf0;
    cursor: pointer;
}

.checkbox-row input {
    width: auto;
}

.compact {
    padding: 7px 12px;
    font-size: 12px;
}

.danger-zone-count {
    margin: 12px 0 16px;
    color: #e8eaf0;
}

.btn-danger-wide {
    width: 100%;
    text-align: center;
}

.category-table td[dir="ltr"] {
    text-align: left;
    direction: ltr;
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
}

.settings-card .form-actions {
    justify-content: flex-start;
}

.settings-card .form-actions .btn,
.settings-card .excel-actions .btn,
.settings-card #importExcelForm > .btn {
    width: auto;
    min-width: 180px;
}

.settings-card input {
    min-width: 0;
}


.main-header {
    background: #111827;
    border: 1px solid #2f3748;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    margin-bottom: 2rem;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header-title {
    color: white;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    text-align: center;
}

.header-nav {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.header-nav .btn {
    margin: 0;
}

button {
    font-family: inherit;
}

input,
select,
textarea {
    font-family: inherit;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    background: #111827;
    color: #e8eaf0;
    border: 1px solid #3f4a5f;
    border-radius: 8px;
}

input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
    color: #748097;
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.14);
}

.btn-info {
    background: #334155;
    border-color: #64748b;
}

.full-btn {
    width: 100%;
}

.compact {
    padding: 7px 10px;
    font-size: 12px;
}

.loading {
    padding: 32px;
    text-align: center;
    color: #cbd5e1;
}

.table-scroll {
    overflow-x: auto;
}

.text-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.text-links a {
    color: #cbd5e1;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid #4b5568;
    border-radius: 4px;
    padding: 4px 8px;
}

.text-links a:hover {
    color: #ffffff;
    border-color: #7c879d;
}

.market-channel-icons {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 132px;
}

.channel-link-row {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 1px solid #374151;
    border-radius: 999px;
    background: #1f2433;
    padding: 2px;
}

.channel-link-row a {
    border: 0;
    padding: 0;
}

.channel-link-row a:hover {
    transform: none;
    border-color: transparent;
}

.market-icon {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e5e7eb;
    text-decoration: none;
    overflow: hidden;
}

.market-icon.disabled {
    opacity: 0.5;
}

.market-icon img {
    display: block;
    max-width: 23px;
    max-height: 18px;
    object-fit: contain;
}

.market-site {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    border-color: transparent;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.market-digikala {
    background: #fff;
}

.market-snapp {
    background: #fff;
}

.market-tapsi {
    background: #fff;
}

.btn-sync {
    padding: 3px 8px;
    font-size: 12px;
    line-height: 1.4;
    background: #334155;
    border-color: #64748b;
    letter-spacing: 0;
    text-transform: none;
}

.btn-sync:hover {
    background: #475569;
    border-color: #94a3b8;
}

.market-sync-icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid #4b5563;
    border-radius: 999px;
    background: #111827;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
}

.market-sync-icon:hover {
    background: #2563eb;
    border-color: #60a5fa;
    color: #ffffff;
}

.market-sync-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: max-content;
    max-width: 180px;
    padding: 6px 9px;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 30;
}

.market-sync-icon:hover::after,
.market-sync-icon:focus-visible::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

.action-cell {
    min-width: 92px;
}

.compact-links {
    min-width: 108px;
}

.row-dropdown {
    position: relative;
    display: inline-block;
}

.row-dropdown summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 86px;
    padding: 6px 10px;
    border: 1px solid #4b5568;
    border-radius: 6px;
    background: #1f2937;
    color: #e5e7eb;
    font-size: 12px;
    cursor: pointer;
    list-style: none;
}

.row-dropdown summary::-webkit-details-marker {
    display: none;
}

.row-dropdown summary::after {
    content: "⌄";
    color: #94a3b8;
}

.row-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.row-dropdown-menu {
    display: grid;
    gap: 7px;
    min-width: 128px;
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.action-dropdown .row-dropdown-menu .btn {
    width: 100%;
    margin: 0;
    padding: 6px 10px;
    font-size: 12px;
    text-align: center;
}

.market-dropdown .row-dropdown-menu {
    min-width: 112px;
}

.status-toggle {
    border: 1px solid #5a6278;
    background: #2a2f42;
    color: #e8eaf0;
}

.modal-wide {
    width: calc(100vw - 32px);
    max-width: none;
    margin: 16px auto;
}

.product-modal-content {
    width: min(640px, calc(100vw - 24px));
    max-width: 640px;
    max-height: calc(100vh - 32px);
    overflow: auto;
}

.product-modal-content .product-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.product-modal-content .price-preview-grid,
.product-modal-content .channel-price-grid,
.product-modal-content .upload-inline {
    grid-template-columns: 1fr;
}

.modal-tall {
    height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-tall .modal-body {
    min-height: 0;
    flex: 1;
    overflow: auto;
}

.modal-close {
    background: transparent;
    border: 0;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.external-link-modal {
    padding-bottom: 18px;
}

.external-frame-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    overflow: hidden;
    background: #111827;
}

.external-frame-wrap iframe {
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 145px);
    border: 0;
    background: #fff;
}

.external-frame-hint {
    position: absolute;
    right: 14px;
    bottom: 14px;
    left: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(17, 24, 39, 0.92);
    color: #e5e7eb;
    font-size: 13px;
    display: none;
}

.external-frame-hint.show {
    display: block;
}

.product-form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
    max-width: none;
}

#productModalBody .product-form-grid {
    gap: 8px;
}

#productModalBody .product-form-grid .form-group {
    margin-bottom: 10px;
}

#productModalBody .product-form-grid .form-group label {
    margin-bottom: 3px;
}

.product-form .errorlist {
    color: #fecaca;
    list-style: none;
    margin-top: 6px;
    font-size: 12px;
}

.form-span {
    grid-column: 1 / -1;
}

.image-select-panel {
    border: 1px solid #4b5568;
    background: #1f2433;
    border-radius: 8px;
    padding: 16px;
}

.image-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.image-select-header h3 {
    margin: 0;
    color: #fff;
}

.selected-image-preview {
    min-height: 92px;
    border: 1px dashed #5a6278;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #a8afc4;
}

.selected-image-preview-grid {
    align-items: stretch;
    flex-wrap: wrap;
}

.selected-image-preview img {
    width: 84px;
    height: 84px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #5a6278;
}

.selected-image-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 8px;
    background: #111827;
}

.selected-image-pill small {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-picker-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-start;
}

.upload-inline {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 16px;
    margin-top: 14px;
}

.price-preview-panel {
    border: 1px solid #4b5568;
    background: #111827;
    border-radius: 8px;
    padding: 16px;
}

.price-preview-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.price-preview-header h3,
.snappshop-settings h3,
.channel-settings-card h3 {
    margin: 0 0 8px;
    color: #fff;
}

.price-source {
    min-width: 180px;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #1f2937;
}

.price-source span,
.price-box span,
.channel-price span,
.price-table-grid span,
.price-mini span {
    color: #a8afc4;
}

.price-source strong,
.price-box strong,
.channel-price strong {
    display: block;
    margin-top: 4px;
    color: #fff;
}

.price-preview-grid,
.channel-price-grid,
.settings-row,
.settings-inline-fields,
.snappshop-settings-grid {
    display: grid;
    gap: 12px;
}

.price-preview-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.channel-price-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    margin-top: 12px;
}

.price-box,
.channel-price,
.channel-settings-card {
    border: 1px solid #374151;
    border-radius: 8px;
    background: #1a1d2e;
    padding: 12px;
}

.channel-price small {
    display: block;
    margin-top: 5px;
    color: #9aa3b8;
}

.price-table-grid,
.price-mini {
    display: grid;
    gap: 4px;
    min-width: 170px;
    font-size: 12px;
    line-height: 1.7;
}

.price-dropdown {
    min-width: 158px;
}

.price-dropdown summary {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #4b5568;
    border-radius: 6px;
    background: #1f2937;
    color: #e5e7eb;
    cursor: pointer;
    font-size: 12px;
    list-style: none;
}

.price-dropdown summary::-webkit-details-marker {
    display: none;
}

.price-dropdown summary::after {
    content: "⌄";
    color: #94a3b8;
}

.price-dropdown[open] summary::after {
    transform: rotate(180deg);
}

.price-dropdown .price-table-grid {
    margin-top: 8px;
    padding: 10px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
}

.settings-grid-wide {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
}

.settings-row {
    grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px);
    align-items: end;
}

.settings-price-row {
    grid-template-columns: minmax(230px, 1fr) minmax(180px, 220px) auto;
    align-items: start;
}

.settings-action-slot {
    display: flex;
    align-items: end;
    height: 100%;
}

.settings-action-slot .btn,
.settings-row .btn {
    width: auto;
    margin-top: 26px;
    white-space: nowrap;
}

.channel-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.settings-inline-fields,
.snappshop-settings-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.snappshop-settings {
    margin-top: 20px;
    border-top: 1px solid #374151;
    padding-top: 18px;
}

.digikala-rsa-panel {
    margin-top: 18px;
    display: grid;
    gap: 10px;
}

.rsa-public-key {
    min-height: 170px;
    width: 100%;
    resize: vertical;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.55;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
    color: #e5e7eb;
    padding: 12px;
}

.rsa-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.settings-grid,
.settings-grid-wide,
.settings-row,
.settings-price-row,
.channel-settings-grid,
.settings-inline-fields,
.snappshop-settings-grid {
    min-width: 0;
}

.settings-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

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

.settings-card {
    min-width: 0;
    padding: clamp(16px, 2vw, 24px);
    overflow: hidden;
}

.settings-card .form-group,
.settings-card label,
.settings-card input,
.settings-card select,
.settings-card textarea,
.settings-card .file-drop,
.channel-settings-card {
    min-width: 0;
    max-width: 100%;
}

.settings-card input,
.settings-card select,
.settings-card textarea {
    width: 100%;
}

.settings-price-row,
.settings-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.settings-action-slot {
    height: auto;
}

.settings-action-slot .btn,
.settings-row .btn {
    width: 100%;
    margin-top: 0;
    white-space: normal;
}

.channel-settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.settings-inline-fields,
.snappshop-settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.toast {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 3000;
    min-width: 240px;
    max-width: min(420px, calc(100vw - 40px));
    background: #253044;
    border: 1px solid #64748b;
    color: #fff;
    border-radius: 8px;
    padding: 12px 16px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    border-color: #ef4444;
    background: #3a2028;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 20px;
}

.login-card {
    width: min(440px, 100%);
    background: #252938;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    padding: 28px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.login-card h1 {
    font-size: 28px;
    letter-spacing: 0;
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card,
.card {
    background: #1a1d2e;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

.stat-card h3,
.card h2 {
    margin: 0 0 12px;
    color: #cbd5e1;
    font-size: 15px;
    font-weight: 500;
}

.stat-value {
    color: #fff;
    font-size: 25px;
}

.profit {
    border-color: #16a34a;
}

.loss {
    border-color: #dc2626;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
}

.badge-success {
    background: #143523;
    color: #bbf7d0;
}

.badge-danger {
    background: #3b1820;
    color: #fecaca;
}

.gallery-page {
    max-width: 1180px;
}

.gallery-shell {
    display: grid;
    grid-template-columns: 210px minmax(320px, 1fr) 230px;
    gap: 16px;
    min-height: 620px;
}

.modal .gallery-shell {
    height: calc(100vh - 150px);
    min-height: 0;
}

.gallery-sidebar,
.gallery-main,
.gallery-preview {
    min-height: 0;
    background: #1a1d2e;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    padding: 14px;
}

.gallery-sidebar,
.gallery-preview {
    overflow: auto;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
}

.gallery-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.gallery-sidebar-header,
.gallery-toolbar,
.gallery-actions,
.preview-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.gallery-sidebar h2,
.gallery-preview h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 18px;
}

.folder-tree {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.folder-row {
    width: 100%;
    text-align: right;
    background: transparent;
    color: #dbe4f0;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 10px;
    cursor: pointer;
}

.folder-row:hover,
.folder-row.active {
    background: #2a2f42;
    border-color: #5a6278;
}

.gallery-toolbar {
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    z-index: 4;
    background: #1a1d2e;
    padding-bottom: 10px;
}

.gallery-actions {
    justify-content: flex-end;
}

.gallery-upload {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(180px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
    border: 1px dashed #4b5568;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    position: sticky;
    top: 58px;
    z-index: 3;
    background: #1a1d2e;
}

.gallery-upload-file .file-drop {
    min-height: 76px;
}

.gallery-help {
    color: #a8afc4;
    font-size: 12px;
    margin-bottom: 10px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
    overflow: auto;
    padding-left: 4px;
}

.gallery-card {
    background: #252938;
    border: 1px solid #3a3f52;
    border-radius: 8px;
    color: #e8eaf0;
    padding: 8px;
    text-align: right;
    cursor: pointer;
    min-width: 0;
}

.gallery-card:hover,
.gallery-card.selected {
    border-color: #93a4c4;
    background: #30364a;
}

.gallery-thumb {
    display: block;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: #111827;
    margin-bottom: 8px;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-name,
.gallery-meta {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gallery-meta {
    color: #9aa3b8;
    font-size: 12px;
    margin-top: 4px;
    direction: ltr;
    text-align: right;
}

.gallery-empty {
    text-align: center;
    color: #9aa3b8;
    padding: 40px;
}

.preview-box {
    min-height: 220px;
    border: 1px dashed #4b5568;
    border-radius: 8px;
    padding: 12px;
    color: #a8afc4;
    display: flex;
    flex-direction: column;
    gap: 10px;
    word-break: break-word;
}

.preview-box img {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 6px;
    background: #111827;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.preview-grid span {
    min-width: 0;
}

.preview-grid img {
    height: 90px;
    object-fit: cover;
}

.preview-grid small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-actions {
    margin-top: 12px;
    justify-content: flex-start;
}

.gallery-choose-under-preview {
    margin-top: 12px;
}

@media (max-width: 1100px) {
    .product-form-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .price-preview-grid,
    .channel-price-grid,
    .settings-grid-wide,
    .channel-settings-grid {
        grid-template-columns: repeat(2, minmax(160px, 1fr));
    }

    .gallery-shell {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .gallery-preview {
        grid-column: 1 / -1;
        position: static;
        max-height: none;
    }
}

@media (max-width: 760px) {
    body {
        padding: 10px;
    }

    body:has(.app-sidebar),
    body.sidebar-collapsed {
        padding-right: 10px;
        padding-bottom: 86px;
    }

    .app-sidebar,
    body.sidebar-collapsed .app-sidebar {
        inset: auto 10px 10px 10px;
        width: auto;
        border-radius: 12px;
        padding: 8px;
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 6px;
    }

    .sidebar-link {
        width: auto;
        min-width: 58px;
        justify-content: center;
        padding: 8px;
    }

    .sidebar-link .nav-text {
        display: none;
    }

    .sidebar-link .order-badge {
        position: absolute;
        top: 2px;
        left: 2px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        font-size: 10px;
        margin-right: 0;
    }

    .container {
        padding: 16px;
    }

    .product-form-grid,
    .upload-inline,
    .price-preview-grid,
    .channel-price-grid,
    .settings-row,
    .settings-inline-fields,
    .snappshop-settings-grid,
    .settings-grid-wide,
    .channel-settings-grid,
    .gallery-upload,
    .gallery-shell {
        grid-template-columns: 1fr;
    }

    .modal-wide {
        width: calc(100vw - 12px);
        margin: 6px auto;
        padding: 14px;
    }

    .product-modal-content {
        width: calc(100vw - 12px);
        max-width: none;
        margin: 6px auto;
        padding: 14px;
    }

    .product-modal-content .product-form-grid {
        grid-template-columns: 1fr;
    }

    .modal .gallery-shell {
        height: auto;
    }

    .gallery-sidebar,
    .gallery-preview,
    .gallery-toolbar,
    .gallery-upload {
        position: static;
        max-height: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        max-height: 55vh;
    }
}

/* 2026 normal edition: professional shell */
body.normal-app-shell {
    --pro-bg: #070b16;
    --pro-bg-soft: #0d1526;
    --pro-panel: rgba(15, 23, 42, .82);
    --pro-panel-strong: #111a2d;
    --pro-border: rgba(148, 163, 184, .17);
    --pro-border-strong: rgba(56, 189, 248, .34);
    --pro-text: #e7eefb;
    --pro-muted: #93a4bc;
    --pro-primary: #38bdf8;
    --pro-secondary: #14b8a6;
    --pro-danger: #fb7185;
    --pro-shadow: 0 24px 70px rgba(0, 0, 0, .3);
    min-height: 100vh;
    padding: 0;
    color: var(--pro-text);
    background:
        radial-gradient(circle at 12% 8%, rgba(56, 189, 248, .16), transparent 27%),
        radial-gradient(circle at 88% 7%, rgba(20, 184, 166, .12), transparent 24%),
        linear-gradient(135deg, var(--pro-bg), #0b1020 48%, #070a13);
    font-size: 13px;
    line-height: 1.7;
}

body.normal-app-shell:has(.app-sidebar) { padding-right: 232px; }
body.normal-app-shell.sidebar-collapsed:has(.app-sidebar) { padding-right: 74px; }
body.normal-app-shell .app-main { padding: 16px 16px 28px; }
body.normal-app-shell .app-main .container {
    width: min(100%, 1400px);
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    color: var(--pro-text);
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

body.normal-app-shell .app-sidebar {
    inset: 12px 12px 12px auto;
    width: 216px;
    height: auto;
    max-height: none;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid var(--pro-border);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(15, 23, 42, .94), rgba(7, 12, 24, .9));
    box-shadow: var(--pro-shadow);
    backdrop-filter: blur(18px);
}
body.normal-app-shell.sidebar-collapsed .app-sidebar { width: 58px; }
body.normal-app-shell .sidebar-brand {
    gap: 9px;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid rgba(56, 189, 248, .14);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(56, 189, 248, .1), rgba(20, 184, 166, .05));
}
body.normal-app-shell .sidebar-brand strong { color: var(--pro-text); font-size: 12px; font-weight: 900; }
body.normal-app-shell .sidebar-brand span { color: var(--pro-muted); font-size: 10.5px; }
body.normal-app-shell .sidebar-toggle {
    width: 30px;
    height: 30px;
    color: var(--pro-text);
    background: rgba(148, 163, 184, .08);
    border: 1px solid var(--pro-border);
    border-radius: 10px;
}
body.normal-app-shell .sidebar-nav { gap: 5px; }
body.normal-app-shell .sidebar-link,
body.normal-app-shell .sidebar-sublink {
    min-height: 36px;
    padding: 7px 8px;
    color: var(--pro-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 13px;
    font-size: 12px;
}
body.normal-app-shell .sidebar-link:hover,
body.normal-app-shell .sidebar-link.is-active,
body.normal-app-shell .sidebar-sublink:hover,
body.normal-app-shell .sidebar-sublink.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(56, 189, 248, .17), rgba(20, 184, 166, .12));
    border-color: var(--pro-border-strong);
}
body.normal-app-shell .sidebar-link.danger { color: #fecdd3; }
body.normal-app-shell .nav-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    color: var(--pro-primary);
    background: rgba(255,255,255,.055);
    border-radius: 10px;
    font-size: 10px;
    font-weight: 900;
}

body.normal-app-shell h1,
body.normal-app-shell h2,
body.normal-app-shell h3,
body.normal-app-shell h4,
body.normal-app-shell strong,
body.normal-app-shell label { color: var(--pro-text); }
body.normal-app-shell h1 {
    margin: 0 0 14px;
    text-align: right;
    text-transform: none;
    letter-spacing: 0;
    font-size: 24px;
    font-weight: 900;
}
body.normal-app-shell .card,
body.normal-app-shell .settings-card,
body.normal-app-shell .toolbar,
body.normal-app-shell .bulk-toolbar,
body.normal-app-shell .summary-card,
body.normal-app-shell .stat-card,
body.normal-app-shell .chat-people,
body.normal-app-shell .chat-panel {
    color: var(--pro-text);
    background: var(--pro-panel);
    border: 1px solid var(--pro-border);
    border-radius: 18px;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .18);
    backdrop-filter: blur(14px);
}
body.normal-app-shell [data-page="inventory"] .summary-card {
    color: var(--pro-text);
    background: linear-gradient(145deg, rgba(15, 23, 42, .9), rgba(17, 34, 57, .78));
    border-color: var(--pro-border);
    border-radius: 18px;
}
body.normal-app-shell [data-page="inventory"] .summary-label,
body.normal-app-shell .muted,
body.normal-app-shell small { color: var(--pro-muted); }
body.normal-app-shell [data-page="inventory"] .summary-value { color: #fff; }
body.normal-app-shell [data-page="inventory"] .inventory-command-center {
    padding: 12px;
    background: rgba(15, 23, 42, .75);
    border-color: var(--pro-border);
    box-shadow: var(--pro-shadow);
}

body.normal-app-shell .btn {
    min-height: 36px;
    padding: 7px 12px;
    color: var(--pro-text);
    background: rgba(148, 163, 184, .08);
    border: 1px solid var(--pro-border);
    border-radius: 11px;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: none;
}
body.normal-app-shell .btn:hover { transform: translateY(-1px); border-color: var(--pro-border-strong); background: rgba(56, 189, 248, .12); }
body.normal-app-shell .btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
    border-color: rgba(56, 189, 248, .45);
}
body.normal-app-shell .btn-secondary { color: var(--pro-text); background: rgba(148, 163, 184, .09); }
body.normal-app-shell .btn-danger,
body.normal-app-shell .btn-delete { color: #fecdd3; background: rgba(251, 113, 133, .12); border-color: rgba(251, 113, 133, .3); }

body.normal-app-shell input:not([type="checkbox"]):not([type="radio"]),
body.normal-app-shell select,
body.normal-app-shell textarea {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    color: var(--pro-text);
    background-color: rgba(2, 6, 23, .38);
    border: 1px solid var(--pro-border);
    border-radius: 12px;
    outline: 0;
}
body.normal-app-shell input:focus,
body.normal-app-shell select:focus,
body.normal-app-shell textarea:focus {
    border-color: var(--pro-primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .12);
}
body.normal-app-shell input::placeholder,
body.normal-app-shell textarea::placeholder { color: #73839b; }
body.normal-app-shell select { color-scheme: dark; }

body.normal-app-shell [data-page="inventory"] .search-form input,
body.normal-app-shell [data-page="inventory"] .sort select,
body.normal-app-shell [data-page="inventory"] .bulk-toolbar select {
    color: var(--pro-text);
    background-color: rgba(2, 6, 23, .42);
    border-color: var(--pro-border);
}
body.normal-app-shell [data-page="inventory"] .filter-btn {
    min-height: 32px;
    padding: 6px 10px;
    color: var(--pro-muted);
    background: rgba(148, 163, 184, .08);
    border-color: var(--pro-border);
    border-radius: 999px;
}
body.normal-app-shell [data-page="inventory"] .filter-btn:hover,
body.normal-app-shell [data-page="inventory"] .filter-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #14b8a6);
    border-color: transparent;
}
body.normal-app-shell [data-page="inventory"] .filters > label,
body.normal-app-shell [data-page="inventory"] .sort,
body.normal-app-shell [data-page="inventory"] .bulk-toolbar-info small { color: var(--pro-muted); }

body.normal-app-shell .table-scroll {
    overflow: auto;
    background: var(--pro-panel);
    border: 1px solid var(--pro-border);
    border-radius: 18px;
    box-shadow: var(--pro-shadow);
}
body.normal-app-shell .inventory-table,
body.normal-app-shell .app-main .inventory-table,
body.normal-app-shell .app-main .inventory-table tbody tr,
body.normal-app-shell .app-main .inventory-table tbody tr:nth-child(even) { color: var(--pro-text); background: transparent; }
body.normal-app-shell .inventory-table thead th,
body.normal-app-shell .app-main .inventory-table thead th {
    color: #a8b7cb;
    background: #101a2d;
    border-color: var(--pro-border);
    font-size: 11px;
}
body.normal-app-shell .app-main .inventory-table tbody td { color: var(--pro-text); border-color: var(--pro-border); }
body.normal-app-shell .app-main .inventory-table tbody tr:nth-child(even) { background: rgba(148, 163, 184, .025); }
body.normal-app-shell .app-main .inventory-table tbody tr:hover { background: rgba(56, 189, 248, .07); }
body.normal-app-shell .stock-cell { color: #99f6e4; background: rgba(20, 184, 166, .13); }

body.normal-app-shell .icon-btn,
body.normal-app-shell .icon-action {
    color: var(--pro-text);
    background: rgba(2, 6, 23, .68) !important;
    border-color: var(--pro-border) !important;
}
body.normal-app-shell .price-popover-panel,
body.normal-app-shell .help-tooltip::after {
    color: var(--pro-text) !important;
    background: #0b1221 !important;
    border-color: var(--pro-border-strong) !important;
}

body.normal-app-shell .modal {
    padding: 12px;
    background: rgba(1, 5, 13, .76);
    backdrop-filter: blur(10px);
}
body.normal-app-shell .modal-content,
body.normal-app-shell .product-modal-content {
    width: min(900px, calc(100vw - 24px));
    max-width: 900px;
    max-height: calc(100dvh - 24px);
    color: var(--pro-text);
    background: var(--pro-panel-strong);
    border: 1px solid var(--pro-border-strong);
    border-radius: 24px;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .48);
    overflow: hidden;
}
body.normal-app-shell .product-modal-content { height: min(900px, calc(100dvh - 24px)); display: flex; flex-direction: column; }
body.normal-app-shell .modal-header {
    flex: 0 0 auto;
    min-height: 58px;
    padding: 12px 16px;
    color: var(--pro-text);
    background: rgba(255, 255, 255, .025);
    border-bottom: 1px solid var(--pro-border);
}
body.normal-app-shell .modal-header h2 { color: var(--pro-text); }
body.normal-app-shell .modal-close {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    color: var(--pro-text);
    background: rgba(255,255,255,.06);
    border: 1px solid var(--pro-border);
    border-radius: 12px;
}
body.normal-app-shell #productModalBody {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: hidden;
}
body.normal-app-shell .product-modal-form {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
body.normal-app-shell .product-form-scroll {
    flex: 1 1 auto;
    min-height: 0;
    padding: 14px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #334155 transparent;
}
body.normal-app-shell .modal .product-form input,
body.normal-app-shell .modal .product-form select,
body.normal-app-shell .modal .product-form textarea {
    color: var(--pro-text);
    background: rgba(2, 6, 23, .34);
    border-color: var(--pro-border);
}
body.normal-app-shell .modal .product-form label,
body.normal-app-shell .modal .product-form h3,
body.normal-app-shell .modal .product-form .title-with-help { color: var(--pro-text); }
body.normal-app-shell .modal .variant-panel,
body.normal-app-shell .modal .price-preview-panel,
body.normal-app-shell .modal .image-select-panel {
    color: var(--pro-text);
    background: rgba(2, 6, 23, .22);
    border-color: var(--pro-border);
    border-radius: 16px;
}
body.normal-app-shell .modal .variant-row,
body.normal-app-shell .modal .price-box,
body.normal-app-shell .modal .channel-price,
body.normal-app-shell .modal .upload-inline,
body.normal-app-shell .modal .file-drop {
    color: var(--pro-text);
    background: rgba(15, 23, 42, .62);
    border-color: var(--pro-border);
}
body.normal-app-shell .modal .price-box span,
body.normal-app-shell .modal .channel-price span,
body.normal-app-shell .modal .channel-price small { color: var(--pro-muted); }
body.normal-app-shell .product-modal-form > .modal-form-actions {
    position: static;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(130px, .7fr);
    gap: 10px;
    margin: 0;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(17, 26, 45, .96), #0d1526);
    border-top: 1px solid var(--pro-border);
    box-shadow: 0 -14px 35px rgba(0,0,0,.18);
}
body.normal-app-shell .product-modal-form > .modal-form-actions .btn { width: 100%; min-height: 46px; }

body.normal-app-shell .settings-section-nav,
body.normal-app-shell .settings-form-modern {
    color: var(--pro-text);
    background: var(--pro-panel);
    border-color: var(--pro-border);
}
body.normal-app-shell .settings-section-nav a { color: var(--pro-muted); }
body.normal-app-shell .settings-section-nav a:hover,
body.normal-app-shell .settings-section-nav a.is-active { color: #fff; background: linear-gradient(135deg, #0ea5e9, #14b8a6); }
body.normal-app-shell .settings-form-modern input,
body.normal-app-shell .settings-form-modern select,
body.normal-app-shell .settings-form-modern textarea { color: var(--pro-text) !important; background: rgba(2,6,23,.35) !important; border-color: var(--pro-border) !important; }
body.normal-app-shell .settings-form-modern label,
body.normal-app-shell .settings-form-modern h2,
body.normal-app-shell .settings-form-modern h3 { color: var(--pro-text) !important; }

@media (max-width: 760px) {
    body.normal-app-shell:has(.app-sidebar),
    body.normal-app-shell.sidebar-collapsed:has(.app-sidebar) { padding-right: 0; }
    body.normal-app-shell .app-main { padding: 0; }
    body.normal-app-shell .app-sidebar,
    body.normal-app-shell.sidebar-collapsed .app-sidebar {
        inset: 0 0 0 auto;
        width: min(86vw, 330px);
        height: 100dvh;
        border-radius: 20px 0 0 20px;
        transform: translateX(110%);
    }
    body.normal-app-shell.sidebar-mobile-open .app-sidebar,
    body.normal-app-shell.sidebar-mobile-open.sidebar-collapsed .app-sidebar { transform: translateX(0); }
    body.normal-app-shell .modal { padding: 0; }
    body.normal-app-shell .modal-content,
    body.normal-app-shell .product-modal-content {
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
    }
    body.normal-app-shell .product-form-scroll { padding: 10px 12px; }
    body.normal-app-shell .product-modal-form > .modal-form-actions {
        grid-template-columns: minmax(0, 1.7fr) minmax(105px, .8fr);
        padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    }
}

.variant-panel {
    border: 1px solid #3a3f52;
    border-radius: 8px;
    padding: 14px;
    background: #1f2433;
}

.variant-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.variant-panel-header h3 {
    margin: 0 0 4px;
    color: #fff;
}

.variant-list {
    display: grid;
    gap: 10px;
}

.variant-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(90px, 1fr) minmax(80px, 0.8fr) auto;
    gap: 10px;
    align-items: end;
    padding: 10px;
    border: 1px solid #374151;
    border-radius: 8px;
    background: #111827;
}

.variant-row .form-group {
    margin-bottom: 0;
}

.variant-mini {
    display: grid;
    gap: 4px;
    min-width: 130px;
}

.variant-mini small,
.order-item-list span {
    color: #9aa3b8;
    font-size: 12px;
}

.order-item-list {
    display: grid;
    gap: 4px;
}

.compact-table td,
.compact-table th {
    padding: 9px 10px;
}

.btn.compact {
    padding: 7px 10px;
    font-size: 12px;
}

@media (max-width: 760px) {
    .variant-row {
        grid-template-columns: 1fr;
    }
}

/* Final layout guards: keep settings and product rows compact even when older rules exist above. */
[data-page="settings"].container {
    max-width: 1120px;
}

[data-page="settings"] .settings-grid,
[data-page="settings"] .settings-grid-wide {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 16px;
    width: 100%;
}

[data-page="settings"] .settings-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    padding: 18px;
}

[data-page="settings"] form,
[data-page="settings"] .settings-row,
[data-page="settings"] .settings-price-row,
[data-page="settings"] .channel-settings-grid,
[data-page="settings"] .settings-inline-fields,
[data-page="settings"] .snappshop-settings-grid {
    width: 100%;
    min-width: 0;
}

[data-page="settings"] .settings-price-row {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)) !important;
}

[data-page="settings"] .channel-settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)) !important;
}

[data-page="settings"] .settings-inline-fields,
[data-page="settings"] .snappshop-settings-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
}

[data-page="settings"] .form-group,
[data-page="settings"] .channel-settings-card,
[data-page="settings"] input,
[data-page="settings"] select,
[data-page="settings"] .file-drop {
    min-width: 0;
    max-width: 100%;
}

[data-page="settings"] input,
[data-page="settings"] select {
    width: 100%;
}

[data-page="settings"] .settings-action-slot .btn,
[data-page="settings"] .settings-row .btn,
[data-page="settings"] .form-actions .btn,
[data-page="settings"] .excel-actions .btn,
[data-page="settings"] #importExcelForm > .btn {
    width: auto;
    max-width: 100%;
    white-space: normal;
}

.inventory-table {
    table-layout: auto;
}

.inventory-table th,
.inventory-table td {
    vertical-align: middle;
}

.price-dropdown,
.row-dropdown {
    max-width: 150px;
}

.row-dropdown-menu {
    max-width: min(220px, calc(100vw - 40px));
}

.inventory-table .wage-mini {
    display: inline-grid;
    gap: 2px;
    min-width: 74px;
    max-width: 96px;
    font-size: 12px;
    line-height: 1.45;
    color: #cbd5e1;
    white-space: nowrap;
}

.inventory-table .wage-mini small {
    color: #94a3b8;
    font-size: 11px;
}

.inventory-table td.text-links,
.inventory-table td.action-cell {
    display: table-cell;
    vertical-align: middle;
}

.inventory-table td.text-links {
    line-height: 1;
}

.inventory-table .row-dropdown,
.inventory-table .price-dropdown {
    vertical-align: middle;
    margin: 0;
    top: 0;
}

.inventory-table .row-dropdown summary,
.inventory-table .price-dropdown summary,
.inventory-table .status-toggle {
    min-height: 32px;
    height: 32px;
    line-height: 1;
    margin: 0;
}

.inventory-table .row-dropdown summary,
.inventory-table .price-dropdown summary,
.inventory-table .status-toggle {
    display: inline-flex;
    align-items: center;
}

.inventory-table .status-toggle {
    justify-content: center;
}

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

    .bulk-toolbar-actions {
        width: 100%;
    }

    .bulk-toolbar select,
    .bulk-toolbar .btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* Inventory workspace polish: dense command bars, scroll-safe filters, and custom selects. */
[data-page="inventory"].container {
    max-width: min(1680px, calc(100vw - 48px));
    padding: clamp(18px, 2vw, 28px);
}

[data-page="inventory"] h1 {
    margin-bottom: 22px;
    font-size: clamp(24px, 2.4vw, 36px);
    letter-spacing: 0;
    text-transform: none;
}

[data-page="inventory"] .inventory-command-center {
    position: sticky;
    top: 12px;
    z-index: 80;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid #374151;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.96);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
}

[data-page="inventory"] .inventory-command-row {
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

[data-page="inventory"] .search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-width: 0;
}

[data-page="inventory"] .search-form input {
    width: 100%;
    min-width: 0;
    height: 40px;
    border-radius: 8px;
    background: #0f172a;
    border-color: #334155;
}

[data-page="inventory"] .btn {
    min-height: 38px;
    border-radius: 8px;
    padding: 8px 13px;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

[data-page="inventory"] .inventory-actions-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px;
    scrollbar-width: thin;
    scrollbar-color: #475569 transparent;
}

[data-page="inventory"] .inventory-actions-strip::-webkit-scrollbar,
[data-page="inventory"] .filters::-webkit-scrollbar {
    height: 6px;
}

[data-page="inventory"] .inventory-actions-strip::-webkit-scrollbar-thumb,
[data-page="inventory"] .filters::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 999px;
}

[data-page="inventory"] .btn-danger-action {
    background: #7f1d1d;
    border-color: #b91c1c;
    color: #fee2e2;
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.08) inset;
}

[data-page="inventory"] .btn-danger-action:hover {
    background: #991b1b;
    border-color: #ef4444;
    color: #fff;
}

.btn-danger-action {
    background: #7f1d1d;
    border-color: #b91c1c;
    color: #fee2e2;
}

.btn-danger-action:hover {
    background: #991b1b;
    border-color: #ef4444;
    color: #fff;
}

[data-page="inventory"] .toolbar-bottom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

[data-page="inventory"] .filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 7px;
}

[data-page="inventory"] .filters > label {
    flex: 0 0 auto;
    align-self: center;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 700;
}

[data-page="inventory"] .filter-btn {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 7px 12px;
    border-color: #334155;
    background: #1f2937;
    color: #cbd5e1;
    font-size: 12px;
    line-height: 1;
}

[data-page="inventory"] .filter-btn:hover {
    background: #253044;
    border-color: #64748b;
}

[data-page="inventory"] .filter-btn.active {
    background: #e5e7eb;
    border-color: #e5e7eb;
    color: #111827;
    box-shadow: 0 8px 18px rgba(229, 231, 235, 0.16);
}

[data-page="inventory"] .sort {
    gap: 8px;
    color: #cbd5e1;
    font-size: 12px;
}

[data-page="inventory"] .sort select,
[data-page="inventory"] .bulk-toolbar select {
    appearance: none;
    -webkit-appearance: none;
    min-height: 40px;
    border-radius: 8px;
    border: 1px solid #334155;
    background:
        linear-gradient(45deg, transparent 50%, #cbd5e1 50%) 16px 17px / 6px 6px no-repeat,
        linear-gradient(135deg, #cbd5e1 50%, transparent 50%) 11px 17px / 6px 6px no-repeat,
        #0f172a;
    color: #f8fafc;
    padding: 8px 12px 8px 34px;
    cursor: pointer;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

[data-page="inventory"] .sort select:focus,
[data-page="inventory"] .bulk-toolbar select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
}

[data-page="inventory"] .bulk-toolbar {
    margin: 0 0 14px;
    padding: 12px;
    border-radius: 10px;
    background: #161d2b;
    border-color: #334155;
}

[data-page="inventory"] .bulk-toolbar-info {
    min-width: 0;
}

[data-page="inventory"] .bulk-toolbar-info strong {
    color: #f8fafc;
}

[data-page="inventory"] .bulk-toolbar-info small {
    color: #94a3b8;
}

[data-page="inventory"] .bulk-toolbar-actions {
    flex-wrap: nowrap;
}

[data-page="inventory"] .bulk-toolbar select {
    min-width: 230px;
}

.confirm-modal-content {
    max-width: 460px;
    border-color: #7f1d1d;
}

.confirm-modal-body {
    margin-bottom: 18px;
}

.confirm-modal-body p {
    margin: 0;
    color: #e5e7eb;
    line-height: 1.9;
}

.confirm-modal-footer {
    justify-content: flex-start;
    border-top: 1px solid #374151;
    padding-top: 14px;
}

.confirm-modal-footer .btn {
    min-width: 120px;
}

@media (max-width: 1180px) {
    [data-page="inventory"] .inventory-command-row {
        grid-template-columns: minmax(280px, 1fr) auto;
    }

    [data-page="inventory"] .inventory-actions-strip {
        grid-column: 1 / -1;
        order: 3;
    }
}

@media (max-width: 820px) {
    [data-page="inventory"].container {
        max-width: calc(100vw - 20px);
        padding: 14px;
    }

    [data-page="inventory"] .inventory-command-center {
        position: static;
    }

    [data-page="inventory"] .inventory-command-row,
    [data-page="inventory"] .toolbar-bottom,
    [data-page="inventory"] .bulk-toolbar {
        display: grid;
        grid-template-columns: 1fr;
    }

    [data-page="inventory"] .search-form {
        grid-template-columns: 1fr;
    }

    [data-page="inventory"] .btn-danger-action,
    [data-page="inventory"] .bulk-toolbar .btn,
    [data-page="inventory"] .bulk-toolbar select {
        width: 100%;
    }

    [data-page="inventory"] .bulk-toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

[data-page="digikala-token"] .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.token-steps {
    display: grid;
    gap: 10px;
    margin: 12px 0 20px;
    padding: 14px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #111827;
    color: #dbe4f0;
    line-height: 1.9;
}

.token-steps code {
    direction: ltr;
    display: inline-block;
    padding: 2px 7px;
    border-radius: 6px;
    background: #020617;
    color: #e5e7eb;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

.digikala-token-grid .settings-card:last-child {
    grid-column: 1 / -1;
}

.token-url-box {
    min-height: 86px;
}

.token-code-input {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
}

.scope-preset-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.scope-preset-actions .btn {
    width: auto;
}

.token-status-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.token-status-list > div {
    display: grid;
    grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
}

.token-status-list span {
    color: #94a3b8;
}

.token-status-list strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #f8fafc;
    direction: ltr;
    text-align: left;
    font-weight: 600;
}

[data-page="digikala-token"] .btn.disabled {
    opacity: 0.55;
    pointer-events: none;
}

@media (max-width: 760px) {
    .token-status-list > div {
        grid-template-columns: 1fr;
    }
}

.digikala-dashboard.container {
    max-width: 1500px;
}

.digikala-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
    padding: 20px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: linear-gradient(135deg, #111827, #1f2937);
}

.digikala-hero h1 {
    margin: 4px 0 8px;
    text-align: right;
    letter-spacing: 0;
    text-transform: none;
    font-size: 2rem;
    font-weight: 700;
}

.digikala-hero p,
.section-head p {
    color: #aab4c3;
    line-height: 1.8;
}

.eyebrow {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    background: #0f172a;
    color: #93c5fd;
    font-size: 12px;
}

.digikala-status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.digikala-status-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #111827;
}

.digikala-status-card span,
.digikala-status-card small {
    color: #94a3b8;
}

.digikala-status-card strong {
    font-size: 1.6rem;
    color: #f8fafc;
}

.status-ok {
    color: #86efac !important;
}

.status-warn {
    color: #fbbf24 !important;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-head h2 {
    margin: 0 0 6px;
}

.digikala-command-card,
.digikala-console-card,
.digikala-docs-card {
    margin-top: 16px;
}

.digikala-command-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.digikala-command-grid .btn {
    width: 100%;
}

.selected-module-note {
    margin-top: 8px;
    color: #bfdbfe !important;
}

.digikala-last-sync,
.digikala-webhook-box {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.digikala-last-sync {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
}

.digikala-webhook-box input,
.digikala-last-sync input {
    width: 100%;
}

.digikala-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.digikala-feature-card,
.digikala-doc-module {
    border: 1px solid #334155;
    border-radius: 10px;
    background: #101827;
    padding: 14px;
}

.digikala-feature-card.is-enabled,
.digikala-doc-module.is-enabled {
    border-color: #2563eb;
    background: #0f1b2e;
}

.digikala-doc-module.is-selected {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

.feature-card-top,
.digikala-doc-module header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.digikala-feature-card h3,
.digikala-doc-module h3 {
    margin: 0 0 5px;
    color: #f8fafc;
}

.digikala-feature-card span,
.digikala-doc-module header span {
    color: #93a4b8;
    font-size: 12px;
}

.digikala-feature-card p {
    margin: 12px 0;
    color: #b8c2d1;
    line-height: 1.8;
}

.digikala-feature-card strong {
    display: inline-flex;
    color: #93c5fd;
    font-size: 12px;
}

.switch-toggle {
    position: relative;
    display: inline-flex;
    width: 46px;
    height: 26px;
    flex: 0 0 auto;
}

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

.switch-toggle i {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #334155;
    cursor: pointer;
    transition: 0.2s ease;
}

.switch-toggle i::before {
    content: "";
    position: absolute;
    top: 4px;
    right: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: 0.2s ease;
}

.switch-toggle input:checked + i {
    background: #2563eb;
}

.switch-toggle input:checked + i::before {
    transform: translateX(-20px);
}

.digikala-api-console {
    display: grid;
    gap: 12px;
}

.console-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.35fr) minmax(0, 1fr);
    gap: 12px;
}

.console-row + .console-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.console-path input,
.digikala-api-console textarea,
.digikala-api-console select {
    direction: ltr;
    text-align: left;
    unicode-bidi: plaintext;
}

.digikala-api-console textarea {
    min-height: 110px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.6;
}

.digikala-dashboard input:not([type="checkbox"]):not([type="radio"]),
.digikala-dashboard select,
.digikala-dashboard textarea {
    width: 100%;
    min-width: 0;
    background: #0b1120;
    color: #e5edf7;
    border: 1px solid #334155;
    border-radius: 9px;
    padding: 10px 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.digikala-dashboard select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
    background-position: left 16px center, left 10px center;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
    padding-left: 34px;
}

.digikala-dashboard textarea {
    background: #020617;
}

.digikala-dashboard input:not([type="checkbox"]):not([type="radio"]):focus,
.digikala-dashboard select:focus,
.digikala-dashboard textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
}

.console-options {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.digikala-api-response {
    margin-top: 14px;
    min-height: 160px;
    max-height: 440px;
    overflow: auto;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    padding: 14px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #020617;
    color: #dbeafe;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    line-height: 1.7;
}

.digikala-module-search {
    max-width: 330px;
}

.digikala-doc-module-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.module-metrics,
.module-scopes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.module-metrics span,
.module-scopes code,
.risk-badge,
.method-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 12px;
    background: #1e293b;
    color: #cbd5e1;
}

.module-scopes code {
    direction: ltr;
    color: #bfdbfe;
}

.risk-danger {
    color: #fecaca !important;
    background: #7f1d1d !important;
}

.endpoint-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    max-height: 360px;
    overflow: auto;
    padding-left: 3px;
}

.endpoint-list[hidden] {
    display: none;
}

.endpoint-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 74px auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid #243244;
    border-radius: 8px;
    background: #0b1120;
}

.endpoint-row[hidden],
.digikala-doc-module[hidden] {
    display: none;
}

.endpoint-row code {
    min-width: 0;
    overflow-wrap: anywhere;
    direction: ltr;
    text-align: left;
    color: #dbeafe;
}

.method-get {
    background: #064e3b;
    color: #a7f3d0;
}

.method-post,
.method-put,
.method-patch {
    background: #1e3a8a;
    color: #bfdbfe;
}

.method-delete {
    background: #7f1d1d;
    color: #fecaca;
}

.risk-read {
    background: #0f766e;
    color: #ccfbf1;
}

.risk-write {
    background: #854d0e;
    color: #fef3c7;
}

.risk-danger {
    background: #7f1d1d;
    color: #fecaca;
}

@media (max-width: 1100px) {
    .digikala-status-grid,
    .digikala-command-grid,
    .digikala-feature-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .digikala-doc-module-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .digikala-hero,
    .section-head,
    .console-options {
        display: grid;
        grid-template-columns: 1fr;
    }

    .digikala-status-grid,
    .digikala-command-grid,
    .digikala-feature-grid,
    .console-row,
    .console-row + .console-row,
    .digikala-last-sync,
    .digikala-webhook-box {
        grid-template-columns: 1fr;
    }

    .digikala-module-search {
        max-width: none;
        width: 100%;
    }

    .endpoint-row {
        grid-template-columns: 1fr;
    }
}

.search-only-row {
    justify-content: flex-start;
}

.inventory-search-form {
    max-width: 560px;
    width: 100%;
}

.price-popover {
    position: relative;
    display: inline-flex;
    justify-content: center;
}

.icon-btn,
.icon-action {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color, #d7dce5);
    border-radius: 10px;
    background: var(--surface-color, #fff);
    color: var(--text-color, #172033);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.icon-btn:hover,
.icon-action:hover,
.price-popover:focus-within .icon-btn {
    transform: translateY(-1px);
    border-color: var(--primary-color, #2563eb);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .12);
}

.price-popover-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    z-index: 40;
    min-width: 230px;
    display: none;
    transform: translateX(-50%);
    padding: 12px;
    border: 1px solid var(--border-color, #d7dce5);
    border-radius: 12px;
    background: var(--surface-color, #fff);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
    font-size: .78rem;
    text-align: right;
    gap: 6px;
}

.price-popover:hover .price-popover-panel,
.price-popover:focus-within .price-popover-panel {
    display: grid;
}

.price-popover-main {
    font-size: .86rem;
    color: var(--primary-color, #2563eb);
}

.row-icon-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.icon-action-sell {
    color: #047857;
}

.icon-action-edit {
    color: #1d4ed8;
}

.icon-action-delete {
    color: #b91c1c;
}

.icon-action-return {
    color: #7c3aed;
}

.price-preview-panel {
    order: 20;
}

.price-preview-grid,
.channel-price-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.price-box strong,
.channel-price strong {
    font-size: .9rem;
}

@media (max-width: 760px) {
    .price-preview-grid,
    .channel-price-grid {
        grid-template-columns: 1fr;
    }
}

.settings-accordion {
    display: block;
}

.settings-accordion > summary {
    cursor: pointer;
    list-style: none;
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-color, #172033);
    padding: 4px 0 16px;
}

.settings-accordion > summary::-webkit-details-marker {
    display: none;
}

.settings-accordion > summary::after {
    content: "+";
    float: left;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(37, 99, 235, .1);
    color: var(--primary-color, #2563eb);
}

.settings-accordion[open] > summary::after {
    content: "-";
}

.sidebar-link {
    font-family: inherit;
}

.sidebar-group[data-sidebar-group] > .sidebar-submenu {
    display: none;
}

.sidebar-group[data-sidebar-group].is-open > .sidebar-submenu {
    display: grid;
}

.sidebar-group[data-sidebar-group] > .sidebar-parent::after {
    content: "+";
    margin-right: auto;
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(148, 163, 184, .16);
    color: #cbd5e1;
    font-weight: 800;
    line-height: 1;
}

.sidebar-group[data-sidebar-group].is-open > .sidebar-parent::after {
    content: "-";
}

body.sidebar-collapsed .sidebar-group[data-sidebar-group] > .sidebar-parent::after,
body.sidebar-collapsed .sidebar-group[data-sidebar-group] > .sidebar-submenu {
    display: none;
}

@media (max-width: 760px) {
    body:has(.app-sidebar),
    body.sidebar-collapsed {
        padding: 72px 10px 16px;
    }

    body.sidebar-mobile-open {
        overflow: hidden;
    }

    .mobile-sidebar-toggle {
        position: fixed;
        top: 14px;
        right: 14px;
        z-index: 3200;
        width: 46px;
        height: 46px;
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border: 1px solid rgba(148, 163, 184, .35);
        border-radius: 14px;
        background: rgba(17, 24, 39, .94);
        color: #fff;
        box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
        cursor: pointer;
    }

    .mobile-sidebar-toggle span {
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
        transition: transform .18s ease, opacity .18s ease;
    }

    body.sidebar-mobile-open .mobile-sidebar-toggle span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.sidebar-mobile-open .mobile-sidebar-toggle span:nth-child(2) {
        opacity: 0;
    }

    body.sidebar-mobile-open .mobile-sidebar-toggle span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 2950;
        display: block;
        pointer-events: none;
        opacity: 0;
        background: rgba(15, 23, 42, .62);
        transition: opacity .2s ease;
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .app-sidebar,
    body.sidebar-collapsed .app-sidebar {
        inset: 0 0 0 auto;
        width: min(86vw, 330px);
        max-height: none;
        height: 100vh;
        border-radius: 18px 0 0 18px;
        padding: 14px;
        z-index: 3100;
        transform: translateX(110%);
        transition: transform .22s ease;
    }

    body.sidebar-mobile-open .app-sidebar,
    body.sidebar-mobile-open.sidebar-collapsed .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-brand,
    body.sidebar-collapsed .sidebar-brand {
        display: flex;
        margin-bottom: 12px;
    }

    body.sidebar-collapsed .sidebar-brand div,
    body.sidebar-collapsed .nav-text {
        display: block;
    }

    .sidebar-nav {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        gap: 7px;
        padding: 0 0 12px;
    }

    .sidebar-link,
    body.sidebar-collapsed .sidebar-link {
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        padding: 10px;
    }

    .sidebar-link .nav-text,
    body.sidebar-collapsed .sidebar-link .nav-text {
        display: inline;
    }

    .sidebar-group[data-sidebar-group] > .sidebar-parent::after,
    body.sidebar-collapsed .sidebar-group[data-sidebar-group] > .sidebar-parent::after {
        display: inline-grid;
    }

    .sidebar-group[data-sidebar-group] > .sidebar-submenu,
    body.sidebar-collapsed .sidebar-group[data-sidebar-group] > .sidebar-submenu {
        display: none;
    }

    .sidebar-group[data-sidebar-group].is-open > .sidebar-submenu,
    body.sidebar-collapsed .sidebar-group[data-sidebar-group].is-open > .sidebar-submenu {
        display: grid;
    }

    .sidebar-submenu {
        margin-right: 18px;
        padding: 2px 12px 8px 0;
    }

    .sidebar-sublink {
        min-height: 36px;
        font-size: 13px;
    }

    .sidebar-link .order-badge,
    body.sidebar-collapsed .sidebar-link .order-badge {
        position: static;
        margin-right: auto;
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

.price-preview-panel .live-price-box-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px;
}

.price-preview-panel .live-price-box-grid .price-box,
.price-preview-panel .live-price-box-grid .channel-price {
    min-width: 0;
    padding: 10px;
}

.price-preview-panel .live-price-box-grid .price-box span,
.price-preview-panel .live-price-box-grid .channel-price span,
.price-preview-panel .live-price-box-grid .channel-price small {
    font-size: .76rem;
    line-height: 1.5;
}

.price-preview-panel .live-price-box-grid .price-box strong,
.price-preview-panel .live-price-box-grid .channel-price strong {
    font-size: .82rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .price-preview-panel .live-price-box-grid {
        grid-template-columns: 1fr !important;
    }
}

.help-tooltip,
.help-tooltip.status-tooltip {
    background: #0f172a !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
}

.help-tooltip::after {
    background: #0b1120 !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .45) !important;
}

.icon-btn,
.icon-action {
    background: #0f172a !important;
    border-color: #334155 !important;
    color: #e5e7eb;
}

.icon-btn:hover,
.icon-action:hover,
.price-popover:focus-within .icon-btn {
    background: #111827 !important;
    border-color: #60a5fa !important;
    box-shadow: 0 12px 28px rgba(2, 6, 23, .24) !important;
}

.price-popover-panel {
    background: #0b1120 !important;
    color: #e5e7eb !important;
    border-color: #334155 !important;
    box-shadow: 0 20px 52px rgba(0, 0, 0, .42) !important;
}

.price-popover-panel span {
    color: #cbd5e1;
}

.price-popover-main {
    color: #93c5fd !important;
}

.icon-action-sell {
    color: #34d399 !important;
}

.icon-action-edit {
    color: #93c5fd !important;
}

.icon-action-delete {
    color: #fca5a5 !important;
}

.icon-action-return {
    color: #c4b5fd !important;
}

/* 2026 normal edition: compact responsive dashboard */
:root {
    --ui-ink: #102a43;
    --ui-muted: #627d98;
    --ui-border: #d9e2ec;
    --ui-panel: #ffffff;
    --ui-canvas: #f3f7fa;
    --ui-accent: #087f8c;
    --ui-accent-dark: #065d67;
    --ui-gold: #c28b19;
    --ui-shadow: 0 12px 32px rgba(16, 42, 67, .08);
}

body:has(.app-sidebar) {
    background: var(--ui-canvas);
    color: var(--ui-ink);
}

.app-sidebar {
    background: #102a43;
    border: 0;
    box-shadow: 10px 0 34px rgba(16, 42, 67, .16);
}

.sidebar-brand { border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 14px; }
.sidebar-brand strong { color: #fff; }
.sidebar-brand span { color: #9fb3c8; }
.sidebar-link { border-radius: 9px; color: #d9e2ec; min-height: 42px; }
.sidebar-link:hover, .sidebar-link.is-active { background: #087f8c; color: #fff; }
.sidebar-sublink { border-right: 2px solid #486581; color: #bcccdc; }
.sidebar-sublink:hover, .sidebar-sublink.is-active { border-color: #2cb1bc; color: #fff; background: rgba(44,177,188,.12); }

.app-main .container { width: min(1540px, calc(100% - 34px)); }
.app-main > .container { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.container > h1, .page-header h1 { color: var(--ui-ink); letter-spacing: 0; }
.eyebrow { color: var(--ui-accent); font-size: 11px; font-weight: 800; }
.card, .toolbar, .bulk-toolbar, .settings-card, .stats-grid .stat-card {
    border: 1px solid var(--ui-border);
    background: var(--ui-panel);
    border-radius: 12px;
    box-shadow: var(--ui-shadow);
}

[data-page="inventory"] .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
[data-page="inventory"] .summary-card {
    padding: 17px;
    color: var(--ui-ink);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    box-shadow: var(--ui-shadow);
}
[data-page="inventory"] .summary-card:hover { border-color: #9fb3c8; box-shadow: var(--ui-shadow); }
[data-page="inventory"] .summary-label { margin-bottom: 6px; color: var(--ui-muted); font-size: 12px; letter-spacing: 0; }
[data-page="inventory"] .summary-value { color: var(--ui-ink); font-size: 25px; font-weight: 800; letter-spacing: 0; }

[data-page="inventory"] .inventory-command-center {
    border-color: var(--ui-border);
    background: rgba(255,255,255,.96);
    box-shadow: var(--ui-shadow);
}
[data-page="inventory"] .search-form input {
    color: var(--ui-ink);
    background: #f8fafc;
    border-color: #cbd5e1;
}
[data-page="inventory"] .search-form input::placeholder { color: #829ab1; }
[data-page="inventory"] .inventory-actions-strip { scrollbar-color: #9fb3c8 transparent; }
[data-page="inventory"] .inventory-actions-strip::-webkit-scrollbar-thumb,
[data-page="inventory"] .filters::-webkit-scrollbar-thumb { background: #9fb3c8; }
[data-page="inventory"] .filter-btn {
    color: #486581;
    background: #f0f4f8;
    border-color: #bcccdc;
}
[data-page="inventory"] .filter-btn:hover { color: var(--ui-accent-dark); background: #e6fffa; border-color: #87e8de; }
[data-page="inventory"] .filter-btn.active { color: #fff; background: var(--ui-accent); border-color: var(--ui-accent); box-shadow: none; }
[data-page="inventory"] .filters > label,
[data-page="inventory"] .sort { color: var(--ui-muted); }
[data-page="inventory"] .sort select,
[data-page="inventory"] .bulk-toolbar select {
    color: var(--ui-ink);
    border-color: #cbd5e1;
    background:
        linear-gradient(45deg, transparent 50%, #486581 50%) 16px 17px / 6px 6px no-repeat,
        linear-gradient(135deg, #486581 50%, transparent 50%) 11px 17px / 6px 6px no-repeat,
        #f8fafc;
}
[data-page="inventory"] .bulk-toolbar {
    color: var(--ui-ink);
    background: #fff;
    border-color: var(--ui-border);
}
[data-page="inventory"] .bulk-toolbar-info strong { color: var(--ui-ink); }
[data-page="inventory"] .bulk-toolbar-info small { color: var(--ui-muted); }

.toolbar, .bulk-toolbar { padding: 12px; }
.search-form input { min-height: 42px; border-radius: 9px; }
.btn { min-height: 40px; border-radius: 9px; font-weight: 700; }
.btn-primary { background: var(--ui-accent); border-color: var(--ui-accent); }
.btn-primary:hover { background: var(--ui-accent-dark); }
.btn-ghost { color: var(--ui-accent); background: transparent; border: 1px dashed var(--ui-accent); }

.table-scroll { border: 1px solid var(--ui-border); border-radius: 12px; background: #fff; box-shadow: var(--ui-shadow); }
.inventory-table { min-width: 1080px; }
.inventory-table thead th { position: sticky; top: 0; z-index: 3; background: #eaf2f6; color: #334e68; }
.app-main .inventory-table { color: var(--ui-ink); background: #fff; }
.app-main .inventory-table tbody tr { color: var(--ui-ink); background: #fff; }
.app-main .inventory-table tbody td { color: var(--ui-ink); border-color: #e6edf2; }
.app-main .inventory-table tbody tr:nth-child(even) { background: #f8fafc; }
.inventory-table tbody tr:hover { background: #f0f9fa; }
.stock-cell { display: inline-grid; place-items: center; min-width: 38px; height: 30px; border-radius: 9px; background: #e6fffa; color: #087f5b; }
.price-popover-panel { min-width: 340px; line-height: 1.8; }

.modal { padding: 18px; align-items: center; }
.modal-content, .product-modal-content {
    width: min(900px, calc(100vw - 30px));
    max-width: 900px;
    max-height: calc(100dvh - 36px);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 30px 90px rgba(16,42,67,.28);
}
.modal-header { min-height: 58px; padding: 12px 18px; background: #102a43; color: #fff; }
.modal-body { max-height: calc(100dvh - 94px); overflow-y: auto; padding: 14px 18px 0; overscroll-behavior: contain; }
.product-form-grid { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 12px; }
.product-form .form-group { gap: 4px; margin: 0; }
.product-form input, .product-form select, .product-form textarea { min-height: 40px; border-radius: 8px; }
.modal .product-form label, .modal .product-form h3, .modal .product-form .title-with-help { color: var(--ui-ink); }
.modal .product-form input, .modal .product-form select, .modal .product-form textarea {
    color: var(--ui-ink);
    background: #f8fafc;
    border-color: #cbd5e1;
}
.modal .product-form input::placeholder, .modal .product-form textarea::placeholder { color: #829ab1; }
.modal .variant-panel, .modal .price-preview-panel, .modal .image-select-panel {
    color: var(--ui-ink);
    background: #f7fafc;
    border: 1px solid var(--ui-border);
    border-radius: 10px;
    padding: 12px;
}
.modal .variant-row, .modal .price-box, .modal .channel-price, .modal .upload-inline {
    color: var(--ui-ink);
    background: #fff;
    border-color: var(--ui-border);
}
.modal .price-box span, .modal .channel-price span, .modal .channel-price small { color: var(--ui-muted); }
.modal .file-drop { color: var(--ui-ink); background: #fff; border-color: #9fb3c8; }
.dkpc-auto-field { display: none !important; }
.product-form .form-actions, .modal-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 12;
    margin: 8px -18px 0;
    padding: 12px 18px;
    border-top: 1px solid var(--ui-border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(12px);
    display: flex;
    gap: 8px;
}
.product-form .form-actions .btn-primary, .modal-form-actions .btn-primary { flex: 1.7; }
.product-form .form-actions .btn-secondary, .modal-form-actions .btn-secondary { flex: 1; }
.sale-modal-content { width: min(560px, calc(100vw - 30px)); }
.sale-modal-content form { padding: 16px 18px 0; }
.compact-modal-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.compact-modal-form .modal-note, .compact-modal-form .form-actions { grid-column: 1/-1; }

.settings-section-nav { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 14px 0; border: 1px solid var(--ui-border); border-radius: 11px; background: #fff; }
.settings-section-nav a { flex: 0 0 auto; padding: 9px 14px; border-radius: 8px; color: var(--ui-muted); text-decoration: none; font-weight: 700; }
.settings-section-nav a:hover, .settings-section-nav a.is-active { color: #fff; background: var(--ui-accent); }
.settings-form-modern { padding: 18px; overflow: visible; }
.settings-form-modern input, .settings-form-modern select, .settings-form-modern textarea {
    color: var(--ui-ink) !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}
.settings-form-modern label, .settings-form-modern h2, .settings-form-modern h3 { color: var(--ui-ink) !important; }
.settings-form-modern .channel-settings-card, .settings-form-modern .digikala-feature-card {
    color: var(--ui-ink);
    background: #f8fafc;
    border-color: var(--ui-border);
}
.settings-form-modern .file-drop { color: var(--ui-ink); background: #f8fafc; border-color: #9fb3c8; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin: 2px 0 12px; }
.section-heading h2 { margin: 2px 0 0; font-size: 18px; }
.section-heading:not(:first-child) { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--ui-border); }
.stamp-preview { display: flex; align-items: center; gap: 12px; width: fit-content; padding: 8px 12px; border: 1px dashed var(--ui-border); border-radius: 10px; }
.stamp-preview img { width: 92px; height: 64px; object-fit: contain; }
.sticky-settings-actions { position: sticky; bottom: 10px; justify-content: flex-end; margin-top: 18px; z-index: 5; }
.webhook-box { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; align-items: center; margin: 16px 0; }
.excel-drop { margin: 16px 0; min-height: 130px; }

.chat-shell { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: calc(100dvh - 165px); gap: 12px; }
.chat-people, .chat-panel { background: #fff; border: 1px solid var(--ui-border); border-radius: 12px; box-shadow: var(--ui-shadow); overflow: hidden; }
.chat-people { display: grid; align-content: start; gap: 6px; padding: 8px; overflow-y: auto; }
.chat-person { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: center; padding: 9px; border: 1px solid transparent; border-radius: 9px; background: transparent; text-align: right; cursor: pointer; }
.chat-person small { grid-column: 2; color: var(--ui-muted); }
.chat-person.active, .chat-person:hover { background: #e6fffa; border-color: #87e8de; }
.chat-avatar { grid-row: span 2; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--ui-accent); font-weight: 800; }
.chat-panel { display: grid; grid-template-rows: minmax(0,1fr) auto; }
.chat-thread { display: flex; flex-direction: column; gap: 8px; padding: 14px; overflow-y: auto; }
.chat-bubble { width: min(72%,560px); align-self: flex-start; padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: #edf2f7; }
.chat-bubble.mine { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: #d9f7f4; }
.chat-bubble-head { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--ui-muted); }
.chat-bubble p { margin: 6px 0; }
.chat-ticks { color: var(--ui-muted); font-size: 11px; }.chat-ticks.read { color: var(--ui-accent); }
.chat-image img, .chat-image-preview img { max-width: 240px; max-height: 190px; object-fit: cover; border-radius: 10px; }
.chat-compose { padding: 10px; border-top: 1px solid var(--ui-border); }
.chat-compose-row { display: grid; grid-template-columns: auto auto auto auto minmax(0,1fr) auto; gap: 6px; align-items: end; }
.chat-compose textarea { min-height: 42px; max-height: 120px; }
.chat-emoji-btn, .chat-attach { min-height: 40px; padding: 8px; border: 1px solid var(--ui-border); border-radius: 8px; background: #fff; cursor: pointer; }
.chat-attach input { display: none; }.chat-image-preview { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

[data-page="beads"] { max-width: min(1500px, calc(100vw - 48px)); }
[data-page="beads"] > h1 { color: var(--ui-ink); margin-bottom: 18px; }
[data-page="beads"] .stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
[data-page="beads"] .stat-card,
[data-page="beads"] .card {
    color: var(--ui-ink);
    background: #fff;
    border: 1px solid var(--ui-border);
    border-radius: 12px;
    box-shadow: var(--ui-shadow);
}
[data-page="beads"] .stat-card { min-height: 118px; margin: 0; padding: 16px; }
[data-page="beads"] .stat-card h3,
[data-page="beads"] .card h2 { color: var(--ui-muted); font-weight: 800; }
[data-page="beads"] .stat-value { color: var(--ui-ink); font-size: clamp(17px, 1.5vw, 24px); font-weight: 800; }
[data-page="beads"] .live-value-card { border-color: #67d5d0; background: #f0fdfa; }
[data-page="beads"] .live-value-card small { display: block; margin-top: 8px; color: var(--ui-muted); }
[data-page="beads"] .profit { border-color: #86efac; }
[data-page="beads"] .loss { border-color: #fca5a5; }
[data-page="beads"] .product-form input,
[data-page="beads"] .product-form select,
[data-page="beads"] .product-form textarea {
    color: var(--ui-ink);
    background: #f8fafc;
    border-color: #cbd5e1;
}
[data-page="beads"] .product-form label { color: var(--ui-ink); }
[data-page="beads"] .product-form .form-actions { position: static; margin: 0; padding: 4px 0 0; border: 0; background: transparent; }

[data-page="sold"] { max-width: min(1500px, calc(100vw - 48px)); }
[data-page="sold"] > h1 { color: var(--ui-ink); margin-bottom: 18px; }
[data-page="sold"] > .toolbar { display: grid; grid-template-columns: minmax(320px, 1fr) auto; align-items: center; gap: 12px; }
[data-page="sold"] .search-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
[data-page="sold"] .search-form input,
[data-page="sold"] .sort select {
    color: var(--ui-ink);
    background: #f8fafc;
    border-color: #cbd5e1;
}
[data-page="sold"] .sort { color: var(--ui-muted); }
[data-page="sold"] .inventory-table { min-width: 1080px; }

@media (max-width: 980px) {
    .product-form-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .chat-shell { grid-template-columns: 1fr; min-height: auto; }
    .chat-people { grid-auto-flow: column; grid-auto-columns: minmax(150px, 1fr); overflow-x: auto; }
    .chat-panel { min-height: 65dvh; }
    [data-page="beads"] .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    .app-main .container { width: 100%; }
    .modal { padding: 0; align-items: stretch; }
    .modal-content, .product-modal-content, .sale-modal-content { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; }
    .modal-body { max-height: calc(100dvh - 58px); padding: 10px 12px 0; }
    .product-form-grid, .compact-modal-form { grid-template-columns: 1fr; }
    .form-span, .compact-modal-form .modal-note, .compact-modal-form .form-actions { grid-column: auto; }
    .product-form .form-actions, .modal-form-actions { margin-inline: -12px; padding-inline: 12px; }
    .inventory-table { min-width: 980px; }
    .settings-row, .channel-settings-grid, .snappshop-settings-grid { grid-template-columns: 1fr !important; }
    .webhook-box { grid-template-columns: 1fr; }
    .chat-compose-row { grid-template-columns: repeat(4,auto); }
    .chat-compose textarea, .chat-compose .btn { grid-column: 1/-1; }
    .chat-bubble { width: 92%; }
    [data-page="inventory"] { padding: 74px 10px 14px !important; }
    [data-page="inventory"] h1 { margin: 0 0 14px; font-size: 22px; text-align: center; }
    [data-page="inventory"] .summary-cards { gap: 8px; }
    [data-page="inventory"] .summary-card { padding: 13px 8px; }
    [data-page="inventory"] .summary-label { font-size: 10px; }
    [data-page="inventory"] .summary-value { font-size: 20px; }
    [data-page="inventory"] .inventory-command-center { padding: 10px; }
    [data-page="inventory"] .inventory-actions-strip {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        overflow: visible;
    }
    [data-page="inventory"] .inventory-actions-strip .btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        padding: 7px;
        white-space: normal;
        line-height: 1.45;
    }
    [data-page="inventory"] .inventory-actions-strip .btn:last-child { grid-column: 1 / -1; }
    [data-page="beads"] { width: 100%; max-width: none; padding: 74px 10px 14px; }
    [data-page="beads"] > h1 { font-size: 25px; text-align: center; }
    [data-page="beads"] .stats-grid { gap: 8px; }
    [data-page="beads"] .stat-card { min-height: 104px; padding: 12px; }
    [data-page="beads"] .stat-card h3 { font-size: 11px; }
    [data-page="beads"] .stat-value { font-size: 17px; }
    [data-page="beads"] .live-value-card { grid-column: 1 / -1; }
    [data-page="beads"] .stats-grid .stat-card:last-child { grid-column: 1 / -1; }
    [data-page="beads"] .card { padding: 14px; }
    [data-page="sold"] { width: 100%; max-width: none; padding: 74px 10px 14px; }
    [data-page="sold"] > h1 { font-size: 25px; text-align: center; }
    [data-page="sold"] > .toolbar,
    [data-page="sold"] .search-form { grid-template-columns: 1fr; }
    [data-page="sold"] .sort { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; }
}

/* Keep this block last: older compatibility rules above must not repaint the pro shell. */
@media (max-width: 560px) {
    body.normal-app-shell [data-page="inventory"] .inventory-actions-strip {
        display: grid !important;
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    body.normal-app-shell [data-page="inventory"] .inventory-actions-strip .btn,
    body.normal-app-shell [data-page="inventory"] .inventory-actions-strip .btn:last-child {
        grid-column: auto !important;
        width: 100% !important;
        min-width: 0 !important;
    }
}

body.normal-app-shell,
body.normal-app-shell:has(.app-sidebar) {
    color: var(--pro-text) !important;
    background:
        radial-gradient(circle at 12% 8%, rgba(56, 189, 248, .16), transparent 27%),
        radial-gradient(circle at 88% 7%, rgba(20, 184, 166, .12), transparent 24%),
        linear-gradient(135deg, #070b16, #0b1020 48%, #070a13) !important;
    background-attachment: fixed !important;
}

body.normal-app-shell .app-main,
body.normal-app-shell .app-main .container,
body.normal-app-shell .app-main [data-page] {
    color: var(--pro-text) !important;
    background-color: transparent !important;
}

body.normal-app-shell .app-main h1,
body.normal-app-shell .app-main h2,
body.normal-app-shell .app-main h3,
body.normal-app-shell .app-main h4,
body.normal-app-shell .app-main label,
body.normal-app-shell .app-main strong { color: var(--pro-text) !important; }

body.normal-app-shell .app-main p,
body.normal-app-shell .app-main small,
body.normal-app-shell .summary-label,
body.normal-app-shell .bulk-toolbar-info small,
body.normal-app-shell .sort { color: var(--pro-muted) !important; }

body.normal-app-shell .toolbar,
body.normal-app-shell .bulk-toolbar,
body.normal-app-shell .card,
body.normal-app-shell .settings-card,
body.normal-app-shell .summary-card,
body.normal-app-shell .stat-card {
    background-color: var(--pro-panel) !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .product-modal-form > .modal-form-actions {
    position: static !important;
    bottom: auto !important;
    margin: 0 !important;
}

.tapsi-catalog-page { display: grid; gap: 14px; min-width: 0; overflow: hidden; }
.tapsi-catalog-page > * { min-width: 0; max-width: 100%; }
.tapsi-catalog-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0;
    padding: 18px;
    border: 1px solid var(--pro-border);
    border-radius: 22px;
    background:
        radial-gradient(circle at 12% 18%, rgba(56,189,248,.14), transparent 32%),
        linear-gradient(135deg, rgba(15,23,42,.9), rgba(20,184,166,.08));
    box-shadow: var(--pro-shadow);
}
.tapsi-catalog-hero p { max-width: 760px; margin: 5px 0 0; }
.tapsi-catalog-toolbar,
.tapsi-catalog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--pro-border);
    border-radius: 18px;
    background: var(--pro-panel);
    box-shadow: 0 16px 42px rgba(0,0,0,.16);
}
.tapsi-catalog-search { flex: 1 1 420px; max-width: 560px; }
.tapsi-catalog-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.tapsi-catalog-filters .filter-btn { border-radius: 999px; }
.tapsi-catalog-filters b { display: inline-grid; min-width: 22px; margin-right: 4px; }
.tapsi-catalog-actions { position: sticky; top: 10px; z-index: 15; margin-bottom: 10px; backdrop-filter: blur(16px); }
.tapsi-catalog-actions > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
.tapsi-catalog-actions small { display: block; }
.tapsi-catalog-table-wrap { width: 100%; max-width: 100%; overflow-x: auto; }
.tapsi-catalog-table { min-width: 1180px; margin: 0; }
.tapsi-catalog-table th { position: sticky; top: 0; z-index: 2; }
.tapsi-catalog-table td { vertical-align: middle; }
.tapsi-catalog-table td > small { display: block; margin-top: 3px; }
.tapsi-catalog-table input[type="text"],
.tapsi-catalog-table input[type="number"] { min-width: 150px; }
.tapsi-variant-fields { display: grid; grid-template-columns: repeat(2, minmax(130px,1fr)); gap: 7px; }
.tapsi-variant-fields label { display: grid; gap: 3px; }
.tapsi-variant-fields label span { color: var(--pro-muted); font-size: 10px; }
.ltr-value { direction: ltr; display: block; text-align: right; overflow-wrap: anywhere; }
.catalog-status { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; }
.catalog-status-pending { color: #fde68a; background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.25); }
.catalog-status-imported { color: #99f6e4; background: rgba(20,184,166,.12); border: 1px solid rgba(20,184,166,.25); }
.catalog-status-ignored { color: #fecdd3; background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.25); }
.catalog-pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.empty-state { padding: 32px; color: var(--pro-muted); text-align: center; }

@media (max-width: 760px) {
    .tapsi-catalog-hero,
    .tapsi-catalog-toolbar,
    .tapsi-catalog-actions { align-items: stretch; flex-direction: column; }
    .tapsi-catalog-hero .btn,
    .tapsi-catalog-search,
    .tapsi-catalog-actions > div:last-child,
    .tapsi-catalog-actions .btn { width: 100%; max-width: none; }
    .tapsi-catalog-search {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        flex: 0 0 auto;
        align-items: center;
    }
    .tapsi-catalog-search input,
    .tapsi-catalog-search .btn { min-height: 42px; height: 42px; }
    .tapsi-catalog-search .btn { width: auto; }
    .tapsi-catalog-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .tapsi-catalog-actions { top: 8px; }
}

/* Silver beads: dark professional workspace */
body.normal-app-shell [data-page="beads"] {
    width: min(100%, 1500px);
    max-width: 1500px;
    min-width: 0;
    padding: 16px;
}

body.normal-app-shell [data-page="beads"] .beads-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    min-height: 96px;
    margin-bottom: 14px;
    padding: 18px 20px;
    border: 1px solid var(--pro-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 8% 18%, rgba(56, 189, 248, .13), transparent 28%),
        linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(20, 184, 166, .06));
    box-shadow: var(--pro-shadow);
}

body.normal-app-shell [data-page="beads"] .beads-page-header h1 {
    margin: 2px 0 4px;
    text-align: right;
    font-size: clamp(22px, 2vw, 30px);
}

body.normal-app-shell [data-page="beads"] .beads-page-header p {
    margin: 0;
    color: var(--pro-muted) !important;
}

body.normal-app-shell [data-page="beads"] .stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

body.normal-app-shell [data-page="beads"] .stat-card {
    position: relative;
    min-width: 0;
    min-height: 126px;
    margin: 0;
    padding: 16px;
    overflow: hidden;
    color: var(--pro-text);
    border: 1px solid var(--pro-border) !important;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(17, 26, 45, .98), rgba(11, 19, 34, .95)) !important;
    box-shadow: 0 14px 35px rgba(0, 0, 0, .16);
}

body.normal-app-shell [data-page="beads"] .stat-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #38bdf8;
}

body.normal-app-shell [data-page="beads"] .stat-card[data-tone="blue"]::before { background: #60a5fa; }
body.normal-app-shell [data-page="beads"] .stat-card[data-tone="teal"]::before { background: #2dd4bf; }
body.normal-app-shell [data-page="beads"] .stat-card[data-tone="violet"]::before { background: #a78bfa; }
body.normal-app-shell [data-page="beads"] .stat-card[data-tone="green"]::before { background: #4ade80; }
body.normal-app-shell [data-page="beads"] .stat-card[data-tone="red"]::before { background: #fb7185; }

body.normal-app-shell [data-page="beads"] .stat-card h3 {
    margin: 0 0 14px;
    color: #a9b9cf !important;
    font-size: 12px;
    font-weight: 800;
}

body.normal-app-shell [data-page="beads"] .stat-value {
    color: #f8fbff !important;
    font-size: clamp(18px, 1.5vw, 25px);
    font-weight: 900;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

body.normal-app-shell [data-page="beads"] .live-value-card small {
    display: block;
    margin-top: 10px;
    color: #8fded7 !important;
}

body.normal-app-shell [data-page="beads"] .card {
    margin-bottom: 14px;
    padding: 18px;
    color: var(--pro-text);
    border: 1px solid var(--pro-border) !important;
    border-radius: 18px;
    background: rgba(15, 23, 42, .84) !important;
    box-shadow: 0 18px 46px rgba(0, 0, 0, .18);
}

.beads-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

body.normal-app-shell [data-page="beads"] .beads-section-heading h2 {
    margin: 2px 0 0;
    color: var(--pro-text) !important;
    font-size: 17px;
}

.beads-section-mark,
.beads-history-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 5px 11px;
    border: 1px solid rgba(56, 189, 248, .24);
    border-radius: 10px;
    color: #7dd3fc;
    background: rgba(56, 189, 248, .08);
    font-size: 12px;
    font-weight: 800;
}

.beads-section-mark {
    width: 34px;
    padding: 0;
    font-size: 20px;
}

body.normal-app-shell [data-page="beads"] .beads-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    max-width: none;
}

body.normal-app-shell [data-page="beads"] .beads-form .form-group {
    min-width: 0;
    margin: 0;
}

body.normal-app-shell [data-page="beads"] .product-form label,
body.normal-app-shell .beads-edit-form label {
    margin-bottom: 5px;
    color: #b8c7da !important;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
}

body.normal-app-shell [data-page="beads"] .product-form input,
body.normal-app-shell [data-page="beads"] .product-form select,
body.normal-app-shell [data-page="beads"] .product-form textarea,
body.normal-app-shell .beads-edit-form input,
body.normal-app-shell .beads-edit-form select,
body.normal-app-shell .beads-edit-form textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    color: #edf5ff !important;
    background: #080f20 !important;
    border: 1px solid rgba(148, 163, 184, .22) !important;
    border-radius: 11px;
    color-scheme: dark;
}

body.normal-app-shell [data-page="beads"] .product-form textarea,
body.normal-app-shell .beads-edit-form textarea {
    min-height: 74px;
    resize: vertical;
}

body.normal-app-shell [data-page="beads"] .product-form input:focus,
body.normal-app-shell [data-page="beads"] .product-form select:focus,
body.normal-app-shell [data-page="beads"] .product-form textarea:focus,
body.normal-app-shell .beads-edit-form input:focus,
body.normal-app-shell .beads-edit-form select:focus,
body.normal-app-shell .beads-edit-form textarea:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .12) !important;
}

body.normal-app-shell [data-page="beads"] .beads-form .form-actions {
    display: flex;
    position: static !important;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

body.normal-app-shell [data-page="beads"] .beads-form .form-actions .btn {
    width: 100%;
    min-height: 44px;
}

body.normal-app-shell [data-page="beads"] .beads-history-card .table-scroll {
    width: 100%;
    border: 1px solid var(--pro-border);
    border-radius: 14px;
}

body.normal-app-shell [data-page="beads"] .inventory-table {
    min-width: 900px;
    margin: 0;
}

body.normal-app-shell [data-page="beads"] .inventory-table thead th {
    color: #9fb0c7;
    background: #101a2d;
    border-color: var(--pro-border);
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
}

body.normal-app-shell [data-page="beads"] .inventory-table tbody td {
    color: #dce8f7;
    background: rgba(9, 16, 30, .5);
    border-color: var(--pro-border);
}

.beads-row-actions {
    display: flex !important;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.beads-row-actions .btn { min-height: 34px; padding: 6px 10px; font-size: 11px; }

body.normal-app-shell .beads-edit-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: none;
    padding: 16px 18px 18px;
}

body.normal-app-shell .beads-edit-form .form-group { margin: 0; }
body.normal-app-shell .beads-edit-form .form-group:nth-of-type(5),
body.normal-app-shell .beads-edit-form .beads-edit-actions { grid-column: 1 / -1; }
.beads-edit-actions { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(110px, .7fr); gap: 8px; }
body.normal-app-shell .beads-edit-form .beads-edit-actions {
    position: static !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}
body.normal-app-shell .beads-edit-form .beads-edit-actions .btn-secondary {
    color: #dce8f7;
    background: rgba(148, 163, 184, .1);
    border-color: rgba(148, 163, 184, .22);
}

@media (max-width: 1100px) {
    body.normal-app-shell [data-page="beads"] .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    body.normal-app-shell [data-page="beads"] .stat-card:nth-child(4),
    body.normal-app-shell [data-page="beads"] .stat-card:nth-child(5) { grid-column: span 1; }
}

@media (max-width: 760px) {
    body.normal-app-shell [data-page="beads"] { padding: 72px 10px 16px !important; }
    body.normal-app-shell [data-page="beads"] .beads-page-header { min-height: 0; padding: 15px; }
    body.normal-app-shell [data-page="beads"] .beads-page-header h1 { font-size: 22px; }
    body.normal-app-shell [data-page="beads"] .beads-page-header p { font-size: 11px; }
    body.normal-app-shell [data-page="beads"] .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.normal-app-shell [data-page="beads"] .live-value-card { grid-column: 1 / -1; }
    body.normal-app-shell [data-page="beads"] .stat-card { min-height: 108px; padding: 13px; }
    body.normal-app-shell [data-page="beads"] .beads-form { grid-template-columns: 1fr; }
    body.normal-app-shell [data-page="beads"] .card { padding: 14px; }
    body.normal-app-shell .beads-edit-form { grid-template-columns: 1fr; padding: 12px; }
    body.normal-app-shell .beads-edit-form .form-group:nth-of-type(5),
    body.normal-app-shell .beads-edit-form .beads-edit-actions { grid-column: auto; }
}

/* Final dark-surface guard for authenticated normal-edition screens. */
body.normal-app-shell:has(.app-sidebar) {
    --ui-ink: #e7eefb;
    --ui-muted: #93a4bc;
    --ui-border: rgba(148, 163, 184, .18);
    --ui-panel: #0f172a;
    --ui-canvas: #070b16;
    --ui-accent: #0891b2;
    --ui-accent-dark: #0e7490;
    --surface-color: #111a2d;
    --text-color: #e7eefb;
    --border-color: rgba(148, 163, 184, .2);
    --primary-color: #38bdf8;
}

body.normal-app-shell .app-main .page-header,
body.normal-app-shell .app-main .toolbar,
body.normal-app-shell .app-main .bulk-toolbar,
body.normal-app-shell .app-main .inventory-command-center,
body.normal-app-shell .app-main .settings-card,
body.normal-app-shell .app-main .card,
body.normal-app-shell .app-main .table-scroll,
body.normal-app-shell .app-main .category-form-card,
body.normal-app-shell .app-main .category-list-card {
    color: var(--pro-text) !important;
    background: rgba(15, 23, 42, .86) !important;
    border-color: var(--pro-border) !important;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .16) !important;
}

body.normal-app-shell .app-main input:not([type="checkbox"]):not([type="radio"]),
body.normal-app-shell .app-main select,
body.normal-app-shell .app-main textarea,
body.normal-app-shell .modal input:not([type="checkbox"]):not([type="radio"]),
body.normal-app-shell .modal select,
body.normal-app-shell .modal textarea {
    color: #e7eefb !important;
    background-color: #080f20 !important;
    border-color: rgba(148, 163, 184, .22) !important;
    color-scheme: dark;
}

body.normal-app-shell .app-main input::placeholder,
body.normal-app-shell .app-main textarea::placeholder,
body.normal-app-shell .modal input::placeholder,
body.normal-app-shell .modal textarea::placeholder { color: #70819a !important; }

body.normal-app-shell .app-main input:focus,
body.normal-app-shell .app-main select:focus,
body.normal-app-shell .app-main textarea:focus,
body.normal-app-shell .modal input:focus,
body.normal-app-shell .modal select:focus,
body.normal-app-shell .modal textarea:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .12) !important;
}

body.normal-app-shell .app-main .filter-btn {
    color: #b8c7da !important;
    background: rgba(30, 41, 59, .88) !important;
    border-color: rgba(148, 163, 184, .2) !important;
}

body.normal-app-shell .app-main .filter-btn:hover,
body.normal-app-shell .app-main .filter-btn.active,
body.normal-app-shell .app-main .settings-section-nav a:hover,
body.normal-app-shell .app-main .settings-section-nav a.is-active {
    color: #fff !important;
    background: rgba(8, 145, 178, .3) !important;
    border-color: rgba(56, 189, 248, .45) !important;
}

body.normal-app-shell .app-main .inventory-table,
body.normal-app-shell .app-main .inventory-table tbody tr,
body.normal-app-shell .app-main .inventory-table tbody tr:nth-child(even),
body.normal-app-shell .app-main .inventory-table tbody td {
    color: #dce8f7 !important;
    background: rgba(8, 15, 32, .52) !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .app-main .inventory-table thead th {
    color: #a9b9cf !important;
    background: #101a2d !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .app-main .inventory-table tbody tr:hover,
body.normal-app-shell .app-main .inventory-table tbody tr:nth-child(even):hover {
    background: rgba(56, 189, 248, .07) !important;
}

body.normal-app-shell .app-main .stock-cell {
    color: #99f6e4 !important;
    background: rgba(20, 184, 166, .14) !important;
}

body.normal-app-shell .app-main .icon-btn,
body.normal-app-shell .app-main .icon-action,
body.normal-app-shell .app-main .price-popover-panel,
body.normal-app-shell .app-main .row-dropdown-menu {
    color: #dce8f7 !important;
    background: #111a2d !important;
    border-color: rgba(148, 163, 184, .22) !important;
}

body.normal-app-shell .app-main .icon-btn:hover,
body.normal-app-shell .app-main .icon-action:hover {
    color: #fff !important;
    background: rgba(56, 189, 248, .12) !important;
    border-color: rgba(56, 189, 248, .42) !important;
}

body.normal-app-shell .modal-content,
body.normal-app-shell .product-modal-content,
body.normal-app-shell .sale-modal-content {
    color: var(--pro-text) !important;
    background: #0f172a !important;
    border-color: rgba(56, 189, 248, .28) !important;
}

body.normal-app-shell .modal .variant-panel,
body.normal-app-shell .modal .price-preview-panel,
body.normal-app-shell .modal .image-select-panel,
body.normal-app-shell .modal .variant-row,
body.normal-app-shell .modal .price-box,
body.normal-app-shell .modal .channel-price,
body.normal-app-shell .modal .upload-inline,
body.normal-app-shell .modal .file-drop {
    color: var(--pro-text) !important;
    background: #101a2d !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .product-form .form-actions,
body.normal-app-shell .modal-form-actions,
body.normal-app-shell .sticky-settings-actions {
    color: var(--pro-text) !important;
    background: rgba(15, 23, 42, .96) !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .settings-section-nav {
    color: var(--pro-text) !important;
    background: rgba(15, 23, 42, .88) !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .settings-form-modern input,
body.normal-app-shell .settings-form-modern select,
body.normal-app-shell .settings-form-modern textarea,
body.normal-app-shell .settings-form-modern .file-drop,
body.normal-app-shell .settings-form-modern .channel-settings-card,
body.normal-app-shell .settings-form-modern .digikala-feature-card {
    color: var(--pro-text) !important;
    background: #0b1426 !important;
    border-color: var(--pro-border) !important;
}

body.normal-app-shell .settings-form-modern label,
body.normal-app-shell .settings-form-modern h2,
body.normal-app-shell .settings-form-modern h3 { color: var(--pro-text) !important; }

/* Internal chat */
body.normal-app-shell [data-page="chat"] .chat-people,
body.normal-app-shell [data-page="chat"] .chat-panel {
    color: var(--pro-text);
    background: rgba(15, 23, 42, .9) !important;
    border-color: var(--pro-border) !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .2);
}

body.normal-app-shell [data-page="chat"] .chat-person {
    color: #dce8f7;
    background: rgba(8, 15, 32, .42);
    border-color: transparent;
}

body.normal-app-shell [data-page="chat"] .chat-person:hover {
    color: #fff;
    background: rgba(56, 189, 248, .09) !important;
    border-color: rgba(56, 189, 248, .25) !important;
}

body.normal-app-shell [data-page="chat"] .chat-person.active,
body.normal-app-shell [data-page="chat"] .chat-person.active:hover {
    color: #fff;
    background: rgba(8, 145, 178, .22) !important;
    border-color: rgba(45, 212, 191, .38) !important;
}

body.normal-app-shell [data-page="chat"] .chat-person small { color: #8597af !important; }
body.normal-app-shell [data-page="chat"] .chat-avatar {
    color: #e6fffb;
    background: linear-gradient(135deg, #0e7490, #0f766e);
}

body.normal-app-shell [data-page="chat"] .chat-thread {
    background:
        radial-gradient(circle at 15% 10%, rgba(56, 189, 248, .05), transparent 26%),
        #080f20;
}

body.normal-app-shell [data-page="chat"] .chat-bubble {
    color: #dce8f7;
    background: #172238 !important;
    border: 1px solid rgba(148, 163, 184, .14);
}

body.normal-app-shell [data-page="chat"] .chat-bubble.mine {
    color: #e6fffb;
    background: rgba(13, 116, 111, .34) !important;
    border-color: rgba(45, 212, 191, .24);
}

body.normal-app-shell [data-page="chat"] .chat-bubble-head,
body.normal-app-shell [data-page="chat"] .chat-ticks { color: #8597af; }
body.normal-app-shell [data-page="chat"] .chat-ticks.read { color: #5eead4; }

body.normal-app-shell [data-page="chat"] .chat-compose {
    background: #0d1629;
    border-color: var(--pro-border);
}

body.normal-app-shell [data-page="chat"] .chat-emoji-btn,
body.normal-app-shell [data-page="chat"] .chat-attach {
    color: #dce8f7;
    background: #111a2d !important;
    border-color: rgba(148, 163, 184, .2) !important;
}

body.normal-app-shell [data-page="chat"] .chat-emoji-btn:hover,
body.normal-app-shell [data-page="chat"] .chat-attach:hover {
    background: rgba(56, 189, 248, .1) !important;
    border-color: rgba(56, 189, 248, .35) !important;
}

/* Bulk product editor and Excel purchase audit */
.bulk-editor-modal-content {
    width: min(1180px, calc(100vw - 32px));
    height: min(920px, calc(100dvh - 24px));
    display: flex;
    flex-direction: column;
}
.bulk-editor-modal-content > .modal-body { flex: 1; min-height: 0; padding-bottom: 0; }
.bulk-editor-form { min-height: 100%; display: flex; flex-direction: column; }
.bulk-editor-list { display: grid; gap: 14px; padding-bottom: 92px; }
.bulk-product-card { border: 1px solid #d8e2ec; border-radius: 8px; background: #f8fafc; overflow: hidden; }
.bulk-product-card > header { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #102a43; color: #fff; }
.bulk-product-card > header div:last-child { display: grid; gap: 3px; }
.bulk-product-card > header small { color: #b8c7d9; }
.bulk-image-preview { width: 54px; height: 54px; border-radius: 7px; overflow: hidden; display: grid; place-items: center; flex: 0 0 auto; color: #9fb3c8; background: #07111f; font-size: 10px; }
.bulk-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.bulk-editor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 12px; }
.bulk-editor-grid label { min-width: 0; display: grid; gap: 5px; color: #334e68; font-size: 12px; font-weight: 700; }
.bulk-editor-grid input { width: 100%; min-width: 0; height: 38px; border: 1px solid #bcccdc; border-radius: 6px; padding: 6px 9px; background: #fff; color: #102a43; }
.bulk-editor-grid .span-2 { grid-column: span 2; }
.bulk-editor-grid .span-all { grid-column: 1 / -1; }
.bulk-image-field { display: flex; align-items: end; gap: 8px; }
.bulk-image-field label { flex: 1; }
.bulk-image-field .btn { min-height: 38px; white-space: nowrap; }
.bulk-editor-details { border: 1px solid #d8e2ec; border-radius: 7px; background: #fff; }
.bulk-editor-details > summary { cursor: pointer; padding: 10px 12px; color: #102a43; font-weight: 800; }
.bulk-editor-details > .bulk-editor-grid { padding-top: 4px; }
.bulk-editor-grid .check-field { display: flex; align-items: center; gap: 8px; min-height: 38px; padding-top: 18px; }
.bulk-editor-grid .check-field input { width: 18px; height: 18px; }
.bulk-editor-actions { position: sticky; bottom: 0; z-index: 5; display: flex; gap: 10px; justify-content: flex-end; margin-top: auto; padding: 12px 0; background: rgba(255,255,255,.97); border-top: 1px solid #d8e2ec; }
.bulk-editor-actions .btn-primary { min-width: 260px; }

.page-heading-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 18px; }
.page-heading-row h1 { margin: 0 0 4px; }
.page-heading-row p { margin: 0; color: var(--ui-muted, #627d98); }
.heading-actions { display: flex; gap: 8px; }
.metal-total-grid, .inventory-delta-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.metal-total-card, .inventory-delta-grid article { padding: 18px; border: 1px solid #d8e2ec; border-radius: 8px; background: #fff; }
.metal-total-card { display: grid; gap: 6px; }
.metal-total-card strong { font-size: 24px; color: #102a43; }
.metal-total-card.silver { border-inline-start: 4px solid #829ab1; }
.metal-total-card.gold { border-inline-start: 4px solid #d69e2e; }
.purchase-log-panel, .purchase-change-list, .import-summary-card { padding: 16px; border: 1px solid #d8e2ec; border-radius: 8px; background: #fff; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-title h2 { margin: 0; }
.purchase-log-table td > span { display: block; white-space: nowrap; }
.purchase-actions { display: flex; gap: 6px; }
.import-status { display: inline-flex; width: fit-content; border-radius: 99px; padding: 4px 10px; font-weight: 800; }
.import-status.success { color: #087f5b; background: #d3f9d8; }
.import-status.failed { color: #c92a2a; background: #ffe3e3; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 14px; padding-top: 16px; }
.import-summary-card { display: grid; grid-template-columns: auto auto 1fr; gap: 18px; align-items: center; margin-bottom: 16px; }
.import-summary-card > div { display: grid; gap: 5px; }
.import-summary-card p { margin: 0; color: #486581; }
.inventory-delta-grid article h3 { margin: 0 0 10px; }
.inventory-delta-grid article p { display: flex; justify-content: space-between; margin: 7px 0; }
.purchase-change-list { display: grid; gap: 10px; }
.purchase-change-card { border: 1px solid #d8e2ec; border-radius: 8px; overflow: hidden; }
.purchase-change-card > header { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; background: #f0f4f8; }
.purchase-change-card > header div { display: grid; }
.purchase-change-card > header span { color: #087f5b; font-weight: 800; }
.change-field-list { padding: 8px 13px; }
.change-field-list p, .variant-change p { display: grid; grid-template-columns: minmax(120px,.7fr) 1fr auto 1fr; gap: 8px; align-items: center; margin: 5px 0; }
.change-field-list del, .variant-change del { color: #c92a2a; text-decoration: none; }
.change-field-list ins, .variant-change ins { color: #087f5b; text-decoration: none; }
.variant-change { margin: 8px 13px; border-top: 1px dashed #bcccdc; padding-top: 8px; }
.variant-change summary { cursor: pointer; font-weight: 800; }

body.normal-app-shell .bulk-product-card,
body.normal-app-shell .bulk-editor-details,
body.normal-app-shell .purchase-log-panel,
body.normal-app-shell .purchase-change-list,
body.normal-app-shell .import-summary-card,
body.normal-app-shell .metal-total-card,
body.normal-app-shell .inventory-delta-grid article { background: #101a2d; border-color: rgba(148,163,184,.2); color: #e5edf7; }
body.normal-app-shell .bulk-editor-grid label,
body.normal-app-shell .bulk-editor-details > summary,
body.normal-app-shell .metal-total-card strong { color: #e5edf7; }
body.normal-app-shell .bulk-editor-grid input { background: #0b1324; border-color: rgba(148,163,184,.28); color: #fff; }
body.normal-app-shell .bulk-editor-actions { background: rgba(8,15,29,.98); border-color: rgba(148,163,184,.2); }
body.normal-app-shell .purchase-change-card { border-color: rgba(148,163,184,.2); }
body.normal-app-shell .purchase-change-card > header { background: #0b1324; }
body.normal-app-shell .page-heading-row p,
body.normal-app-shell .import-summary-card p { color: #aebdd0; }

@media (max-width: 900px) {
    .bulk-editor-modal-content { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; }
    .bulk-editor-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .page-heading-row, .import-summary-card { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
}
@media (max-width: 560px) {
    .bulk-editor-grid, .metal-total-grid, .inventory-delta-grid { grid-template-columns: 1fr; }
    .bulk-editor-grid .span-2 { grid-column: auto; }
    .bulk-image-field { align-items: stretch; flex-direction: column; }
    .bulk-editor-actions { flex-direction: row; }
    .bulk-editor-actions .btn { width: auto; min-width: 0; flex: 1; }
    .bulk-editor-actions .btn-primary { flex: 1.7; }
    .heading-actions { display: grid; width: 100%; }
    .change-field-list p, .variant-change p { grid-template-columns: 1fr; border-bottom: 1px dashed #d8e2ec; padding-bottom: 7px; }
}
