/* ===== MATERIAL DESIGN СТИЛИ ===== */
:root {
    --bg: #f6f8fa;
    --bg-card: #ffffff;
    --bg-hover: #f0f2f5;
    --text: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-bg: rgba(79, 70, 229, 0.08);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);
    
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.2s ease;
    --md-surface: #fffbff;
    --md-surface-container: #f1eef6;
    --md-primary: #6750a4;
    --md-on-primary: #ffffff;
    --md-secondary: #625b71;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    padding: 24px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== HEADER ===== */
.header {
    position: sticky;
    top: 12px;
    z-index: 600;
    background: var(--bg-card);
    padding: 24px 32px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.header h1,
.header .brand-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
    color: var(--text);
}

.header h1 span,
.header .brand-title span {
    color: var(--primary);
}

.header-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.header-time {
    font-size: 14px;
    color: var(--text-secondary);
    background: var(--bg);
    padding: 6px 16px;
    border-radius: 20px;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--border-light);
}

/* ===== STATUS BAR ===== */
.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    background: var(--bg-card);
    padding: 14px 24px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-dot.green { background: var(--success); }
.status-dot.orange { background: var(--warning); }
.status-dot.blue { background: var(--primary); }
.status-dot.gray { background: var(--text-muted); }
.status-dot.red { background: var(--danger); }

.status-label {
    color: var(--text-secondary);
    font-size: 13px;
}

.status-value {
    font-weight: 600;
    color: var(--text);
}

.status-value.green { color: var(--success); }
.status-value.orange { color: var(--warning); }
.status-value.blue { color: var(--primary); }
.status-value.red { color: var(--danger); }

.status-meta {
    display: block;
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.25;
}

/* ===== СТАТУС ПЛАНИРОВЩИКА ===== */
.scheduler-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.scheduler-status.running {
    background: var(--success-bg);
    color: var(--success);
}
.scheduler-status.stopped {
    background: var(--danger-bg);
    color: var(--danger);
}
.scheduler-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.scheduler-status.running .dot {
    background: var(--success);
    animation: pulse-dot 1.5s ease-in-out infinite;
}
.scheduler-status.stopped .dot {
    background: var(--danger);
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ===== BUTTONS ===== */
.btn {
    padding: 10px 20px;
    min-height: 44px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3); }

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3); }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #dc2626; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3); }

.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover { background: #d97706; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3); }

.btn-info {
    background: var(--info);
    color: white;
}
.btn-info:hover { background: #2563eb; box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-outline:hover { background: var(--bg); border-color: var(--text-muted); }

.btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

/* ===== BULK SCHEDULE ===== */
.bulk-schedule {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.bulk-schedule h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.bulk-schedule form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.bulk-schedule input,
.bulk-schedule select {
    padding: 9px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text);
    min-width: 140px;
}

.bulk-schedule input:focus,
.bulk-schedule select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ===== PRODUCT CARDS ===== */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.product-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.product-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 200px;
}

.product-photo {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.product-photo-placeholder {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border-radius: var(--radius-sm);
    font-size: 20px;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
}

.product-title {
    font-weight: 600;
    color: var(--text);
    font-size: 15px;
}

/* ===== ЭФФЕКТ ПРИ НАВЕДЕНИИ НА НАЗВАНИЕ ===== */
.product-title-link {
    color: var(--text);
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s ease, border-bottom-color 0.2s ease;
    position: relative;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    padding-bottom: 1px;
}
.product-title-link:hover {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.product-title-link:active {
    transform: scale(0.98);
}

.product-code {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
    flex-wrap: wrap;
}
.product-code .code-label {
    color: var(--text-secondary);
}
.product-code .code-value {
    color: var(--text);
    font-weight: 500;
}

/* Кнопка копирования */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.copy-btn:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
    color: var(--primary);
}
.copy-btn:active {
    transform: scale(0.92);
}
.copy-btn.copied {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}
.copy-btn svg {
    display: block;
    width: 14px;
    height: 14px;
}
.copy-btn.copied svg {
    stroke: var(--success);
}

.product-right {
    text-align: right;
    flex-shrink: 0;
}

.product-discount {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.product-discount-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.product-price {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
}

/* ===== ФОРМАТИРОВАНИЕ ЦЕН ===== */
.product-price .currency {
    font-size: 0.7em;
    color: var(--text-muted);
}
.product-price .kopecks {
    font-size: 0.7em;
    vertical-align: super;
    color: var(--text-secondary);
}

.product-price .status-loading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
}
.product-price .status-loading .dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: dotPulse 1.4s ease-in-out infinite;
}
.product-price .status-loading .dot:nth-child(2) { animation-delay: 0.2s; }
.product-price .status-loading .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.product-price.loading {
    color: var(--text-muted);
    font-weight: 400;
    animation: none !important;
}

.product-updated {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.product-updated .date {
    color: var(--text-secondary);
}
.product-updated .time {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ===== SCHEDULE ===== */
.schedule-list {
    margin: 12px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.schedule-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    background: linear-gradient(135deg, #fbfaff, #f4f0fb);
    padding: 8px 8px 8px 11px;
    border-radius: 11px;
    font-size: 11px;
    border: 1px solid #e8e1f2;
    box-shadow: 0 1px 1px rgba(51, 35, 77, .03);
}

.schedule-time {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-arrow {
    color: var(--text-muted);
}

.schedule-discount {
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}
.schedule-item .btn-danger {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    min-width: 20px !important;
    padding: 0 !important;
    border-radius: 7px !important;
    line-height: 1;
}

.schedule-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.schedule-form input {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    background: var(--bg-card);
    color: var(--text);
}

.schedule-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.schedule-form input[type="time"] { width: 140px; }
.schedule-form input[type="number"] { width: 120px; }

/* ===== LOGS ===== */
.logs-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

.logs-section h2 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.logs-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    font-size: 14px;
}

.logs-table th {
    background: var(--bg);
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1.5px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.logs-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text);
}

.logs-table tr:hover td { background: var(--bg); }

.status-success { color: var(--success); font-weight: 600; }
.status-error { color: var(--danger); font-weight: 600; }

/* ===== RATE LIMIT ===== */
.rate-limit-banner {
    background: var(--warning-bg);
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.rate-limit-banner .icon { font-size: 22px; }
.rate-limit-banner .title { color: #92400e; font-weight: 600; }
.rate-limit-banner .subtitle { color: #78350f; font-size: 14px; }
.rate-limit-banner .timer { font-weight: 700; color: #92400e; }
.rate-limit-banner .until { margin-left: auto; font-size: 14px; color: #78350f; }

/* ===== TOAST ===== */
#toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--text);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    display: none;
    z-index: 1000;
    max-width: 400px;
    font-size: 14px;
    animation: slideUp 0.3s ease;
}
#toast.error { background: var(--danger); }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== COPY TOAST ===== */
.toast-copy {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 999;
}
.toast-copy.show {
    opacity: 1;
}

/* ===== EMPTY ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}
.empty-state p { font-size: 18px; }
.empty-state .sub-text { font-size: 14px; margin-top: 8px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    body { padding: 12px; }
    
    .header { flex-direction: column; text-align: center; padding: 20px; }
    .header-time { align-self: center; }
    
    .status-bar { flex-direction: column; gap: 6px; padding: 14px 18px; }
    .controls .btn { flex: 1; min-width: 100px; justify-content: center; }
    
    .product-header { flex-direction: column; align-items: stretch; gap: 8px; }
    .product-info { min-width: unset; }
    .product-right { text-align: left; }
    
    .bulk-schedule form { flex-direction: column; align-items: stretch; }
    .bulk-schedule input, .bulk-schedule select { width: 100%; min-width: unset; }
    
    .schedule-form { flex-direction: column; }
    .schedule-form input { width: 100% !important; }
    
    .rate-limit-banner { flex-direction: column; align-items: flex-start; }
    .rate-limit-banner .until { margin-left: 0; }
    
    .logs-table { font-size: 12px; }
    .logs-table th, .logs-table td { padding: 6px 10px; }
    
    #toast { left: 16px; right: 16px; bottom: 16px; max-width: none; }
    .toast-copy { font-size: 12px; padding: 6px 14px; bottom: 70px; }
}

@media (max-width: 480px) {
    .product-title { font-size: 14px; }
    .product-discount { font-size: 22px; }
    .product-price { font-size: 16px; }
    .product-photo { width: 40px; height: 40px; }
    .product-photo-placeholder { width: 40px; height: 40px; font-size: 16px; }
    .schedule-list { grid-template-columns: 1fr; }
    .schedule-item { font-size: 12px; }
    .copy-btn { width: 20px; height: 20px; }
    .copy-btn svg { width: 12px; height: 12px; }
}

/* Акции в карточке */
.promo-stack {
    width: min(520px, 100%);
    margin-top: 12px;
    display: grid;
    gap: 7px;
}
.promo-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: left;
    background: linear-gradient(135deg, #fff7ed, #fffbeb);
    border: 1px solid #fed7aa;
}
.promo-row.joined {
    background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
    border-color: #a7f3d0;
}
.promo-row strong {
    display: block;
    max-width: 310px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}
.promo-row small {
    display: block;
    color: var(--text-secondary);
    font-size: 11px;
}
.promo-target {
    text-align: right;
    flex: none;
}
.promo-target span {
    color: #c2410c;
    font-weight: 800;
}
.promo-row.joined .promo-target span { color: #047857; }

.promotion-compact {
    margin: 10px 0 12px;
    overflow: hidden;
    border: 1px solid #e8e3ee;
    border-radius: 13px;
    background: #faf9fc;
}
.promotion-compact-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 11px;
    border-bottom: 1px solid #ece8f1;
    color: var(--text-secondary);
    font-size: 11px;
}
.promotion-compact-head .promotion-count {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #6d28d9;
    background: #ede9fe;
    text-align: center;
    font-weight: 700;
}
.promotion-compact-toggle {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    width: 100%;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.promotion-compact-toggle:hover strong { color: var(--primary); }
.md3-expand-icon {
    position: relative;
    display: inline-grid;
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0 !important;
    place-items: center;
    overflow: hidden;
    border-radius: 999px;
    background: transparent !important;
    color: #65558f !important;
    transition: background-color .18s ease, transform .22s cubic-bezier(.2, 0, 0, 1);
}
.md3-expand-icon::before {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: currentColor;
    content: "";
    opacity: 0;
    transition: opacity .18s ease;
}
.md3-expand-icon svg {
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.promotion-compact-toggle:hover .md3-expand-icon::before,
.promotion-compact-toggle:focus-visible .md3-expand-icon::before,
.promotion-show-more:hover .md3-expand-icon::before,
.schedule-options summary:hover .md3-expand-icon::before {
    opacity: .08;
}
.promotion-compact-toggle:active .md3-expand-icon::before,
.promotion-show-more:active .md3-expand-icon::before,
.schedule-options summary:active .md3-expand-icon::before {
    opacity: .12;
}
.promotion-compact:not(.promotion-compact-collapsed) .promotion-compact-toggle .md3-expand-icon,
.promotion-show-more[aria-expanded="true"] .md3-expand-icon,
.schedule-options[open] summary .md3-expand-icon {
    transform: rotate(180deg);
}
.promotion-compact-collapsed .promotion-compact-list,
.promotion-compact-collapsed .promotion-show-more { display: none; }
.promotion-compact-list { display: grid; }
.promotion-compact .promotion-extra { display: none; }
.promotion-compact.expanded .promotion-extra { display: flex; }
.promotion-show-more {
    display: flex;
    align-self: center;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-height: 30px;
    margin: 0;
    border: 1px solid #ded5ed;
    border-radius: 999px;
    background: #f7f3fd;
    color: var(--primary);
    padding: 3px 10px 3px 12px;
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.promotion-show-more:hover {
    border-color: #c9b8e5;
    background: #efe8fa;
}
.promotion-show-more .md3-expand-icon {
    width: 20px;
    min-width: 20px;
    height: 20px;
}
.promotion-show-more .md3-expand-icon svg {
    width: 16px;
    height: 16px;
}
.promotion-head-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.promotion-head-actions .promotion-show-more {
    min-height: 26px;
    padding: 2px 5px 2px 9px;
}
.promotion-compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(165px, 190px);
    align-items: center;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
    padding: 8px 11px;
    border-top: 1px solid #eeeaf2;
}
.promotion-compact-row:first-child { border-top: 0; }
.promotion-compact-name {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: 8px;
}
.promotion-compact-name > div {
    min-width: 0;
    overflow: hidden;
}
.promotion-compact-name strong {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.promotion-compact-name small,
.promotion-compact-price small {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
}
.promotion-status-dot {
    flex: 0 0 8px;
    width: 8px;
    height: 8px;
    margin-top: 3px;
    border-radius: 50%;
    background: #a8a1b3;
}
.promotion-compact-price {
    min-width: 0;
    overflow: hidden;
    text-align: right;
}
.promotion-compact-price strong {
    display: block;
    overflow: hidden;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.promotion-compact-row.status-joined,
.promotion-compact-row.status-ready { background: #f0fdf7; }
.promotion-compact-row.status-joined .promotion-status-dot,
.promotion-compact-row.status-ready .promotion-status-dot { background: #10b981; }
.promotion-compact-row.status-joined .promotion-compact-price strong,
.promotion-compact-row.status-ready .promotion-compact-price strong { color: #047857; }
.promotion-compact-row.status-adjust { background: #fffbeb; }
.promotion-compact-row.status-adjust .promotion-status-dot { background: #f59e0b; }
.promotion-compact-row.status-adjust .promotion-compact-price strong { color: #b45309; }
.promotion-compact-row.status-blocked { background: #fff1f2; }
.promotion-compact-row.status-blocked .promotion-status-dot { background: #e11d48; }
.promotion-compact-row.status-blocked .promotion-compact-price strong { color: #be123c; }
.promotion-compact-row.status-unknown { background: #f8f7fa; }
.promotion-compact-row.status-unknown .promotion-compact-price strong { color: #8b8494; }
.promo-more {
    color: var(--primary);
    font-size: 12px;
    text-decoration: none;
    text-align: left;
}
.auto-import-summary {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid #c4b5fd;
    border-radius: 10px;
    background: #f5f3ff;
    color: #4c1d95;
    font-size: 13px;
}
.auto-import-summary strong { color: #6d28d9; }
.auto-import-summary span { color: #5b4b72; }
.auto-import-summary small { color: #756889; font-size: 11px; overflow-wrap: anywhere; }

/* Календарь */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 16px;
}
.calendar-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
}
.calendar-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(#7c3aed, #ec4899);
}
.calendar-card[hidden] { display: none; }
.calendar-card.ending-soon::before { background: linear-gradient(#f59e0b, #ef4444); }
.calendar-filter {
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: #fff;
}
.calendar-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    min-height: 48px;
}
.calendar-card h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 16px;
    line-height: 1.35;
}
.calendar-card p { color: var(--text-secondary); font-size: 13px; }
.promotion-description {
    min-height: 70px;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    cursor: help;
}
.promotion-description-empty { cursor: default; color: var(--text-muted) !important; }
.promotion-description[data-tooltip]:hover { z-index: 10; }
.calendar-period { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; align-items: center; min-height: 66px; margin: 14px 0 4px; padding: 11px 12px; border: 1px solid #e8e2f2; border-radius: 12px; background: linear-gradient(100deg, #faf8ff, #fff); }
.calendar-period small { display: block; margin-bottom: 3px; color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.calendar-period strong { display: block; overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-period-end { text-align: right; }
.calendar-period-arrow { color: var(--primary); font-weight: 800; }
.participation-level { display: flex; flex-direction: column; min-height: 155px; margin-top: 12px; padding: 12px; border: 1px solid #d9f2e5; border-radius: 12px; background: linear-gradient(135deg, #f2fdf7, #fbfffd); }
.participation-level-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.participation-level-head small { display: block; color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.participation-level-head strong { display: block; margin-top: 2px; color: #047857; font-size: 20px; line-height: 1; }
.participation-boost { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; background: #d1fae5; color: #047857; font-size: 11px; font-weight: 800; white-space: nowrap; }
.participation-boost-muted { background: #eef2f7; color: #64748b; white-space: normal; text-align: right; }
.participation-progress { height: 7px; margin: 10px 0 9px; overflow: hidden; border-radius: 999px; background: #dceee5; }
.participation-progress span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: linear-gradient(90deg, #10b981, #34d399); }
.participation-levels { display: flex; flex-wrap: wrap; gap: 5px; }
.participation-step { border-radius: 999px; padding: 4px 6px; background: #edf2f0; color: #718096; font-size: 10px; font-weight: 700; }
.participation-step.is-reached { background: #d1fae5; color: #047857; }
.participation-next { margin: auto 0 0; color: #475569; font-size: 11px !important; line-height: 1.35; }
.participation-level-empty { border-style: dashed; background: #fbfafc; }
.participation-level-empty .participation-level-head strong { color: #94a3b8; }
.calendar-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.calendar-stat {
    display: grid;
    grid-template-rows: 24px 32px;
    align-content: start;
    align-items: center;
    min-height: 64px;
    background: var(--bg);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}
.calendar-stat-button { border: 1px solid transparent; width: 100%; color: inherit; font: inherit; cursor: pointer; transition: .18s ease; }
.calendar-stat-button:hover, .calendar-stat-button:focus-visible { border-color: var(--primary); background: #faf7ff; transform: translateY(-1px); outline: none; }
.calendar-stat strong {
    display: block;
    margin: 0;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    line-height: 24px;
}
.calendar-stat small {
    display: block;
    min-height: 30px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.25;
}
.promotion-data-source { display: grid; min-height: 54px; gap: 2px; margin-top: 10px; padding: 9px 11px; border-radius: 10px; font-size: 11px; }
.promotion-data-source strong { font-size: 12px; }
.promotion-data-source span { color: var(--text-secondary); }
.promotion-data-source small { overflow: hidden; color: var(--text-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-excel { background: #f4f0ff; color: #6d28d9; }
.source-wb-api { background: #ecfdf5; color: #047857; }
.source-wb-summary { background: #eff6ff; color: #1d4ed8; }
.source-empty { background: #fff7ed; color: #b45309; }
.calendar-overview { margin: 0 0 16px; padding: 17px 18px; border: 1px solid #e7def7; border-radius: 16px; background: linear-gradient(120deg, #fff, #faf7ff); box-shadow: var(--shadow); }
.calendar-overview-title { display: flex; justify-content: space-between; gap: 14px; align-items: end; margin-bottom: 14px; }
.calendar-overview-title h2 { margin: 3px 0 0; font-size: 20px; }
.calendar-overview-title p { max-width: 530px; margin: 0; color: var(--text-secondary); font-size: 11px; text-align: right; }
.calendar-overview-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.calendar-overview-stat { min-height: 78px; display: flex; flex-direction: column; justify-content: center; padding: 11px 12px; border: 1px solid #ebe5f5; border-radius: 12px; background: rgba(255,255,255,.82); }
.calendar-overview-stat small { color: var(--text-muted); font-size: 10px; }
.calendar-overview-stat strong { margin-top: 5px; color: var(--text); font-size: 22px; line-height: 1; }
.calendar-overview-stat strong span { color: var(--text-muted); font-size: 12px; font-weight: 600; }
.type-pill {
    display: inline-flex;
    border-radius: 999px;
    padding: 4px 9px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 11px;
    font-weight: 700;
}
.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.calendar-toolbar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.promotion-members-modal { width: min(720px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 28px)); display: flex; flex-direction: column; }
.members-modal-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.members-modal-head h3 { margin: 2px 0 0; font-size: 18px; }
.members-modal-note { margin: 14px 0 8px; color: var(--text-secondary); font-size: 12px; }
.promotion-members-list { overflow: auto; border: 1px solid var(--border-light); border-radius: 11px; background: #fff; }
.promotion-member-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--border-light); font-size: 12px; }
.promotion-member-row:first-child { border-top: 0; }
.promotion-member-row div:last-child { text-align: right; flex: 0 0 auto; }
.promotion-member-row strong, .promotion-member-row span, .promotion-member-row small { display: block; }
.promotion-member-row span, .promotion-member-row small { margin-top: 2px; color: var(--text-muted); font-size: 11px; }

/* ===== ИНТЕРФЕЙС СМОРОДИНЫ ===== */
:root {
    --bg: #ffffff;
    --bg-card: rgba(255,255,255,.92);
    --text: #17151f;
    --text-secondary: #6f6a79;
    --text-muted: #9b96a5;
    --border: #e7e4ec;
    --border-light: #efedf3;
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --primary-light: #f1eafe;
    --primary-bg: rgba(109,40,217,.09);
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #6d28d9;
    --shadow: 0 1px 2px rgba(31,25,45,.04), 0 8px 24px rgba(31,25,45,.05);
    --shadow-md: 0 12px 30px rgba(35,23,62,.13);
    --shadow-hover: 0 20px 45px rgba(40,25,75,.11);
    --radius: 18px;
    --radius-sm: 11px;
}

body {
    min-height: 100vh;
    background: #ffffff;
    padding: 28px;
}

.container { max-width: 1480px; }

.header {
    padding: 18px 22px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, .92);
    background: linear-gradient(135deg, rgba(255, 255, 255, .9), rgba(250, 249, 253, .76));
    -webkit-backdrop-filter: blur(22px) saturate(1.35);
    backdrop-filter: blur(22px) saturate(1.35);
    box-shadow:
        0 14px 36px rgba(38, 31, 52, .1),
        inset 0 1px 0 rgba(255, 255, 255, .95);
}
.brand, .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand-mark {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}
.brand-mark img {
    width: 120%;
    height: 120%;
    object-fit: contain;
    filter: drop-shadow(0 3px 3px rgba(49, 15, 87, .2));
}
/* Знак одинаковый на всех страницах: без цветной подложки. */
.header h1, .header .brand-title { font-size: 20px; line-height: 1.15; }
.header h1 span, .header .brand-title span { color: var(--text-secondary); font-weight: 500; }
.header-subtitle { font-size: 12px; }
.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    padding: 8px 10px;
    min-height: 44px;
    border-radius: 9px;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.active { color: var(--primary); background: #ede9fe; box-shadow: inset 0 0 0 1px rgba(124,58,237,.12); }
.nav-inline-form { display: inline-flex; margin: 0; }
.nav-button {
    border: 0;
    font-family: inherit;
    line-height: inherit;
    background: transparent;
    cursor: pointer;
}
.brand-link { color: inherit; text-decoration: none; }
.brand-link:hover .brand-mark { transform: translateY(-1px); }
.brand-mark { transition: transform .2s ease; }
.header-time {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255,255,255,.58);
    border-color: rgba(176, 218, 242, .72);
}
.header-runtime {
    display: flex;
    min-width: 112px;
    align-items: center;
    justify-content: center;
}

body.public-shell,
body.auth-shell {
    padding: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 90% 10%, rgba(103,80,164,0.10), transparent 30%),
        linear-gradient(180deg, #fffbff 0%, #f7f3fb 100%);
}

.public-nav,
.public-footer {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.public-nav-actions,
.landing-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.landing-hero {
    max-width: 1180px;
    min-height: calc(100vh - 168px);
    margin: 0 auto;
    padding: 56px 24px 72px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
    align-items: center;
    gap: 48px;
}

.landing-hero-copy h1 {
    max-width: 760px;
    font-size: clamp(38px, 6vw, 72px);
    line-height: 0.98;
    letter-spacing: 0;
    margin: 12px 0 24px;
    color: #1d1b20;
}

.landing-hero-copy p {
    max-width: 680px;
    color: #4d4654;
    font-size: 18px;
}

.eyebrow {
    color: var(--md-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.landing-panel,
.feature-card,
.auth-card,
.onboarding-card,
.admin-panel,
.temporary-password-box {
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(103,80,164,0.12);
    border-radius: 24px;
    box-shadow: 0 10px 28px rgba(42, 32, 60, 0.08);
}

.landing-panel {
    padding: 28px;
}

.landing-panel-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.landing-panel-row strong {
    color: var(--md-primary);
    font-size: 24px;
}

.landing-chart {
    height: 150px;
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: end;
    gap: 12px;
}

.landing-chart span {
    border-radius: 16px 16px 6px 6px;
    background: linear-gradient(180deg, #6750a4, #9a82db);
}

.landing-chart span:nth-child(1) { height: 42%; }
.landing-chart span:nth-child(2) { height: 72%; }
.landing-chart span:nth-child(3) { height: 54%; }
.landing-chart span:nth-child(4) { height: 88%; }

.landing-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 24px 80px;
}

.landing-section h2 {
    max-width: 720px;
    margin-top: 8px;
    font-size: 36px;
    line-height: 1.1;
    letter-spacing: 0;
}

.landing-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 28px;
}

.feature-card {
    padding: 24px;
    border-radius: 18px;
}

.feature-card h3 {
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-secondary);
}

.public-footer {
    justify-content: flex-start;
    flex-wrap: wrap;
    border-top: 1px solid rgba(103,80,164,0.12);
}

.public-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.auth-shell {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 460px);
    padding: 28px;
}

.auth-heading {
    margin: 28px 0 18px;
}

.auth-heading h2,
.auth-card h1,
.onboarding-card h1 {
    font-size: 30px;
    line-height: 1.15;
    letter-spacing: 0;
}

.auth-heading p,
.auth-switch,
.onboarding-card p,
.legal-page p {
    color: var(--text-secondary);
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label {
    display: grid;
    gap: 7px;
    color: var(--text);
    font-weight: 650;
}

.auth-form input,
.auth-form textarea,
.auth-form select,
.admin-search input,
.admin-search select,
.admin-create-user input,
.admin-create-user select,
.row-actions select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 14px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.auth-form input:focus,
.auth-form textarea:focus,
.admin-search input:focus,
.admin-search select:focus,
.admin-create-user input:focus,
.admin-create-user select:focus {
    outline: 3px solid rgba(103,80,164,0.18);
    border-color: var(--md-primary);
}

.auth-form .checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
}

.auth-form .checkbox-line input {
    width: 24px;
    min-width: 24px;
    height: 24px;
    min-height: 24px;
    margin-top: 1px;
    padding: 0;
    accent-color: var(--md-primary);
}

.auth-form .checkbox-line a,
.auth-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 45px;
}

.auth-switch {
    margin-top: 18px;
}

.password-requirements {
    display: grid;
    gap: 6px;
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    color: #991b1b;
    font-size: 13px;
    font-weight: 650;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 7px;
}

.password-requirements li::before {
    content: '●';
    font-size: 10px;
    color: currentColor;
}

.password-requirements li.is-valid {
    color: #047857;
}

.form-alert {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
}

.form-alert.error {
    background: var(--danger-bg);
    color: #991b1b;
}

.form-alert.success {
    background: #ecfdf5;
    color: #047857;
}

.onboarding-hero-card {
    max-width: 980px;
}

.onboarding-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.onboarding-topbar h1 {
    margin-bottom: 0;
}

.onboarding-logout {
    flex: 0 0 auto;
}

.onboarding-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 22px 0;
    list-style: none;
}

.onboarding-steps li {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(103,80,164,.12);
    border-radius: 18px;
    background: var(--surface-container);
}

.onboarding-steps span {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--md-primary);
    color: #fff;
    font-weight: 800;
}

.onboarding-steps strong,
.onboarding-steps small {
    display: block;
    margin-top: 8px;
}

.onboarding-steps small {
    color: var(--text-secondary);
}

.onboarding-step-panel {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid rgba(103,80,164,.12);
    border-radius: 20px;
    background: rgba(255,255,255,.72);
}

.step-kicker {
    width: max-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(103,80,164,.10);
    color: var(--md-primary);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.onboarding-step-panel h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: 0;
}

.onboarding-token-help {
    padding: 14px;
    border-radius: 16px;
    background: var(--md-surface-container);
}

.onboarding-token-help p,
.onboarding-permissions p {
    margin: 8px 0 0;
}

.onboarding-token-help ul {
    margin: 8px 0 8px 18px;
    color: var(--text-secondary);
}

.onboarding-permissions ul {
    margin: 0 0 0 20px;
    color: var(--text-secondary);
}

.onboarding-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.token-check-result {
    flex: 1 1 260px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--md-surface-container);
    color: var(--text-secondary);
    font-weight: 700;
}

.token-check-result:empty {
    display: none;
}

.token-check-result.pending {
    background: #eff6ff;
    color: #1d4ed8;
}

.token-check-result.success {
    background: #ecfdf5;
    color: #047857;
}

.token-check-result.error {
    background: #fef2f2;
    color: #b91c1c;
}

.onboarding-resume {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.onboarding-layout,
.legal-page,
.admin-layout {
    padding-top: 24px;
}

.onboarding-card,
.legal-page {
    max-width: 860px;
    padding: 28px;
    margin: 0 auto;
    overflow-wrap: anywhere;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.admin-stats article {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 18px;
}

.admin-stats small {
    color: var(--text-secondary);
}

.admin-stats strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
}

.admin-panel,
.temporary-password-box {
    padding: 22px;
    margin-bottom: 20px;
}

.admin-panel-head,
.admin-search,
.admin-create-user,
.row-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-panel-head {
    justify-content: space-between;
    margin-bottom: 16px;
}

.admin-search input {
    min-width: 240px;
}

.admin-create-user {
    margin-bottom: 16px;
}

.temporary-password-box {
    background: #fff8e1;
    border-color: #f6d365;
}

.temporary-password-box code {
    display: block;
    width: max-content;
    max-width: 100%;
    margin: 12px 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: #1f2937;
    color: #fff;
    overflow-wrap: anywhere;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.admin-panel .table-wrap table {
    width: 100%;
    min-width: 980px;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-panel .table-wrap th,
.admin-panel .table-wrap td {
    padding: 12px 14px;
    vertical-align: middle;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.admin-panel .table-wrap th {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.admin-panel .table-wrap td:first-child {
    font-weight: 650;
}

.admin-panel .row-actions {
    min-width: 420px;
}

.admin-inline-input {
    width: min(220px, 100%);
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.admin-inline-input:focus {
    outline: 3px solid rgba(103,80,164,0.18);
    border-color: var(--md-primary);
}

.admin-table-link,
.admin-back-link {
    color: var(--md-primary);
    font-weight: 800;
    text-decoration: none;
}

.admin-table-link:hover,
.admin-back-link:hover {
    text-decoration: underline;
}

.admin-status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 2px 4px 2px 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
}

.admin-status-active {
    background: rgba(16,185,129,.10);
    color: #047857;
}

.admin-status-blocked,
.admin-status-lockout {
    background: rgba(239,68,68,.10);
    color: #b91c1c;
}

.admin-login-note {
    display: block;
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}

.admin-pagination-summary {
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

.admin-pagination {
    justify-content: flex-start;
    margin-top: 12px;
    margin-bottom: 0;
}

.admin-user-detail .admin-panel-head {
    align-items: flex-start;
}

.admin-detail-subtitle {
    margin: 6px 0 0;
    color: var(--text-secondary);
}

.admin-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
    gap: 16px;
}

.admin-detail-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--surface-container);
}

.admin-detail-card h3 {
    margin: 0 0 14px;
}

.admin-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.admin-detail-list div {
    min-width: 0;
    padding: 12px;
    border-radius: 16px;
    background: var(--surface);
}

.admin-detail-list dt {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.admin-detail-list dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

.admin-detail-form {
    display: grid;
    gap: 12px;
}

.admin-detail-form .row-actions {
    min-width: 0;
}

.admin-detail-form label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.admin-detail-form input,
.admin-detail-form select {
    min-height: 44px;
}

.admin-mini-list {
    display: grid;
    gap: 10px;
}

.admin-mini-row {
    min-width: 0;
    padding: 14px;
    border-radius: 16px;
    background: var(--surface);
}

.admin-mini-row strong,
.admin-mini-row span,
.admin-mini-row small {
    display: block;
    overflow-wrap: anywhere;
}

.admin-mini-row span,
.admin-mini-row small {
    margin-top: 4px;
    color: var(--text-secondary);
}

@media (max-width: 900px) {
    .admin-detail-grid,
    .admin-detail-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .admin-detail-form .row-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-detail-form .row-actions .btn {
        width: 100%;
    }
}

.admin-job-state {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(103,80,164,.10);
    color: var(--md-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .03em;
}

.admin-job-completed {
    background: rgba(16,185,129,.10);
    color: #047857;
}

.admin-job-failed {
    background: rgba(239,68,68,.10);
    color: #b91c1c;
}

.admin-job-retrying {
    background: rgba(245,158,11,.14);
    color: #b45309;
}

.admin-job-message {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-muted {
    color: var(--text-muted);
}

.admin-system-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.admin-system-card {
    min-width: 0;
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: var(--surface-container);
}

.admin-system-card small,
.admin-system-card span {
    display: block;
    color: var(--text-secondary);
    overflow-wrap: anywhere;
}

.admin-system-card strong {
    display: block;
    margin: 8px 0;
    color: var(--on-surface);
    font-size: 24px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.system-ok { color: #047857 !important; }
.system-warn { color: #b45309 !important; }
.system-error { color: #b91c1c !important; }

@media (max-width: 960px) {
    .admin-system-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .admin-system-grid {
        grid-template-columns: 1fr;
    }
}

.legal-page h1 {
    margin: 24px 0 12px;
}

.legal-note {
    padding: 14px 16px;
    border: 1px solid rgba(103,80,164,.14);
    border-radius: 18px;
    background: var(--md-surface-container);
}

.legal-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--border-light);
}

.legal-section h2 {
    margin: 0 0 10px;
    font-size: 22px;
    letter-spacing: 0;
}

.legal-section ul {
    margin: 10px 0 0 20px;
    color: var(--text-secondary);
}

.legal-section li + li {
    margin-top: 6px;
}

.legal-requisites {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0 0;
}

.legal-requisites div {
    min-width: 0;
    padding: 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.72);
}

.legal-requisites dt {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.legal-requisites dd {
    margin: 4px 0 0;
    font-weight: 800;
}

.cabinet-settings-page {
    padding-top: 24px;
}

.cabinet-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
}

.cabinet-page-head > * {
    min-width: 0;
}

.cabinet-page-head .landing-actions,
.cabinet-page-head .public-nav-actions {
    justify-content: flex-end;
}

.cabinet-page-head h1 {
    margin: 6px 0 8px;
    font-size: 34px;
    letter-spacing: 0;
}

.cabinet-page-head p {
    max-width: 720px;
    color: var(--text-secondary);
}

.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.cabinet-card {
    display: grid;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.cabinet-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.cabinet-card.active {
    border-color: rgba(103,80,164,0.42);
    box-shadow: 0 0 0 3px rgba(103,80,164,0.10), var(--shadow);
}

.cabinet-card h2 {
    font-size: 20px;
    letter-spacing: 0;
}

.cabinet-card p,
.cabinet-card-meta {
    color: var(--text-secondary);
}

.status-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 11px;
    border-radius: 999px;
    background: var(--md-surface-container);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .03em;
}

.status-active {
    background: #dcfce7;
    color: #047857;
}

.status-error {
    background: #fee2e2;
    color: #b91c1c;
}

.status-invalid-token {
    background: #fee2e2;
    color: #b91c1c;
}

.status-needs-captcha {
    background: #fef3c7;
    color: #92400e;
}

.status-disabled {
    background: #f1f5f9;
    color: #64748b;
}

.status-pending {
    background: #ede9fe;
    color: var(--md-primary);
}

.cabinet-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.cabinet-facts div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: rgba(255,255,255,.68);
}

.cabinet-facts dt {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.cabinet-facts dd {
    margin: 3px 0 0;
    color: var(--text);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.cabinet-fact-wide {
    grid-column: 1 / -1;
}

.cabinet-facts code {
    padding: 4px 8px;
    border-radius: 9px;
    background: var(--md-surface-container);
}

.cabinet-card-meta,
.cabinet-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.cabinet-card-meta small {
    width: 100%;
    overflow-wrap: anywhere;
}

.cabinet-edit-form {
    display: grid;
    gap: 10px;
}

.cabinet-edit-form label {
    display: grid;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.cabinet-edit-form label small {
    color: var(--text-muted);
    font-weight: 600;
}

.cabinet-edit-form input,
.cabinet-edit-form textarea {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    border: 1px solid rgba(103,80,164,.18);
    border-radius: 14px;
    background: rgba(255,255,255,.92);
    color: var(--text-primary);
    font: inherit;
    font-size: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.cabinet-edit-form input {
    min-height: 46px;
    padding: 0 14px;
}

.cabinet-edit-form textarea {
    min-height: 96px;
    padding: 12px 14px;
    resize: vertical;
}

.cabinet-edit-form input:focus,
.cabinet-edit-form textarea:focus {
    outline: 3px solid rgba(103,80,164,.14);
    border-color: rgba(103,80,164,.56);
    background: #fff;
}

.cabinet-edit-form input:disabled,
.cabinet-edit-form textarea:disabled {
    background: rgba(238,234,244,.72);
    color: var(--text-muted);
}

.cabinet-inline-result {
    min-height: 20px;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
}

.cabinet-inline-result.error {
    color: #b91c1c;
}

.cabinet-empty-card {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
    padding: 28px;
    border: 1px solid rgba(103,80,164,.14);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(245,239,255,.88));
    box-shadow: var(--shadow);
}

.cabinet-empty-card p {
    max-width: 620px;
    color: var(--text-secondary);
}

.cabinet-create-card {
    margin: 0 0 32px;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
    gap: 16px;
    margin-bottom: 18px;
}

.profile-card {
    align-content: start;
}

.profile-facts {
    display: grid;
    gap: 10px;
    margin: 0;
}

.profile-facts div,
.profile-cabinet-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: 14px;
    background: rgba(255,255,255,.72);
}

.profile-facts dt {
    color: var(--text-secondary);
    font-size: 13px;
}

.profile-facts dd {
    margin: 0;
    font-weight: 700;
}

.profile-cabinet-list {
    display: grid;
    gap: 10px;
}

.profile-cabinet-row > div {
    display: grid;
    gap: 4px;
}

.profile-cabinet-row span {
    color: var(--text-secondary);
}

.profile-cabinet-row code {
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--md-surface-container);
}

@media (max-width: 900px) {
    .landing-hero,
    .landing-feature-grid,
    .admin-stats,
    .profile-grid,
    .onboarding-steps {
        grid-template-columns: 1fr;
    }
    .landing-hero {
        padding-top: 24px;
        min-height: auto;
    }
    .landing-hero-copy h1 {
        font-size: 42px;
    }
    .cabinet-page-head {
        flex-direction: column;
    }
    .cabinet-page-head .landing-actions,
    .cabinet-page-head .public-nav-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    body {
        padding: 12px;
    }
    body.public-shell,
    body.auth-shell {
        padding: 0;
    }
    .public-nav {
        align-items: flex-start;
        flex-direction: column;
    }
    .landing-hero-copy h1 {
        font-size: 36px;
    }
    .landing-panel,
    .auth-card,
    .onboarding-card,
    .admin-panel,
    .legal-page {
        border-radius: 18px;
        padding: 18px;
    }
    .legal-requisites {
        grid-template-columns: 1fr;
    }
    .cabinet-card-top,
    .onboarding-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .onboarding-topbar {
        display: grid;
    }
    .onboarding-logout,
    .onboarding-logout .btn {
        width: 100%;
    }
    .cabinet-facts {
        grid-template-columns: 1fr;
    }
    .landing-actions .btn,
    .cabinet-page-head .btn {
        flex: 1 1 150px;
        justify-content: center;
    }
}
.header-time-status {
    appearance: none;
    font: inherit;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.header-time-status:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.header-time-status:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.header-time-status:disabled { cursor: wait; opacity: .7; transform: none; }
.header-time-status.running { color: var(--success); background: var(--success-bg); border-color: rgba(16,185,129,.34); }
.header-time-status.stopped { color: var(--primary); background: var(--primary-bg); border-color: rgba(79,70,229,.3); }
.header-time-status.waiting { color: var(--warning); background: var(--warning-bg); border-color: rgba(245,158,11,.34); }
.header-time-status.error { color: var(--danger); background: var(--danger-bg); border-color: rgba(239,68,68,.34); }
.header-time-status.running .live-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(16,185,129,.12); animation: pulse-dot 1.5s ease-in-out infinite; }
.header-time-status.stopped .live-dot { background: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.12); }
.header-time-status.waiting .live-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(245,158,11,.12); animation: pulse-dot 1.5s ease-in-out infinite; }
.header-time-status.error .live-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(239,68,68,.12); }
.header-time-status[data-tooltip]::before {
    display: none;
}
.header-time-status[data-tooltip]::after {
    top: calc(100% + 8px);
    width: 285px;
    max-width: min(285px, calc(100vw - 32px));
    padding: 11px 12px;
    color: #f8f6fc;
    font-size: 11px;
    font-weight: 550;
    line-height: 1.55;
    text-align: left;
    white-space: pre-line;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 4px rgba(16,185,129,.12);
}

.status-bar {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,.58);
    backdrop-filter: blur(12px);
    border-color: rgba(255,255,255,.8);
}
.status-item {
    min-height: 62px;
    padding: 10px 13px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    border-radius: 13px;
    background: rgba(255,255,255,.82);
    border: 1px solid var(--border-light);
}
.status-item:has(.status-value.orange) { display: none; }
.status-label { font-size: 11px; }
.status-value { font-size: 18px; letter-spacing: -.02em; }

.command-bar {
    position: sticky;
    top: var(--sticky-command-top, 106px);
    z-index: 590;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-bottom: 18px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid rgba(124,58,237,.14);
    background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,242,255,.96));
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 32px rgba(76,29,149,.12);
}
.command-primary, .command-secondary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap;
}
.command-bar .btn {
    min-height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    box-shadow: none;
}
.btn-soft {
    color: var(--primary);
    background: rgba(124,58,237,.07);
    border: 1px solid rgba(124,58,237,.14);
}
.btn-soft:hover { background: rgba(124,58,237,.13); color: var(--primary-hover); }
.scheduler-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid rgba(124,58,237,.13);
    border-radius: 13px;
    background: rgba(255,255,255,.68);
}
.command-promotion-switch {
    height: 42px;
    min-width: auto;
    padding: 0 10px;
    border-radius: 11px;
    color: var(--primary);
    transition: background-color .18s ease;
}
.command-promotion-switch:hover { background: rgba(124,58,237,.07); }
.command-promotion-switch .md3-switch-track {
    border-color: #c4b5fd;
    background: #ede9fe;
}
.command-promotion-switch .md3-switch-track > span { background: #8b5cf6; }
.command-promotion-switch input:checked + .md3-switch-track {
    border-color: var(--primary);
    background: var(--primary);
}
.command-promotion-switch input:focus-visible + .md3-switch-track {
    outline-color: rgba(124,58,237,.38);
}
.scheduler-controls-label {
    padding: 0 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
}
.scheduler-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--text-secondary);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 750;
    transition: var(--transition);
}
.scheduler-control.start:not(:disabled):hover {
    border-color: rgba(110,231,183,.25);
    color: #6ee7b7;
    background: rgba(16,185,129,.13);
}
.scheduler-control.stop:not(:disabled):hover {
    border-color: rgba(252,165,165,.24);
    color: #fca5a5;
    background: rgba(239,68,68,.12);
}
.scheduler-control:disabled {
    border-color: rgba(124,58,237,.06);
    color: #c5bfcd;
    background: rgba(124,58,237,.025);
    cursor: default;
}
.btn-accent {
    color: #fff;
    background: linear-gradient(135deg, #db2777, #7c3aed);
    box-shadow: 0 8px 18px rgba(219,39,119,.22);
}
.btn-accent:hover { filter: brightness(1.08); }

/* Подсказки сервиса: единый ягодный акцент вместо системных подсказок браузера.
   Задержка не даёт им мелькать при движении по панели действий. */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    left: 50%;
    z-index: 5000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .66s;
}
[data-tooltip]::before {
    display: none;
}
[data-tooltip]::after {
    display: none;
    content: attr(data-tooltip);
    top: calc(100% + 9px);
    width: max-content;
    max-width: min(260px, calc(100vw - 32px));
    padding: 12px 13px 10px;
    border: 1px solid rgba(220,203,255,.32);
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #302044, #211b31);
    box-shadow: 0 14px 32px rgba(46,31,69,.28);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
    text-align: center;
    white-space: normal;
    transform: translate(-50%, -4px);
}
[data-tooltip]:hover::before,
[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-within::before,
[data-tooltip]:focus-within::after {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    transition-delay: .5s;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.update-progress {
    margin: -8px 0 18px;
    padding: 12px 16px;
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow);
}
.update-progress.error {
    color: #9f1239;
    background: #fff1f2;
    border: 1px solid #fecdd3;
}
.update-progress.error .progress-track > div {
    background: linear-gradient(90deg, #f59e0b, #e11d48);
}
.update-progress-copy {
    display: flex;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 700;
}
.progress-track { height: 6px; overflow: hidden; border-radius: 99px; background: #eeeaf4; }
#progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #db2777);
    transition: width .35s ease;
}

.bulk-schedule {
    display: block;
    padding: 18px 20px 20px;
    overflow: visible;
    border: 1px solid #e8e2ef;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 30px rgba(43, 32, 59, .07);
}
.bulk-schedule-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee9f3;
}
.bulk-schedule-heading { display: flex; align-items: center; gap: 11px; }
.bulk-schedule-heading h3 { margin: 0; font-size: 14px; line-height: 1.25; }
.bulk-schedule-heading p { margin: 3px 0 0; color: #857e8d; font-size: 10px; }
.bulk-schedule-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 12px;
    background: #f0eafb;
    color: #6d28d9;
}
.bulk-schedule-icon svg,
#bulk-schedule-submit svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.selection-counter {
    display: inline-flex;
    min-height: 30px;
    padding: 0 10px;
    align-items: center;
    border-radius: 999px;
    background: #f2eff5;
    color: #756e7d;
    font-size: 10px;
    font-weight: 750;
}
.selection-counter.has-selection { background: #eee8fb; color: #642bc2; }
.bulk-schedule form {
    display: grid;
    grid-template-columns: 140px 140px minmax(230px, 1.15fr) minmax(210px, 1fr) minmax(170px, .75fr);
    gap: 10px;
    align-items: end;
}
.bulk-field { display: grid; min-width: 0; gap: 5px; }
.bulk-field > span {
    padding-left: 3px;
    color: #7f7788;
    font-size: 9px;
    font-weight: 750;
}
.bulk-schedule .bulk-field input,
.bulk-schedule .bulk-field select {
    width: 100%;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    border: 1px solid #ddd7e5;
    border-radius: 11px;
    background: #fff;
    font-size: 12px;
}
#bulk-schedule-submit {
    display: inline-flex;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 0 14px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 11px;
    white-space: normal;
}
.bulk-submit-label { line-height: 1.2; }

.product-select {
    position: relative;
    display: inline-flex;
    align-self: flex-start;
    margin: 3px 2px 0 0;
    cursor: pointer;
}
.product-select-input { position: absolute; opacity: 0; pointer-events: none; }
.product-select > span:not(.sr-only) {
    width: 19px; height: 19px; display: block; border: 2px solid #c9c1d7;
    border-radius: 6px; background: #fff; transition: .18s ease;
}
.product-select-input:checked + span:not(.sr-only) {
    border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px #fff;
}
.product-select-input:focus-visible + span:not(.sr-only) { outline: 3px solid var(--primary-bg); outline-offset: 2px; }
.product-card.is-selected { box-shadow: 0 0 0 2px rgba(124, 58, 237, .28), var(--shadow); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

.catalog-divider {
    display: flex;
    align-items: center;
    margin: 30px 0 14px;
}
.catalog-divider::before {
    width: 72px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #6d28d9, #a855f7);
    content: "";
}
.catalog-divider span {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, #ddd5eb, rgba(221, 213, 235, 0));
}
.catalog-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin: 0 0 14px;
}
.eyebrow {
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15em;
}
.catalog-toolbar h2 { margin-top: 2px; font-size: 25px; letter-spacing: -.04em; }
.catalog-toolbar h2 span { color: var(--text-muted); font-weight: 500; }
.catalog-range {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
}
.catalog-tools {
    display: flex;
    width: 100%;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: nowrap;
}
.search-box {
    width: clamp(300px, 28vw, 410px);
    min-width: 260px;
    height: 46px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
}
.search-box svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: #777080;
    stroke-width: 1.9;
    stroke-linecap: round;
}
.search-box:focus-within {
    border-color: #a78bfa;
    box-shadow: 0 0 0 4px rgba(124,58,237,.08);
}
.search-box input {
    width: 100%;
    height: 44px;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
}
.catalog-select-field {
    display: grid;
    min-width: 190px;
    gap: 4px;
}
.catalog-select-field > span {
    padding-left: 3px;
    color: #827a8b;
    font-size: 9px;
    font-weight: 750;
}
.catalog-tools select {
    height: 46px;
    min-width: 160px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    background: var(--bg-card);
    color: var(--text);
}
.catalog-limit-field { min-width: 96px; }
.catalog-limit-field select { min-width: 96px; }
.catalog-reset {
    display: inline-flex;
    height: 46px;
    padding: 0 12px;
    align-items: center;
    border-radius: 11px;
    color: #6d28d9;
    font-size: 11px;
    font-weight: 750;
    text-decoration: none;
}
.catalog-reset:hover { background: #f3effb; }
.catalog-page-selection {
    display: flex;
    margin-left: auto;
    margin-right: 20px;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}
.catalog-select-page {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 11px;
    user-select: none;
}
.catalog-select-page input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.catalog-select-page > span {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border: 1.5px solid #968ca0;
    border-radius: 6px;
    background: #fff;
}
.catalog-select-page input:checked + span,
.catalog-select-page input:indeterminate + span {
    border-color: #6d28d9;
    background: #6d28d9;
}
.catalog-select-page input:checked + span::after {
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: translateY(-1px) rotate(-45deg);
    content: "";
}
.catalog-select-page input:indeterminate + span::after {
    width: 9px;
    height: 2px;
    border-radius: 2px;
    background: #fff;
    content: "";
}
.catalog-select-page input:focus-visible + span {
    box-shadow: 0 0 0 4px rgba(109,40,217,.13);
}
.catalog-promotion-switch {
    display: flex;
    height: 46px;
    min-width: 166px;
    align-items: center;
    gap: 8px;
    color: #5f5867;
    cursor: pointer;
    user-select: none;
}
.catalog-promotion-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}
.md3-switch-track {
    position: relative;
    width: 42px;
    height: 24px;
    flex: 0 0 42px;
    border: 2px solid #79747e;
    border-radius: 999px;
    background: #e6e0e9;
    transition: background-color .2s cubic-bezier(.2,0,0,1), border-color .2s cubic-bezier(.2,0,0,1);
}
.md3-switch-track > span {
    position: absolute;
    top: 50%;
    left: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #79747e;
    transform: translateY(-50%);
    transition: width .2s cubic-bezier(.2,0,0,1), left .2s cubic-bezier(.2,0,0,1), background-color .2s;
}
.catalog-promotion-switch input:checked + .md3-switch-track {
    border-color: #6750a4;
    background: #6750a4;
}
.catalog-promotion-switch input:checked + .md3-switch-track > span {
    left: 20px;
    background: #fff;
}
.catalog-promotion-switch input:focus-visible + .md3-switch-track {
    outline: 3px solid rgba(103,80,164,.2);
    outline-offset: 2px;
}
.catalog-promotion-switch-label { font-size: 10px; font-weight: 750; white-space: nowrap; }
.command-bar .command-promotion-switch .catalog-promotion-switch-label {
    color: var(--primary);
    opacity: 1;
}
.command-bar .command-promotion-switch:hover .catalog-promotion-switch-label {
    color: var(--primary-hover);
}
.catalog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 22px 0 8px;
    flex-wrap: wrap;
}
.page-link,
.page-dots {
    width: 44px;
    height: 44px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.9);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.job-queue {
    margin: 12px 0;
    padding: 12px 16px;
    border: 1px solid #e8e3ee;
    border-radius: 16px;
    background: rgba(255,255,255,.86);
}
.job-queue-head { display:flex; justify-content:space-between; color:var(--text); font-size:13px; }
.job-queue-head span { color:var(--text-muted); font-size:12px; }
.job-row { display:flex; align-items:center; gap:10px; padding:9px 0; border-top:1px solid #f0edf4; }
.job-row > span:first-child { min-width:0; flex:1; }
.job-row b, .job-row small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.job-row b { font-size:12px; }.job-row small { color:var(--text-muted); font-size:11px; margin-top:2px; }
.job-state { font-size:11px; font-weight:700; color:#6d28d9; white-space:nowrap; }
.job-state.failed { color:#be123c; }.job-state.completed { color:#047857; }.job-state.retrying { color:#b45309; }
.page-link:not(.disabled):not(.active):hover {
    border-color: rgba(109,40,217,.38);
    background: #faf7ff;
    color: var(--primary);
    transform: translateY(-1px);
}
.page-link-nav {
    width: 108px;
    gap: 8px;
    font-size: 14px;
}
.page-link.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 14px rgba(109,40,217,.18);
}
.page-link.disabled {
    pointer-events: none;
    opacity: .45;
}
.page-dots {
    width: 24px;
    border-color: transparent;
    background: transparent;
    color: var(--text-muted);
    letter-spacing: 2px;
    cursor: default;
}
@media (max-width: 520px) {
    .catalog-pagination { gap: 7px; }
    .page-link, .page-dots { width: 40px; height: 40px; border-radius: 12px; }
    .page-link-nav { width: 40px; gap: 0; }
    .page-link-nav span:not([aria-hidden="true"]) { display: none; }
    .page-dots { width: 20px; }
}
.operation-state {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 10px;
}
.operation-state > span:first-child {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}
.operation-state.failed { color: var(--danger); }
.operation-state.failed span { background: var(--danger); }
.promo-gap { color: #c2410c !important; font-weight: 700; margin-top: 3px; }
.promo-ready { color: var(--success) !important; font-weight: 700; margin-top: 3px; }
.schedule-done {
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--success);
    font-size: 11px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(18,14,25,.58);
    backdrop-filter: blur(8px);
}
.modal-backdrop[hidden] { display: none; }
.confirm-modal {
    width: min(470px, 100%);
    padding: 26px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(18,10,35,.3);
    animation: modal-in .2s ease-out;
}
@keyframes modal-in {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
}
.modal-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #db2777);
    font-weight: 900;
}
.confirm-modal h3 { font-size: 20px; }
#confirm-product { margin-top: 5px; color: var(--text-secondary); font-size: 13px; }
.confirm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 20px 0 14px;
}
.confirm-grid div { padding: 12px; border-radius: 12px; background: var(--bg); }
.confirm-grid small { display: block; color: var(--text-muted); font-size: 10px; }
.confirm-grid strong { display: block; margin-top: 3px; font-size: 17px; }
.modal-note { color: var(--text-secondary); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

body.service-dialog-open { overflow: hidden; }
.service-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(31, 25, 40, .52);
    backdrop-filter: blur(7px);
}
.service-dialog-backdrop[hidden] { display: none; }
.service-dialog {
    width: min(520px, 100%);
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 0 16px;
    padding: 24px;
    border: 1px solid #e5dcf3;
    border-radius: 28px;
    background: #fffbff;
    box-shadow: 0 24px 70px rgba(30, 20, 46, .24);
    animation: service-dialog-in .18s cubic-bezier(.2, .8, .2, 1);
}
@keyframes service-dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
}
.service-dialog-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #eee5ff;
    color: var(--primary);
    font-size: 22px;
    font-weight: 900;
}
.service-dialog-eyebrow {
    display: block;
    margin: 1px 0 5px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .1em;
}
.service-dialog h2 { margin: 0; color: var(--text-primary); font-size: 21px; line-height: 1.25; }
.service-dialog p { margin: 9px 0 0; color: var(--text-secondary); font-size: 14px; line-height: 1.55; white-space: pre-line; }
.service-dialog-field { display: block; margin-top: 18px; }
.service-dialog-field[hidden] { display: none; }
.service-dialog-field > span { display: block; margin-bottom: 7px; color: var(--text-secondary); font-size: 12px; font-weight: 800; }
.service-dialog-field input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
}
.service-dialog-field input:focus { outline: 3px solid rgba(124, 58, 237, .14); border-color: var(--primary); }
.service-dialog-field small { display: block; margin-top: 7px; color: var(--text-muted); font-size: 12px; }
.service-dialog-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}
.service-dialog-actions .btn { min-width: 112px; min-height: 44px; border-radius: 14px; }
.service-dialog-backdrop[data-tone="danger"] .service-dialog-icon { background: #ffe8eb; color: #c6284a; }
.service-dialog-backdrop[data-tone="danger"] .service-dialog-eyebrow { color: #c6284a; }
.service-dialog-backdrop[data-tone="danger"] #service-dialog-confirm { border-color: #c6284a; background: #c6284a; }
@media (max-width: 560px) {
    .service-dialog { grid-template-columns: 40px minmax(0, 1fr); padding: 20px; border-radius: 24px; }
    .service-dialog-icon { width: 40px; height: 40px; border-radius: 13px; font-size: 18px; }
    .service-dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .service-dialog-actions .btn { width: 100%; min-width: 0; }
}

.connection-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #fecaca;
    border-radius: 12px;
    background: #fff1f2;
    color: #be123c;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.connection-button.connected {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}
.connection-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(225, 29, 72, .1);
}
.connection-button.connected .connection-dot { box-shadow: 0 0 0 4px rgba(5, 150, 105, .1); }
.settings-modal { width: min(560px, calc(100vw - 28px)); }
.settings-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.settings-heading h3 { margin: 0 0 3px; }
.settings-heading p { margin: 0; color: var(--text-muted); font-size: 13px; }
.settings-field { display: block; margin-top: 16px; }
.settings-field > span { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.settings-field input,
.settings-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 0 12px;
    background: #fff;
    color: var(--text-primary);
    font: inherit;
}
.settings-field input:focus,
.settings-field select:focus { outline: 2px solid rgba(124, 58, 237, .18); border-color: var(--primary); }
.settings-field small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; }
.storefront-auto-settings { border: 1px solid #ddd6fe; border-radius: 13px; padding: 14px; background: linear-gradient(135deg,#faf8ff,#f7fcff); }
.storefront-auto-settings legend { padding: 0 5px; font-size: 13px; font-weight: 800; color: var(--primary-dark); }
.settings-checkbox { display:flex; gap:8px; align-items:center; font-size:14px; font-weight:700; cursor:pointer; }
.settings-checkbox input { inline-size:17px; block-size:17px; accent-color:var(--primary); }
.settings-auto-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:12px; }
.settings-auto-grid label { display:block; font-size:12px; color:var(--text-secondary); font-weight:700; }
.settings-auto-grid label span { display:block; margin:0 0 5px; }
.settings-auto-grid input,.settings-auto-grid select { min-height:40px; }
@media(max-width:520px){.settings-auto-grid{grid-template-columns:1fr}}
.password-field { display: flex; position: relative; }
.password-field input { padding-right: 88px; }
.password-field button {
    position: absolute;
    right: 6px;
    top: 6px;
    bottom: 6px;
    border: 0;
    border-radius: 8px;
    padding: 0 10px;
    background: var(--surface-soft);
    color: var(--text-secondary);
    cursor: pointer;
}
.connection-result {
    margin-top: 16px;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 600;
}
.connection-result.success { background: #ecfdf5; color: #047857; }
.connection-result.error { background: #fff1f2; color: #be123c; }
.settings-actions { align-items: center; }
.settings-spacer { flex: 1; }

.product-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}
/* Карточка товара всегда занимает полную ширину каталога. */
.product-grid .product-card { min-width: 0; }
.row-summary {
    display: none;
    grid-template-columns: 110px 80px 150px minmax(210px, 1fr) 135px auto;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    background: #f8f7fa;
    border: 1px solid var(--border-light);
}
.row-summary > * { min-width: 0; }
.row-cell small, .row-cell span { display: block; color: var(--text-muted); font-size: 10px; }
.row-cell strong { display: block; color: var(--text); font-size: 14px; }
.storefront-row-cell strong { color: #2563eb; }
.storefront-row-cell span { white-space: nowrap; }
.promo-cell span {
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.details-toggle {
    padding: 8px 11px;
    border: 1px solid #d8d2e4;
    border-radius: 9px;
    color: var(--primary);
    background: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
}
.details-toggle.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.tile-details-toggle { align-self: flex-end; margin-top: 9px; }
.promo-unavailable { margin-top: 3px; color: #9a6700 !important; font-weight: 650; }
.promo-apply {
    margin-top: 5px;
    padding: 4px 7px;
    border: 0;
    border-radius: 7px;
    color: #fff;
    background: var(--primary);
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
}

.analytics-panel {
    grid-column: 1 / -1;
    margin-top: 14px;
    padding: 18px;
    border: 1px solid #ded8ea;
    border-radius: 15px;
    background: linear-gradient(145deg, #fff, #faf8fd);
    min-width: 0;
    overflow: hidden;
}
.analytics-panel[hidden] { display: none; }
.analytics-modal-backdrop {
    position: fixed;
    z-index: 1990;
    inset: 0;
    background: #f8f6fa;
    animation: analytics-backdrop-in .18s ease-out;
}
.analytics-modal-backdrop[hidden] { display: none; }
.analytics-panel.analytics-modal-open {
    position: fixed;
    z-index: 2000;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0 clamp(24px, 4vw, 64px) 48px;
    border: 0;
    border-radius: 0;
    background: #f8f6fa;
    overflow-x: hidden;
    overflow-y: auto;
    transform: none;
    box-shadow: none;
    animation: analytics-modal-in .22s cubic-bezier(.2,0,0,1);
}
body.analytics-modal-active { overflow: hidden; }
body.analytics-modal-active [data-tooltip]::before,
body.analytics-modal-active [data-tooltip]::after { display: none; }
@keyframes analytics-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes analytics-modal-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.analytics-head {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin: 0 clamp(-64px, -4vw, -24px) 20px;
    padding: 20px clamp(24px, 4vw, 64px);
    border-bottom: 1px solid #e7e1ea;
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(10px);
}
.analytics-head h3 { margin: 0; font-size: clamp(20px, 2vw, 26px); }
.analytics-head p { margin: 4px 0 0; color: #79717f; font-size: 12px; }
.analytics-head-actions { display: flex; align-items: center; gap: 10px; }
.analytics-close {
    display: inline-grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 1px solid #ded7e7;
    border-radius: 999px;
    background: #f8f5fb;
    color: #655d6d;
    cursor: pointer;
}
.analytics-close:hover { border-color: #c9b9df; background: #efe8f7; color: var(--primary); }
.analytics-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.range-switch { display: flex; gap: 5px; }
.range-switch button {
    padding: 6px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    background: #fff;
    cursor: pointer;
    font-size: 10px;
}
.range-switch button.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0 auto 14px;
    max-width: 1480px;
}
.analytics-metric {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #e8e2ed;
    border-radius: 16px;
    background: #fff;
}
.analytics-metric small,
.analytics-metric span { display: block; color: #7d7585; }
.analytics-metric small { font-size: 10px; font-weight: 750; }
.analytics-metric strong {
    display: block;
    margin: 7px 0 4px;
    color: #332d38;
    font-size: clamp(16px, 1.7vw, 22px);
    line-height: 1.15;
}
.analytics-metric span { font-size: 9px; }
.analytics-metric-target { background: #f4efff; border-color: #e2d6fb; }
.analytics-metric-spp { background: #edf8f6; border-color: #d2ece7; }
.analytics-metric-wallet { background: #fff0f5; border-color: #f4d9e3; }
.chart-wrap {
    position: relative;
    height: clamp(340px, 49vh, 520px);
    max-width: 1480px;
    margin: 0 auto;
    padding: 16px 18px 10px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e8e2ef;
    box-shadow: none;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}
.chart-wrap canvas { max-width: 100% !important; }
.chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
}
.chart-empty[hidden] { display: none; }
.history-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 14px;
    margin-right: auto;
    margin-left: auto;
    max-width: 1480px;
}
.history-columns h4 { margin-bottom: 7px; font-size: 12px; }
.history-table-wrap {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: #fff;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.history-table th {
    position: sticky;
    top: 0;
    padding: 7px 8px;
    color: var(--text-secondary);
    background: #f5f3f8;
    text-align: left;
}
.history-table td { padding: 7px 8px; border-top: 1px solid var(--border-light); }
.history-empty { padding: 20px; color: var(--text-muted); text-align: center; font-size: 11px; }
.product-card {
    padding: 18px;
    overflow: hidden;
    border-color: rgba(255,255,255,.9);
}
.product-card[hidden] { display: none; }
.product-card:hover { transform: translateY(-3px); }
.product-header { gap: 16px; margin-bottom: 12px; }
.product-info { align-items: flex-start; flex: 1 1 260px; }
.product-photo, .product-photo-placeholder {
    width: 68px;
    height: 82px;
    border-radius: 12px;
}
.product-title {
    max-width: 340px;
    line-height: 1.35;
    font-size: 14px;
}
.product-code { margin-top: 8px; font-size: 11px; }
.product-right {
    min-width: 160px;
    padding: 10px 12px;
    border-radius: 13px;
    background: linear-gradient(145deg, #faf8fd, #f5f1fb);
}
.price-metric-label { display: none; }
.storefront-prices {
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    background: #f8fbff;
    font-size: 11px;
}
.storefront-prices > small { display: block; margin-bottom: 5px; color: var(--text-muted); font-weight: 700; }
.storefront-prices div { display: flex; justify-content: space-between; gap: 12px; color: var(--text-secondary); }
.storefront-prices .club { margin-top: 3px; }
.storefront-prices strong { color: #2563eb; }
.storefront-prices .club strong { color: #7c3aed; }
.storefront-prices .spp strong { color: #059669; }
.storefront-prices .old strong { color: var(--text-muted); text-decoration: line-through; }
.public-storefront-prices { border-color: #f3d2f7; background: linear-gradient(135deg, #fff8ff, #faf5ff); }

/* В строках цены занимают одну компактную полосу, а не высокую плитку справа. */
html[data-catalog-view="rows"] .product-header { align-items: center; }
html[data-catalog-view="rows"] .product-right {
    display: flex;
    flex: 0 1 610px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 7px 16px;
    min-width: 390px;
    padding: 0;
    background: transparent;
}
html[data-catalog-view="rows"] .price-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    white-space: nowrap;
}
html[data-catalog-view="rows"] .price-metric-label {
    display: inline;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}
html[data-catalog-view="rows"] .price-metric-base > span { font-size: 16px !important; }
html[data-catalog-view="rows"] .price-metric-discount > span { font-size: 17px !important; }
html[data-catalog-view="rows"] .price-metric-current > span { font-size: 19px !important; }
html[data-catalog-view="rows"] .price-metric-current > span > span:not(.currency):not(.kopecks) { font-size: 11px !important; }
html[data-catalog-view="rows"] .storefront-prices {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 11px;
}
html[data-catalog-view="rows"] .storefront-prices > small { font-weight: 600; }
html[data-catalog-view="rows"] .storefront-prices div { display: inline-flex; gap: 4px; }
html[data-catalog-view="rows"] .storefront-prices strong { color: #2563eb; }
html[data-catalog-view="rows"] .storefront-prices .club strong { color: #7c3aed; }
html[data-catalog-view="rows"] .storefront-prices .spp strong { color: #059669; }
html[data-catalog-view="rows"] .public-storefront-prices { padding: 0; border: 0; background: transparent; }
html[data-catalog-view="rows"] .product-right .product-updated {
    width: 100%;
    margin: 0;
    text-align: right;
}
html[data-catalog-view="rows"] .tile-details-toggle { margin-top: 0; }
/* Компактная ценовая зона строчной карточки. */
html[data-catalog-view="rows"] .product-header { align-items: flex-start; }
html[data-catalog-view="rows"] .product-right {
    display: grid;
    grid-template-columns: minmax(360px, 1fr) auto;
    grid-template-areas:
        "seller actions"
        "storefront actions";
    align-items: center;
    flex: 1 1 680px;
    min-width: 500px;
    max-width: 850px;
    gap: 8px 12px;
}
.seller-price-summary {
    grid-area: seller;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #ece8f2;
    border-radius: 12px;
    background: #fff;
}
html[data-catalog-view="rows"] .seller-price-summary .price-metric {
    display: flex;
    min-width: 0;
    min-height: 58px;
    padding: 9px 12px;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    border-left: 1px solid #eeeaf3;
}
html[data-catalog-view="rows"] .seller-price-summary .price-metric:first-child { border-left: 0; }
html[data-catalog-view="rows"] .seller-price-summary .price-metric-label {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .035em;
}
html[data-catalog-view="rows"] .seller-price-summary .price-metric > span { line-height: 1.18; }
html[data-catalog-view="rows"] .seller-price-summary .price-metric-base > span { font-size: 17px !important; }
html[data-catalog-view="rows"] .seller-price-summary .price-metric-discount > span { font-size: 18px !important; }
html[data-catalog-view="rows"] .seller-price-summary .price-metric-current > span { font-size: 21px !important; }
.storefront-price-summary {
    grid-area: storefront;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
}
html[data-catalog-view="rows"] .storefront-price-summary .storefront-prices {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    padding: 6px 9px;
    border-radius: 9px;
    background: #fafaff;
    white-space: normal;
}
html[data-catalog-view="rows"] .storefront-price-summary .public-storefront-prices {
    border-color: #eadcf9;
    background: linear-gradient(135deg, #fcf9ff, #f7f3ff);
}
html[data-catalog-view="rows"] .storefront-price-summary .storefront-prices > small { margin: 0 3px 0 0; }
.product-price-actions {
    grid-area: actions;
    display: flex;
    min-width: 144px;
    align-self: stretch;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 7px;
}
html[data-catalog-view="rows"] .product-price-actions .product-updated {
    width: auto;
    text-align: center;
    margin: 0;
    font-size: 10px;
}
html[data-catalog-view="rows"] .product-price-actions .tile-details-toggle {
    margin: 0;
    min-height: 36px;
    padding: 0 11px;
    border-color: #d8c9fb;
    color: #6d28d9;
    background: #faf8ff;
    box-shadow: 0 5px 12px rgba(109,40,217,.08);
}
html[data-catalog-view="rows"] .product-price-actions .tile-details-toggle:hover {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}
.schedule-list {
    min-height: 30px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.schedule-form {
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}
.schedule-form input { min-width: 0; flex: 1; }
.schedule-form .btn { padding-inline: 12px; }
.promo-stack { width: 100%; }
.promo-row { padding: 8px 10px; }

.logs-section { margin-top: 30px; }

@media (max-width: 1120px) {
    .product-grid { grid-template-columns: 1fr; }
    .status-bar { grid-template-columns: repeat(3, 1fr); }
    .bulk-schedule { grid-template-columns: 1fr; }
    .bulk-schedule form { flex-wrap: wrap; }
    .row-summary { grid-template-columns: 100px 70px 135px 1fr; }
    .row-summary .details-toggle { grid-column: 1 / -1; justify-self: end; }
    .calendar-overview-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .catalog-tools { flex-wrap: wrap; }
    .search-box { width: 100%; }
    .catalog-select-field { flex: 1 1 190px; }
    .catalog-limit-field { flex: 0 0 110px; }
    .catalog-page-selection { margin-right: 8px; }
}

@media (max-width: 900px) {
    .bulk-schedule form { grid-template-columns: 1fr 1fr; }
    #bulk-schedule-submit { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    body { padding: 10px; }
    .header-actions .nav-link { display: none; }
    .header-actions { min-width: 0; max-width: 100%; overflow-x: clip; }
    .header-runtime { min-width: 0; max-width: 100%; }
    .header-time { max-width: 100%; overflow: hidden; }
    .header-time-status[data-tooltip]::after { left: auto; right: 0; max-width: calc(100vw - 32px); }
    .header { align-items: flex-start; }
    .brand-mark { width: 40px; height: 40px; }
    .status-bar { grid-template-columns: repeat(2, 1fr); }
    .status-item { min-height: 56px; }
    .command-bar { top: var(--sticky-command-top, 126px); align-items: stretch; }
    .command-primary { overflow-x: auto; }
    .command-primary .btn { flex: none; font-size: 12px; padding-inline: 12px; }
    .command-secondary, .scheduler-controls { display: none; }
    .bulk-schedule { padding: 14px; }
    .bulk-schedule-head { align-items: flex-start; flex-direction: column; }
    .bulk-schedule-head-actions { width: 100%; justify-content: space-between; }
    .bulk-schedule form { grid-template-columns: 1fr 1fr; }
    .bulk-schedule .bulk-field { width: 100%; }
    .bulk-schedule .bulk-field:nth-child(3),
    .bulk-schedule .bulk-field:nth-child(4),
    #bulk-schedule-submit { grid-column: 1 / -1; }
    .catalog-toolbar { align-items: stretch; flex-direction: column; }
    .catalog-tools { flex-direction: column; }
    .search-box { width: 100%; }
    .catalog-select-field, .catalog-limit-field { width: 100%; }
    .catalog-tools select { width: 100%; height: 46px; }
    .catalog-reset { justify-content: center; }
    .catalog-page-selection { width: 100%; margin: 0; justify-content: space-between; }
    .product-card { padding: 14px; }
    .calendar-overview-title { align-items: flex-start; flex-direction: column; }
    .calendar-overview-title p { text-align: left; }
    .calendar-overview-stats { grid-template-columns: 1fr 1fr; }
    .product-photo, .product-photo-placeholder { width: 58px; height: 70px; }
    .product-right { width: 100%; text-align: left; }
    html[data-catalog-view="rows"] .product-right {
        min-width: 0;
        width: 100%;
        justify-content: flex-start;
        padding-top: 4px;
    }
    html[data-catalog-view="rows"] .product-right .product-updated { text-align: left; }
    .schedule-form .btn {
        flex: 0 0 auto;
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }
    .row-summary { grid-template-columns: 1fr 1fr; }
    .promo-cell { grid-column: 1 / -1; }
    .storefront-row-cell { grid-column: span 1; }
    .row-summary .details-toggle { grid-column: 1 / -1; width: 100%; }
    .analytics-head { align-items: flex-start; flex-direction: column; }
    .history-columns { grid-template-columns: 1fr; }
    .chart-wrap { height: 260px; padding: 5px; }
    .promotion-compact-row { grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
    .promotion-compact-name strong { white-space: normal; }
}
@media (max-width: 760px) {
    html[data-catalog-view="rows"] .product-right {
        grid-template-columns: 1fr;
        grid-template-areas: "seller" "storefront" "actions";
        min-width: 0;
        max-width: none;
        width: 100%;
    }
    .seller-price-summary { grid-template-columns: 1fr 1fr 1.2fr; }
    html[data-catalog-view="rows"] .seller-price-summary .price-metric { padding: 8px 9px; }
    .product-price-actions { min-width: 0; flex-direction: row; align-items: center; justify-content: space-between; }
    html[data-catalog-view="rows"] .product-price-actions .product-updated { text-align: left; }
    html[data-catalog-view="rows"] .product-price-actions .tile-details-toggle { flex: 0 0 auto; }
}

/* Карточка товара: последовательный путь цены и компактные рабочие блоки. */
.product-card {
    padding: 20px;
    border: 1px solid #ece8f4;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(39, 24, 74, .055);
}
.product-card:hover {
    border-color: #ded5ef;
    box-shadow: 0 16px 42px rgba(39, 24, 74, .09);
}
/* Выбор времени внутри карточки не должен обрезаться границами карточки
   или соседним товаром. Поднимаем только активную карточку, чтобы обычная
   вёрстка и скругления остальных карточек не менялись. */
.product-card:has(.smart-picker-open) {
    position: relative;
    z-index: 10060;
    overflow: visible;
}
.product-card .schedule-form label:has(.smart-picker-open) {
    z-index: 10061;
}
.product-header {
    display: grid;
    grid-template-columns: minmax(300px, 430px) minmax(680px, 1fr);
    align-items: stretch !important;
    gap: 20px;
}
.product-info {
    min-width: 0;
    padding: 4px 0;
}
.product-info > div:last-child { min-width: 0; }
.product-photo, .product-photo-placeholder {
    width: 76px;
    height: 92px;
    border: 1px solid #eeeaf4;
    background: #fff;
    box-shadow: 0 8px 20px rgba(32, 24, 54, .07);
}
.product-title { max-width: 100%; font-size: 16px; font-weight: 720; }
.product-code {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
}
.copy-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #e6e0ef;
    border-radius: 8px;
    background: #faf9fc;
}
html[data-catalog-view="rows"] .product-right {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "flow";
    align-items: stretch;
    min-width: 0;
    max-width: none;
    gap: 12px;
}
.product-meta-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.product-meta-actions .tile-details-toggle {
    min-height: 32px;
    margin: 0;
    padding: 0 10px;
    border-color: #d8c9fb;
    border-radius: 9px;
    background: #faf8ff;
    color: #6d28d9;
    font-size: 10px;
    font-weight: 750;
}
.product-meta-actions .storefront-product-check {
    color: #087d61;
    background: #f1fffa;
    border-color: #bcebdc;
}
.product-meta-actions .storefront-product-check:hover:not(:disabled) {
    color: #fff;
    background: #059669;
    border-color: #059669;
}
.product-meta-actions .storefront-product-check:disabled {
    cursor: wait;
    opacity: .72;
}
.product-meta-actions > span { color: var(--text-muted); font-size: 9px; }
.price-flow {
    grid-area: flow;
    display: grid;
    grid-template-columns: 1.05fr .82fr 1.08fr .72fr 1.18fr 1.16fr;
    overflow: hidden;
    min-width: 0;
    border: 1px solid #e8e3ef;
    border-radius: 15px;
    background: #f8f7fb;
}
.price-step {
    position: relative;
    display: grid;
    grid-template-rows: 30px 32px 16px;
    align-content: center;
    justify-items: center;
    min-width: 0;
    min-height: 86px;
    padding: 13px 12px;
    gap: 3px;
    border-left: 1px solid #e8e3ef;
    background: #fff;
    text-align: center;
}
.price-step:first-child { border-left: 0; }
.price-step:not(:last-child)::after {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: -7px;
    width: 12px;
    height: 12px;
    border-top: 1px solid #e8e3ef;
    border-right: 1px solid #e8e3ef;
    background: inherit;
    content: "";
    transform: translateY(-50%) rotate(45deg);
}
.price-step small {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    align-items: flex-end;
    justify-content: center;
    color: #8a8494;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .045em;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
}
.price-step strong {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    color: #262131;
    font-size: clamp(15px, 1.15vw, 20px);
    font-variant-numeric: tabular-nums lining-nums;
    letter-spacing: -.015em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}
.price-step > span {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
    color: #8a8494;
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
}
.price-step-percent { background: #faf7ff; }
.price-step-percent strong { color: #7138d0; }
.price-step-discount { background: #f4fbf8; }
.price-step-discount strong, .price-step-buyer strong { color: #07815e; }
.price-step-spp { background: #f1fbf7; }
.price-step-spp strong { color: #07815e; }
.price-step-buyer { background: #f1fbf7; }
.price-step-club { background: linear-gradient(145deg, #fbf5ff, #f5efff); }
.price-step-club strong { color: #7b2ed0; }
.product-price-actions { grid-area: actions; min-width: 0; }
html[data-catalog-view="rows"] .product-price-actions .tile-details-toggle {
    min-height: 42px;
    border-radius: 11px;
    font-weight: 700;
}
.promotion-compact {
    margin-top: 9px;
    border: 1px solid #ebe6f1;
    border-radius: 12px;
    background: #fbfafc;
}
.promotion-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px;
    margin-top: 10px;
}
.promotion-pair .promotion-compact {
    display: flex;
    min-width: 0;
    margin-top: 0;
    flex-direction: column;
}
.promotion-pair .promotion-compact-auto { grid-column: 1 / -1; }
.promotion-pair .promotion-compact-list {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    flex: 1 1 auto;
    gap: 6px;
    padding: 8px;
    overflow: visible;
}
.promotion-pair .promotion-columns-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.promotion-pair .promotion-columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.promotion-pair .promotion-compact-row {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 44px;
    padding: 8px 9px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    overflow: visible;
    border: 1px solid rgba(103, 80, 164, .1);
    border-radius: 10px;
}
.promotion-pair .promotion-compact-row.promotion-extra { display: none; }
.promotion-pair .promotion-compact.expanded .promotion-compact-row.promotion-extra { display: flex; }
.promotion-pair .promotion-compact-row:first-child { border-top: 1px solid rgba(103, 80, 164, .1); }
.promotion-pair .promotion-compact-price {
    display: grid;
    width: 100%;
    min-height: 36px;
    place-items: center;
    text-align: center;
}
.promotion-price-caption {
    display: block;
    margin-bottom: 4px;
    color: #8a8291;
    font-size: 8px;
    font-weight: 650;
    line-height: 1;
    text-align: center;
}
.promotion-pair .promotion-compact-price strong {
    overflow: visible;
    font-size: 12px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.01em;
    text-overflow: clip;
}
.promotion-pair .promotion-compact-price .promotion-discount-gap {
    display: inline-block;
    margin-left: 4px;
    color: currentColor;
    font-size: 9px;
    font-weight: 750;
    opacity: .8;
    white-space: nowrap;
}
.promotion-hover-card {
    position: static;
    display: grid;
    width: 100%;
    max-height: 0;
    gap: 4px;
    margin-top: 0;
    padding: 0 9px;
    visibility: hidden;
    overflow: hidden;
    border: 0 solid rgba(103,80,164,.1);
    border-radius: 9px;
    background: rgba(255,255,255,.72);
    box-shadow: none;
    color: #4c4652;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition:
        max-height .22s cubic-bezier(.2,0,0,1),
        margin-top .22s cubic-bezier(.2,0,0,1),
        padding .22s cubic-bezier(.2,0,0,1),
        opacity .14s ease,
        transform .18s ease,
        visibility 0s linear .22s;
}
.promotion-hover-card strong { font-size: 11px; line-height: 1.35; }
.promotion-hover-card small { color: #7d7485; font-size: 9px; }
.promotion-hover-card span { color: #625a69; font-size: 9px; }
.promotion-details-expanded .promotion-hover-card {
    max-height: 220px;
    margin-top: 8px;
    padding: 9px;
    visibility: visible;
    border-width: 1px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition-delay: 0s;
}
.promotion-details-expanded .promotion-pair .promotion-hover-card {
    min-height: 112px;
    align-content: start;
}
html:not(.promotion-details-expanded) .promotion-pair {
    gap: 8px;
    margin-top: 8px;
}
html:not(.promotion-details-expanded) .promotion-pair .promotion-compact-list {
    padding: 3px;
    gap: 3px;
    flex: 0 0 auto;
}
html:not(.promotion-details-expanded) .promotion-pair .promotion-compact-row {
    height: 54px;
    min-height: 54px;
    padding: 3px 7px;
}
html:not(.promotion-details-expanded) .promotion-pair .promotion-compact-price {
    position: absolute;
    inset: 0;
    display: flex;
    height: 100%;
    width: 100%;
    min-height: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
html:not(.promotion-details-expanded) .promotion-pair .promotion-compact-price strong {
    display: block;
    line-height: 1;
    transform: translateY(1px);
}
html:not(.promotion-details-expanded) .promotion-pair .promotion-compact-head {
    min-height: 46px;
}
.promotion-compact-row:focus-visible {
    outline: 3px solid rgba(103,80,164,.22);
    outline-offset: 1px;
}
.promotion-compact-head {
    min-height: 42px;
    padding: 0 12px;
}
.promotion-section-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}
.promotion-section-icon {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    border-radius: 9px;
}
.promotion-section-icon svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.promotion-section-copy { display: grid; min-width: 0; gap: 1px; }
.promotion-section-copy strong { color: #332d3a; font-size: 11px; line-height: 1.2; }
.promotion-section-copy small { color: #8a8291; font-size: 8px; line-height: 1.2; }
.promotion-compact-joined .promotion-section-icon { color: #07815e; background: #e5f8f1; }
.promotion-compact-eligible .promotion-section-icon { color: #7c3aed; background: #f0eafd; }
.promotion-compact-toggle { min-height: 42px; }
.promotion-compact-toggle > span:not(.md3-expand-icon),
.promotion-compact-head .promotion-count {
    min-width: 22px;
    height: 24px;
    padding: 0 8px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #eee8fb;
    color: #6931c5;
    font-size: 9px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.promotion-compact-joined { border-left: 3px solid #10b981; }
.promotion-compact-eligible { border-left: 3px solid #8b5cf6; }
.promotion-empty { grid-column: 1 / -1; padding: 10px; color: var(--text-muted); font-size: 11px; }
.schedule-manager {
    margin-top: 16px;
    overflow: hidden;
    border: 1px solid #e7e1ed;
    border-radius: 15px;
    background: #fcfbfd;
}
.schedule-manager-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px 10px;
}
.schedule-manager-head h3 { margin: 2px 0 0; font-size: 14px; }
.schedule-eyebrow-row { display: flex; align-items: center; gap: 5px; }
.schedule-eyebrow {
    color: #82798d;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .09em;
}
.history-table-daily { max-height: 320px; }
@media (max-width: 1100px) {
    .analytics-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .analytics-panel.analytics-modal-open { padding: 0 14px 32px; }
    .analytics-head {
        align-items: flex-start;
        margin-right: -14px;
        margin-left: -14px;
        padding: 16px 14px;
    }
    .analytics-head-actions { align-items: flex-end; flex-direction: column-reverse; }
    .range-switch { flex-wrap: wrap; justify-content: flex-end; }
    .analytics-metrics { grid-template-columns: 1fr 1fr; }
    .analytics-metric-target { grid-column: 1 / -1; }
    .chart-wrap { height: 360px; padding: 12px 8px 8px; }
}
.schedule-info {
    display: inline-grid;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f0e9ff;
    color: var(--primary);
    cursor: help;
    place-items: center;
}
.schedule-info svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.schedule-info[data-tooltip]::after {
    left: 0;
    width: min(330px, calc(100vw - 48px));
    max-width: 330px;
    text-align: left;
    transform: translate(0, -4px);
}
.schedule-info[data-tooltip]:hover::after,
.schedule-info[data-tooltip]:focus-visible::after { transform: translate(0, 0); }
.schedule-count {
    display: grid;
    min-width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    background: #eee8fb;
    color: #6931c5;
    font-size: 11px;
    font-weight: 800;
}
.schedule-manager .schedule-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    padding: 0 14px 12px;
    border: 0;
}
.schedule-manager .schedule-item {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px 12px;
    min-height: 48px;
    padding: 9px 10px;
    border: 1px solid #e7e1ef;
    border-radius: 11px;
    background: #fff;
}
.schedule-manager .schedule-item.is-editing {
    grid-column: 1 / -1;
    z-index: 2;
    border-color: #d6c9ed;
    box-shadow: 0 10px 26px rgba(70, 46, 112, .08);
}
.schedule-item.is-paused { background: #f6f5f8; opacity: .78; }
.schedule-item-main { display: flex; align-items: center; gap: 7px; min-width: 0; }
.schedule-state {
    padding: 4px 7px;
    border-radius: 999px;
    background: #e7f8f1;
    color: #087c5b;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}
.is-paused .schedule-state { background: #ebe9ee; color: #716a78; }
.schedule-item-main .schedule-time { font-size: 13px; }
.schedule-rule { color: #615a69; font-size: 10px; }
.schedule-runtime { display: flex; gap: 10px; color: var(--text-muted); font-size: 9px; }
.schedule-runtime .run-ok { color: #087c5b; }
.schedule-runtime .run-error { color: #c33f50; }
.schedule-item-actions {
    grid-column: 2;
    grid-row: 1 / 4;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow: visible;
}
.schedule-icon-btn {
    position: relative;
    display: grid;
    width: 32px;
    min-width: 32px;
    height: 28px;
    padding: 0;
    place-items: center;
    border: 1px solid #e4deea;
    border-radius: 8px;
    background: #fff;
    color: #665e70;
    cursor: pointer;
}
.schedule-icon-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.schedule-icon-btn::before,
.schedule-icon-btn::after {
    position: absolute;
    z-index: 30;
    left: 50%;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .14s ease, visibility 0s linear .14s;
}
.schedule-icon-btn::before {
    display: none;
}
.schedule-icon-btn::after {
    bottom: calc(100% + 8px);
    width: max-content;
    max-width: 210px;
    padding: 10px 11px 9px;
    border: 1px solid rgba(220,203,255,.32);
    border-radius: 10px;
    background: linear-gradient(135deg, #302044, #211b31);
    box-shadow: 0 12px 26px rgba(29, 24, 38, .24);
    color: #fff;
    content: attr(data-hint);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    transform: translateX(-50%);
    white-space: nowrap;
}
.schedule-icon-btn:hover::before,
.schedule-icon-btn:hover::after,
.schedule-icon-btn:focus-visible::before,
.schedule-icon-btn:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transition-delay: .5s;
}
.schedule-icon-btn:last-child::after {
    right: -2px;
    left: auto;
    transform: none;
}
.schedule-icon-btn:last-child::before {
    right: 9px;
    left: auto;
    transform: none;
}
.schedule-icon-btn:hover { border-color: #cdbcf0; color: #6d28d9; background: #faf8ff; }
.schedule-icon-btn.danger:hover { border-color: #f2bdc4; color: #c33f50; background: #fff5f6; }
.schedule-edit-form {
    display: block;
}
.schedule-edit-form > * { min-width: 0; }
.schedule-edit-form[hidden] { display: none; }
.schedule-editor-backdrop {
    position: fixed;
    z-index: 2100;
    inset: 0;
    display: block;
    padding: 0;
    background: #f8f6fa;
    animation: analytics-backdrop-in .18s ease-out;
}
.schedule-editor-backdrop[hidden] { display: none; }
.schedule-editor-modal {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #f8f6fa;
    box-shadow: none;
    animation: schedule-editor-in .18s cubic-bezier(.2,0,0,1);
}
@keyframes schedule-editor-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.schedule-editor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px clamp(24px, 5vw, 80px);
    border-bottom: 1px solid #e7e1ea;
    background: #fff;
}
.schedule-editor-head h3 { margin: 4px 0 3px; font-size: clamp(20px, 2vw, 26px); }
.schedule-editor-head p { color: #827a8a; font-size: 12px; }
#schedule-editor-content {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: clamp(24px, 4vw, 56px) clamp(24px, 5vw, 64px) 96px;
    overflow-x: hidden;
    overflow-y: auto;
}
.schedule-edit-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}
.schedule-edit-field { display: grid; gap: 6px; }
.schedule-edit-field > span,
.schedule-edit-weekdays legend {
    color: #6f6777;
    font-size: 10px;
    font-weight: 750;
}
.schedule-edit-form input {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid #ddd7e5;
    border-radius: 10px;
    padding: 8px 11px;
    background: #fff;
    font: inherit;
}
.schedule-edit-form input:focus {
    border-color: #8b5cf6;
    outline: 3px solid rgba(139,92,246,.12);
}
.schedule-percent-input { position: relative; }
.schedule-percent-input input { padding-right: 34px; }
.schedule-percent-input > span {
    position: absolute;
    top: 50%;
    right: 12px;
    color: #756e7d;
    font-weight: 750;
    transform: translateY(-50%);
}
.schedule-edit-weekdays {
    grid-column: 1 / -1;
    margin: 0;
    padding: 0;
    border: 0;
}
.schedule-edit-weekdays legend { margin-bottom: 7px; }
.schedule-edit-weekdays .weekday-picker { gap: 6px; }
.schedule-edit-weekdays .weekday-picker span {
    width: 40px;
    height: 36px;
    border-radius: 10px;
    font-size: 10px;
}
.schedule-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #eee9f3;
}
body.schedule-editor-active { overflow: hidden; }
.weekday-picker { display: flex; align-items: center; gap: 3px; }
.weekday-picker label { display: block; }
.weekday-picker input { position: absolute; opacity: 0; pointer-events: none; }
.weekday-picker span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid #e2dce9;
    border-radius: 8px;
    background: #fff;
    color: #777080;
    font-size: 9px;
    font-weight: 700;
    font-weight: 750;
    cursor: pointer;
}
.weekday-picker input:checked + span {
    border-color: #cdbcf0;
    background: #eee8fb;
    color: #6530c2;
}
.schedule-empty {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px dashed #dcd4e8;
    border-radius: 11px;
    color: #81798a;
}
.schedule-empty > span {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 9px;
    background: #f0ebfa;
    color: #6931c5;
    font-size: 18px;
}
.schedule-empty strong, .schedule-empty small { display: block; }
.schedule-empty strong { color: #57505f; font-size: 11px; }
.schedule-empty small { margin-top: 2px; font-size: 9px; }
.schedule-create-bar {
    display: flex;
    justify-content: flex-end;
    padding: 13px 14px 14px;
    border-top: 1px solid #eee9f3;
    background: #fff;
}
.schedule-create-button { min-height: 40px; border-radius: 10px; padding-inline: 15px; }
.schedule-create-form[hidden] { display: none !important; }
#schedule-editor-content .schedule-modal-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px 28px;
    margin: 0;
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid #e7e1ea;
    border-radius: 24px;
    background: #fff;
}
#schedule-editor-content .schedule-modal-form input { width: 100%; min-height: 44px; }
#schedule-editor-content .schedule-edit-fields,
#schedule-editor-content .schedule-edit-actions { grid-column: 1 / -1; }
.schedule-create-fields,
.schedule-create-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.schedule-create-fields > label,
.schedule-create-dates > label { display: grid; gap: 6px; min-width: 0; }
.schedule-create-fields span,
.schedule-create-dates span,
.schedule-create-weekdays legend {
    color: #6f6777;
    font-size: 10px;
    font-weight: 750;
}
.schedule-create-dates { margin-top: 0; }
.schedule-create-dates em {
    color: #a49cac;
    font-size: 9px;
    font-style: normal;
    font-weight: 500;
}
.schedule-create-weekdays {
    grid-column: 1 / -1;
    margin: 0;
    padding: 13px 14px 14px;
    border: 1px solid #eee8f4;
    border-radius: 14px;
    background: linear-gradient(135deg, #fcfbff, #f8fbff);
}
.schedule-create-weekdays legend { padding: 0 4px; }
.schedule-create-weekdays .weekday-picker { gap: 7px; }
.schedule-create-weekdays .weekday-picker span {
    width: 42px;
    height: 34px;
    border-radius: 10px;
    font-size: 10px;
}
.schedule-create-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
    padding-top: 15px;
    border-top: 1px solid #eee9f3;
}
.schedule-create-actions .btn { min-height: 42px; justify-content: center; }
.schedule-manager .schedule-form {
    display: grid;
    grid-template-columns: minmax(150px, .7fr) minmax(180px, .8fr) minmax(260px, 1.5fr) auto auto;
    gap: 9px;
    padding: 12px 14px 14px;
    border-top: 1px solid #eee9f3;
    background: #fff;
}
.schedule-options {
    min-width: 0;
}
.schedule-options-field { display: grid; gap: 4px; min-width: 0; align-self: end; }
.schedule-field-label {
    padding-left: 2px;
    color: #81798a;
    font-size: 9px;
    font-weight: 700;
}
.schedule-options summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    height: 40px;
    padding: 11px 12px;
    border: 1px solid #ddd7e5;
    border-radius: 10px;
    background: #fff;
    color: #675f70;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.schedule-options summary::-webkit-details-marker { display: none; }
.schedule-options summary::marker { content: ""; }
.schedule-options[open] {
    position: relative;
}
.schedule-options[open] > .weekday-picker,
.schedule-options[open] > .schedule-date-range {
    position: absolute;
    z-index: 8;
    right: 0;
    left: 0;
    padding: 10px;
    border: 1px solid #dfd7e9;
    background: #fff;
}
.schedule-options[open] > .weekday-picker {
    bottom: 40px;
    border-bottom: 0;
    border-radius: 12px 12px 0 0;
}
.schedule-options[open] > .schedule-date-range {
    bottom: 92px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    border-bottom: 0;
}
.schedule-form label { display: grid; gap: 4px; }
.schedule-form label > span {
    padding-left: 2px;
    color: #81798a;
    font-size: 9px;
    font-weight: 700;
}
.schedule-manager .schedule-form input {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
}
.schedule-manager .schedule-form .btn { align-self: end; min-height: 40px; border-radius: 10px; }

@media (max-width: 1280px) {
    .product-header { grid-template-columns: 300px minmax(0, 1fr); }
    .price-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .price-step:nth-child(4) { border-left: 0; }
    .price-step:nth-child(3)::after { display: none; }
    .schedule-manager .schedule-form { grid-template-columns: 1fr 1fr 1fr; }
    .schedule-manager .schedule-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .schedule-manager .schedule-form .btn { width: 100%; }
    .schedule-edit-fields { grid-template-columns: 1fr 1fr; }
    .schedule-edit-form .weekday-picker { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
    .product-header { grid-template-columns: 1fr; }
    html[data-catalog-view="rows"] .product-right {
        grid-template-columns: 1fr;
        grid-template-areas: "flow" "actions";
    }
    .product-price-actions { flex-direction: row; align-items: center; justify-content: space-between; }
    .schedule-manager .schedule-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #schedule-editor-content .schedule-modal-form { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
    .product-card { padding: 12px; border-radius: 15px; }
    .product-info { display: grid; grid-template-columns: auto 64px minmax(0, 1fr); }
    .product-photo, .product-photo-placeholder { width: 64px; height: 78px; }
    .price-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .price-step { min-height: 76px; padding: 10px; border-bottom: 1px solid #e8e3ef; }
    .price-step:nth-child(odd) { border-left: 0; }
    .price-step::after { display: none !important; }
    .price-step strong { font-size: 16px; }
    .promotion-pair, .schedule-manager .schedule-list { grid-template-columns: 1fr; }
    .promotion-pair .promotion-compact-auto { grid-column: auto; }
    .schedule-item-actions { grid-column: 1 / -1; grid-row: auto; justify-content: flex-end; }
    .schedule-runtime { flex-direction: column; gap: 2px; }
    .schedule-manager .schedule-form { grid-template-columns: 1fr 1fr; }
    .schedule-manager .schedule-form .schedule-options-field { grid-column: 1 / -1; }
    .schedule-manager .schedule-form .btn { width: 100%; }
    .schedule-editor-head { padding: 16px 18px; }
    #schedule-editor-content { padding: 18px 14px 72px; }
    #schedule-editor-content .schedule-modal-form { padding: 18px; border-radius: 18px; }
    .schedule-edit-fields { grid-template-columns: 1fr; }
    .schedule-create-fields,
    .schedule-create-dates { grid-template-columns: 1fr; }
    .schedule-create-actions { flex-wrap: wrap; }
    .schedule-create-actions .btn { flex: 1 1 150px; }
    .schedule-create-bar .schedule-create-button { width: 100%; }
}

/* Универсальный импорт цен акций */
/* Единый контейнер на всех разделах: шапка всегда одинаковой ширины. */
.import-page { max-width: 1480px; }
.import-card {
    margin: 20px 0;
    padding: 26px;
    background: #fff;
    border: 1px solid rgba(112, 54, 220, .1);
    border-radius: 24px;
    box-shadow: 0 14px 38px rgba(50, 35, 80, .08);
}
.import-card h2 { margin: 0 0 8px; }
.muted { color: #797386; font-size: 14px; }
.file-drop {
    display: flex;
    min-height: 150px;
    margin: 20px 0 14px;
    border: 2px dashed #b99bea;
    border-radius: 18px;
    background: linear-gradient(135deg, #faf7ff, #fff8fc);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: #6c2bd9;
    cursor: pointer;
    transition: .2s ease;
}
.file-drop:hover { border-color: #db258b; transform: translateY(-1px); }
.file-drop.is-dragging {
    border-color: #db258b;
    background: linear-gradient(135deg, #f4eaff, #fff0f8);
    box-shadow: 0 0 0 4px rgba(219, 37, 139, .12);
    transform: translateY(-1px);
}
.file-drop input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.file-drop span { color: #857e90; font-size: 13px; }
.import-message { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.import-message.info { background: #f0ebff; color: #5720b3; }
.import-message.success { background: #e7f9f2; color: #087b56; }
.import-message.error { background: #fff0f2; color: #b51e3e; }
.mapping-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.mapping-grid label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: #716b7a; }
.mapping-grid select { min-height: 42px; border: 1px solid #ded8e8; border-radius: 10px; padding: 0 10px; background: white; }
.import-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; }
.import-stats { padding: 10px 14px; border-radius: 12px; background: #f5f2fa; color: #655e70; font-size: 13px; }
.table-scroll { overflow-x: auto; margin: 18px 0; }

/* Единый локальный выбор времени и даты: не используем системное меню браузера. */
.smart-picker {
    min-width: 132px;
    padding-right: 42px !important;
    background-image: linear-gradient(135deg, transparent 45%, #6c2bd9 46%, #6c2bd9 54%, transparent 55%),
                      linear-gradient(45deg, transparent 45%, #6c2bd9 46%, #6c2bd9 54%, transparent 55%);
    background-position: calc(100% - 18px) 48%, calc(100% - 12px) 48%;
    background-size: 7px 7px;
    background-repeat: no-repeat;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.smart-picker:focus,
.smart-picker-open {
    border-color: #7c3aed !important;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .12) !important;
    outline: 0;
}
.smart-picker-popup {
    position: absolute;
    z-index: 10050;
    width: min(304px, calc(100vw - 24px));
    padding: 14px;
    border: 1px solid rgba(102, 60, 180, .20);
    border-radius: 20px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 22px 52px rgba(52, 35, 79, .24);
    color: #211c2e;
    backdrop-filter: blur(16px);
}
.smart-picker-host { position: relative; }
.smart-picker-popup[hidden] { display: none; }
.service-select {
    position: relative;
    min-width: 0;
    width: 100%;
    font: inherit;
}
.service-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
    margin: 0 !important;
}
.service-select-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #ded8e8;
    border-radius: 12px;
    background: rgba(255,255,255,.94);
    color: #292334;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.service-select-button:hover { border-color: #bda1ef; background: #fff; }
.service-select.is-open .service-select-button,
.service-select-button:focus-visible {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124,58,237,.12);
    background: #fff;
}
.service-select-button svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    transition: transform .16s ease;
}
.service-select.is-open .service-select-button svg { transform: rotate(180deg); }
.service-select-menu {
    position: absolute;
    z-index: 10040;
    top: calc(100% + 7px);
    left: 0;
    width: max(100%, 216px);
    max-width: min(390px, calc(100vw - 24px));
    max-height: min(340px, calc(100vh - 120px));
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(124,58,237,.18);
    border-radius: 14px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 16px 34px rgba(48,31,75,.16), 0 2px 8px rgba(48,31,75,.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-5px) scale(.985);
    transform-origin: top left;
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}
.service-select.is-open .service-select-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.service-select-option {
    display: block;
    width: 100%;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #302a39;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: color .13s ease, background .13s ease;
}
.service-select-option:hover,
.service-select-option:focus-visible { outline: none; background: #f1eaff; color: #642bc2; }
.service-select-option.is-selected { background: linear-gradient(135deg, #7027df, #9241ea); color: #fff; box-shadow: 0 3px 8px rgba(112,39,223,.2); }
.service-select-option:disabled { color: #aaa2b3; cursor: not-allowed; }
.service-select-group { padding: 4px 0; }
.service-select-group + .service-select-group { margin-top: 4px; padding-top: 8px; border-top: 1px solid #eee8f5; }
.service-select-group-title { padding: 2px 10px 5px; color: #776d85; font-size: 11px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.bulk-schedule .bulk-field .service-select-button,
.catalog-tools .service-select-button { min-height: 46px; height: 46px; border-color: #ddd7e5; }
/* Значения в массовой форме соответствуют компактным полям времени и скидки. */
.bulk-schedule .bulk-field .service-select-button { font-size: 12px; }
.catalog-limit-field .service-select-button { min-width: 96px; }
.calendar-toolbar .service-select { width: auto; min-width: 200px; }
.calendar-toolbar .service-select-button { min-height: 40px; }
.settings-field .service-select-button { min-height: 44px; }
.mapping-grid .service-select-button { min-height: 42px; border-radius: 10px; }
@media (max-width: 720px) {
    .service-select-menu {
        left: auto;
        right: 0;
        width: min(340px, calc(100vw - 24px));
        max-height: min(300px, calc(100vh - 96px));
    }
}
.smart-picker-title { display: flex; align-items: center; min-height: 32px; gap: 8px; margin-bottom: 10px; }
.smart-picker-title > div:first-child { flex: 1 1 auto; }
.smart-picker-title:has(.smart-date-heading) { justify-content: space-between; }
.smart-picker-title strong { font-size: 14px; }
.smart-picker-zone { display: block; margin-top: 1px; color: #776e86; font-size: 10px; font-weight: 700; letter-spacing: .02em; }
.smart-picker-clear,
.smart-picker-today,
.smart-picker-nav {
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #6c2bd9;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.smart-picker-clear,
.smart-picker-today { padding: 7px 9px; font-size: 12px; }
.smart-picker-clear:hover,
.smart-picker-today:hover { background: #f1eaff; }
.smart-picker-nav { width: 30px; height: 30px; font-size: 24px; line-height: 1; }
.smart-picker-nav:hover { background: #f3effa; }
.smart-time-preview {
    flex: 0 0 auto;
    min-width: 58px;
    margin: 0;
    padding: 7px 9px;
    border-radius: 11px;
    background: #f4efff;
    color: #5721be;
    font-size: 16px;
    font-weight: 780;
    letter-spacing: .04em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.smart-time-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.smart-time-columns section { min-width: 0; }
.smart-time-columns small { display: block; margin: 0 0 5px 2px; color: #8a8494; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.smart-discount-popup { width: min(280px, calc(100vw - 28px)); }
.smart-discount-column small { display: block; margin: 0 0 5px 2px; color: #8a8494; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.smart-discount-wheel { max-width: 118px; height: 178px; margin-inline: auto; }
.smart-time-wheel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 132px;
    padding: 46px 3px;
    border: 1px solid #ebe5f2;
    border-radius: 16px;
    background: linear-gradient(to bottom, rgba(255,255,255,.98) 0, rgba(255,255,255,.82) 26%, rgba(244,239,255,.94) 38%, rgba(244,239,255,.94) 62%, rgba(255,255,255,.82) 74%, rgba(255,255,255,.98) 100%);
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
}
.smart-time-wheel::-webkit-scrollbar { display: none; }
.smart-time-value,
.smart-date-value {
    min-height: 34px;
    border: 0;
    border-radius: 9px;
    background: #f7f5fa;
    color: #342d41;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    scroll-snap-align: center;
}
.smart-time-value {
    flex: 0 0 34px;
    width: 100%;
    min-height: 34px;
    border-radius: 10px;
    background: transparent;
    color: #81798b;
    font-size: 16px;
    opacity: .64;
}
.smart-time-value:hover,
.smart-date-value:hover { background: #ece1ff; color: #5623ba; }
.smart-time-value.selected { background: rgba(112, 39, 223, .12); color: #5b20bf; box-shadow: inset 0 1px 0 rgba(112, 39, 223, .22), inset 0 -1px 0 rgba(112, 39, 223, .22); opacity: 1; }
.smart-date-value.selected { background: linear-gradient(135deg, #7027df, #9d43ef); color: #fff; box-shadow: 0 5px 12px rgba(112, 39, 223, .22); }
.smart-picker-hint { margin: 12px 2px 0; color: #958e9e; font-size: 10px; }
.smart-picker-footer .smart-picker-hint { margin: 0; align-self: center; }
.smart-picker-apply {
    min-height: 32px;
    padding: 0 13px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #7027df, #9d43ef);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(112, 39, 223, .20);
}
.smart-picker-apply:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.smart-date-heading { display: flex; min-width: 0; gap: 5px; }
.smart-date-heading select {
    min-width: 0;
    border: 0;
    border-radius: 10px;
    padding: 6px 5px;
    background: #f4f0fa;
    color: #3d334a;
    font: inherit;
    font-size: 13px;
    font-weight: 720;
    cursor: pointer;
}
.smart-picker-month { max-width: 118px; }
.smart-picker-year { max-width: 76px; }
.smart-weekdays,
.smart-date-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.smart-weekdays { margin-bottom: 5px; color: #928a9b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.smart-date-value { min-height: 34px; background: transparent; font-size: 13px; }
.smart-date-value.today { box-shadow: inset 0 0 0 1px #9d6eea; color: #6929ca; }
.smart-date-value.selected.today { color: #fff; box-shadow: 0 5px 12px rgba(112, 39, 223, .22); }
.smart-picker-footer { display: flex; justify-content: space-between; margin-top: 9px; padding-top: 8px; border-top: 1px solid #eee9f3; }
@media (max-width: 800px) {
    .mapping-grid { grid-template-columns: 1fr 1fr; }
    .import-heading { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 520px) {
    .mapping-grid { grid-template-columns: 1fr; }
    .import-card { padding: 18px; border-radius: 18px; }
}
