/* ===== APP LAYOUT ===== */
.stb-app { display: flex; min-height: 100vh; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif; }

/* ===== SIDEBAR ===== */
.stb-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
}
.stb-sidebar__brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.stb-sidebar__logo { font-size: 28px; }
.stb-sidebar__title { font-size: 16px; font-weight: 700; letter-spacing: -0.3px; }

.stb-sidebar__nav { flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.stb-sidebar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: left;
}
.stb-sidebar__item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.9); }
.stb-sidebar__item.is-active { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; box-shadow: 0 4px 15px rgba(102,126,234,0.3); }
.stb-sidebar__icon { font-size: 18px; width: 24px; text-align: center; }
.stb-sidebar__label { flex: 1; }
.stb-sidebar__badge {
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
    min-width: 22px;
    text-align: center;
}

.stb-sidebar__footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.08); }
.stb-sidebar__user { display: flex; align-items: center; gap: 10px; }
.stb-sidebar__avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: #fff;
}
.stb-sidebar__name { font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.8); }

/* ===== MAIN ===== */
.stb-main {
    flex: 1;
    margin-left: 260px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: 100vh;
    padding: 0;
}

/* ===== VIEWS ===== */
.stb-view { display: none; padding: 32px; max-width: 900px; }
.stb-view.is-active { display: block; animation: viewIn 0.3s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.stb-view__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.stb-view__header h2 { font-size: 24px; font-weight: 700; color: #1a1a2e; margin: 0; }

.stb-back-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; border-radius: 12px;
    border: 2px solid #e8e8f0; background: #fff;
    color: #667eea; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all 0.2s ease;
}
.stb-back-btn:hover { border-color: #667eea; box-shadow: 0 2px 8px rgba(102,126,234,0.15); }
.stb-back-btn svg { width: 16px; height: 16px; }

.stb-fab {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(102,126,234,0.35);
    transition: all 0.2s ease; margin-left: auto;
    padding: 0; flex-shrink: 0; flex-grow: 0;
}
.stb-fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(102,126,234,0.45); }
.stb-fab svg { width: 24px; height: 24px; display: block; flex-shrink: 0; }

/* ===== BUBBLES (Telegram style) ===== */
.stb-bubbles { display: flex; flex-direction: column; gap: 12px; }
.stb-bubble {
    background: #fff;
    border-radius: 18px;
    padding: 16px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    max-width: 600px;
    transition: all 0.2s ease;
    border: 1px solid #f0f0f5;
}
.stb-bubble:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); transform: translateY(-1px); }
.stb-bubble__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.stb-bubble__id { font-size: 12px; font-weight: 700; color: #667eea; background: rgba(102,126,234,0.1); padding: 2px 8px; border-radius: 100px; }
.stb-bubble__status { font-size: 12px; font-weight: 600; }
.stb-bubble__client { font-size: 16px; font-weight: 700; color: #1a1a2e; margin-bottom: 8px; }
.stb-bubble__meta { display: flex; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.stb-bubble__meta span { font-size: 13px; color: #666; }
.stb-bubble__date { font-size: 13px; color: #888; margin-bottom: 4px; }
.stb-bubble__address { font-size: 13px; color: #888; }
.stb-bubble__notes { font-size: 12px; color: #999; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f0f0f5; font-style: italic; }

/* ===== FORM (compact in sidebar layout) ===== */
.form-card--compact { max-width: 560px; margin: 0; }

/* ===== REFERENCES ===== */
.stb-ref-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.stb-ref-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f5;
}
.stb-ref-card__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.stb-ref-card__header h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; margin: 0; }
.stb-ref-count { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 100px; }
.stb-ref-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; max-height: 320px; overflow-y: auto; }
.stb-ref-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: #f8f8fb; border-radius: 12px; transition: all 0.15s ease; }
.stb-ref-item:hover { background: #f0f0f5; }
.stb-ref-item__name { font-size: 14px; font-weight: 500; color: #333; }
.stb-ref-item__del { background: none; border: none; color: #e53935; cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: 8px; transition: all 0.15s; opacity: 0.6; }
.stb-ref-item__del:hover { opacity: 1; background: #ffebee; }
.stb-ref-add { display: flex; gap: 8px; }
.stb-ref-add input { flex: 1; padding: 10px 14px; border: 2px solid #e8e8f0; border-radius: 12px; font-size: 14px; outline: none; transition: all 0.2s; }
.stb-ref-add input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
.stb-ref-add button { width: 40px; height: 40px; border-radius: 12px; border: none; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; font-size: 20px; font-weight: 700; cursor: pointer; transition: all 0.2s; }
.stb-ref-add button:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(102,126,234,0.3); }

/* ===== STATISTICS ===== */
.stb-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stb-stat-card-big {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f5;
    transition: all 0.2s ease;
}
.stb-stat-card-big:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
.stb-stat-big__icon { font-size: 32px; margin-bottom: 8px; }
.stb-stat-big__value { font-size: 32px; font-weight: 800; color: #1a1a2e; line-height: 1; }
.stb-stat-big__label { font-size: 13px; color: #888; margin-top: 6px; font-weight: 500; }

.stb-charts-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.stb-chart-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f5;
}
.stb-chart-card h3 { font-size: 16px; font-weight: 700; color: #1a1a2e; margin: 0 0 20px 0; }
.stb-chart { display: flex; flex-direction: column; gap: 12px; }
.stb-bar-row { display: flex; align-items: center; gap: 12px; }
.stb-bar-label { font-size: 13px; color: #555; font-weight: 500; min-width: 140px; text-align: right; }
.stb-bar-track { flex: 1; height: 28px; background: #f0f0f5; border-radius: 14px; overflow: hidden; position: relative; }
.stb-bar-fill { height: 100%; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); border-radius: 14px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }
.stb-bar-value { font-size: 13px; font-weight: 700; color: #333; min-width: 30px; text-align: left; }

/* ===== COMMON ===== */
.stb-loading { text-align: center; padding: 40px; color: #aaa; font-size: 14px; }
.stb-empty { text-align: center; padding: 40px; color: #aaa; font-size: 14px; }

/* ===== ACCESS DENIED ===== */
.stb-access-denied { background: rgba(255,255,255,0.95); border-radius: 20px; padding: 40px; text-align: center; max-width: 500px; margin: 60px auto; box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.stb-access-denied p { color: #c62828; font-size: 16px; font-weight: 600; }

/* ===== FORM SECTIONS (original) ===== */
.page-header { text-align: center; padding: 24px 0 32px; }
.page-header h1 { font-size: 26px; font-weight: 800; color: #fff; margin-bottom: 8px; letter-spacing: -0.5px; }
.page-header p { color: rgba(255,255,255,0.6); font-size: 15px; }

.form-card {
    background: rgba(255,255,255,0.97);
    border-radius: 28px;
    padding: 28px 24px 32px;
    max-width: 520px;
    margin: 0 auto;
    box-shadow: 0 30px 60px -15px rgba(0,0,0,0.4);
}

.form-section { margin-bottom: 28px; }
.form-section:last-child { margin-bottom: 0; }

.section-title {
    font-size: 13px; font-weight: 700; color: #555;
    text-transform: uppercase; letter-spacing: 0.8px;
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.section-title .icon { width: 20px; height: 20px; color: #667eea; }

.form-input {
    width: 100%; height: 48px; padding: 0 16px;
    border: 2px solid #e8e8f0; border-radius: 16px;
    font-size: 15px; font-family: inherit; color: #333;
    background: #fff; outline: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    transform: translateY(-1px);
}
.form-input::placeholder { color: #aaa; }
textarea.form-input { height: auto; min-height: 80px; padding: 12px 16px; resize: vertical; }

.submit-btn {
    width: 100%; padding: 16px 24px; border: none; border-radius: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(102,126,234,0.35);
    margin-top: 8px;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.submit-btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(102,126,234,0.45); }
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.7; cursor: not-allowed; }
.submit-btn svg { width: 20px; height: 20px; }

.result-card {
    margin-top: 20px; padding: 20px;
    background: linear-gradient(135deg, rgba(102,126,234,0.08) 0%, rgba(118,75,162,0.08) 100%);
    border-radius: 20px; border: 1px solid rgba(102,126,234,0.15);
    display: none;
}
.result-card.is-visible { display: block; animation: resultIn 0.4s ease; }
@keyframes resultIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.result-card h3 { font-size: 14px; color: #667eea; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.result-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.05); font-size: 14px; }
.result-row:last-child { border-bottom: none; }
.result-label { color: #888; }
.result-value { color: #333; font-weight: 600; text-align: right; max-width: 60%; }

.scroll-hint { font-size: 11px; color: #bbb; text-align: center; margin-top: 6px; }

/* ===== SWIPEABLE CHIPS ===== */
.swipeable-chips { --chip-bg: #f0f0f5; --chip-color: #555; --chip-hover: #e8e8f0; --chip-selected-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --chip-selected-color: #fff; --accent: #667eea; --btn-size: 36px; --btn-bg: #fff; --btn-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.swipeable-chips__wrapper { display: flex; align-items: flex-start; gap: 8px; }
.swipeable-chips__box { flex: 1; min-width: 0; display: flex; gap: 10px; padding: 4px 2px; transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), mask-image 0.3s ease; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; max-height: 48px; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(to right, black calc(100% - 50px), transparent 100%); -webkit-mask-image: linear-gradient(to right, black calc(100% - 50px), transparent 100%); }
.swipeable-chips__box::-webkit-scrollbar { display: none; }
.swipeable-chips__box.is-expanded { flex-wrap: wrap; overflow-x: visible; overflow-y: visible; max-height: 600px; mask-image: none; -webkit-mask-image: none; }
.swipeable-chips__chip { flex-shrink: 0; padding: 10px 18px; border-radius: 100px; background: var(--chip-bg); color: var(--chip-color); font-size: 13px; font-weight: 500; cursor: pointer; user-select: none; transition: all 0.25s cubic-bezier(0.4,0,0.2,1); border: 2px solid transparent; position: relative; overflow: hidden; white-space: nowrap; }
.swipeable-chips__chip:hover { background: var(--chip-hover); transform: translateY(-1px); }
.swipeable-chips__chip:active { transform: scale(0.96); }
.swipeable-chips__chip.selected { background: var(--chip-selected-bg); color: var(--chip-selected-color); box-shadow: 0 4px 15px rgba(102,126,234,0.4); border-color: rgba(255,255,255,0.3); }
.swipeable-chips__check { display: inline-block; width: 0; opacity: 0; transition: all 0.3s ease; margin-right: 0; }
.swipeable-chips__chip.selected .swipeable-chips__check { width: 16px; opacity: 1; margin-right: 5px; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip { animation: chipFadeIn 0.4s ease both; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(1) { animation-delay: 0.03s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(2) { animation-delay: 0.06s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(3) { animation-delay: 0.09s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(4) { animation-delay: 0.12s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(5) { animation-delay: 0.15s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(6) { animation-delay: 0.18s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(7) { animation-delay: 0.21s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(8) { animation-delay: 0.24s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(9) { animation-delay: 0.27s; }
.swipeable-chips__box.is-expanded .swipeable-chips__chip:nth-child(10) { animation-delay: 0.30s; }
@keyframes chipFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.swipeable-chips__expand-btn { flex-shrink: 0; width: var(--btn-size); height: var(--btn-size); border-radius: 50%; background: var(--btn-bg); border: none; box-shadow: var(--btn-shadow); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; margin-top: 2px; }
.swipeable-chips__expand-btn:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.15); transform: scale(1.05); }
.swipeable-chips__expand-btn svg { width: 18px; height: 18px; transition: transform 0.4s cubic-bezier(0.68,-0.55,0.265,1.55); color: var(--accent); }
.swipeable-chips__expand-btn.is-open svg { transform: rotate(180deg); }

/* ===== SMART INPUT ===== */
.smart-input { --si-bg: #fff; --si-border: #e8e8f0; --si-border-focus: #667eea; --si-shadow-focus: 0 0 0 4px rgba(102,126,234,0.15); --si-radius: 16px; --si-height: 48px; --si-padding: 0 14px; --si-font: 15px; --si-color: #333; --si-placeholder: #aaa; --si-icon: #999; --si-icon-focus: #667eea; --si-dropdown-bg: #fff; --si-dropdown-shadow: 0 12px 40px -8px rgba(0,0,0,0.18); --si-dropdown-radius: 16px; --si-item-hover: #f5f5fb; --si-item-active: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --si-item-active-color: #fff; --si-empty-color: #aaa; --si-accent: #667eea; --si-transition: 0.25s cubic-bezier(0.4,0,0.2,1); --si-dropdown-transition: 0.3s cubic-bezier(0.4,0,0.2,1); position: relative; width: 100%; }
.smart-input__wrapper { display: flex; align-items: center; gap: 10px; background: var(--si-bg); border: 2px solid var(--si-border); border-radius: var(--si-radius); height: var(--si-height); padding: var(--si-padding); transition: border-color var(--si-transition), box-shadow var(--si-transition), transform var(--si-transition); }
.smart-input__wrapper:hover { border-color: #d0d0e0; }
.smart-input__wrapper.is-focused { border-color: var(--si-border-focus); box-shadow: var(--si-shadow-focus); transform: translateY(-1px); }
.smart-input__icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--si-icon); transition: color var(--si-transition); display: flex; align-items: center; justify-content: center; }
.smart-input__wrapper.is-focused .smart-input__icon { color: var(--si-icon-focus); }
.smart-input__icon svg { width: 100%; height: 100%; }
.smart-input__field { flex: 1; min-width: 0; border: none; background: transparent; font-size: var(--si-font); color: var(--si-color); outline: none; height: 100%; font-family: inherit; }
.smart-input__field::placeholder { color: var(--si-placeholder); opacity: 1; }
.smart-input__clear { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: none; background: #f0f0f5; color: #888; cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0; transition: all 0.2s ease; opacity: 0.7; }
.smart-input__clear:hover { background: #e0e0ec; opacity: 1; transform: scale(1.1); }
.smart-input__clear svg { width: 14px; height: 14px; }
.smart-input__dropdown { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--si-dropdown-bg); border-radius: var(--si-dropdown-radius); box-shadow: var(--si-dropdown-shadow); max-height: 0; opacity: 0; overflow: hidden; transition: max-height var(--si-dropdown-transition), opacity var(--si-dropdown-transition), transform var(--si-dropdown-transition); transform: translateY(-8px); z-index: 100; padding: 0; }
.smart-input__dropdown.is-open { max-height: 320px; opacity: 1; transform: translateY(0); padding: 8px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ddd transparent; }
.smart-input__dropdown.is-open::-webkit-scrollbar { width: 6px; }
.smart-input__dropdown.is-open::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }
.smart-input__item { padding: 12px 16px; border-radius: 12px; font-size: 14px; color: var(--si-color); cursor: pointer; transition: all 0.15s ease; display: flex; align-items: center; gap: 8px; animation: siFadeIn 0.25s ease both; opacity: 0; }
.smart-input__item:hover, .smart-input__item.is-highlighted { background: var(--si-item-hover); }
.smart-input__item.is-highlighted { background: var(--si-item-active); color: var(--si-item-active-color); box-shadow: 0 4px 12px rgba(102,126,234,0.25); }
.smart-input__item mark { background: transparent; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: rgba(102,126,234,0.5); text-underline-offset: 2px; }
.smart-input__item.is-highlighted mark { text-decoration-color: rgba(255,255,255,0.6); }
.smart-input__dropdown.is-open .smart-input__item:nth-child(1) { animation-delay: 0.02s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(2) { animation-delay: 0.04s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(3) { animation-delay: 0.06s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(4) { animation-delay: 0.08s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(5) { animation-delay: 0.10s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(6) { animation-delay: 0.12s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(7) { animation-delay: 0.14s; }
.smart-input__dropdown.is-open .smart-input__item:nth-child(8) { animation-delay: 0.16s; }
@keyframes siFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.smart-input__empty { padding: 20px; text-align: center; color: var(--si-empty-color); font-size: 13px; animation: siFadeIn 0.2s ease both; }

/* ===== SMART DATETIME PICKER ===== */
.smart-datetime-picker {
    --sdtp-bg: #ffffff; --sdtp-border: #e8e8f0; --sdtp-border-focus: #667eea; --sdtp-shadow-focus: 0 0 0 4px rgba(102, 126, 234, 0.15);
    --sdtp-radius: 16px; --sdtp-accent: #667eea; --sdtp-accent-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --sdtp-icon: #999; --sdtp-icon-focus: #667eea; --sdtp-dropdown-bg: #ffffff; --sdtp-dropdown-shadow: 0 20px 60px -12px rgba(0,0,0,0.25);
    --sdtp-dropdown-radius: 20px; --sdtp-cell-bg: #fafafc; --sdtp-cell-hover: #f0f0f5; --sdtp-cell-today-border: #667eea;
    --sdtp-cell-selected-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --sdtp-cell-selected-color: #fff;
    --sdtp-dot-partial: #ff9800; --sdtp-dot-full: #e53935; --sdtp-track-bg: #f0f0f5;
    --sdtp-range-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%); --sdtp-occupied-bg: #ffebee; --sdtp-occupied-border: #e53935;
    --sdtp-handle-bg: #fff; --sdtp-handle-shadow: 0 2px 10px rgba(0,0,0,0.2); --sdtp-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sdtp-panel-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1); position: relative; width: 100%; user-select: none;
}
.sdtp__wrapper { display: flex; align-items: center; gap: 10px; background: var(--sdtp-bg); border: 2px solid var(--sdtp-border); border-radius: var(--sdtp-radius); height: 48px; padding: 0 14px; cursor: pointer; transition: border-color var(--sdtp-transition), box-shadow var(--sdtp-transition), transform var(--sdtp-transition); }
.sdtp__wrapper:hover { border-color: #d0d0e0; }
.sdtp__wrapper.is-open, .sdtp__wrapper:focus-within { border-color: var(--sdtp-border-focus); box-shadow: var(--sdtp-shadow-focus); transform: translateY(-1px); }
.sdtp__field { flex: 1; min-width: 0; border: none; background: transparent; font-size: 15px; color: #333; outline: none; cursor: pointer; font-family: inherit; font-variant-numeric: tabular-nums; }
.sdtp__field::placeholder { color: #aaa; opacity: 1; }
.sdtp__icon { flex-shrink: 0; width: 20px; height: 20px; color: var(--sdtp-icon); transition: color var(--sdtp-transition); display: flex; align-items: center; justify-content: center; }
.sdtp__wrapper.is-open .sdtp__icon, .sdtp__wrapper:focus-within .sdtp__icon { color: var(--sdtp-icon-focus); }
.sdtp__icon svg { width: 100%; height: 100%; }
.sdtp__clear { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: none; background: #f0f0f5; color: #888; cursor: pointer; display: none; align-items: center; justify-content: center; padding: 0; transition: all 0.2s ease; opacity: 0.7; }
.sdtp__clear:hover { background: #e0e0ec; opacity: 1; transform: scale(1.1); }
.sdtp__clear svg { width: 14px; height: 14px; }
.sdtp__dropdown { position: absolute; top: calc(100% + 10px); left: 0; right: 0; background: var(--sdtp-dropdown-bg); border-radius: var(--sdtp-dropdown-radius); box-shadow: var(--sdtp-dropdown-shadow); max-height: 0; opacity: 0; overflow: hidden; transition: max-height var(--sdtp-panel-transition), opacity var(--sdtp-panel-transition), transform var(--sdtp-panel-transition); transform: translateY(-10px); z-index: 100; padding: 0; }
.sdtp__dropdown.is-open { max-height: 600px; opacity: 1; transform: translateY(0); padding: 20px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ddd transparent; }
.sdtp__dropdown.is-open::-webkit-scrollbar { width: 6px; }
.sdtp__dropdown.is-open::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }
.sdtp__section { margin-bottom: 16px; }
.sdtp__section:last-child { margin-bottom: 0; }
.sdtp__section--time.is-disabled { opacity: 0.4; pointer-events: none; }
.sdtp__cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sdtp__cal-title { font-size: 16px; font-weight: 700; color: #1a1a2e; }
.sdtp__nav { width: 32px; height: 32px; border-radius: 50%; border: none; background: #f0f0f5; color: #666; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--sdtp-transition); padding: 0; }
.sdtp__nav:hover { background: #e8e8f0; color: var(--sdtp-accent); transform: scale(1.1); }
.sdtp__nav svg { width: 16px; height: 16px; }
.sdtp__weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.sdtp__weekdays span { text-align: center; font-size: 11px; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.5px; }
.sdtp__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.sdtp__cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; background: var(--sdtp-cell-bg); cursor: pointer; position: relative; transition: all var(--sdtp-transition); border: 2px solid transparent; }
.sdtp__cell:hover { background: var(--sdtp-cell-hover); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.06); }
.sdtp__cell--empty { background: transparent; cursor: default; pointer-events: none; }
.sdtp__cell.is-today { border-color: var(--sdtp-cell-today-border); box-shadow: 0 0 0 3px rgba(102,126,234,0.12); }
.sdtp__cell.is-selected { background: var(--sdtp-cell-selected-bg); color: var(--sdtp-cell-selected-color); box-shadow: 0 6px 20px rgba(102,126,234,0.3); transform: translateY(-2px) scale(1.05); z-index: 2; }
.sdtp__cell.is-selected .sdtp__day-num { font-weight: 700; }
.sdtp__cell.is-selected .sdtp__dot { background: rgba(255,255,255,0.8); }
.sdtp__cell.is-partial .sdtp__dot { background: var(--sdtp-dot-partial); }
.sdtp__cell.is-full .sdtp__dot { background: var(--sdtp-dot-full); }
.sdtp__day-num { font-size: 13px; font-weight: 500; line-height: 1; margin-bottom: 3px; }
.sdtp__dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; transition: background var(--sdtp-transition); }
.sdtp__time-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sdtp__time-label { font-size: 13px; font-weight: 600; color: #555; letter-spacing: 0.3px; }
.sdtp__duration-badge { padding: 6px 14px; border-radius: 100px; background: var(--sdtp-accent-gradient); color: #fff; font-size: 12px; font-weight: 600; box-shadow: 0 4px 12px rgba(102,126,234,0.25); transition: all var(--sdtp-transition); }
.sdtp__duration-badge.is-zero { background: #f0f0f5; color: #888; box-shadow: none; }
.sdtp__timeline { margin-bottom: 14px; }
.sdtp__track { position: relative; height: 40px; background: var(--sdtp-track-bg); border-radius: 20px; cursor: pointer; overflow: hidden; }
.sdtp__occupied { position: absolute; inset: 0; pointer-events: none; }
.sdtp__occupied-block { position: absolute; top: 4px; bottom: 4px; background: var(--sdtp-occupied-bg); border: 1px dashed var(--sdtp-occupied-border); border-radius: 8px; opacity: 0.7; transition: opacity 0.2s; }
.sdtp__occupied-block:hover { opacity: 1; }
.sdtp__range { position: absolute; top: 0; bottom: 0; background: var(--sdtp-range-bg); border-radius: 20px; transition: left 0.1s linear, width 0.1s linear; pointer-events: none; z-index: 1; }
.sdtp__handle { position: absolute; top: 50%; width: 28px; height: 28px; background: var(--sdtp-handle-bg); border-radius: 50%; box-shadow: var(--sdtp-handle-shadow); transform: translate(-50%, -50%); cursor: grab; transition: transform 0.15s ease, box-shadow 0.15s ease; z-index: 3; display: flex; align-items: center; justify-content: center; }
.sdtp__handle::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sdtp-accent-gradient); }
.sdtp__handle:hover { transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 4px 16px rgba(0,0,0,0.25); }
.sdtp__handle:active { cursor: grabbing; transform: translate(-50%, -50%) scale(1.25); }
.sdtp__ticks { display: flex; justify-content: space-between; font-size: 10px; color: #aaa; margin-top: 6px; padding: 0 4px; }
.sdtp__presets { display: flex; gap: 8px; flex-wrap: wrap; }
.sdtp__preset { padding: 8px 16px; border-radius: 100px; background: #f0f0f5; color: #555; font-size: 12px; font-weight: 500; cursor: pointer; transition: all var(--sdtp-transition); border: 2px solid transparent; user-select: none; }
.sdtp__preset:hover { background: #e8e8f0; transform: translateY(-1px); }
.sdtp__preset:active { transform: scale(0.96); }
.sdtp__preset.is-active, .sdtp__preset.active { background: var(--sdtp-accent-gradient); color: #fff; box-shadow: 0 4px 12px rgba(102,126,234,0.25); border-color: rgba(255,255,255,0.3); }
.sdtp__apply-btn { width: 100%; margin-top: 16px; padding: 12px; border: none; border-radius: 14px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.25s ease; box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
.sdtp__apply-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4); }
.sdtp__apply-btn:active { transform: translateY(0); }

/* ===== DETAIL PANEL ===== */
.sdtp__detail { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease; padding: 0 2px; margin-top: 0; }
.sdtp__detail.is-open { max-height: 300px; opacity: 1; padding: 12px 2px 4px; margin-top: 10px; border-top: 1px solid #f0f0f5; }
.sdtp__detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sdtp__detail-date { font-size: 14px; font-weight: 600; color: #1a1a2e; }
.sdtp__detail-badge { padding: 3px 10px; border-radius: 100px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.sdtp__detail-badge--free { background: #e8f5e9; color: #2e7d32; }
.sdtp__detail-badge--partial { background: #fff3e0; color: #e65100; }
.sdtp__detail-badge--full { background: #ffebee; color: #c62828; }
.sdtp__detail-empty { text-align: center; padding: 14px; color: #aaa; font-size: 12px; background: #f8f8fb; border-radius: 12px; }
.sdtp__slots { display: flex; flex-direction: column; gap: 6px; }
.sdtp__slot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: #fff; border: 1px solid #f0f0f5; border-radius: 12px; transition: all 0.2s ease; }
.sdtp__slot-time { font-size: 13px; font-weight: 600; color: #333; font-variant-numeric: tabular-nums; }
.sdtp__slot-label { font-size: 12px; color: #888; background: #f5f5f5; padding: 3px 8px; border-radius: 100px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== RESPONSIVE: TAB BAR BOTTOM (like Telegram) ===== */
@media (max-width: 768px) {
    .stb-app { flex-direction: column; }

    /* Sidebar → Bottom Tab Bar */
    .stb-sidebar {
        position: fixed;
        left: 0; right: 0; bottom: 0; top: auto;
        width: 100%;
        height: 64px;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        padding: 0;
        z-index: 1000;
        background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
        box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
        border-top: 1px solid rgba(255,255,255,0.06);
    }
    .stb-sidebar__brand { display: none; }
    .stb-sidebar__footer { display: none; }

    .stb-sidebar__nav {
        flex-direction: row;
        padding: 0;
        width: 100%;
        justify-content: space-around;
        align-items: center;
        gap: 0;
    }
    .stb-sidebar__item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 12px;
        gap: 2px;
        min-width: 64px;
        position: relative;
    }
    .stb-sidebar__icon { font-size: 22px; width: auto; }
    .stb-sidebar__label { 
        display: block !important; 
        font-size: 10px; 
        font-weight: 500;
        color: rgba(255,255,255,0.5);
    }
    .stb-sidebar__item.is-active .stb-sidebar__label { color: #fff; }
    .stb-sidebar__badge {
        position: absolute;
        top: 2px;
        right: 4px;
        font-size: 9px;
        padding: 1px 5px;
        min-width: 16px;
    }

    /* Main content with bottom padding for tab bar */
    .stb-main {
        margin-left: 0;
        padding-bottom: 64px;
    }
    .stb-view { padding: 16px; }
    .stb-ref-grid, .stb-charts-row, .stb-stats-grid { grid-template-columns: 1fr; }
    .stb-bubble { max-width: 100%; }

    /* FAB button moved up to avoid tab bar */
    .stb-fab {
        position: fixed;
        bottom: 80px;
        right: 16px;
        z-index: 999;
        margin-left: 0;
        width: 56px; height: 56px;
    }
    .stb-fab svg { width: 26px; height: 26px; }
}



/* ===== PUBLIC SCHEDULE ===== */
.stb-schedule {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.stb-schedule__header {
    margin-bottom: 24px;
}
.stb-schedule__header h1 {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 16px;
}

.stb-schedule__filter {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.stb-schedule__filter select {
    padding: 10px 16px;
    border: 2px solid #e8e8f0;
    border-radius: 12px;
    font-size: 14px;
    background: #fff;
    outline: none;
    cursor: pointer;
    min-width: 200px;
}
.stb-schedule__nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.stb-schedule__nav button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f0f5;
    color: #667eea;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.stb-schedule__nav button:hover {
    background: #667eea;
    color: #fff;
    transform: scale(1.1);
}
.stb-schedule__nav span {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    min-width: 120px;
    text-align: center;
}

.stb-schedule__legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.stb-schedule__legend span {
    font-size: 13px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}
.stb-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}
.stb-dot--new { background: #667eea; }
.stb-dot--confirmed { background: #43a047; }
.stb-dot--completed { background: #1e88e5; }

/* ===== DAY CARDS ===== */
.stb-schedule__grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stb-day-card {
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f5;
    transition: all 0.2s ease;
}
.stb-day-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.stb-day-card.is-today {
    border: 2px solid #667eea;
    box-shadow: 0 4px 20px rgba(102,126,234,0.15);
}
.stb-day-card.is-weekend {
    background: linear-gradient(135deg, #fafafc 0%, #f5f5fb 100%);
}

.stb-day-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f5;
}
.stb-day-card__date {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.stb-day-card__num {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1;
}
.stb-day-card__month {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    text-transform: lowercase;
}
.stb-day-card__weekday {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}
.stb-day-card__badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 100px;
}

/* ===== SLOT BUBBLES ===== */
.stb-day-card__slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.stb-slot-bubble {
    background: #fafafc;
    border-radius: 14px;
    padding: 14px 16px;
    border-left: 4px solid #667eea;
    transition: all 0.15s ease;
}
.stb-slot-bubble:hover {
    background: #f5f5fb;
    transform: translateX(4px);
}
.stb-slot-bubble__time {
    font-size: 13px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 6px;
}
.stb-slot-bubble__client {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.stb-slot-bubble__meta {
    display: flex;
    gap: 16px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}
.stb-slot-bubble__meta span {
    font-size: 13px;
    color: #666;
}
.stb-slot-bubble__address {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .stb-schedule { padding: 16px 12px 24px; }
    .stb-schedule__header h1 { font-size: 20px; }
    .stb-schedule__filter { flex-direction: column; align-items: stretch; }
    .stb-schedule__nav { margin-left: 0; justify-content: center; }
    .stb-day-card { padding: 16px; border-radius: 16px; }
    .stb-day-card__num { font-size: 24px; }
    .stb-slot-bubble { padding: 12px 14px; }
}
