* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #FBF7F0; color: #1A1A1A; line-height: 1.6; }
a { color: #C49A6C; text-decoration: none; }
a:hover { opacity: .8; }
img { max-width: 100%; height: auto; }

/* Header */
.header { background: #FFF; border-bottom: 1px solid #E8E0D6; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; height: 72px; gap: 32px; }
.header-logo { display: flex; align-items: center; }
.header-logo img { height: 60px; }
.header-nav { display: flex; gap: 24px; align-items: center; flex: 1; margin-left: 8px; }
.header-nav a, .dropdown > a { color: #1A1A1A; font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; padding: 8px 0; white-space: nowrap; display: flex; align-items: center; }
.header-nav a:hover { color: #C49A6C; }
.header-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.header-actions a { color: #1A1A1A; font-size: 14px; white-space: nowrap; }
.cart-link { position: relative; }
.cart-count { background: #C49A6C; color: #FFF; font-size: 11px; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; position: absolute; top: -8px; right: -12px; }

/* Dropdown */
.dropdown { position: relative; display: flex; align-items: stretch; }
.dropdown-menu { position: absolute; top: 100%; left: 0; background: #FFF; border: 1px solid #E8E0D6; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08); min-width: 200px; padding: 8px; display: none; z-index: 50; }
.dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 12px; font-size: 13px; text-transform: none; letter-spacing: 0; border-radius: 4px; }
.dropdown-menu a:hover { background: #FBF7F0; }

/* Hero Banner */
.hero { background: #FFF; border-radius: 16px; margin: 24px auto; max-width: 1280px; overflow: hidden; display: flex; min-height: calc(95vh - 96px); position: relative; border: 1px solid #F0EBE4; }

.hero-photo { flex: 0 0 55%; background: url('/images/123.png') center/cover no-repeat; }

.hero-content { flex: 0 0 45%; padding: 80px 48px; display: flex; align-items: center; }

.hero-text { max-width: 440px; }

.hero-text p { font-size: 14px; color: #444; line-height: 1.9; margin-bottom: 16px; }

.hero-tagline { font-size: 16px; color: #C49A6C; font-weight: 600; letter-spacing: .5px; margin-bottom: 28px !important; }

.hero-text .btn { display: inline-block; padding: 14px 40px; background: #C49A6C; color: #FFF; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; border-radius: 4px; transition: background .3s; }

.hero-text .btn:hover { background: #B8895A; }

/* Container */
.container { max-width: 1280px; margin: 0 auto; padding: 40px 24px; }
.section-title { font-size: 28px; font-weight: 300; text-align: center; letter-spacing: 1px; margin-bottom: 40px; }

/* Products grid */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.product-card { background: #FFF; border-radius: 12px; overflow: hidden; transition: box-shadow .3s, transform .3s; border: 1px solid #F0EBE4; position: relative; display: flex; flex-direction: column; }
.product-card:hover { box-shadow: 0 8px 32px rgba(0,0,0,.06); transform: translateY(-2px); }
.product-card-image { aspect-ratio: 3/4; background: #F5F0EA; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card-image img { width: 100%; height: 100%; object-fit: contain; transition: transform .5s; }
.product-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.product-card-brand { font-size: 11px; color: #C49A6C; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.product-card-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.product-card-title a { color: #1A1A1A; }
.product-card-price { font-size: 18px; font-weight: 700; color: #1A1A1A; margin-bottom: 12px; }
.product-card-old-price { font-size: 13px; color: #2B5E4B; text-decoration: line-through; margin-left: 8px; }
.product-card-meta { font-size: 11px; color: #999; margin-bottom: 6px; }
.btn-cart { width: 100%; margin-top: auto; padding: 12px; background: #3A3A3A; color: #FFF; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: background .3s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.btn-cart:hover { background: #C49A6C; }
.btn-cart svg { width: 18px; height: 18px; }
.badge-new { position: absolute; top: 12px; left: 12px; background: #2B5E4B; color: #FFF; padding: 4px 10px; border-radius: 4px; font-size: 11px; text-transform: uppercase; }
.badge-sale { position: absolute; top: 12px; right: 12px; background: #C49A6C; color: #FFF; padding: 4px 10px; border-radius: 4px; font-size: 11px; text-transform: uppercase; }

/* Catalog */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.filters { background: #FFF; border-radius: 12px; padding: 24px; border: 1px solid #F0EBE4; height: fit-content; position: sticky; top: 100px; }
.filters h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; color: #C49A6C; }
.filter-group { margin-bottom: 20px; }
.filter-group label { display: block; font-size: 13px; margin-bottom: 4px; color: #666; }
.filter-group select, .filter-group input[type="text"] { width: 100%; padding: 8px 12px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 13px; background: #FBF7F0; }
.filter-group button { width: 100%; padding: 10px; background: #3A3A3A; color: #FFF; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; }
.filter-group button:hover { background: #C49A6C; }
.catalog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.catalog-header h1 { font-size: 24px; font-weight: 300; }

/* Product detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.product-image { background: #F5F0EA; border-radius: 16px; overflow: hidden; height: 500px; display: flex; align-items: center; justify-content: center; position: relative; }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-thumbs { position: absolute; bottom: 12px; left: 12px; right: 12px; display: flex; gap: 8px; justify-content: center; background: rgba(245, 240, 234, .85); padding: 8px; border-radius: 12px; }
.product-thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; background: #FFF; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; }
.product-thumb.active { border-color: #C49A6C; }
.product-info h1 { font-size: 32px; font-weight: 300; margin-bottom: 8px; }
.product-info .brand { color: #C49A6C; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.product-info .price { font-size: 28px; font-weight: 700; color: #C49A6C; margin-bottom: 24px; }
.product-info .old-price { font-size: 18px; color: #999; text-decoration: line-through; margin-left: 12px; }
.product-specs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.spec { background: #FBF7F0; padding: 6px 14px; border-radius: 20px; font-size: 12px; color: #666; }
.spec strong { color: #1A1A1A; }
.review-item { padding: 12px 0; border-bottom: 1px solid #F0EBE4; }
.review-item:last-child { border-bottom: none; }
.product-tabs { margin-top: 24px; }
.tab-nav { display: flex; gap: 0; border-bottom: 1px solid #E8E0D6; }
.tab-nav button { padding: 12px 20px; background: none; border: none; cursor: pointer; font-size: 14px; color: #999; border-bottom: 2px solid transparent; }
.tab-nav button.active { color: #C49A6C; border-bottom-color: #C49A6C; }
.tab-content { padding: 20px 0; display: none; font-size: 14px; line-height: 1.8; }
.tab-content.active { display: block; }
.btn-graphite { padding: 14px 32px; background: #3A3A3A; color: #FFF; border: none; border-radius: 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: background .3s; }
.btn-graphite:hover { background: #C49A6C; }
.sticky-cart { position: fixed; bottom: 0; left: 0; right: 0; background: #FFF; padding: 16px 24px; border-top: 1px solid #E8E0D6; display: none; z-index: 50; }
.sticky-cart.visible { display: flex; justify-content: space-between; align-items: center; max-width: 1280px; margin: 0 auto; }

/* Cart */
/* Cart — modern layout */
.cart-layout { display: flex; gap: 32px; align-items: flex-start; }
.cart-items { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.cart-item { display: flex; gap: 16px; background: #FFF; border-radius: 12px; padding: 16px; border: 1px solid #F0EBE4; align-items: center; position: relative; }
.cart-item-img { width: 100px; height: 100px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #FBF7F0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-item-body { flex: 1; min-width: 0; }
.cart-item-name { font-size: 15px; font-weight: 600; color: #1A1A1A; margin-bottom: 12px; line-height: 1.3; }
.cart-qty { display: inline-flex; align-items: center; border: 1px solid #E0D8CE; border-radius: 8px; overflow: hidden; }
.cart-qty-btn { width: 36px; height: 36px; border: none; background: #FBF7F0; cursor: pointer; font-size: 16px; color: #1A1A1A; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.cart-qty-btn:hover { background: #F0EBE4; }
.cart-qty-input { width: 40px; height: 36px; border: none; border-left: 1px solid #E0D8CE; border-right: 1px solid #E0D8CE; text-align: center; font-size: 14px; outline: none; }
.cart-item-price { text-align: right; flex-shrink: 0; min-width: 100px; }
.cart-price-current { font-size: 18px; font-weight: 700; color: #1A1A1A; }
.cart-price-old { font-size: 13px; color: #999; text-decoration: line-through; margin-top: 2px; }
.cart-item-remove { position: absolute; top: 12px; right: 12px; background: none; border: none; cursor: pointer; color: #ccc; padding: 4px; transition: color .2s; }
.cart-item-remove:hover { color: #e74c3c; }
.cart-summary { width: 320px; flex-shrink: 0; background: #FFF; border-radius: 12px; padding: 24px; border: 1px solid #F0EBE4; position: sticky; top: 90px; }
.cart-summary-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: #1A1A1A; }
.cart-summary-row { display: flex; justify-content: space-between; font-size: 14px; color: #555; margin-bottom: 12px; }
.cart-summary-divider { height: 1px; background: #F0EBE4; margin: 12px 0; }
.cart-summary-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; color: #1A1A1A; margin-bottom: 8px; }
@media (max-width:768px) {
  .cart-layout { flex-direction: column; }
  .cart-summary { width: 100%; position: static; }
  .cart-item { flex-wrap: wrap; }
  .cart-item-price { min-width: auto; }
}

/* Cart Drawer */
.cart-drawer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 160; opacity: 0; visibility: hidden; transition: opacity .3s; }
.cart-drawer-overlay.show { opacity: 1; visibility: visible; }
.cart-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 100vw; background: #FFF; z-index: 170; box-shadow: -8px 0 40px rgba(0,0,0,.12); transform: translateX(100%); transition: transform .3s ease; display: flex; flex-direction: column; }
.cart-drawer.open { transform: translateX(0); }
.cart-drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #F0EBE4; }
.cart-drawer-header h3 { font-size: 20px; font-weight: 700; }
.cart-drawer-close { background: none; border: none; cursor: pointer; color: #999; padding: 4px; display: flex; transition: color .2s; }
.cart-drawer-close:hover { color: #1A1A1A; }
.cart-drawer-items { flex: 1; overflow-y: auto; padding: 16px 24px; }
.cart-drawer-empty { text-align: center; color: #999; padding: 60px 0; font-size: 15px; }
.cart-drawer-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid #F5F1EB; position: relative; }
.cart-drawer-item-img { width: 72px; height: 72px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #FBF7F0; }
.cart-drawer-item-img img { width: 100%; height: 100%; object-fit: contain; }
.cart-drawer-item-body { flex: 1; min-width: 0; padding-right: 24px; }
.cart-drawer-item-name { font-size: 13px; font-weight: 600; color: #1A1A1A; line-height: 1.35; margin-bottom: 8px; }
.cart-drawer-item-controls { display: inline-flex; align-items: center; border: 1px solid #E0D8CE; border-radius: 8px; overflow: hidden; }
.cart-drawer-qty-btn { width: 30px; height: 30px; border: none; background: #FBF7F0; cursor: pointer; font-size: 16px; color: #1A1A1A; display: flex; align-items: center; justify-content: center; }
.cart-drawer-qty-btn:hover { background: #F0EBE4; }
.cart-drawer-qty-val { width: 36px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 14px; border-left: 1px solid #E0D8CE; border-right: 1px solid #E0D8CE; }
.cart-drawer-item-price { font-size: 14px; font-weight: 700; color: #1A1A1A; margin-top: 10px; }
.cart-drawer-item-remove { position: absolute; top: 16px; right: 0; background: none; border: none; cursor: pointer; color: #ccc; padding: 4px; transition: color .2s; }
.cart-drawer-item-remove:hover { color: #e74c3c; }
.cart-drawer-footer { padding: 20px 24px; border-top: 1px solid #F0EBE4; background: #FFF; }
.cart-drawer-total-row { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; color: #1A1A1A; margin-bottom: 6px; }
.cart-drawer-free { font-size: 12px; color: #999; margin-bottom: 16px; }
.cart-drawer-checkout { display: block; text-align: center; padding: 16px; font-size: 15px; text-decoration: none; }
.cart-drawer-continue { width: 100%; margin-top: 10px; background: none; border: none; color: #C49A6C; font-size: 13px; cursor: pointer; text-align: center; padding: 8px; }
.cart-drawer-continue:hover { text-decoration: underline; }

/* Reviews */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.review-card { background: #FFF; border-radius: 12px; padding: 24px; border: 1px solid #F0EBE4; }
.review-card .stars { color: #C49A6C; margin-bottom: 8px; }
.review-card h4 { font-size: 14px; margin-bottom: 4px; }
.review-card .product-name { font-size: 12px; color: #C49A6C; margin-bottom: 8px; }
.review-card p { font-size: 14px; color: #555; line-height: 1.6; }
.review-card .date { font-size: 12px; color: #aaa; margin-top: 8px; }
.review-form { background: #FFF; border-radius: 12px; padding: 32px; border: 1px solid #F0EBE4; max-width: 600px; margin: 0 auto; }
.review-form select, .review-form textarea, .review-form input[type="file"] { width: 100%; padding: 10px; border: 1px solid #E0D8CE; border-radius: 6px; margin-bottom: 16px; font-size: 14px; background: #FBF7F0; }
.review-form textarea { min-height: 120px; resize: vertical; }
.star-rating { display: flex; flex-direction: row-reverse; gap: 4px; justify-content: flex-end; margin-bottom: 16px; }
.star-rating input { display: none; }
.star-rating label { font-size: 28px; color: #ddd; cursor: pointer; }
.star-rating input:checked ~ label, .star-rating label:hover, .star-rating label:hover ~ label { color: #C49A6C; }

/* Auth */
.auth-form { max-width: 400px; margin: 60px auto; background: #FFF; padding: 40px; border-radius: 16px; border: 1px solid #F0EBE4; }
.auth-form h1 { font-size: 24px; font-weight: 300; text-align: center; margin-bottom: 24px; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"], .auth-form input[type="tel"] { width: 100%; padding: 12px; border: 1px solid #E0D8CE; border-radius: 6px; margin-bottom: 16px; font-size: 14px; background: #FBF7F0; }
.auth-form label { font-size: 13px; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; }
.auth-form label input[type="checkbox"] { margin-top: 3px; }
.auth-form .btn { width: 100%; padding: 12px; background: #C49A6C; color: #FFF; border: none; border-radius: 6px; font-size: 14px; text-transform: uppercase; cursor: pointer; }
.auth-form .error { color: #D32F2F; font-size: 13px; margin-bottom: 16px; text-align: center; }
.consent-link { color: #C49A6C; text-decoration: underline; }

/* Social icons */
.social-icons { display: flex; gap: 12px; margin-top: 12px; }
.social-icons a { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #444; border-radius: 50%; color: #999; transition: all .3s; }
.social-icons a:hover { border-color: #C49A6C; color: #C49A6C; background: rgba(196,154,108,.1); }

/* Footer */
.footer { background: #1A1A1A; color: #CCC; padding: 60px 24px 40px; margin-top: 80px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; }
.footer h4 { color: #FFF; font-size: 14px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer a { display: block; color: #999; font-size: 13px; margin-bottom: 8px; }
.footer a:hover { color: #C49A6C; }
.footer-bottom { max-width: 1280px; margin: 40px auto 0; padding-top: 20px; border-top: 1px solid #333; text-align: center; font-size: 12px; color: #666; }

/* Recently viewed widget */


/* ============================================================
   ADMIN SHELL — AmoCRM-style layout (only inside admin pages)
   Clean, self-contained; does NOT depend on public-site rules.
   ============================================================ */
body.admin-shell { padding-top: 60px; }        /* topbar */

/* Topbar: fixed, thin, light, search left, avatar right */
body.admin-shell .header,
body.admin-shell .header-admin { position: fixed; top: 0; left: 220px; right: 0; height: 60px; background: #FFF; border-bottom: 1px solid #E8E0D6; z-index: 200; transition: left .2s; }
body.admin-shell.admin-collapsed .header,
body.admin-shell.admin-collapsed .header-admin { left: 56px; }
body.admin-shell .header-inner { max-width: none; margin: 0; padding: 0 16px; height: 60px; display: flex; align-items: center; gap: 12px; }
body.admin-shell .header-admin .gs-wrap { flex: 1; max-width: 640px; margin: 0 auto; }
body.admin-shell .header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Header: funnel select (left of view switch) */
body.admin-shell .admin-funnel-switch { flex-shrink: 0; }
body.admin-shell .admin-funnel-select { border: 1px solid #E0D8CE; border-radius: 8px; background: #FFF; color: #1A1A1A; font-size: 12px; font-weight: 500; padding: 7px 10px; cursor: pointer; outline: none; max-width: 160px; transition: border-color .15s; }
body.admin-shell .admin-funnel-select:hover, body.admin-shell .admin-funnel-select:focus { border-color: #C49A6C; }

/* Header: view-switch segmented control (left of search) */
body.admin-shell .admin-view-switch { display: inline-flex; border: 1px solid #E0D8CE; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
body.admin-shell .admin-view-switch button { background: #FFF; border: none; padding: 6px 10px; cursor: pointer; color: #888; display: flex; align-items: center; transition: all .15s; }
body.admin-shell .admin-view-switch button:hover { color: #1A1A1A; }
body.admin-shell .admin-view-switch button.active { background: #1A1A1A; color: #FFF; }

/* Header: create-order button */
body.admin-shell .ab-create-order { display: inline-flex; align-items: center; gap: 6px; background: #C49A6C; color: #FFF; border: none; border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: opacity .15s; flex-shrink: 0; }
body.admin-shell .ab-create-order:hover { opacity: .85; }

/* Header: three-dots kebab menu */
body.admin-shell .ab-dots { position: relative; flex-shrink: 0; }
body.admin-shell .ab-dots-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; color: #888; display: flex; align-items: center; transition: all .15s; }
body.admin-shell .ab-dots-btn:hover { color: #1A1A1A; background: #FBF7F0; }
body.admin-shell .ab-dots-drop { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 180px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; z-index: 210; }
body.admin-shell .ab-dots.open .ab-dots-drop { display: block; }
body.admin-shell .ab-dots-item { display: block; padding: 10px 14px; font-size: 13px; color: #1A1A1A; text-decoration: none; transition: background .12s; }
body.admin-shell .ab-dots-item:hover { background: #FBF7F0; }
body.admin-shell .ab-dots-item.ab-sort-item.active { background: #FBF7F0; color: #C49A6C; font-weight: 600; position: relative; }
body.admin-shell .ab-dots-item.ab-sort-item.active::after { content: "✓"; position: absolute; right: 12px; color: #C49A6C; }
body.admin-shell .ab-dots-group-title { padding: 10px 14px 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #999; }
body.admin-shell .ab-dots-sep { height: 1px; background: #F0EBE4; margin: 4px 0; }

/* Sidebar: full-height rail fixed under the topbar, flush to left edge */
body.admin-shell .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 220px; background: #1A1A1A; border-radius: 0; padding: 0 0 12px; overflow: hidden; display: flex; flex-direction: column; transition: width .2s; z-index: 110; }
body.admin-shell .admin-sidebar.collapsed { width: 56px; }
body.admin-shell .sidebar-toggle { background: none; border: none; color: #888; cursor: pointer; padding: 14px 16px 8px; display: flex; align-items: center; gap: 10px; transition: color .2s; width: 100%; }
body.admin-shell .admin-sidebar.collapsed .sidebar-toggle { justify-content: center; padding: 14px 0 8px; }
body.admin-shell .sidebar-toggle:hover { color: #FFF; }
body.admin-shell .sidebar-scroll { flex: 1; overflow-y: auto; padding: 0 8px; }
body.admin-shell .sidebar-scroll::-webkit-scrollbar { width: 3px; }
body.admin-shell .sidebar-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 2px; }
body.admin-shell .sidebar-scroll:hover::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); }
body.admin-shell .sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; color: #A9A29B; font-size: 13px; border-radius: 8px; text-decoration: none; transition: all .15s; cursor: pointer; white-space: nowrap; }
body.admin-shell .sidebar-item:hover { color: #FFF; background: rgba(255,255,255,.06); }
body.admin-shell .sidebar-item.active { color: #FFF; }
body.admin-shell .sidebar-icon { flex-shrink: 0; width: 20px; display: flex; align-items: center; justify-content: center; }
body.admin-shell .admin-sidebar.collapsed .sidebar-label,
body.admin-shell .admin-sidebar.collapsed .sidebar-arrow,
body.admin-shell .admin-sidebar.collapsed .sidebar-sep { display: none; }
body.admin-shell .admin-sidebar.collapsed .sidebar-item { justify-content: center; padding: 10px 0; }
body.admin-shell .sidebar-sep { height: 1px; background: #333; margin: 8px 12px; }
body.admin-shell .sidebar-item.group-a.active { background: rgba(196,154,108,.18); color: #C49A6C; }
body.admin-shell .sidebar-item.group-a:hover { color: #C49A6C; }
body.admin-shell .sidebar-item.group-b.active { background: rgba(43,94,75,.2); color: #58A08A; }
body.admin-shell .sidebar-item.group-b:hover { color: #58A08A; }
body.admin-shell .sidebar-group .sidebar-sub { display: none; padding-left: 18px; }
body.admin-shell .sidebar-group.open .sidebar-sub { display: block; }
body.admin-shell .sidebar-group .sidebar-arrow { margin-left: auto; transition: transform .2s; display: flex; }
body.admin-shell .sidebar-group.open > .sidebar-group-btn .sidebar-arrow { transform: rotate(90deg); }
body.admin-shell .sidebar-sub-item { font-size: 12px; padding: 7px 12px; gap: 8px; }
body.admin-shell .sidebar-sub-item.active { background: rgba(255,255,255,.08); color: #FFF; }
body.admin-shell .sidebar-group-btn { background: none; border: none; width: 100%; text-align: left; font: inherit; }
body.admin-shell .sidebar-badge { margin-left: auto; background: #C49A6C; color: #FFF; font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 10px; flex-shrink: 0; }
body.admin-shell .sidebar-group-label { font-size: 10px; color: #777; text-transform: uppercase; letter-spacing: 1px; padding: 16px 16px 4px; font-weight: 600; }

/* Page container: full width right of sidebar (kanban, lists) */
body.admin-shell .container { max-width: none; margin: 0; padding: 20px 16px 48px; }
body.admin-shell .admin-layout { display: block; }
body.admin-shell .admin-layout > div:last-child { margin-left: 220px; min-width: 0; }
body.admin-shell.admin-collapsed .admin-layout > div:last-child { margin-left: 56px; }

/* -- Admin components shared by pages -- */
.admin-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
.admin-card { background: #FFF; border-radius: 12px; padding: 24px; border: 1px solid #F0EBE4; margin-bottom: 20px; }
.admin-card .stat { font-size: 36px; font-weight: 700; color: #C49A6C; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th { text-align: left; padding: 10px 12px; background: #FBF7F0; border-bottom: 1px solid #E8E0D6; font-size: 12px; text-transform: uppercase; color: #666; }
.admin-table td { padding: 10px 12px; border-bottom: 1px solid #F0EBE4; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 4px; border: none; cursor: pointer; }
.btn-gold { background: #C49A6C; color: #FFF; }
.btn-dark { background: #3A3A3A; color: #FFF; }
.btn-danger { background: #D32F2F; color: #FFF; }
.admin-form input, .admin-form select, .admin-form textarea { width: 100%; padding: 10px; border: 1px solid #E0D8CE; border-radius: 6px; margin-bottom: 12px; font-size: 14px; background: #FBF7F0; }
.admin-form textarea { min-height: 100px; resize: vertical; }
.admin-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-form label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }

/* ---- Редизайн-утилиты (v82) ---- */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-head h3 { margin: 0; }
.link-gold { color: #C49A6C; font-size: 12px; text-decoration: none; white-space: nowrap; }
.link-gold:hover { color: #B8895C; }
.text-muted { color: #999; font-size: 13px; }
.empty-row td { padding: 32px 16px; text-align: center; color: #999; font-size: 13px; }
.gap-btn { display: inline-flex; align-items: center; gap: 8px; }
.crm-select { padding: 5px 10px; font-size: 12px; min-height: 30px; width: auto; }
.crm-trunc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-badge.muted { background: #F0EBE4; color: #666; border-color: #E0D8CE; }
.tag-badge.green { background: #EAF5EF; color: #2B5E4B; border-color: #2B5E4B; }

/* Dashboard */
.dash-hero { background: linear-gradient(135deg, #1A1A1A, #2E2E2E); border-radius: 14px; padding: 20px 24px; margin-bottom: 20px; }
.dash-hero-title { color: #C49A6C; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 14px; }
.dash-hero .crm-today-card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.1); }
.dash-hero .crm-today-card .num { color: #C49A6C; }
.dash-hero .crm-today-card .lbl { color: #AAA; }
.dash-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.chat-link { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #F8F5F0; text-decoration: none; color: inherit; }
.chat-link:hover { background: #FBF7F0; }
.chat-link-main { flex: 1; min-width: 0; }
.chat-link-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-link-sub { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Знания (knowledge) */
.kb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kb-card { background: #FBF7F0; border-radius: 12px; padding: 20px; text-align: center; }
.mm-list { display: flex; flex-direction: column; gap: 26px; }
.mm-slide { margin: 0; border: 1px solid #E7DED2; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.mm-slide img { width: 100%; display: block; border-bottom: 1px solid #E7DED2; }
.mm-slide figcaption { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: #555; padding: 14px 16px; line-height: 1.5; background: #FAF6EF; }
.mm-slide figcaption strong { font-size: 15px; color: #1A1A1A; }
.mm-slide-mobile img { max-width: 360px; margin: 0 auto; display: block; }
.mm-slide-mobile figcaption { text-align: center; }
.kb-card.left { text-align: left; padding: 16px; }
.kb-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.kb-card.left .kb-icon { margin: 0 0 12px; }
.kb-icon svg { width: 24px; height: 24px; }
.kb-icon-gold { background: #C49A6C; }
.kb-icon-green { background: #2B5E4B; }
.kb-icon-gray { background: #3A3A3A; }
.kb-icon-black { background: #1A1A1A; }
.kb-title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.kb-desc { font-size: 12px; color: #666; margin: 0; line-height: 1.6; }
.kb-step-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 32px; }
@media (max-width: 700px) { .kb-step-grid { grid-template-columns: 1fr; } }
.kb-step { display: flex; gap: 12px; align-items: flex-start; }
.kb-step-num { width: 28px; height: 28px; background: #C49A6C; color: #FFF; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.kb-step-num.green { background: #2B5E4B; }
.kb-step-title { display: block; font-size: 13px; font-weight: 600; }
.kb-step-desc { display: block; font-size: 12px; color: #666; margin-top: 2px; line-height: 1.5; }
.kb-note { background: #FBF7F0; border-left: 3px solid #C49A6C; border-radius: 0 12px 12px 0; padding: 16px 18px; }
.admin-card .kb-note { margin-bottom: 14px; }

/* Дашборд: тренд по дням */
.trend-cell { width: 200px; }
.trend-bar { display: inline-block; height: 6px; border-radius: 3px; background: #C49A6C; vertical-align: middle; }

/* Admin header: logo hidden, search fills, avatar profile on right */
.header-admin .header-inner { gap: 16px; }

/* Global search (in header) */
.gs-wrap { position: relative; }
.gs-input { display: flex; align-items: center; gap: 8px; background: #FBF7F0; border: 1px solid #E0D8CE; border-radius: 10px; padding: 8px 12px; color: #999; transition: border-color .15s; }
.gs-input:focus-within { border-color: #C49A6C; background: #FFF; }
.gs-input svg { flex-shrink: 0; }
.gs-input input { flex: 1; border: none; outline: none; background: transparent; font-size: 13px; color: #1A1A1A; min-width: 0; }
.gs-close { display: none; background: none; border: none; color: #999; cursor: pointer; padding: 2px; }
.gs-wrap.open .gs-close { display: block; }
.gs-drop { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; min-width: 420px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.12); overflow: hidden; z-index: 200; }
.gs-wrap.open .gs-drop { display: block; }
.gs-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid #F0EBE4; }
.gs-tab { background: none; border: none; padding: 6px 12px; font-size: 12px; color: #888; cursor: pointer; border-radius: 8px; position: relative; }
.gs-tab:hover { color: #1A1A1A; }
.gs-tab.active { background: #F5F0E8; color: #C49A6C; font-weight: 600; }
.gs-tab-count { display: inline-block; margin-left: 5px; background: #C49A6C; color: #FFF; font-size: 10px; font-weight: 600; padding: 0 6px; border-radius: 8px; line-height: 15px; }
.gs-body { max-height: 380px; overflow-y: auto; }
.gs-empty { padding: 28px 20px; text-align: center; color: #999; font-size: 13px; }
.gs-list { padding: 4px; }
.gs-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: #1A1A1A; transition: background .12s; }
.gs-item:hover { background: #FBF7F0; }
.gs-item-ic { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; font-weight: 600; }
.gs-ic-order { background: #E8F0FE; color: #1E5FA8; }
.gs-ic-avatar { background: #F5F0E8; color: #C49A6C; }
.gs-item-thumb { width: 32px; height: 32px; border-radius: 8px; background: #F5F0EA; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.gs-item-thumb img { width: 100%; height: 100%; object-fit: contain; }
.gs-item-body { flex: 1; min-width: 0; }
.gs-item-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-item-sub { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.gs-item-link { font-size: 12px; color: #C49A6C; text-decoration: none; white-space: nowrap; }
.gs-item-link:hover { text-decoration: underline; }
.gs-order-tag { display: inline-block; margin-left: 6px; background: #EAF5EF; color: #2B5E4B; font-size: 10px; padding: 1px 6px; border-radius: 8px; }

/* Header filter toggle (AmoCRM-style): shown on pages with page filter */
.gs-filter-toggle { flex-shrink: 0; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: #FBF7F0; border: 1px solid #E0D8CE; border-radius: 10px; color: #888; cursor: pointer; transition: all .15s; }
.gs-filter-toggle:hover { color: #C49A6C; border-color: #C49A6C; }
.gs-filter-toggle.active { background: #C49A6C; border-color: #C49A6C; color: #FFF; }
.header-admin .gs-filter-toggle { margin-left: 4px; }

/* Orders filter drawer: slides from under the header, AmoCRM-style */
.order-filter-drawer {
  background: #FFF; border: 1px solid #E8E0D6; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.10); padding: 16px; margin-bottom: 14px;
}
.order-filter-drawer[hidden] { display: none; }

/* Filter as a slide-down panel from the header (orders) — overlays the board, does not push content */
#orderFilterDrawer[data-page-filter] {
  position: fixed; top: 60px; left: 220px; right: 0; z-index: 290;
  margin: 0; padding: 16px 20px; background: #FFF; border: none; border-bottom: 1px solid #E8E0D6;
  box-shadow: 0 12px 40px rgba(0,0,0,.12); flex-direction: column;
  max-height: calc(100vh - 60px); overflow: hidden;
  display: none;
}
body.admin-shell.admin-collapsed #orderFilterDrawer[data-page-filter] { left: 56px; }
#orderFilterDrawer.filter-open { display: flex !important; }
#orderFilterDrawer form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.filter-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.8fr 1fr; gap: 18px; }
.filter-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; align-content: start; }
.filter-col { display: flex; flex-direction: column; min-height: 0; }

/* Saved filters — separate visual block (settings of the filter, not filtering) */
.filter-save-group {
  border-left: 1px solid #F0EBE4; padding-left: 18px;
  display: flex; flex-direction: column; gap: 10px; align-content: start;
}
.filter-save-title { font-size: 12px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: .5px; }
.filter-save-group select { padding: 9px 10px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; background: #FFF; width: 100%; }

/* Multiselect control (status / responsible) */
.filter-ms { position: relative; width: 100%; }
.ms-trigger {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 9px 12px;
  background: #FFF; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px;
  color: #1A1A1A; cursor: pointer; text-align: left; transition: border-color .15s; white-space: nowrap; overflow: hidden;
}
.ms-trigger:hover { border-color: #C49A6C; }
.filter-ms.open .ms-trigger { border-color: #C49A6C; box-shadow: 0 0 0 2px rgba(196,154,108,.15); }
.ms-placeholder { color: #888; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.ms-chips { display: inline-flex; gap: 4px; flex-wrap: nowrap; overflow: hidden; min-width: 0; }
.ms-chip { background: #FBF7F0; border: 1px solid #E8E0D6; border-radius: 5px; padding: 1px 6px; font-size: 11px; color: #1A1A1A; white-space: nowrap; }
.ms-caret { margin-left: auto; font-size: 10px; color: #999; flex-shrink: 0; }
.ms-options {
  display: none; z-index: 1200; background: #FFF; border: 1px solid #E8E0D6; border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.14); padding: 10px; min-width: 240px;
}
.filter-ms.open .ms-options { display: block; }
.ms-options-title { font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.ms-options .filter-multi { display: flex; flex-direction: column; gap: 1px; }
.ms-options .filter-multi.scroll { max-height: 220px; overflow-y: auto; }
.filter-check { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; font-size: 13px; color: #555; cursor: pointer; transition: background .12s; }
.filter-check:hover { background: #FBF7F0; }
.filter-check.checked { background: rgba(196,154,108,.15); color: #1A1A1A; font-weight: 500; }
.filter-check input { accent-color: #C49A6C; }
.filter-date { display: flex; flex-direction: column; gap: 6px; }
.filter-date .filter-label { font-size: 12px; font-weight: 500; color: #777; margin-bottom: 2px; }
.filter-date input[type="date"] {
  width: 100%; height: 38px; padding: 0 10px; box-sizing: border-box;
  border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; font-family: inherit;
  background: #FFF; color: #1A1A1A; outline: none; cursor: pointer; transition: border-color .15s;
}
.filter-date input[type="date"]:hover { border-color: #C49A6C; }
.filter-date input[type="date"]:focus { border-color: #C49A6C; box-shadow: 0 0 0 2px rgba(196,154,108,.15); }
.filter-date input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .55; margin-left: auto; transition: opacity .15s;
}
.filter-date input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.filter-date input[type="date"]::-webkit-datetime-edit { color: #1A1A1A; }
.filter-date input[type="date"]::-webkit-datetime-edit-fields-wrapper { color: #1A1A1A; }
.filter-date input[type="date"]:invalid::-webkit-datetime-edit, .filter-date input[type="date"]:empty, .filter-date input[type="date"][value=""] { color: #888; }
.ms-options .filter-label { font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.filter-foot { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; border-top: 1px solid #F0EBE4; margin-top: 14px; flex-shrink: 0; }

/* Admin: profile avatar dropdown */
.profile-menu { position: relative; }
.profile-btn { background: none; border: none; cursor: pointer; padding: 0; }
.profile-avatar { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: #C49A6C; color: #FFF; font-weight: 700; font-size: 15px; }
.profile-drop { display: none; position: absolute; right: 0; top: calc(100% + 10px); width: 240px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.12); overflow: hidden; z-index: 210; }
.profile-menu.open .profile-drop { display: block; }
.profile-drop-head { padding: 14px 16px; border-bottom: 1px solid #F0EBE4; }
.profile-drop-head strong { display: block; font-size: 13px; color: #1A1A1A; }
.profile-drop-mail { display: block; font-size: 11px; color: #999; margin-top: 2px; }
.profile-drop-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 13px; color: #1A1A1A; text-decoration: none; cursor: pointer; }
.profile-drop-item:hover { background: #FBF7F0; }
.profile-drop-item svg { color: #999; flex-shrink: 0; }
.profile-drop-item.active { color: #C49A6C; font-weight: 600; }
.profile-drop-sep { height: 1px; background: #F0EBE4; margin: 4px 0; }
.profile-drop-logout { color: #B3261E; }
.profile-drop-logout:hover { background: #FDECEA; }
.profile-active-dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: #2B5E4B; flex-shrink: 0; }
.eco-app-btn { background: none; border: 1px solid #E8E0D6; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #8C6A3F; flex-shrink: 0; padding: 0; transition: background .15s, border-color .15s; }
.eco-app-btn:hover { background: #FBF7F0; border-color: #C49A6C; }

/* Sticky contextual filters (applied to per-page filter cards) */
.sticky-filters { position: sticky; top: 72px; z-index: 90; }

/* Admin: mobile bottom nav */
.admin-bottombar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120; background: #1A1A1A; border-top: 1px solid #333; }
.abb-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px 12px; color: #888; text-decoration: none; font-size: 10px; }
.abb-item.active { color: #C49A6C; }
.abb-item:hover { color: #FFF; }

.admin-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.admin-alert.success { background: #EAF5EF; color: #2B5E4B; border: 1px solid #CDE5D8; }
.admin-alert.error { background: #FDECEA; color: #B3261E; border: 1px solid #F5D0CC; }
.mailbox-form .mailbox-row { display: flex; gap: 10px; flex-wrap: wrap; }
.mailbox-form input { flex: 1; min-width: 160px; padding: 10px 12px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 14px; background: #FBF7F0; }
.mailbox-form button { padding: 10px 18px; font-size: 14px; border: none; border-radius: 6px; cursor: pointer; }
.mailbox-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mailbox-inline { display: flex; gap: 6px; align-items: center; margin: 0; }
.mailbox-inline .crm-input { min-width: 150px; }

/* Chat Widget */
.chat-widget { position: fixed; bottom: 24px; right: 24px; z-index: 150; }
.chat-button { width: 56px; height: 56px; background: #C49A6C; color: #FFF; border: none; border-radius: 50%; cursor: pointer; font-size: 24px; box-shadow: 0 4px 16px rgba(196,154,108,.3); transition: transform .3s; display: flex; align-items: center; justify-content: center; }
.chat-button:hover { transform: scale(1.1); }
.chat-window { position: absolute; bottom: 68px; right: 0; width: 360px; background: #FFF; border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,.12); display: none; flex-direction: column; max-height: 500px; overflow: hidden; border: 1px solid #E8E0D6; }
.chat-window.open { display: flex; }
.chat-header { background: #1A1A1A; color: #FFF; padding: 14px 20px; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.chat-header button { background: none; border: none; color: #FFF; font-size: 20px; cursor: pointer; opacity: .7; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #FBF7F0; }
.chat-msg { max-width: 80%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.chat-msg.bot { background: #FFF; border: 1px solid #E8E0D6; align-self: flex-start; }
.chat-msg.user { background: #C49A6C; color: #FFF; align-self: flex-end; }
.chat-msg.op { background: #F0F7F0; border: 1px solid #D5E5D5; color: #27413A; align-self: flex-start; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-contact-form { display: none; flex-direction: column; gap: 8px; padding: 14px 16px; background: #FBF7F0; border-bottom: 1px solid #E8E0D6; }
.chat-window.contact .chat-contact-form { display: flex; }
.chat-window.contact .chat-main { display: none; }
.chat-contact-form input { padding: 10px 12px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; outline: none; background: #FFF; }
.chat-contact-form input:focus { border-color: #C49A6C; }
.chat-contact-actions { display: flex; gap: 8px; }
.chat-contact-start { flex: 1; background: #C49A6C; color: #FFF; border: none; border-radius: 8px; padding: 10px; cursor: pointer; font-size: 13px; }
.chat-contact-skip { flex: 1; background: #FFF; border: 1px solid #E0D8CE; color: #666; border-radius: 8px; padding: 10px; cursor: pointer; font-size: 13px; }
.chat-contact-hint { font-size: 11px; color: #999; text-align: center; }
.chat-input { display: flex; padding: 12px; border-top: 1px solid #E8E0D6; gap: 8px; }
.chat-input input { flex: 1; padding: 10px 14px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; outline: none; }
.chat-input input:focus { border-color: #C49A6C; }
.chat-input button { background: #C49A6C; color: #FFF; border: none; border-radius: 8px; padding: 10px 16px; cursor: pointer; }
.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 16px 12px; border-top: 1px solid #F0EBE4; }
.chat-quick button { background: #FBF7F0; border: 1px solid #E8E0D6; border-radius: 16px; padding: 6px 12px; font-size: 12px; cursor: pointer; color: #555; }
.chat-quick button:hover { background: #C49A6C; color: #FFF; }

/* AI Suggestions */
.ai-suggestions { background: #F0FFE6; border: 1px solid #B8D9A0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.ai-suggestions h4 { font-size: 13px; color: #2B5E4B; margin-bottom: 8px; }
.ai-suggestion-item { background: #FFF; border: 1px solid #E0D8CE; border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; font-size: 13px; display: flex; gap: 8px; }
.ai-suggestion-item .text { flex: 1; }
.ai-suggestion-item .actions { display: flex; gap: 4px; flex-shrink: 0; }
.ai-suggestion-item .actions button { font-size: 11px; padding: 3px 8px; border-radius: 4px; border: none; cursor: pointer; }
.ai-suggestion-item .actions .accept { background: #2B5E4B; color: #FFF; }

/* Marketing — generator chat */
.mkt-layout { display: flex; background: #FFF; border-radius: 12px; border: 1px solid #F0EBE4; overflow: hidden; min-height: 500px; }
.mkt-list-panel { width: 280px; min-width: 280px; border-right: 1px solid #F0EBE4; display: flex; flex-direction: column; }
.mkt-list-scroll { flex: 1; overflow-y: auto; }
.mkt-list-item { display: flex; gap: 10px; padding: 12px 14px; text-decoration: none; color: inherit; border-bottom: 1px solid #F8F5F0; transition: background .15s; }
.mkt-list-item:hover { background: #FBF7F0; }
.mkt-list-item.selected { background: #F5F0E8; }
.mkt-list-avatar { width: 36px; height: 36px; border-radius: 50%; background: #C49A6C; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.mkt-list-avatar span { color: #FFF; font-weight: 600; font-size: 14px; }
.mkt-list-body { flex: 1; min-width: 0; }
.mkt-list-header { display: flex; justify-content: space-between; align-items: center; }
.mkt-list-name { font-weight: 600; font-size: 12px; }
.mkt-list-time { font-size: 10px; color: #999; }
.mkt-list-preview { font-size: 11px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mkt-detail-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mkt-detail-header { padding: 16px 20px; border-bottom: 1px solid #F0EBE4; display: flex; justify-content: space-between; align-items: center; }
.mkt-messages-area { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; background: #FAF8F5; }
.mkt-suggestions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.mkt-suggestion-chip { padding: 8px 16px; background: #FFF; border: 1px solid #E0D8CE; border-radius: 20px; font-size: 12px; cursor: pointer; transition: all .15s; }
.mkt-suggestion-chip:hover { border-color: #C49A6C; background: #FBF7F0; }
.mkt-msg-bubble { max-width: 85%; padding: 14px 18px; border-radius: 14px; font-size: 13px; line-height: 1.6; }
.mkt-msg-bubble.user { background: #C49A6C; color: #FFF; align-self: flex-end; border-bottom-right-radius: 4px; }
.mkt-msg-bubble.ai { background: #FFF; border: 1px solid #E8E0D6; align-self: flex-start; border-bottom-left-radius: 4px; }
.mkt-msg-meta { font-size: 10px; opacity: .6; margin-top: 6px; }
.mkt-script-box { background: #FBF7F0; border-radius: 10px; padding: 16px; margin: 8px 0; border: 1px solid #E8E0D6; }
.mkt-script-text { font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.mkt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.mkt-channel-grid { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.mkt-channel-btn { padding: 7px 16px; border: 1px solid #E0D8CE; border-radius: 20px; cursor: pointer; font-size: 11px; background: #FFF; transition: all .15s; }
.mkt-channel-btn:hover { border-color: #C49A6C; }
.mkt-channel-btn.active { background: #C49A6C; color: #FFF; border-color: #C49A6C; }
.mkt-input-area { padding: 12px 16px; border-top: 1px solid #F0EBE4; background: #FFF; }
.mkt-input-form { display: flex; gap: 8px; }
.mkt-input-form input { flex: 1; padding: 10px 14px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; outline: none; }
.mkt-input-form input:focus { border-color: #C49A6C; }
.mkt-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 8px 0; }
.mkt-img-item { border-radius: 8px; overflow: hidden; border: 1px solid #E8E0D6; aspect-ratio: 9/16; background: #FBF7F0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #999; }
.mkt-img-item img { width: 100%; height: 100%; object-fit: cover; }

/* Chats panel */
.chats-layout { display: flex; background: #FFF; border-radius: 12px; border: 1px solid #F0EBE4; overflow: hidden; min-height: 500px; }
body.admin-shell .chats-layout { height: calc(100vh - 128px); min-height: 560px; }
.chat-side-toggle { width: 22px; flex-shrink: 0; border-left: 1px solid #F0EBE4; border-right: 1px solid #F0EBE4; background: #FAF8F5; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #BBB; transition: background .15s, color .15s; }
.chat-side-toggle:hover { background: #FBF7F0; color: #C49A6C; }
.chat-side-panel { width: 300px; min-width: 300px; flex-shrink: 0; background: #FFF; display: flex; flex-direction: column; }
.chat-side-scroll { flex: 1; overflow-y: auto; padding: 16px; }
.chat-side-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #999; margin: 14px 0 8px; }
.chat-side-title:first-child { margin-top: 0; }
.client-order-card { border: 1px solid #F0EBE4; border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; background: #FDFBF8; }
.client-order-head { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: #1A1A1A; font-size: 13px; font-weight: 600; }
.client-order-head:hover { color: #C49A6C; }
.client-order-total { font-size: 12px; color: #2B5E4B; font-weight: 700; }
.client-order-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: #888; }
.client-order-items { margin-top: 8px; border-top: 1px dashed #E8E0D6; padding-top: 6px; }
.client-order-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: #555; padding: 3px 0; }
.client-order-item > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-order-qty { color: #999; flex-shrink: 0; }
.chats-layout.side-collapsed .chat-side-panel { display: none; }
.chats-layout.side-collapsed .chat-side-toggle { border-right: none; }
.chats-layout .chat-side-toggle .ico-open { display: none; }
.chats-layout.side-collapsed .chat-side-toggle .ico-close { display: none; }
.chats-layout.side-collapsed .chat-side-toggle .ico-open { display: block; }
.chats-list-panel { width: 300px; min-width: 300px; border-right: 1px solid #F0EBE4; display: flex; flex-direction: column; }
.chat-kind-switch { display: flex; flex-shrink: 0; margin: 12px 12px 8px; border: 1px solid #E0D8CE; border-radius: 8px; overflow: hidden; background: #FFF; }
.chat-kind-switch a { flex: 1; text-align: center; padding: 7px 10px; font-size: 12px; color: #888; text-decoration: none; border-right: 1px solid #E0D8CE; transition: all .15s; }
.chat-kind-switch a:last-child { border-right: none; }
.chat-kind-switch a:hover { color: #1A1A1A; }
.chat-kind-switch a.active { background: #1A1A1A; color: #FFF; }
.chat-canal-filter { display: flex; gap: 6px; padding: 0 12px 8px; flex-shrink: 0; flex-wrap: wrap; }
.chat-canal-filter a { padding: 4px 10px; border: 1px solid #E0D8CE; border-radius: 14px; font-size: 11px; color: #888; text-decoration: none; transition: all .15s; }
.chat-canal-filter a:hover { color: #1A1A1A; border-color: #C49A6C; }
.chat-canal-filter a.active { background: #C49A6C; border-color: #C49A6C; color: #FFF; }
.cm-edit { background: none; border: none; cursor: pointer; color: #C49A6C; font-size: 12px; padding: 0 2px; }
.cm-edit:hover { color: #a37f4f; }
.cm-edit.link { border: 1px dashed #D8CFC2; border-radius: 6px; padding: 4px 8px; color: #8a5a2b; background: #FFFDF8; font-size: 11px; }
.chats-list-scroll { flex: 1; overflow-y: auto; }
.chat-list-item { display: flex; gap: 10px; padding: 12px 16px; text-decoration: none; color: #1A1A1A; border-bottom: 1px solid #F8F5F0; transition: background .15s; }
.chat-list-item:hover { background: #FBF7F0; }
.chat-list-item.selected { background: #F5F0EA; }
.chat-list-avatar { width: 40px; height: 40px; border-radius: 50%; background: #C49A6C; color: #FFF; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.chat-list-body { flex: 1; min-width: 0; }
.chat-list-header { display: flex; justify-content: space-between; align-items: center; }
.chat-list-name { font-weight: 600; font-size: 13px; }
.chat-list-time { font-size: 11px; color: #999; }
.chat-list-preview { font-size: 12px; color: #888; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-msg-count { font-size: 10px; color: #BBB; }
.chat-list-unread { background: #C49A6C; color: #FFF; font-size: 10px; padding: 1px 6px; border-radius: 8px; font-weight: 600; }
.chat-detail-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-detail-header { padding: 16px 20px; border-bottom: 1px solid #F0EBE4; display: flex; justify-content: space-between; align-items: flex-start; }
.chat-messages-area { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #FBF7F0; }
.chat-messages-area .deal-msg { max-width: 72%; }
.chat-messages-area, .chat-input-area { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.chat-messages-area:hover, .chat-input-area:hover { scrollbar-color: rgba(196,154,108,.35) transparent; }
.chat-messages-area::-webkit-scrollbar, .chat-input-area::-webkit-scrollbar { width: 4px; }
.chat-messages-area::-webkit-scrollbar-track, .chat-input-area::-webkit-scrollbar-track { background: transparent; }
.chat-messages-area::-webkit-scrollbar-thumb, .chat-input-area::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.chat-messages-area:hover::-webkit-scrollbar-thumb, .chat-input-area:hover::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); }
.chat-msg-bubble { max-width: 75%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.5; }
.chat-msg-bubble.msg-user { background: #F0EBE4; color: #1A1A1A; align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg-bubble.msg-admin { background: #C49A6C; color: #FFF; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg-bubble.msg-bot { background: #F0F7F0; border: 1px solid #D0E0D0; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg-text { font-size: 13px; }
.chat-msg-meta { font-size: 10px; opacity: .6; margin-top: 4px; }
.chat-input-area { padding: 12px 16px; border-top: 1px solid #F0EBE4; background: #FFF; }
.chat-detail-panel .deal-composer { border-top: 1px solid #F0EBE4; }
.chat-detail-panel .btn-voice { height: 38px; width: 38px; }
.chat-input-form { display: flex; gap: 8px; }
.chat-input-form input { flex: 1; padding: 10px 14px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; outline: none; }
.chat-input-form input:focus { border-color: #C49A6C; }
.btn-send { background: #C49A6C; color: #FFF; border: none; border-radius: 8px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; }
.btn-send:hover { background: #B8895C; }
.btn-voice { background: #F0EBE4; color: #666; border: none; border-radius: 8px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .2s; flex-shrink: 0; }
.btn-voice:hover { background: #E0D8CE; color: #1A1A1A; }
.btn-voice.listening { background: #C49A6C; color: #FFF; animation: pulse-mic 1s ease-in-out infinite; }
@keyframes pulse-mic { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }

/* Responsive */
.hamburger-btn { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: #1A1A1A; }
@media (max-width: 768px) {
  .hamburger-btn { display: block; }
  .header-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-top: 1px solid #E8E0D6; box-shadow: 0 8px 24px rgba(0,0,0,.08); z-index: 100; padding: 16px; flex-direction: column; gap: 0; }
  .header-nav.open { display: flex; }
  .header-nav .dropdown { flex-direction: column; }
  .header-nav .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 16px; min-width: 0; display: none; }
  .header-nav .dropdown:hover .dropdown-menu,
  .header-nav .dropdown.open .dropdown-menu { display: block; }
  .header-nav a { padding: 10px 0; border-bottom: 1px solid #F0EBE4; }
  .hero { flex-direction: column; }
  .hero-photo { flex: none; min-height: 35vh; }
  .hero-content { padding: 40px 24px; }
  .hero-text p { font-size: 13px; }
  .catalog-layout { grid-template-columns: 1fr; }
  .product-detail { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
  .admin-layout { flex-direction: column; }
  .admin-sidebar { display: none; }
  .admin-layout > div:last-child { margin-left: 0; padding-left: 0; margin-top: 0; }
  body.admin-shell .header,
  body.admin-shell .header-admin { left: 0; }
  .sticky-filters { top: 60px; }
  .order-filter-drawer { position: static; }
  .gs-wrap { max-width: none; }
  .gs-drop { position: fixed; left: 12px; right: 12px; top: auto; min-width: 0; }
  .admin-bottombar { display: flex; }
  .admin-shell { padding-bottom: 64px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .chat-window { width: calc(100vw - 48px); }
  .chats-layout { flex-direction: column; }
  .chats-layout.side-collapsed .chat-side-panel { display: none; }
  .chat-side-toggle { width: 100%; height: 26px; border-left: none; border-right: none; border-top: 1px solid #F0EBE4; }
  .chat-side-toggle .ico-close, .chat-side-toggle .ico-open { display: none !important; }
  .chat-side-panel { width: 100%; min-width: 0; border-bottom: none; }
  .chats-list-panel { width: 100%; min-width: 0; border-right: none; border-bottom: 1px solid #F0EBE4; max-height: 200px; }
}
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1A1A1A; color: #FFF; padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 200; opacity: 0; transition: opacity .3s; pointer-events: none; }
.toast.show { opacity: 1; }
.recently-viewed { position: fixed; bottom: 24px; left: 24px; width: 220px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,.08); z-index: 90; max-height: 420px; overflow-y: auto; display: none; }
.recently-viewed .rv-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #999; padding: 12px 12px 8px; }
.recently-viewed .rv-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; text-decoration: none; color: #1A1A1A; border-top: 1px solid #F5F0EA; transition: background .2s; }
.recently-viewed .rv-item:hover { background: #FBF7F0; }
.recently-viewed .rv-item img { width: 36px; height: 36px; object-fit: contain; border-radius: 4px; background: #F5F0EA; flex-shrink: 0; }
.recently-viewed .rv-name { font-size: 11px; line-height: 1.3; flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.recently-viewed .rv-price { font-size: 11px; color: #C49A6C; font-weight: 600; white-space: nowrap; }
.kanban-col { touch-action: pan-y; }
.kanban-col .kanban-card { transition: box-shadow .2s; touch-action: none; user-select: none; -webkit-user-select: none; }
.kanban-col .kanban-card:active { cursor: grabbing; }
.kanban-col .kanban-body { transition: background .15s; }
.kanban-col .kanban-body.drag-over { background: #F3EFE9; }
#kanbanGhost { position: fixed; z-index: 10000; pointer-events: none; opacity: .9; }
.kanban-col .kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.kanban::-webkit-scrollbar { height: 3px; }
.kanban::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.kanban:hover::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); }
.kanban::-webkit-scrollbar-track { background: transparent; }

/* CRM: toolbars */
.crm-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crm-toolbar input[type=text], .crm-toolbar input[type=date], .crm-toolbar select { padding: 7px 10px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 12px; background: #FFF; }
.crm-toolbar .crm-search { flex: 1; min-width: 180px; }
.filter-block { margin-bottom: 12px; }
.filter-block:last-child { margin-bottom: 0; }
.filter-label { font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; display: block; }
.filter-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid #F0EBE4; margin-top: 12px; }
.view-switch { display: inline-flex; border: 1px solid #E0D8CE; border-radius: 8px; overflow: hidden; }
.view-switch button { background: #FFF; border: none; padding: 7px 14px; font-size: 12px; cursor: pointer; color: #666; }
.view-switch button.active { background: #1A1A1A; color: #FFF; }
.crm-btn { padding: 7px 14px; font-size: 12px; border-radius: 6px; border: none; cursor: pointer; }
.crm-btn-gold { background: #C49A6C; color: #FFF; }
.crm-btn-dark { background: #3A3A3A; color: #FFF; }
.crm-btn-ghost { background: #F0EBE4; color: #555; }
.crm-btn-green { background: #2B5E4B; color: #FFF; }

/* CRM: funnel chips */
.crm-funnel { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.crm-funnel-chip { background: #FFF; border: 1px solid #E8E0D6; border-radius: 10px; padding: 6px 12px; font-size: 12px; color: #666; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all .15s; }
.crm-funnel-chip:hover { border-color: #C49A6C; color: #1A1A1A; }
.crm-funnel-chip.active { background: #1A1A1A; color: #FFF; border-color: #1A1A1A; }
.crm-funnel-chip b { font-size: 13px; }
.crm-funnel-chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* CRM: funnel switcher in orders header */
.crm-funnel-switch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; padding: 8px 12px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 12px; }
.crm-funnel-switch-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #999; margin-right: 4px; }
.crm-funnel-switch .crm-funnel-chip { border-radius: 8px; }
.crm-funnel-switch .crm-funnel-chip .star { color: #C49A6C; margin-left: 2px; font-size: 12px; }
.crm-funnel-default-btn { background: none; border: 1px dashed #D0C8BE; color: #999; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; transition: all .15s; }
.crm-funnel-default-btn:hover { border-color: #C49A6C; color: #1A1A1A; }
.crm-funnel-default-btn.set { border-style: solid; border-color: #C49A6C; color: #1A1A1A; }

/* CRM: funnel groups inside the status filter multiselect */
.filter-funnel-group { border: 1px solid #F0EBE4; border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.filter-funnel-group.closed .filter-funnel-body { display: none; }
.filter-funnel-head { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #FBF7F0; cursor: pointer; font-size: 12px; font-weight: 600; color: #1A1A1A; user-select: none; }
.filter-funnel-head:hover { background: #F3EFE9; }
.filter-funnel-caret { color: #999; font-size: 10px; width: 12px; }
.filter-funnel-name { flex: 1; }
.filter-funnel-count { font-size: 11px; color: #999; font-weight: 500; background: #FFF; border: 1px solid #E8E0D6; border-radius: 10px; padding: 0 7px; }
.filter-funnel-body { padding: 4px 6px; }

/* CRM: filter chips (multi-select) */
.crm-chip-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.crm-chip { position: relative; display: inline-flex; align-items: center; gap: 5px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 10px; padding: 5px 11px; font-size: 12px; color: #666; cursor: pointer; user-select: none; transition: all .15s; }
.crm-chip:hover { border-color: #C49A6C; color: #1A1A1A; }
.crm-chip.checked { background: #1A1A1A; color: #FFF; border-color: #1A1A1A; }
.crm-chip input { display: none; }
.crm-chip .chip-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.crm-chip.checked .chip-dot { opacity: 1; }

/* CRM: status badges */
.status-badge { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 11px; font-weight: 500; }
.status-new { background: #FDECEA; color: #B3261E; }
.status-confirmed { background: #FFF4E0; color: #B26A00; }
.status-sent { background: #E8F0FE; color: #1E5FA8; }
.status-delivered { background: #EAF5EF; color: #2B5E4B; }
.status-cancelled { background: #F0EBE4; color: #777; }
.status-open { background: #FDECEA; color: #B3261E; }
.status-answered { background: #FFF4E0; color: #B26A00; }
.status-closed { background: #EAF5EF; color: #2B5E4B; }

/* CRM: bulk bar */
.crm-bulk { display: none; align-items: center; gap: 10px; background: #FBF7F0; border: 1px solid #E8E0D6; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-size: 12px; }
.crm-bulk.show { display: flex; }

/* CRM: sortable column headers with direction arrow */
.cols-head { position: relative; padding-right: 15px; color: #1A1A1A; text-decoration: none; cursor: pointer; font-weight: 600; white-space: nowrap; }
.cols-head:hover { color: #C49A6C; }
.cols-head::after { content: '↕'; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 10px; line-height: 1; color: #B9AC99; opacity: .4; }
.cols-head.cols-sort { color: #C49A6C; }
.cols-head.cols-sort::after { content: '▲'; font-size: 9px; color: #C49A6C; opacity: 1; }
.cols-head.cols-sort.desc::after { content: '▼'; }

/* CRM: order list rows */
.order-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #FFF; border: 1px solid #F0EBE4; border-radius: 8px; margin-bottom: 6px; cursor: pointer; transition: background .15s; font-size: 13px; }
.order-row:hover { background: #FBF7F0; }
.order-row .grow { flex: 1; min-width: 0; }
.resp-badge { font-size: 11px; color: #C49A6C; background: #F5F0E8; padding: 1px 8px; border-radius: 8px; white-space: nowrap; }

/* CRM: tabs */
.crm-tabs { display: flex; gap: 4px; border-bottom: 2px solid #F0EBE4; margin-bottom: 14px; }
.crm-tab { background: none; border: none; padding: 8px 16px; font-size: 13px; color: #888; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500; }
.crm-tab.active { color: #C49A6C; border-bottom-color: #C49A6C; }
.crm-tab-panel { display: none; }
.crm-tab-panel.active { display: block; }

/* CRM: timeline */
.crm-timeline { position: relative; padding-left: 20px; }
.crm-timeline:before { content: ''; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: #F0EBE4; }
.crm-timeline-item { position: relative; margin-bottom: 14px; }
.crm-timeline-item:before { content: ''; position: absolute; left: -18px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: #C49A6C; }
.crm-note { background: #FBF7F0; border: 1px solid #F0EBE4; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 12px; }
.crm-note .meta { font-size: 11px; color: #999; margin-bottom: 4px; }

/* CRM: order items cards (vertical) */
.crm-order-items { display: flex; flex-direction: column; gap: 10px; }
.crm-order-item { display: flex; align-items: center; gap: 12px; background: #FBF7F0; border: 1px solid #F0EBE4; border-radius: 10px; padding: 10px 12px; }
.crm-order-item a { flex-shrink: 0; }
.crm-order-item img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; cursor: zoom-in; border: 1px solid #E8E0D6; }
.crm-order-item .info { flex: 1; min-width: 0; }
.crm-order-item .name { font-size: 13px; font-weight: 600; color: #1A1A1A; line-height: 1.3; }
.crm-order-item .meta { font-size: 12px; color: #999; margin-top: 2px; }
.crm-order-item .sum { font-size: 13px; font-weight: 600; color: #C49A6C; white-space: nowrap; }

/* CRM: modal wider */
#orderModal .crm-modal-box { max-width: 720px; }
#orderModal .crm-modal-amo { max-width: 1180px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 90vh; }
#orderModal .crm-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-bottom: 1px solid #EFE8DF; }
#orderModal .crm-modal-head-left { display: flex; align-items: center; gap: 10px; }
#orderModal .order-detail-status { font-size: 12px; padding: 3px 10px; border-radius: 20px; background: #FBF7F0; color: #C49A6C; font-weight: 600; }
#orderModal .crm-modal-head-actions { display: flex; align-items: center; gap: 8px; }
#orderModal .crm-modal-grid { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); flex: 1; min-height: 0; align-items: stretch; }
#orderModal .crm-modal-col { padding: 0; overflow-y: auto; height: 100%; }
#orderModal .crm-modal-col, #orderModal .deal-chat-body { scrollbar-width: thin; scrollbar-color: transparent transparent; }
#orderModal .crm-modal-col:hover, #orderModal .deal-chat-body:hover { scrollbar-color: rgba(196,154,108,.35) transparent; }
#orderModal .crm-modal-col::-webkit-scrollbar, #orderModal .deal-chat-body::-webkit-scrollbar { width: 4px; }
#orderModal .crm-modal-col::-webkit-scrollbar-track, #orderModal .deal-chat-body::-webkit-scrollbar-track { background: transparent; }
#orderModal .crm-modal-col::-webkit-scrollbar-thumb, #orderModal .deal-chat-body::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
#orderModal .crm-modal-col:hover::-webkit-scrollbar-thumb, #orderModal .deal-chat-body:hover::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); }
#orderModal .crm-modal-left { border-right: 1px solid #EFE8DF; background: #FFF; padding: 0; }
#orderModal .crm-modal-right { flex: 1; display: flex; flex-direction: column; background: #FCFAF6; min-height: 0; overflow: hidden; }
#orderModal .crm-modal-right.deal-chat { position: static; height: auto; min-height: 0; }
#orderModal .crm-modal-right .deal-chat-body { padding: 14px; }
#orderModal .crm-modal-right .deal-composer { padding: 10px 14px; }
#orderModal .deal-fields-card { background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
#orderModal .deal-fields-card:last-child { margin-bottom: 0; }
#orderModal .deal-fields-card .crm-detail-block-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #999; margin-bottom: 6px; }
#orderModal .deal-field-row { padding: 4px 0; }
#orderModal .deal-field-label { flex-basis: 104px; }
#orderModal .crm-order-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid #F0EBE4; }
#orderModal .crm-order-item img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
#orderModal .crm-order-item .info { flex: 1; min-width: 0; }
#orderModal .crm-order-item .name { font-size: 12px; font-weight: 600; color: #1A1A1A; line-height: 1.3; }
#orderModal .crm-order-item .sum { font-size: 12px; font-weight: 700; color: #C49A6C; white-space: nowrap; }
#orderModal .crm-order-item.saved-ok { background: #F0F7F3; }
#orderModal .modal-item-inputs { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #888; flex-wrap: wrap; }
#orderModal .modal-item-inputs input { width: 42px; padding: 2px 4px; border: 1px solid #E0D8CE; border-radius: 5px; font-size: 11px; color: #1A1A1A; background: #FFF; }
#orderModal .crm-detail-total-line { text-align: right; margin-top: 8px; font-weight: 600; color: #1A1A1A; font-size: 13px; }
#orderModal .crm-detail-total-line span { color: #C49A6C; }
#orderModal .crm-status-select { padding: 7px 10px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 13px; width: 100%; background: #FFF; color: #1A1A1A; }
#orderModal .crm-side-block { background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 12px 14px; }
#orderModal .crm-modal-left .crm-detail-info { background: #FBF7F0; border: 1px solid #F0EBE4; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
#orderModal .crm-detail-row { display: flex; padding: 4px 0; font-size: 13px; }
#orderModal .crm-detail-label { flex: 0 0 110px; color: #999; }
#orderModal .crm-detail-value { color: #1A1A1A; font-weight: 500; }
#orderModal .crm-detail-total { color: #C49A6C; font-weight: 700; font-size: 15px; }
#orderModal .crm-detail-actions { background: #FBF7F0; border: 1px solid #F0EBE4; border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
#orderModal .crm-status-select, #orderModal .crm-status-comment { padding: 8px 12px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 13px; }
#orderModal .crm-detail-block { margin-bottom: 14px; }
#orderModal .crm-detail-block-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #999; margin-bottom: 10px; }
#orderModal .crm-detail-total-line { text-align: right; margin-top: 10px; font-weight: 600; color: #1A1A1A; }
#orderModal .crm-detail-total-line span { color: #C49A6C; }
#orderModal .crm-side-block { background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 12px 14px; }
#orderModal .crm-side-block-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1A1A1A; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
#orderModal .crm-collapse-toggle { cursor: pointer; user-select: none; }
#orderModal .crm-collapse-arrow { color: #C49A6C; font-size: 14px; }
#orderModal .crm-empty-hint { font-size: 12px; color: #B5A996; font-style: italic; padding: 4px 0; }
#orderModal .crm-loading, #orderModal .crm-error { padding: 12px; color: #666; }
#orderModal .crm-error { color: #B00020; }
#orderModal .crm-chat-mini-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#orderModal .crm-chat-mini { max-width: 85%; background: #F5F1EC; border-radius: 8px; padding: 6px 10px; }
#orderModal .crm-chat-mini.from-user { max-width: 85%; margin-left: auto; background: #C49A6C; }
#orderModal .crm-chat-mini-body { font-size: 13px; color: #1A1A1A; }
#orderModal .crm-chat-mini.from-user .crm-chat-mini-body { color: #FFF; }
#orderModal .crm-chat-mini-meta { font-size: 10px; color: #999; margin-top: 2px; }
#orderModal .crm-chat-mini.from-user .crm-chat-mini-meta { color: rgba(255,255,255,.8); }
#orderModal .crm-tasks { display: flex; flex-direction: column; gap: 6px; }
#orderModal .crm-task { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #F0EBE4; border-radius: 8px; font-size: 13px; background: #FFF; }
#orderModal .crm-task.done { opacity: .55; }
#orderModal .crm-task.done .crm-task-text { text-decoration: line-through; }
#orderModal .crm-task-text { flex: 1; color: #1A1A1A; }
#orderModal .crm-task-del { border: none; background: none; color: #BBB; font-size: 12px; cursor: pointer; padding: 0 4px; }
#orderModal .crm-task-del:hover { color: #B00020; }
#orderModal #taskInput { box-sizing: border-box; }
#orderModal .crm-btn-green { background: #2B5E4B; color: #FFF; }
#orderModal .crm-btn-gold { background: #C49A6C; color: #FFF; }
@media (max-width: 900px) {
  #orderModal .crm-modal-amo { max-width: 96vw; }
  #orderModal .crm-modal-grid { grid-template-columns: 1fr; }
  #orderModal .crm-modal-left { border-right: none; border-bottom: 1px solid #EFE8DF; }
  #orderModal .crm-modal-right { max-height: 40vh; }
  #orderModal .crm-modal-col { overflow-y: auto; }
}

/* CRM: standalone order page (reuses modal look without overlay) */
.tag-badge { display: inline-block; background: rgba(196,154,108,.2); color: #7a5b33; border: 1px solid #C49A6C; border-radius: 12px; padding: 1px 10px; font-size: 11px; margin-left: 4px; vertical-align: middle; }
.order-page .crm-side-block { background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.order-page .crm-side-block-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1A1A1A; margin-bottom: 10px; }
.order-page .crm-empty-hint { font-size: 12px; color: #B5A996; font-style: italic; padding: 4px 0; }
.order-page .crm-chat-mini-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.order-page .crm-chat-mini { max-width: 85%; background: #F5F1EC; border-radius: 8px; padding: 6px 10px; }
.order-page .crm-chat-mini.from-user { max-width: 85%; margin-left: auto; background: #C49A6C; }
.order-page .crm-chat-mini-body { font-size: 13px; color: #1A1A1A; }
.order-page .crm-chat-mini.from-user .crm-chat-mini-body { color: #FFF; }
.order-page .crm-chat-mini-meta { font-size: 10px; color: #999; margin-top: 2px; }
.order-page .crm-chat-mini.from-user .crm-chat-mini-meta { color: rgba(255,255,255,.8); }
.order-page .crm-task { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #F0EBE4; border-radius: 8px; font-size: 13px; background: #FFF; margin-bottom: 6px; }
.order-page .crm-task.done { opacity: .55; }
.order-page .crm-task.done .crm-task-text { text-decoration: line-through; }
.order-page .crm-task-text { flex: 1; color: #1A1A1A; }
.order-page .crm-detail-info { background: #FBF7F0; border: 1px solid #EFE8DF; border-radius: 10px; padding: 12px 14px; }
.order-page .crm-detail-row { display: flex; padding: 4px 0; font-size: 13px; }
.order-page .crm-detail-label { flex: 0 0 130px; color: #999; }
.order-page .crm-detail-value { color: #1A1A1A; }
.order-page .crm-detail-total { color: #C49A6C; font-weight: 700; }
.order-page .crm-status-select, .order-page .crm-status-comment { padding: 9px 12px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 13px; background: #FFF; color: #1A1A1A; }
.order-page .crm-detail-total-line { text-align: right; margin-top: 10px; font-weight: 600; color: #1A1A1A; }
.order-page .crm-detail-total-line span { color: #C49A6C; }
.order-page .crm-detail-block-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #999; margin-bottom: 10px; }

/* CRM: table column settings popup */
.crm-bulk-table select { padding: 6px 10px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 12px; }
.col-settings-row { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid #F0EBE4; border-radius: 8px; background: #FFF; }

/* CRM: client card in chat */
.crm-client-card { background: #FBF7F0; border: 1px solid #F0EBE4; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; font-size: 12px; }
.crm-client-card .row { display: flex; justify-content: space-between; padding: 3px 0; }
.crm-client-card .label { color: #999; }
.crm-metric-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid #F0EBE4; background: #FBF7F0; }
.crm-metric { font-size: 11px; color: #666; background: #FFF; border: 1px solid #E8E0D6; border-radius: 8px; padding: 4px 10px; }
.crm-metric b { color: #1A1A1A; }

/* CRM: templates */
.crm-templates { border-bottom: 1px solid #F0EBE4; padding: 10px 16px; background: #FAF8F5; }
.crm-template-chip { display: inline-block; background: #FFF; border: 1px solid #E0D8CE; border-radius: 14px; padding: 4px 12px; font-size: 11px; margin: 0 6px 6px 0; cursor: pointer; transition: all .15s; }
.crm-template-chip:hover { background: #C49A6C; color: #FFF; border-color: #C49A6C; }

/* CRM: attachments */
.chat-attach { margin-top: 6px; }
.chat-attach a { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #C49A6C; text-decoration: none; border: 1px dashed #C49A6C; border-radius: 8px; padding: 4px 10px; }
.chat-attach img { max-width: 200px; border-radius: 8px; display: block; margin-top: 6px; }

/* CRM: create-order mini form */
.crm-mini-form input[type=text], .crm-mini-form input[type=number], .crm-mini-form select { width: 100%; padding: 8px 10px; border: 1px solid #E0D8CE; border-radius: 6px; font-size: 13px; margin-bottom: 8px; box-sizing: border-box; }
.crm-item-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.crm-item-row select { flex: 1; margin-bottom: 0; }
.crm-item-row input { width: 70px; margin-bottom: 0; }

/* CRM: today panel */
.crm-today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.crm-today-card { background: #FFF; border: 1px solid #F0EBE4; border-radius: 12px; padding: 16px; }
.crm-today-card .num { font-size: 26px; font-weight: 700; color: #C49A6C; }
.crm-today-card .lbl { font-size: 12px; color: #999; margin-top: 4px; }

@media (max-width: 768px) {
  .crm-toolbar .crm-search { min-width: 100%; }
  .view-switch { order: -1; }
}

/* Photobank */
.pb-product { border: 1px solid #F0EBE4; background: #FFF; border-radius: 16px; padding: 20px; margin-bottom: 24px; }
.pb-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: #1A1A1A; }
.pb-meta { font-size: 13px; color: #999; margin-bottom: 16px; }
.pb-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.pb-photo { display: block; width: 180px; aspect-ratio: 3/4; border: 1px solid #F0EBE4; border-radius: 12px; overflow: hidden; background: #FAF6F0; }
.pb-photo img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .2s ease; }
.pb-photo:hover img { transform: scale(1.05); }
@media (max-width: 768px) {
  .pb-photo { width: 46%; height: auto; aspect-ratio: 3/4; }
}

/* Presentations */
.pres-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin: 24px 0 60px; }
.pres-card { border: 1px solid #F0EBE4; background: #FFF; border-radius: 16px; padding: 20px; display: flex; flex-direction: column; }
.pres-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.pres-brand { font-size: 13px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #C49A6C; }
.pres-country { font-size: 12px; color: #999; }
.pres-title { font-size: 17px; font-weight: 700; color: #1A1A1A; margin-bottom: 8px; }
.pres-desc { font-size: 13px; color: #666; line-height: 1.5; flex: 1; margin-bottom: 14px; }
.pres-meta { font-size: 12px; color: #999; margin-bottom: 14px; }
.pres-open { display: inline-block; text-align: center; padding: 10px 16px; border-radius: 10px; background: #C49A6C; color: #FFF; font-size: 14px; text-decoration: none; transition: opacity .2s ease; }
.pres-open:hover { opacity: .85; }

/* Product edit modal */
.edit-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.edit-modal-box { background: #FBF7F0; border-radius: 16px; width: min(1000px, 96vw); height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0,0,0,.3); }
.edit-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid #E0D8CE; background: #fff; }
.edit-modal-head strong { font-size: 16px; color: #1A1A1A; }
.edit-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; line-height: 1; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.edit-modal-close:hover { background: #FBF7F0; color: #1A1A1A; }
.edit-modal-frame { flex: 1; border: none; width: 100%; background: #fff; }

/* ===== CRM settings (Настройки → CRM): modern cards + drag & drop ===== */
.crm-card { background: #FFF; border: 1px solid #F0EBE4; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 4px rgba(26,26,26,.04); }
.crm-card-head { padding: 16px 20px; border-bottom: 1px solid #F0EBE4; }
.crm-card-head h2 { font-size: 15px; font-weight: 700; color: #1A1A1A; margin: 0; }
.crm-card-head p { font-size: 12px; color: #888; margin: 4px 0 0; }
.crm-card-body { padding: 16px 20px; }
.crm-input { padding: 8px 12px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; background: #FFF; color: #1A1A1A; min-height: 34px; }
.crm-input:focus { border-color: #C49A6C; outline: none; box-shadow: 0 0 0 2px rgba(196,154,108,.18); }
.crm-btn-danger { background: transparent; color: #B3261E; }
.crm-btn-danger:hover { background: #FDECEA; }
.crm-row { display: flex; align-items: center; gap: 10px; }

/* Sortable list (drag & drop). Plain rows (div) */
.crm-sort { display: flex; flex-direction: column; gap: 8px; }
.crm-sort-row { display: flex; align-items: center; gap: 12px; background: #FFF; border: 1px solid #E8E0D6; border-radius: 10px; padding: 10px 14px; transition: border-color .12s, box-shadow .12s, transform .12s; }
.crm-sort-row:hover { border-color: #C49A6C; }
.crm-sort-row.sort-drag { opacity: .45; border: 1px dashed #C49A6C; background: #FBF7F0; }
.crm-sort.sort-over .crm-sort-row:not(.sort-drag) { background: #FFF; }
.crm-grip { cursor: grab; color: #C7BFB2; font-size: 15px; user-select: none; padding: 2px 4px; display: inline-flex; }
.crm-grip:active { cursor: grabbing; }
.crm-grip svg { display: block; }
.crm-row-main { flex: 1; min-width: 0; }
.crm-field-meta { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.crm-row-main strong { font-size: 13px; color: #1A1A1A; }
.crm-status-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.crm-pill { display: inline-flex; align-items: center; gap: 5px; background: #FBF7F0; border: 1px solid #E8E0D6; border-radius: 999px; padding: 2px 9px; font-size: 11px; color: #555; }
.crm-row-actions { display: flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.crm-row-actions .crm-btn { padding: 6px 10px; font-size: 12px; }

/* Add-new row (dashed) */
.crm-add-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; border: 1px dashed #D0C8BE; border-radius: 10px; padding: 10px 14px; }
.crm-add-row .crm-plus { color: #C49A6C; font-size: 16px; }

/* Status groups within the statuses card */
.crm-status-group { border: 1px solid #F0EBE4; border-radius: 12px; padding: 12px 16px; margin-bottom: 12px; }
.crm-status-group-title { font-weight: 600; font-size: 13px; color: #1A1A1A; margin-bottom: 10px; }

/* Field type / required tags */
.crm-tag { display: inline-block; background: #F0EBE4; color: #666; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.crm-tag-required { background: rgba(196,154,108,.14); color: #A47A3D; }
.crm-tag-off { background: #F0EBE4; color: #AAA; }

/* Toggle switch (field enable/disable) */
.crm-switch { position: relative; display: inline-block; width: 34px; height: 20px; }
.crm-switch input { opacity: 0; width: 0; height: 0; }
.crm-switch .track { position: absolute; inset: 0; background: #DDD6CC; border-radius: 999px; transition: background .15s; }
.crm-switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #FFF; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.crm-switch input:checked + .track { background: #2B5E4B; }
.crm-switch input:checked + .track::after { transform: translateX(14px); }

/* Inline-edit name (click to rename — like deal name) */
.crm-editable { display: flex; align-items: center; gap: 8px; }
.crm-name { cursor: pointer; color: #1A1A1A; border-bottom: 1px dashed transparent; }
.crm-name:hover { border-bottom: 1px dashed #C49A6C; }

/* Trash delete button */
.crm-del-form { display: inline; }
.crm-del { background: transparent; border: none; cursor: pointer; color: #BBB; padding: 6px; border-radius: 8px; line-height: 1; transition: all .15s; }
.crm-del:hover { color: #B3261E; background: #FDECEA; }

/* ===== Страница сделки: слева поля, справа чат-активность ===== */
.deal-form { margin-top: 12px; }
.deal-form + .deal-form { border-top: 1px solid #F0EBE4; padding-top: 10px; }
.deal-form-label { font-size: 11px; color: #999; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.deal-form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.deal-form-row select { flex: 1; min-width: 160px; }
.deal-checkbox { font-size: 12px; color: #666; display: flex; align-items: center; gap: 5px; cursor: pointer; white-space: nowrap; }
/* Страница сделки: фиксированная высота, обе колонки начинаются ровно от верха,
   левая скроллится внутри, правая (чат) статична как в модалке */
body.admin-shell .deal-page { height: calc(100vh - 60px); padding-bottom: 0; overflow: hidden; }
body.admin-shell .deal-page .admin-layout,
body.admin-shell .deal-page .order-page { height: 100%; min-height: 0; }
.deal-page .deal-grid { height: 100%; }
.deal-page .deal-fields { overflow-y: auto; max-height: 100%; min-height: 0; padding-right: 0; padding-bottom: 16px; }
.deal-page .deal-fields::-webkit-scrollbar { width: 4px; }
.deal-page .deal-fields::-webkit-scrollbar-track { background: transparent; }
.deal-page .deal-fields::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.deal-page .deal-fields:hover::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); }
.deal-page .deal-chat { position: static; height: calc(100% - 16px); margin-bottom: 16px; }
.deal-grid { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 0; align-items: start; }
.deal-fields { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.deal-chat { display: flex; flex-direction: column; height: calc(100vh - 84px); min-height: 460px; padding: 0; overflow: hidden; }
.deal-chat-head { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #F0EBE4; background: #FBF7F0; }
.deal-chat-open { margin-left: auto; }
.deal-chat-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #1A1A1A; }
.deal-chat-body { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.deal-chat-body, .deal-page .deal-fields { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.deal-chat-body:hover, .deal-page .deal-fields:hover { scrollbar-color: rgba(196,154,108,.35) transparent; }
.deal-chat-body::-webkit-scrollbar, .deal-page .deal-fields::-webkit-scrollbar { width: 4px; }
.deal-chat-body::-webkit-scrollbar-track, .deal-page .deal-fields::-webkit-scrollbar-track { background: transparent; }
.deal-chat-body::-webkit-scrollbar-thumb, .deal-page .deal-fields::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.deal-chat-body:hover::-webkit-scrollbar-thumb, .deal-page .deal-fields:hover::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); }

/* Чаты-закладки партнёрской воронки: переключение как вкладки браузера */
.deal-thread-bar { padding: 8px 12px 0; background: #FFF; border-bottom: 1px solid #F0EBE4; }
.deal-thread-tabs { display: flex; align-items: flex-end; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
.deal-thread-tabs::-webkit-scrollbar { height: 3px; }
.deal-thread-tabs::-webkit-scrollbar-thumb { background: rgba(196,154,108,.35); border-radius: 3px; }
.deal-thread-tab { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; padding: 5px 8px 6px 10px; background: #F0EBE4; color: #555; border-radius: 10px 10px 0 0; cursor: pointer; font-size: 12px; font-weight: 500; user-select: none; white-space: nowrap; overflow: hidden; transition: all .15s; }
.deal-thread-tab:hover { background: #E7E0D4; color: #1A1A1A; }
.deal-thread-tab.active { background: #1A1A1A; color: #FFF; }
.deal-thread-name { overflow: hidden; text-overflow: ellipsis; }
.deal-thread-tab input.deal-thread-rename { width: 130px; padding: 3px 6px; border: 1px solid #C49A6C; border-radius: 6px; font-size: 12px; font-family: inherit; outline: none; background: #FFF; color: #1A1A1A; }
.deal-thread-del { background: none; border: none; cursor: pointer; color: inherit; opacity: .55; padding: 2px; border-radius: 6px; line-height: 1; flex-shrink: 0; display: inline-flex; }
.deal-thread-del:hover { opacity: 1; color: #B3261E; background: rgba(179,38,30,.12); }
.deal-thread-add { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-bottom: 1px; background: none; border: 1px dashed #C9BFAD; border-radius: 8px; color: #9b907f; cursor: pointer; transition: all .15s; flex-shrink: 0; }
.deal-thread-add:hover { border-color: #C49A6C; color: #C49A6C; background: #FBF7F0; }

/* Компактные поля слева: клик по значению — инлайн-ввод, без кнопок-карандашиков */
.deal-fields-card { padding: 12px 14px; margin-bottom: 0; }
.deal-fields-card .crm-detail-block-title { margin-bottom: 4px; }
.deal-field-list { display: flex; flex-direction: column; }
.deal-field-row { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; font-size: 13px; }
.deal-field-label { flex: 0 0 108px; color: #999; font-size: 12px; padding-top: 1px; }
.deal-field-value { flex: 1; min-width: 0; color: #1A1A1A; word-break: break-word; }
.deal-field-value.editable, .deal-field-value.edit-me { cursor: text; border-bottom: 1px dashed transparent; transition: border-color .15s; }
.deal-field-value.editable:hover, .deal-field-value.edit-me:hover { border-bottom-color: #C49A6C; background: #FDF9F2; }
.deal-field-total { color: #C49A6C; font-weight: 700; }
.deal-edit-input { width: 100%; box-sizing: border-box; padding: 4px 8px; border: 1px solid #C49A6C; border-radius: 6px; font-size: 13px; background: #FFF; color: #1A1A1A; outline: none; }
.deal-edit-input.multi { min-height: 56px; resize: vertical; }

/* Сообщения — один цвет (белый фон + контур), админ справа, клиент слева */
.deal-msg { max-width: 88%; background: #FFF; border: 1px solid #E8E0D6; border-radius: 12px; padding: 8px 12px; font-size: 13px; color: #1A1A1A; align-self: flex-start; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.deal-msg.me { align-self: flex-end; background: #C49A6C; border-color: #C49A6C; color: #FFF; }
.deal-msg.bot { align-self: flex-end; background: #F0F7F0; border-color: #D0E0D0; color: #1A1A1A; }
.deal-msg.bot .deal-msg-head { color: #6C9B6C; }
.deal-msg.note { border-style: dashed; background: #FDFAF3; }
.deal-msg.note .deal-msg-head { color: #B08952; }
.deal-msg.me .deal-msg-head { color: rgba(255,255,255,.85); }
.deal-msg-head { font-size: 10px; color: #999; margin-bottom: 3px; }
.deal-msg-body { line-height: 1.45; white-space: pre-wrap; word-break: break-word; }

/* Логи — идущие подряд действия сворачиваются в одну свёртку */
details.deal-log { border: 1px solid #EFE8DF; border-radius: 8px; background: #FAF8F5; font-size: 12px; }
details.deal-log summary { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; list-style: none; color: #666; }
details.deal-log summary::-webkit-details-marker { display: none; }
details.deal-log summary::before { content: '▸'; color: #C49A6C; font-size: 11px; transition: transform .15s; }
details.deal-log.open-log summary::before, details.deal-log[open] summary::before { transform: rotate(90deg); }
details.deal-log summary .deal-log-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-log-count { background: #EEE6DA; color: #A47A3D; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.deal-log-list { padding: 2px 12px 10px 30px; display: flex; flex-direction: column; gap: 6px; }
.deal-log-item { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: #8A7F6F; font-size: 11.5px; line-height: 1.45; }
.deal-log-item .deal-log-text { flex: 1; min-width: 0; word-break: break-word; }
.deal-log-change { color: #B08952; font-weight: 600; }
.deal-log-meta { flex: 0 0 auto; color: #B5A996; font-size: 10.5px; white-space: nowrap; }

/* Задачи — плашки в ленте диалога */
.deal-task-inline { display: flex; align-items: center; gap: 8px; background: #FFF; border: 1px solid #C49A6C; border-radius: 10px; padding: 6px 10px; font-size: 13px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.deal-task-inline.done { opacity: .6; }
.deal-task-inline.done .deal-task-text { text-decoration: line-through; }
.deal-task-check { width: 20px; height: 20px; border-radius: 6px; border: 1px solid #C49A6C; background: #FFF; color: #C49A6C; font-size: 12px; cursor: pointer; line-height: 1; flex: 0 0 auto; }
.deal-task-check:hover { background: #C49A6C; color: #FFF; }
.deal-task-text { flex: 1; color: #1A1A1A; }
.deal-task-del { border: none; background: none; color: #BBB; font-size: 13px; cursor: pointer; padding: 0 2px; }
.deal-task-del:hover { color: #B3261E; }

/* Товары в карточке сделки: редактируемые количество/цена + добавление */
.deal-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #F0EBE4; }
.deal-item img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.deal-item .info { flex: 1; min-width: 0; }
.deal-item .name { font-size: 12px; font-weight: 600; color: #1A1A1A; margin-bottom: 3px; line-height: 1.3; }
.deal-item .sum { font-size: 12px; font-weight: 600; color: #1A1A1A; white-space: nowrap; }
.deal-item-inputs { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #888; flex-wrap: wrap; }
/* П7-коррекция: ВСЕ поля в заказе/сделке — БЕЗ рамок (прозрачный фон, нижняя пунктирная линия при наведении) */
body.admin-shell .deal-page input, body.admin-shell .deal-page select, body.admin-shell .deal-page textarea,
body.admin-shell .deal-fields input, body.admin-shell .deal-fields select, body.admin-shell .deal-fields textarea {
  border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important;
}
body.admin-shell .deal-page input:hover, body.admin-shell .deal-page select:hover,
body.admin-shell .deal-fields input:hover, body.admin-shell .deal-fields select:hover { border-bottom: 1px dashed #C49A6C !important; }
body.admin-shell .deal-page input:focus, body.admin-shell .deal-page select:focus,
body.admin-shell .deal-fields input:focus, body.admin-shell .deal-fields select:focus { border-bottom: 1px solid #C49A6C !important; }
/* П7-коррекция: поля штуки/цена в модалках товара и канбан-модалке сделки — тоже БЕЗ рамок */
body.admin-shell #productModalDeal .pm-qty, body.admin-shell #productModal .pm-qty,
body.admin-shell #orderModal .modal-item-inputs input, body.admin-shell #orderModal .crm-order-item input {
  border: none !important; background: transparent !important; box-shadow: none !important; outline: none !important;
}
body.admin-shell #productModalDeal .pm-qty:hover, body.admin-shell #productModal .pm-qty:hover,
body.admin-shell #orderModal .modal-item-inputs input:hover, body.admin-shell #orderModal .crm-order-item input:hover { border-bottom: 1px dashed #C49A6C !important; }
body.admin-shell #productModalDeal .pm-qty:focus, body.admin-shell #productModal .pm-qty:focus,
body.admin-shell #orderModal .modal-item-inputs input:focus, body.admin-shell #orderModal .crm-order-item input:focus { border-bottom: 1px solid #C49A6C !important; }
.deal-item-count { display: inline-flex; align-items: center; gap: 3px; }
.deal-item-count input { width: 46px; padding: 2px 4px; border: 1px solid #E0D8CE; border-radius: 5px; font-size: 11px; color: #1A1A1A; background: #FFF; }
.deal-item-del { border: none; background: none; color: #BBB; font-size: 12px; cursor: pointer; padding: 2px 4px; flex: 0 0 auto; }
.deal-item-del:hover { color: #B3261E; }
.deal-add-item { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.deal-add-item select { width: 100%; padding: 7px 8px; border: 1px solid #E0D8CE; border-radius: 7px; font-size: 12px; background: #FFF; color: #1A1A1A; }
.deal-add-item-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: #888; }
.deal-add-item-row input { border: 1px solid #E0D8CE; border-radius: 5px; font-size: 12px; padding: 5px 6px; color: #1A1A1A; background: #FFF; }

/* Композер */
.deal-composer { border-top: 1px solid #F0EBE4; padding: 10px 12px; background: #FFF; display: flex; flex-direction: column; gap: 8px; }
.deal-composer-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.deal-canal { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.deal-canal-label { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: .04em; flex: 0 0 auto; }
.deal-source { padding: 5px 10px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 12px; background: #FFF; color: #1A1A1A; outline: none; }
.deal-source:focus { border-color: #C49A6C; }
.deal-mode { display: flex; gap: 6px; flex-wrap: wrap; }
.deal-mode-btn { border: 1px solid #E0D8CE; background: #FFF; color: #666; border-radius: 8px; padding: 5px 14px; font-size: 12px; cursor: pointer; transition: all .15s; }
.deal-mode-btn.active { background: #C49A6C; border-color: #C49A6C; color: #FFF; }

/* Панель действий (Действия) — вместо поля ввода */
.deal-action-pane { display: flex; gap: 8px; flex-wrap: wrap; }
.deal-action-big { flex: 1; padding: 10px 14px; border: 1px solid #E0D8CE; background: #FFF; color: #1A1A1A; border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; min-height: 42px; }
.deal-action-big:hover { border-color: #C49A6C; color: #C49A6C; }
.deal-action-big.danger { color: #B3261E; }
.deal-action-big.danger:hover { border-color: #B3261E; background: #FDECEA; color: #B3261E; }

.deal-composer-row { display: flex; gap: 8px; align-items: flex-end; }
.deal-composer-row textarea { flex: 1; min-height: 40px; max-height: 140px; resize: vertical; padding: 9px 12px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; font-family: inherit; line-height: 1.45; background: #FFF; color: #1A1A1A; outline: none; box-sizing: border-box; }
.deal-composer-row textarea:focus { border-color: #C49A6C; }
/* Rich-редактор канала «Почта» (страница сделки и модалка) */
.deal-rte-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.deal-rte-toolbar { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border: 1px solid #E0D8CE; border-bottom: 0; border-radius: 8px 8px 0 0; background: #FBF7F0; flex-wrap: wrap; }
.deal-rte-toolbar button { min-width: 26px; height: 26px; padding: 0 5px; border: 1px solid transparent; border-radius: 6px; background: transparent; cursor: pointer; font-size: 12px; color: #333; line-height: 1; }
.deal-rte-toolbar button:hover { background: #F0EBE4; }
.deal-rte-toolbar select { height: 26px; border: 1px solid #D8D0C6; border-radius: 6px; background: #FFF; font-size: 11px; color: #333; }
.deal-rte-toolbar input[type=color] { width: 24px; height: 24px; padding: 0; border: 1px solid #D8D0C6; border-radius: 6px; background: #FFF; cursor: pointer; }
.deal-rte-toolbar .deal-rte-sep { width: 1px; height: 16px; background: #E0D8CE; margin: 0 3px; }
.deal-rte-body { flex: 1; min-height: 70px; max-height: 180px; overflow-y: auto; border: 1px solid #E0D8CE; border-radius: 0 0 8px 8px; padding: 9px 12px; font-size: 13px; line-height: 1.45; color: #1A1A1A; background: #FFF; outline: none; box-sizing: border-box; }
.deal-rte-body:focus { border-color: #C49A6C; }
.deal-rte-body:empty::before { content: attr(data-placeholder); color: #B9B0A2; pointer-events: none; }
.deal-rte-body img, .deal-rte-body img.deal-rte-logo { max-width: 100%; height: auto; }
.deal-rte-body .deal-rte-logo { max-width: 240px; display: block; margin: 4px 0; }
/* Скрепка и кнопка Отправить — одинаковой высоты, выровнены с textarea */
.deal-attach { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid #E0D8CE; border-radius: 8px; background: #FFF; color: #666; cursor: pointer; transition: all .15s; box-sizing: border-box; }
.deal-attach:hover { border-color: #C49A6C; color: #C49A6C; }
.deal-send { flex: 0 0 auto; height: 38px; display: inline-flex; align-items: center; padding: 0 18px; border-radius: 8px; font-size: 13px; box-sizing: border-box; }

/* Источник сообщения (почта/мессенджер) — бейдж в шапке сообщения */
.deal-msg-source { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(196,154,108,.16); color: #A47A3D; font-size: 9px; font-weight: 600; text-transform: lowercase; letter-spacing: .03em; vertical-align: 1px; }
.deal-msg.me .deal-msg-source { background: rgba(255,255,255,.22); color: #FFF; }
.deal-msg.note .deal-msg-source { background: rgba(196,154,108,.16); color: #A47A3D; }

/* Вложение в сообщении */
.deal-msg-attach { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(0,0,0,.12); }
.deal-msg.me .deal-msg-attach { border-top-color: rgba(255,255,255,.35); }
.deal-msg-attach a { color: #2B5E4B; font-weight: 600; text-decoration: none; word-break: break-all; }
.deal-msg.me .deal-msg-attach a { color: #FFF; }
.deal-msg-attach img { margin-top: 6px; max-width: 180px; max-height: 120px; border-radius: 8px; display: block; object-fit: cover; cursor: zoom-in; }

/* Сообщение в канале «Почта» — рендерится как письмо (HTML) */
.deal-msg-body.html { background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 10px 12px; overflow: hidden; }
.deal-msg.me .deal-msg-body.html { background: #FFF; color: #1A1A1A; }

/* Канал «Почта»: подпись + кнопка «написать из почты» */
.deal-sig { max-width: 160px; }
.deal-mail-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #E0D8CE; background: #FFF; color: #1A1A1A; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .15s; }
.deal-mail-btn:hover { border-color: #C49A6C; color: #C49A6C; }
.deal-pres-btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid #E0D8CE; background: #FFF; color: #1A1A1A; border-radius: 8px; font-size: 12px; cursor: pointer; transition: all .15s; }
.deal-pres-btn:hover { border-color: #C49A6C; color: #C49A6C; }
.deal-pres-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #EFE9E0; border-radius: 10px; background: #FFF; }
.deal-pres-item:hover { border-color: #C49A6C; }
.deal-pres-title { flex: 1; font-size: 13px; color: #1A1A1A; font-weight: 500; }
.deal-pres-sub { font-size: 11px; color: #A08A6C; margin-top: 2px; }
.deal-logo-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: #7A5C33; cursor: pointer; white-space: nowrap; }
.deal-logo-chk input { accent-color: #C49A6C; width: 14px; height: 14px; cursor: pointer; }

/* Статус доставки/прочтения письма канала «Почта» + кнопка «Ответить» */
.deal-msg-status { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(196,154,108,.16); color: #A47A3D; font-size: 9px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.deal-msg.me .deal-msg-status { background: rgba(255,255,255,.22); color: #FFF; }
.deal-msg-status.s-delivered { background: rgba(43,94,75,.14); color: #2B5E4B; }
.deal-msg.me .deal-msg-status.s-delivered { background: rgba(255,255,255,.22); color: #C9E3D5; }
.deal-msg-status.s-read { background: rgba(43,94,75,.20); color: #1F4B3C; }
.deal-msg.me .deal-msg-status.s-read { background: rgba(255,255,255,.28); color: #CFE8DC; }
.deal-msg-reply { margin-left: 6px; padding: 1px 7px; border: 1px solid rgba(196,154,108,.5); background: transparent; color: #A47A3D; border-radius: 999px; font-size: 9px; font-weight: 600; cursor: pointer; vertical-align: 1px; white-space: nowrap; transition: all .15s; }
.deal-msg-reply:hover { background: rgba(196,154,108,.14); border-color: #C49A6C; color: #7A5C33; }
.deal-msg.me .deal-msg-reply { border-color: rgba(255,255,255,.4); color: rgba(255,255,255,.85); }
.deal-msg.me .deal-msg-reply:hover { background: rgba(255,255,255,.2); color: #FFF; }
.deal-msg-mail { margin-left: 6px; padding: 1px 7px; border: 1px solid rgba(196,154,108,.5); background: transparent; color: #A47A3D; border-radius: 999px; font-size: 9px; font-weight: 600; cursor: pointer; vertical-align: 1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; transition: all .15s; }
.deal-msg-mail svg { display: inline-block; }
.deal-msg-mail:hover { background: rgba(196,154,108,.14); border-color: #C49A6C; color: #7A5C33; }
.deal-msg.me .deal-msg-mail { border-color: rgba(255,255,255,.4); color: rgba(255,255,255,.85); }
.deal-msg.me .deal-msg-mail:hover { background: rgba(255,255,255,.2); color: #FFF; }

/* Режим почты в карточке сделки: предпросмотр письма (#dealMailModal) */
.mail-pv-row { display: flex; gap: 8px; align-items: baseline; }
.mail-pv-label { flex: 0 0 64px; color: #A47A3D; font-weight: 600; }
.mail-pv-value { word-break: break-all; }
.mail-pv-atts { align-items: center; }
.mail-pv-atts .mail-pv-value { display: inline-flex; gap: 10px; flex-wrap: wrap; }
.deal-mail-pv-body { border: 1px solid #E8E0D6 !important; }

/* Шаблоны сообщений по каналу */
.deal-templates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.deal-tmpl-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crm-template-chip { background: #F3ECE2; color: #7A5C33; border: 1px solid #E8DCCB; border-radius: 999px; padding: 2px 10px; font-size: 11px; cursor: pointer; transition: all .15s; }
.crm-template-chip:hover { background: #EADFCF; color: #5C4523; }
.deal-tmpl-add { padding: 2px 10px; font-size: 11px; border-radius: 999px; }
.deal-template-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.deal-template-form input { flex: 1; min-width: 140px; }

/* Модалка выбора товара (поиск + список + добавление) */
.pm-card .crm-empty-hint { padding: 24px; text-align: center; color: #A99C8C; font-size: 13px; }
.pm-item { display: flex; align-items: center; gap: 12px; background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.pm-item img { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: #F5F1EA; flex: 0 0 auto; }
.pm-info { flex: 1; min-width: 0; }
.pm-name { font-size: 13px; font-weight: 600; color: #1A1A1A; line-height: 1.3; }
.pm-price { font-size: 12px; color: #2B5E4B; font-weight: 600; margin-top: 2px; }
.pm-qty { width: 64px; padding: 6px 8px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; background: #FFF; color: #1A1A1A; }
.pm-add { flex: 0 0 auto; padding: 7px 14px; font-size: 12px; border-radius: 8px; }
.pm-item.pm-out { opacity: .5; }
.pm-stock { font-weight: 400; color: #A99C8C; font-size: 11px; margin-left: 6px; }
.pm-stock-zero { font-size: 11px; font-weight: 600; color: #D32F2F; margin-top: 2px; }

@media (max-width: 1100px) {
  body.admin-shell .deal-page { height: auto; overflow: visible; }
  .deal-page .deal-fields { overflow: visible; padding-right: 0; }
  .deal-grid { grid-template-columns: 1fr; }
  .deal-chat { height: 70vh; position: static; }
}
@media (max-width: 768px) {
  .deal-chat { height: 60vh; }
}

/* ============================================================
   Форма создания заказа: клиент полями + маска телефона + предложение существующего
   ============================================================ */
.oc-client-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.oc-client-error { padding: 10px 12px; border-radius: 8px; font-size: 12px; margin-bottom: 10px; background: #FDECEA; color: #B3261E; border: 1px solid #F5D0CC; }
.oc-client-suggest { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; padding: 10px 12px; border: 1px solid #CDE5D8; background: #EAF5EF; border-radius: 8px; font-size: 12px; color: #2B5E4B; }
.oc-suggest-text { flex: 1; min-width: 0; }
.oc-suggest-phone { color: #6B8A7D; }
.oc-suggest-actions { display: flex; gap: 6px; flex-shrink: 0; }
@media (max-width: 720px) {
  .oc-client-grid { grid-template-columns: 1fr; }
  .oc-client-suggest { flex-direction: column; align-items: stretch; }
  .oc-suggest-actions { justify-content: flex-end; }
}
.oc-card { margin: 0 0 12px; padding: 14px; border: 1px solid #EFE8DF; border-radius: 12px; background: #FFF; }
.oc-card-head { font-size: 13px; font-weight: 600; color: #7A5C33; margin-bottom: 10px; }
.oc-card .crm-item-row { margin: 6px 0; }
.oc-item-row { display: flex; align-items: center; gap: 10px; background: #FFF; border: 1px solid #EFE8DF; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.oc-item-row img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #F5F1EA; flex: 0 0 auto; }
.oc-item-row .pm-info { flex: 1; min-width: 0; }
.oc-item-price { width: 90px; padding: 6px 8px; border: 1px solid #E0D8CE; border-radius: 8px; font-size: 13px; background: #FFF; color: #1A1A1A; }

/* ��������� */
.crm-pagination { display: flex; align-items: center; gap: 6px; padding: 14px 0 4px; flex-wrap: wrap; }
.crm-pagination-info { font-size: 12px; color: #999; margin-right: 8px; }
.crm-pagination-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid #E0D8CE; border-radius: 8px; background: #FFF; color: #7A5C33; font-size: 13px; text-decoration: none; box-sizing: border-box; }
a.crm-pagination-btn:hover { border-color: #C49A6C; background: #FBF7F0; }
.crm-pagination-btn.active { background: #C49A6C; border-color: #C49A6C; color: #FFF; font-weight: 600; }
.crm-pagination-dots { color: #BBB; font-size: 13px; padding: 0 2px; }

/* Список заказов: кнопка удаления на карточке/строке */
.deal-del-btn { width: 20px; height: 20px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #B3261E; font-size: 12px; line-height: 1; cursor: pointer; opacity: .45; transition: all .15s; }
.deal-del-btn:hover { opacity: 1; background: #FDECEA; border-color: #F5D0CC; }

/* Фильтр по доп. полям */
.filter-field-row { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.filter-field-row .filter-label { font-size: 11px; color: #7A5C33; }
.filter-field-row .crm-input { width: 100%; box-sizing: border-box; }

/* Web Push: кнопка-колокольчик в шапке админки */
.push-bell { position: relative; }
.push-bell.push-on::after { content: ""; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #C49A6C; border: 2px solid #FFF; }

/* WhatsApp: тики статусов на исходящих сообщениях оператора */
.wa-ticks { color: #7596C9; font-size: 11px; margin-left: 4px; letter-spacing: -1px; }

/* «печатает» в чате */
.deal-typing { display: none; align-items: flex-start; gap: 8px; font-size: 12px; color: #7A5C33; padding: 4px 2px; }
.deal-typing span { background: #FFF6E9; border: 1px solid #EADDC3; border-radius: 14px 14px 14px 4px; padding: 5px 12px; }
.deal-typing span::after { content: "..."; animation: dealTypingBlink 1.2s infinite; }
@keyframes dealTypingBlink { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }
