/* ===== DESIGN TOKENS ===== */
:root {
    --color-bg:        #f5f6fa;
    --color-surface:   #ffffff;
    --color-sidebar:   #1e2235;
    --color-sidebar-hover: rgba(255,255,255,.08);
    --color-sidebar-active: rgba(255,255,255,.14);
    --color-text:      #2b2d42;
    --color-text-muted:#6c757d;
    --color-border:    #e2e5ec;
    --color-primary:   #4361ee;
    --color-primary-hover: #3451d1;
    --color-success:   #2dc653;
    --color-warning:   #f4a261;
    --color-danger:    #e63946;
    --color-info:      #4cc9f0;
    --radius:          6px;
    --radius-lg:       10px;
    --shadow:          0 1px 4px rgba(0,0,0,.10);
    --shadow-md:       0 4px 16px rgba(0,0,0,.12);
    --sidebar-width:   220px;
    --font:            system-ui, -apple-system, 'Segoe UI', sans-serif;
    --transition:      .18s ease;
}

[data-theme="dark"] {
    --color-bg:        #12141c;
    --color-surface:   #1a1d2b;
    --color-sidebar:   #0d0f1a;
    --color-text:      #e0e0e8;
    --color-text-muted:#8b92a8;
    --color-border:    #2a2d3e;
    --color-primary:   #5a75f0;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--color-bg); color: var(--color-text); line-height: 1.5; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }

/* ===== LAYOUT ===== */
.layout { display: flex; height: 100vh; overflow: hidden; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.sidebar__menu { list-style: none; padding: 12px 0; }
.sidebar__menu--bottom { margin-top: auto; }
.sidebar__menu li { margin: 2px 8px; }

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: rgba(255,255,255,.7);
    border-radius: var(--radius);
    transition: background var(--transition), color var(--transition);
    font-size: .9rem;
}
.sidebar__link:hover { background: var(--color-sidebar-hover); color: #fff; text-decoration: none; }
.sidebar__link--active { background: var(--color-sidebar-active); color: #fff; }
.sidebar__link svg { flex-shrink: 0; opacity: .8; }

.sidebar__section-label {
    padding: 14px 20px 4px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.35);
}
.sidebar__link--sub { padding-left: 20px; font-size: .85rem; }
.sidebar__badge {
    margin-left: auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-danger); color: #fff; border-radius: 10px;
    font-size: .7rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px;
}

.sidebar__footer {
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 8px 8px 12px;
    flex-shrink: 0;
}
.sidebar__theme-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: var(--radius);
    color: rgba(255,255,255,.6);
    font-size: .9rem;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    text-align: left;
}
.sidebar__theme-btn:hover { background: var(--color-sidebar-hover); color: #fff; }
.sidebar__user-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    margin-top: 2px;
}
.sidebar__user-name {
    flex: 1;
    font-size: .85rem;
    color: rgba(255,255,255,.45);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar__logout-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.35);
    padding: 5px;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
    flex-shrink: 0;
}
.sidebar__logout-btn:hover { color: #fff; background: var(--color-sidebar-hover); }

.layout__main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.mobile-burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    padding: 7px;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 100;
    box-shadow: var(--shadow);
}
.mobile-burger span { display: block; width: 18px; height: 2px; background: var(--color-text); border-radius: 2px; }

/* Full-page back bar — mirrors .doc-panel__topbar, breaks out of .content padding to sit flush like the panel */
.page-back-bar { margin: -24px -24px 20px; }
@media (max-width: 768px) { .page-back-bar { margin: -8px -8px 12px; } }

.content { flex: 1; padding: 24px; overflow-y: auto; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), opacity var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; text-decoration: none; }
.btn--secondary { background: var(--color-border); color: var(--color-text); }
.btn--secondary:hover { opacity: .85; text-decoration: none; }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { opacity: .85; text-decoration: none; }
.btn--success { background: var(--color-success); color: #fff; }
.btn--ghost { background: transparent; color: var(--color-text-muted); border: 1px solid var(--color-border); }
.btn--ghost:hover { background: var(--color-bg); text-decoration: none; }
.btn--sm { padding: 5px 10px; font-size: .8rem; }
.btn--icon { padding: 5px 7px; }
.btn--full { width: 100%; justify-content: center; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group--error .form-control,
.form-group--error select.form-control { border-color: var(--color-danger); }
.form-label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 5px; color: var(--color-text); }
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: .875rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: var(--font);
}
.form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(67,97,238,.15); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .8rem; color: var(--color-text-muted); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--color-border); }
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    font-size: .875rem;
}
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--color-border); }
.table th { font-weight: 600; color: var(--color-text-muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; background: var(--color-bg); }
.table tbody tr:hover { background: var(--color-bg); }
.table tbody tr:last-child td { border-bottom: none; }
.table--compact th, .table--compact td { padding: 7px 12px; }

/* ===== CARD ===== */
.card { background: var(--color-surface); border-radius: var(--radius-lg); border: 1px solid var(--color-border); box-shadow: var(--shadow); }
.card__header { padding: 16px 20px; border-bottom: 1px solid var(--color-border); display: flex; align-items: center; gap: 12px; }
.card__title { font-size: 1rem; font-weight: 600; flex: 1; }
.card__body { padding: 20px; }
.card__footer { padding: 14px 20px; border-top: 1px solid var(--color-border); display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== IMAGE PLACEHOLDER / ITEM IMAGE ===== */
.img-placeholder {
    width: 35px;
    height: 35px;
    background-color: var(--color-bg, #f1f3f5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23adb5bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpolyline points='21 15 16 10 5 21'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 3px;
    flex-shrink: 0;
}

/* Картинка ещё не загружена (image_path = null) — нейтральное «грузится»,
   без иконки «нет фото»: она появится только если МойСклад вернёт пустоту. */
.img-placeholder[data-img-pending] {
    background-image: none;
    background-color: var(--color-border, #e0e0e0);
    border-color: transparent;
    animation: img-placeholder-pulse 1.2s ease-in-out infinite;
}

@keyframes img-placeholder-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .45; }
}

.item-img {
    width: 35px;
    height: 35px;
    object-fit: cover;
    display: block;
    border-radius: 3px;
}

/* ===== BADGE ===== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ===== ALERT ===== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: .875rem;
    border: 1px solid transparent;
}
.alert--success { background: #d1fae5; color: #065f46; border-color: #6ee7b7; }
.alert--danger  { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.alert--warning { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.alert--info    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

[data-theme="dark"] .alert--success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }
[data-theme="dark"] .alert--danger  { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
    padding-bottom: 12px;
    padding-top: 24px;
}
.page-header h2 { font-size: 1.25rem; font-weight: 700; }
.page-header[hidden] { display: none; }
.filters[hidden]     { display: none; }
.content:has(.page-header) { padding-top: 0; }
.no-desktop { display: none; }

/* ===== FILTERS BAR ===== */
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; position: sticky; top: 49px; z-index: 49; background: var(--color-bg); padding-bottom: 8px; box-shadow: 0 4px 8px rgba(0,0,0,.07); }
.filters .form-control { width: auto; min-width: 160px; }

/* Filter toggle button (mobile only) */
.filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: .8rem;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}
.filter-toggle-btn--active { border-color: var(--color-primary); color: var(--color-primary); }
.filter-toggle-btn__dot {
    position: absolute;
    top: -3px; right: -3px;
    width: 8px; height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    border: 1px solid var(--color-bg);
}
@media (max-width: 768px) {
    .filter-toggle-btn { display: inline-flex; }
    .filters--hidden { display: none; }
}

/* ===== STAT CARDS (dashboard) ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 20px; }
.stat-card__label { font-size: .8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.stat-card__value { font-size: 2rem; font-weight: 700; color: var(--color-primary); }
.stat-card__sub { font-size: .78rem; color: var(--color-text-muted); margin-top: 4px; }

.dashboard-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card__hint { font-size: .8rem; color: var(--color-text-muted); }
.notes-list--compact { list-style: none; padding: 0; margin: 0; }
.note-preview { padding: 10px 16px; border-bottom: 1px solid var(--color-border); }
.note-preview:last-child { border-bottom: none; }
.note-preview__order { font-size: .85rem; font-weight: 600; color: var(--color-primary); text-decoration: none; display: block; }
.note-preview__order:hover { text-decoration: underline; }
.note-preview__text { font-size: .85rem; color: var(--color-text); margin: 4px 0 2px; line-height: 1.4; }
.note-preview__meta { font-size: .75rem; color: var(--color-text-muted); }
.note-preview--new { border-left: 3px solid var(--color-danger); padding-left: 13px; }
.note-preview__new-tag {
    display: inline-block; margin-left: 6px; vertical-align: middle;
    background: var(--color-danger); color: #fff; font-size: .65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px; border-radius: 999px;
}

/* ===== TIMELINE (status log) ===== */
.timeline { list-style: none; padding: 0; }
.timeline__item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.timeline__item:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: var(--color-border); }
.timeline__dot { width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.timeline__dot svg { color: #fff; }
.timeline__body { flex: 1; }
.timeline__meta { font-size: .8rem; color: var(--color-text-muted); margin-top: 2px; }
.timeline__comment { font-size: .875rem; margin-top: 4px; color: var(--color-text-muted); }

/* ===== ITEMS TABLE (purchases form) ===== */
.items-table-wrap { overflow-x: auto; margin-bottom: 12px; }
.items-table td input { width: 100%; border: 1px solid var(--color-border); border-radius: 4px; padding: 5px 8px; background: var(--color-surface); color: var(--color-text); font-size: .875rem; }
.items-table td input:focus { outline: none; border-color: var(--color-primary); }
.row-total { text-align: right; font-weight: 600; min-width: 90px; }

.total-block { text-align: right; font-size: 1.1rem; margin-top: 8px; }
.total-block strong { color: var(--color-primary); }

/* ===== AUTH PAGE ===== */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-wrap { width: 100%; max-width: 400px; padding: 20px; }
.auth-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 36px; box-shadow: var(--shadow-md); }
.auth-logo { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; margin-bottom: 24px; color: var(--color-primary); }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }

/* ===== DETAIL SECTIONS ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.detail-field__label { font-size: .8rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.detail-field__value { font-weight: 500; }

/* ===== ORDER HEADER BAR ===== */
.order-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.order-header__main {
    flex: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 0;
}
.order-header__number { font-size: 1rem; font-weight: 700; color: var(--color-text); }
.order-header__sep { color: var(--color-text-muted); font-size: .8rem; }
.order-header__date { font-size: .875rem; color: var(--color-text-muted); }
.order-header__status { text-decoration: none; line-height: 1; background: none; border: none; padding: 0; cursor: pointer; }
.order-header__status:hover { opacity: .8; }
.order-header__status--static { cursor: default; }
.order-header__status--static:hover { opacity: 1; }
#current-status-btn.is-selecting .badge { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: 4px; }
.status-popover { position: fixed; z-index: 200; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; gap: 2px; min-width: 148px; max-height: 320px; overflow-y: auto; }
.status-popover__item { background: none; border: none; padding: 5px 8px; cursor: pointer; border-radius: calc(var(--radius) - 2px); text-align: left; display: flex; align-items: center; gap: 8px; transition: background .1s; white-space: nowrap; }
.status-popover__item:hover { background: var(--color-bg-alt); }
.status-popover__item.is-current { background: var(--color-bg-alt); }
.status-popover__item.is-current::after { content: '✓'; margin-left: auto; padding-left: 8px; color: var(--color-text-muted); font-size: .75rem; }
.order-header__carrier { font-size: .875rem; color: var(--color-text-muted); }

/* ===== ORDER COMMENT ===== */
.order-comment {
    margin-bottom: 16px;
    padding: 8px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--color-text-muted);
}

/* ===== INLINE COMMENT ===== */
.inline-comment {
    margin-bottom: 16px;
}
.inline-comment__view {
    display: flex;
    align-items: flex-start;
    min-height: 28px;
    cursor: pointer;
}
.inline-comment__view[hidden] { display: none; }
.inline-comment__view:hover .inline-comment__text {
    border-color: var(--color-primary);
}
.inline-comment__text {
    flex: 1;
    padding: 6px 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius);
    font-size: .875rem;
    color: var(--color-text-muted);
    white-space: pre-wrap;
    word-break: break-word;
    transition: border-color var(--transition);
}
.inline-comment--empty .inline-comment__text {
    display: none;
}
.inline-comment--empty .inline-comment__view::after {
    content: 'Добавить комментарий…';
    font-size: .875rem;
    color: var(--color-text-muted);
    opacity: 0.5;
    padding: 6px 2px;
}
.inline-comment__textarea {
    width: 100%;
    resize: vertical;
}
.inline-comment__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}
.inline-comment__status {
    font-size: .8rem;
    color: var(--color-text-muted);
}
.inline-comment__status--error { color: var(--color-danger); }

/* ===== ORDER BODY LAYOUT ===== */
.order-body { display: grid; grid-template-columns: 1fr 360px; gap: 20px; align-items: start; }

/* ===== ITEMS TOTAL ===== */
.order-items-total {
    padding: 8px 14px;
    border-top: 1px solid var(--color-border);
    font-size: .875rem;
    color: var(--color-text-muted);
    text-align: right;
}

/* ===== PAGINATION ===== */
.pagination { display: flex; align-items: center; gap: 4px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.pagination__item {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    min-width: 36px; height: 36px; padding: 0 8px;
    border: 1px solid var(--color-border); border-radius: var(--radius);
    color: var(--color-text); background: var(--color-surface);
    font-size: .875rem; white-space: nowrap; line-height: 1; flex-shrink: 0;
    text-decoration: none;
}
.pagination__item:hover:not(.pagination__item--disabled):not(.pagination__item--active) {
    background: var(--color-bg); border-color: var(--color-primary); color: var(--color-primary); text-decoration: none;
}
.pagination__item--active { background: var(--color-sidebar); border-color: var(--color-sidebar); color: #fff; font-weight: 600; pointer-events: none; }
.pagination__item--disabled { opacity: .35; cursor: default; pointer-events: none; }
.pagination__item--dots { border: none; background: none; cursor: default; min-width: 24px; padding: 0; color: var(--color-text-muted); }
.pagination__item--edge { gap: 2px; }
.pagination__gap { display: none; }
@media (max-width: 768px) {
    .pagination__item--edge { display: none; }
    .pagination__item--label { display: none; }
    .pagination__gap { display: inline-flex; }
}

/* ===== SIDEBAR BACKDROP ===== */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
}
.sidebar-backdrop--visible { display: block; }


/* ===== NEW ORDERS BANNER ===== */
.new-orders-banner[hidden] { display: none; }
.new-orders-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    background: var(--color-warning);
    color: #7c2d12;
    font-size: .875rem;
    font-weight: 500;
    border-bottom: 1px solid #f97316;
    position: sticky;
    top: 0;
    z-index: 90;
}
[data-theme="dark"] .new-orders-banner { color: #fff; }
.new-orders-banner__text { flex: 1; font-weight: 600; }
.new-orders-banner__link { color: inherit; text-decoration: underline; font-weight: 700; white-space: nowrap; }
.new-orders-banner__dismiss {
    background: none; border: none; cursor: pointer;
    font-size: 1.25rem; line-height: 1; padding: 2px 6px;
    color: inherit; opacity: .7; border-radius: var(--radius);
}
.new-orders-banner__dismiss:hover { opacity: 1; background: rgba(0,0,0,.1); }

/* ===== NEW ORDER ROW ===== */
.table tbody tr.row--new { background: rgba(244, 162, 97, .08); }
.table tbody tr.row--swiped { animation: swipe-flash .4s ease-out; }
@keyframes swipe-flash {
    0%   { background: rgba(67, 97, 238, .18); }
    100% { background: transparent; }
}
.table tbody tr.row--new > td:first-child { border-left: 3px solid var(--color-warning); }
[data-theme="dark"] .table tbody tr.row--new { background: rgba(244, 162, 97, .12); }

.new-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-warning);
    margin-right: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ===== BATCH TOOLBAR ===== */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 7px 12px;
    margin-bottom: 12px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.batch-toolbar__count  { font-size: .8rem; font-weight: 600; white-space: nowrap; color: var(--color-text-muted); min-width: 80px; }
.batch-toolbar__select { width: 160px !important; flex-shrink: 0; }
.batch-toolbar__print  { margin-left: auto; }
.form-control--sm { padding: 5px 8px; font-size: .8rem; }

/* ===== CHECKBOX COLUMN ===== */
.col-check { width: 36px; text-align: center; }
.col-check input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; }

/* ===== BTN GROUP ===== */
.btn-group { display: flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.btn-group .btn:last-child  { border-radius: 0 var(--radius) var(--radius) 0; }

/* ===== CONFIRM MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 420px;
    padding: 24px;
}
.modal__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal__title  { font-size: 1.05rem; font-weight: 700; }
.modal__close  { background: none; border: none; font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--color-text-muted); padding: 0 2px; }
.modal__close:hover { color: var(--color-text); }
.modal__body   { color: var(--color-text-muted); font-size: .9rem; margin-bottom: 4px; }
.modal__footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal--wide         { max-width: 720px; width: 100%; }
.modal__body--scroll { max-height: 80vh; overflow-y: auto; }

/* ===== SKELETON ===== */
@keyframes skel-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position:  400px 0; }
}

.skel {
    border-radius: 4px;
    background: linear-gradient(90deg, var(--color-border) 25%, var(--color-bg) 50%, var(--color-border) 75%);
    background-size: 800px 100%;
    animation: skel-shimmer 1.4s ease-in-out infinite;
    height: 14px;
    flex-shrink: 0;
}

.positions-skeleton { padding: 8px 0; }

.skel-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    border-bottom: 1px solid var(--color-border);
}
.skel-row:last-child { border-bottom: none; }

.skel--num  { width: 24px; }
.skel--code { width: 70px; }
.skel--img  { width: 35px; height: 35px; border-radius: 3px; }
.skel--name { flex: 1; }
.skel--qty  { width: 40px; }

/* Vary name widths so rows don't look identical */
.skel-row:nth-child(2n)   .skel--name { max-width: 75%; }
.skel-row:nth-child(3n)   .skel--name { max-width: 55%; }
.skel-row:nth-child(4n+1) .skel--name { max-width: 88%; }

.positions-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn--spinning svg { animation: spin 0.7s linear infinite; }

#product-search { padding-left: 28px; }

.search-field-spinner {
    position: absolute;
    left: 8px;
    top: 50%;
    margin-top: -7px;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    pointer-events: none;
}

/* ===== SUBMIT OVERLAY SPINNER ===== */
.submit-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}
.submit-overlay.is-visible { display: flex; }
.submit-overlay__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
.submit-overlay__label {
    font-size: .875rem;
    color: var(--color-text-muted);
}

/* ===== IMAGE MODAL ===== */
.img-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
}
.img-modal[hidden] { display: none; }
.img-modal__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    padding: 4px;
}
.img-modal__close:hover { opacity: 1; }
.img-modal__img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
    border-radius: 4px;
}

/* ===== IMAGE TOOLTIP (hover preview) ===== */
.img-tooltip {
    position: fixed;
    width: 100px;
    height: 100px;
    background: #fff;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 6px;
    overflow: hidden;
    pointer-events: none;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
    transition: opacity .15s;
}
.img-tooltip img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ===== PRINT ===== */
@media print {
    .sidebar, .no-print, .btn, .filters, .page-header .btn { display: none !important; }
    .layout__main { margin-left: 0; }
    .content { padding: 0; }
    body { background: #fff; color: #000; }
    .card { border: none; box-shadow: none; }
    .badge { border: 1px solid #ccc; background: transparent !important; color: #000 !important; }
    .table th { background: #f5f5f5; }
}

/* ===== AUTOCOMPLETE DROPDOWN ===== */
.autocomplete-wrap { position: relative; }

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    max-height: 300px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: .875rem;
    border-bottom: 1px solid var(--color-border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--color-bg); }
.autocomplete-item--empty { color: var(--color-text-muted); cursor: default; font-style: italic; }
.autocomplete-item--empty:hover { background: none; }
.autocomplete-show-more { color: var(--color-primary); font-size: .85rem; text-align: center; cursor: pointer; justify-content: center; }
.autocomplete-show-more:hover { background: var(--color-bg); }

.autocomplete-item__img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 3px;
    flex-shrink: 0;
}
.autocomplete-item__img-placeholder {
    width: 32px;
    height: 32px;
    background: var(--color-border);
    border-radius: 3px;
    flex-shrink: 0;
}
.autocomplete-item__info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.autocomplete-item__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.autocomplete-item__code { font-size: .75rem; color: var(--color-text-muted); }

/* ===== PURCHASE FORM ===== */
.purchase-header-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.product-search-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 8px;
    max-width: 750px;
}

.product-cell--link {
    cursor: pointer;
    color: var(--color-text);
}
.product-cell--link:hover {
    text-decoration: underline;
}

/* ===== PURCHASE ITEMS TABLE ===== */
.item-cell-text {
    display: block;
    font-size: .875rem;
    padding: 2px 0;
    line-height: 1.4;
    color: var(--color-text);
}

.cell-img-col  { text-align: center; padding: 2px 4px !important; }
.cell-actions-col { text-align: center; padding: 2px 4px !important; width: 36px; }

/* Remove number input spinners */
.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.no-spin { -moz-appearance: textfield; appearance: textfield; }

/* Three-dot row actions menu */
.row-actions { position: relative; display: inline-flex; }

.row-actions__btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    line-height: 1;
    border-radius: var(--radius);
    letter-spacing: .5px;
}
.row-actions__btn:hover { background: var(--color-bg); color: var(--color-text); }

.row-actions__menu {
    position: fixed; /* fixed escapes overflow:auto table wrapper */
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 500;
    min-width: 110px;
    white-space: nowrap;
}
.row-actions__menu[hidden] { display: none; }

.row-actions__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .875rem;
    color: var(--color-text);
}
.row-actions__item:hover { background: var(--color-bg); }
.row-actions__item--danger { color: var(--color-danger); }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: .875rem;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(0,0,0,.15);
    opacity: 1;
    transition: opacity .3s;
    pointer-events: auto;
    max-width: 360px;
}
.toast--success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.toast--danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.toast--fade    { opacity: 0; }
[data-theme="dark"] .toast--success { background: #064e3b; color: #a7f3d0; border-color: #065f46; }
[data-theme="dark"] .toast--danger  { background: #7f1d1d; color: #fecaca; border-color: #991b1b; }

/* ===== DOCUMENT PANEL ===== */
.content { position: relative; }
.doc-panel {
    position: absolute; inset: 0; z-index: 10;
    background: var(--color-bg);
    display: flex; flex-direction: column;
    overflow: hidden;
}
.doc-panel[hidden] { display: none; }
.doc-panel__topbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}
.doc-panel__title   { font-weight: 600; font-size: 1rem; }
.doc-panel__actions { margin-left: auto; display: flex; gap: 8px; }
.doc-panel__body    { flex: 1; overflow-y: auto; padding: 20px; }
.doc-panel__loading { text-align: center; padding: 60px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar--open { transform: translateX(0); }
    .layout__main { margin-left: 0; position: relative; }
    .mobile-burger { display: flex; }
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .order-body { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .dashboard-cols { grid-template-columns: 1fr; }
    .content { padding: 8px; }
    .page-header { padding-top: 8px; }
    .batch-toolbar { flex-wrap: wrap; }
    .batch-toolbar__print { margin-left: 0; }
    .no-mobile { display: none; }
    .no-desktop { display: inline; }
    .filters .form-control { min-width: 0; }
    .table--compact th, .table--compact td { padding: 7px 9px; }
    .modal { margin: 12px; }
    .toast-container { right: 12px; left: 12px; }
    .toast { max-width: 100%; }
}

/* ===== PRODUCTS FOLDER TREE ===== */
.products-layout { display: flex; align-items: flex-start; gap: 0; }
.products-layout__main { flex: 1; min-width: 0; }

.folder-tree-sidebar {
    width: 396px;
    flex-shrink: 0;
    margin-left: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow);
    position: sticky;
    top: 16px;
}
.folder-tree-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px 10px;
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.folder-tree-sidebar__body { padding: 6px 0 8px; }

.folder-tree, .folder-tree__sub {
    list-style: none;
    margin: 0;
    padding: 0;
}
.folder-tree__sub { padding-left: 16px; }
.folder-tree__row {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--color-text);
    user-select: none;
    transition: background var(--transition);
    margin: 1px 6px;
}
.folder-tree__row:hover { background: var(--color-bg); }
.folder-tree__row--active { background: rgba(67,97,238,.08); color: var(--color-primary); font-weight: 600; }
.folder-tree__arrow { color: var(--color-text-muted); width: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform var(--transition); }
.folder-tree__spacer { display: inline-block; width: 12px; flex-shrink: 0; }
.folder-tree__icon { color: var(--color-text-muted); flex-shrink: 0; }
.folder-tree__label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 768px) {
    .folder-tree-sidebar { display: none; }
}
@media (min-width: 769px) {
    .products-layout__main { min-width: 660px; }
}

/* ===== NOTES LAYOUT ===== */
.order-notes-layout { display: flex; gap: 44px; align-items: flex-start; }
.order-notes-layout > #positions-card { flex: 1; min-width: 280px; }

/* ===== NOTES PANEL ===== */
.notes-panel { flex: 1; min-width: 240px; max-width: 690px; display: flex; flex-direction: column; }
.notes-panel--collapsed { flex: 0 0 36px; min-width: 36px; }

/* Vertical tab (collapsed state) */
.notes-panel__tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 36px;
    min-height: 100px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    padding: 14px 0;
    user-select: none;
    transition: background var(--transition);
}
.notes-panel__tab:hover { background: var(--color-bg); }
.notes-panel__tab-text {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: .75rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: .04em;
}
.notes-panel__tab-badge {
    display: flex; align-items: center; justify-content: center;
    background: var(--color-primary); color: #fff; border-radius: 10px;
    font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; padding: 0 4px;
}
.notes-panel__tab-arrow { color: var(--color-text-muted); }

/* Expanded card */
.notes-panel__card { width: 100%; }
.notes-panel__header { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--color-border); }
.notes-panel__collapse-btn,
.notes-panel__copy-btn {
    background: none; border: none; cursor: pointer; color: var(--color-text-muted);
    padding: 4px; display: flex; align-items: center; border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
}
.notes-panel__collapse-btn:hover,
.notes-panel__copy-btn:hover { color: var(--color-text); background: var(--color-bg); }

/* Count badge in card header */
.notes-panel__count {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--color-primary); color: #fff; border-radius: 10px;
    font-size: .7rem; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px;
    margin-left: 6px; vertical-align: middle;
}

/* Notes list */
.notes-list { max-height: 360px; overflow-y: auto; padding: 8px 16px; }
.notes-list__loading, .notes-list__empty, .notes-list__error { color: var(--color-text-muted); font-size: .875rem; padding: 8px 0; }
.notes-list__error { color: var(--color-danger); }

.note-item { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
.note-item:last-child { border-bottom: none; }
.note-item__header { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; user-select: none; }
.note-item__author { font-size: .8rem; font-weight: 600; color: var(--color-text); flex: 1; }
.note-item__date { font-size: .75rem; color: var(--color-text-muted); white-space: nowrap; }
.note-item__del { background: none; border: none; color: var(--color-text-muted); font-size: 1rem; cursor: pointer; line-height: 1; padding: 0 2px; }
.note-item__del:hover { color: var(--color-danger); }
.note-item__position { display: flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--color-text-muted); margin-bottom: 4px; flex-wrap: wrap; }
.note-item__img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; border: 1px solid var(--color-border); }
.note-item__code { font-family: monospace; font-size: .75rem; background: var(--color-bg); padding: 1px 4px; border-radius: 3px; }
.note-item__name { color: var(--color-text); font-size: .8rem; }
.note-item__comment { font-size: .875rem; white-space: pre-wrap; word-break: break-word; }
.note-item__comment--editable { cursor: text; border-radius: var(--radius); padding: 2px 4px; margin: -2px -4px; }
.note-item__comment--editable:hover { background: var(--color-bg); }
.note-item__comment--editable:focus { outline: none; background: var(--color-bg); box-shadow: 0 0 0 2px var(--color-primary); }

/* Notes form */
.notes-form { padding: 10px 16px 14px; border-top: 1px solid var(--color-border); }
.notes-form__position { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--color-bg);
    border-radius: var(--radius); margin-bottom: 8px; font-size: .8rem; flex-wrap: wrap; }
.notes-form__position img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; border: 1px solid var(--color-border); }
.notes-form__pos-code { font-family: monospace; font-size: .75rem; color: var(--color-text-muted); }
.notes-form__pos-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-form__clear-pos { background: none; border: none; color: var(--color-text-muted); font-size: 1rem; cursor: pointer; padding: 0 2px; line-height: 1; margin-left: auto; }
.notes-form__clear-pos:hover { color: var(--color-danger); }
.notes-form__textarea { width: 100%; border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 8px 10px; font-family: var(--font); font-size: .875rem; resize: vertical;
    background: var(--color-surface); color: var(--color-text); }
.notes-form__textarea:focus { outline: none; border-color: var(--color-primary); }
.notes-form__actions { margin-top: 8px; }

/* Floating note button (position: fixed, injected by JS on row hover) */
.btn-note-float { position: fixed; background: none; border: none; cursor: pointer;
    color: var(--color-text-muted); padding: 3px; line-height: 0; z-index: 11;
    border-radius: 50%; transition: color .15s, background .15s; }
.btn-note-float:hover { color: var(--color-primary); background: var(--color-primary-light, rgba(99,102,241,.1)); }

/* Processing state (note as a task) */
.note-item__process {
    background: none; border: 1px solid var(--color-border); color: var(--color-text-muted);
    font-size: .72rem; cursor: pointer; line-height: 1; padding: 3px 7px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 4px; transition: background .15s, color .15s, border-color .15s;
}
.note-item__process:hover { color: #fff; background: var(--color-success, #16a34a); border-color: var(--color-success, #16a34a); }
.note-item__process svg { width: 12px; height: 12px; }
.note-item__done {
    font-size: .72rem; color: var(--color-success, #16a34a); display: inline-flex; align-items: center; gap: 4px;
    cursor: default;
}
.note-item__done svg { width: 13px; height: 13px; }
.note-item__reopen { background: none; border: none; color: var(--color-text-muted); font-size: .72rem; cursor: pointer; text-decoration: underline; padding: 0; }
.note-item__reopen:hover { color: var(--color-text); }
.note-item--processed { opacity: .6; }

/* Deep-link highlight */
.note-item--highlight { animation: noteHighlight 2.4s ease-out; }
@keyframes noteHighlight {
    0%, 35% { background: var(--color-primary-light, rgba(99,102,241,.18)); }
    100% { background: transparent; }
}

/* Admin overview / inbox */
.notes-overview { display: flex; flex-direction: column; gap: 16px; }
.notes-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.notes-toolbar__tab {
    padding: 6px 14px; border: 1px solid var(--color-border); border-radius: 999px;
    font-size: .85rem; color: var(--color-text-muted); background: var(--color-surface); cursor: pointer;
}
.notes-toolbar__tab:hover { color: var(--color-text); text-decoration: none; }
.notes-toolbar__tab--active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.notes-toolbar__tab--active:hover { color: #fff; }
.notes-overview__card .note-item__process { float: right; }
.notes-overview__list { padding: 0 16px; }
.notes-overview__list:empty { display: none; }
.notes-add { display: flex; gap: 8px; align-items: flex-start; padding: 10px 16px 14px; border-top: 1px solid var(--color-border); }
.notes-add__input {
    flex: 1; border: 1px solid var(--color-border); border-radius: var(--radius);
    padding: 8px 10px; font-family: var(--font); font-size: .875rem; resize: vertical;
    background: var(--color-surface); color: var(--color-text);
}
.notes-add__input:focus { outline: none; border-color: var(--color-primary); }
.notes-add__btn { flex-shrink: 0; }

@media (max-width: 900px) {
    .order-notes-layout { flex-direction: column; }
    .notes-panel, .notes-panel--collapsed { flex: none; width: 100%; min-width: 0; }
    .notes-panel__tab { width: 100%; flex-direction: row; min-height: auto; padding: 12px 16px; border-radius: var(--radius-lg); }
    .notes-panel__tab-text { writing-mode: horizontal-tb; transform: none; }
    .notes-panel__tab-arrow { transform: rotate(90deg); }
}
