@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

:root {
    --bg-main: #1c1c1e;
    --bg-sidebar: #23262b;
    --bg-card: #2b2f36;
    --bg-input: #2c2c2e;
    --border-color: #444b55;
    --text-main: #ffffff;
    --text-muted: #aeb6bf;
    --accent: #00b36b;
    --accent-hover: #00985a;
    --danger: #dc3545;
    --warning: #ffc107;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

html, body {
    min-height: 100%;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
}

a {
    transition: all 0.2s ease;
}

.sidebar {
    background-color: var(--bg-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-inner {
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 24px 18px;
    /* Тонкая полоса прокрутки (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

/* Тонкая полоса прокрутки (WebKit/Chromium) */
.sidebar-inner::-webkit-scrollbar {
    width: 8px;
}
.sidebar-inner::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-inner::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.18);
    border-radius: 8px;
}
.sidebar-inner:hover::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.30);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 1.45rem;
    font-weight: 700;
}

.brand-main {
    color: #ffffff;
}

.brand-accent {
    color: var(--accent);
}

.nav-link {
    color: #ffffff !important;
    border-radius: 10px;
    font-size: 0.98rem;
    font-weight: 400;
    padding: 10px 14px !important;
    margin-bottom: 4px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    text-decoration: none;
}

.main-content {
    padding: 24px;
}

.page-section {
    padding-bottom: 40px;
}

.page-title {
    font-size: 2rem;
    font-weight: 500;
    margin: 0;
}

.text-muted-custom {
    color: var(--text-muted);
}

.content-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.form-control.bg-dark,
textarea.form-control.bg-dark,
select.form-control.bg-dark {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.form-control.bg-dark:focus,
textarea.form-control.bg-dark:focus,
select.form-control.bg-dark:focus {
    background-color: var(--bg-input) !important;
    color: var(--text-main) !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 179, 107, 0.2) !important;
}

.form-control.bg-dark::placeholder {
    color: var(--text-muted) !important;
}

.form-check-label,
label {
    color: var(--text-main);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.btn-success {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

.btn-success:hover,
.btn-success:focus {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.btn-outline-light {
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-outline-light:hover {
    color: #111;
}

.btn-toggle-password {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-toggle-password:hover {
    background-color: #3a3f47;
    color: var(--text-main);
}

.alert {
    border-radius: 12px;
}

.table-dark {
    background-color: transparent;
    color: var(--text-main);
}

.table-dark th,
.table-dark td {
    border-color: rgba(255, 255, 255, 0.08) !important;
    vertical-align: middle;
}

.table-dark thead th {
    background-color: rgba(255, 255, 255, 0.04);
    font-weight: 500;
}

/* subtle zebra striping for readability */
.table tbody tr {
    transition: background-color 0.15s ease;
}

.table.table-dark tbody tr:nth-of-type(odd) > * ,
.content-card .table tbody tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.015);
}

.table.table-dark tbody tr:nth-of-type(even) > * ,
.content-card .table tbody tr:nth-of-type(even) > * {
    background-color: rgba(255, 255, 255, 0.045);
}

.table-hover.table-dark tbody tr:hover > * ,
.content-card .table-hover tbody tr:hover > * {
    background-color: rgba(255, 255, 255, 0.075) !important;
}

.table thead tr > * {
    border-bottom-width: 1px;
}

.card {
    border-radius: 16px;
    overflow: hidden;
}

.no-border {
    border: none !important;
}

.thin-font {
    font-weight: 400 !important;
}

.square-card {
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.square-card .card-body {
    width: 100%;
    text-align: center;
}

.chart-container,
.legend-container {
    font-family: 'Roboto', sans-serif;
}

hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin: 1.5rem 0;
}

.date-picker-container {
    cursor: pointer;
}

.date-input {
    pointer-events: auto;
}

.connection-alert {
    text-align: center;
    padding: 60px 20px;
}

.pie-chart-wrap {
    max-width: 280px;
    margin: 0 auto;
    padding: 8px;
    overflow: visible;
}

.shared-legend-item {
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.shared-legend-item.active {
    background-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 991.98px) {
    .main-content {
        padding: 16px;
    }

    .page-title {
        font-size: 1.6rem;
    }

    .content-card {
        padding: 16px;
    }

    .pie-chart-wrap {
        max-width: 240px;
    }
}
/* statof2 */
.statof2-page {
    max-width: 1600px;
    margin: 0 auto;
}

.statof2-eyebrow {
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    margin-bottom: 8px;
}

.statof2-header-note {
    max-width: 460px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.statof2-kpi-card {
    min-height: 148px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.statof2-kpi-title {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-bottom: 10px;
}

.statof2-kpi-value {
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.15;
}

.statof2-kpi-subtitle {
    margin-top: 10px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.statof2-chart-card,
.statof2-ranking-card {
    height: 100%;
}

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

.statof2-section-head.compact {
    margin-bottom: 14px;
}

.statof2-section-head h3 {
    font-size: 1.05rem;
    margin: 0 0 6px;
}

.statof2-section-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.statof2-chart-wrap {
    position: relative;
    height: 310px;
}

.statof2-chart-wrap-lg {
    height: 360px;
}

.statof2-rank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.statof2-rank-item:first-of-type {
    border-top: none;
    padding-top: 4px;
}

.statof2-rank-name {
    font-weight: 600;
    line-height: 1.2;
}

.statof2-rank-meta {
    color: var(--text-muted);
    font-size: 0.83rem;
    margin-top: 4px;
}

.statof2-rank-value {
    font-weight: 700;
    white-space: nowrap;
    text-align: right;
}

.statof2-table th {
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

.statof2-mobile-card {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 14px;
}

.statof2-mobile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.statof2-mobile-main-value {
    font-size: 1.15rem;
    font-weight: 700;
    white-space: nowrap;
}

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

.statof2-mobile-grid span {
    display: block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-bottom: 2px;
}

.statof2-mobile-grid strong {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
}

@media (max-width: 991.98px) {
    .statof2-chart-wrap,
    .statof2-chart-wrap-lg {
        height: 280px;
    }
}

@media (max-width: 575.98px) {
    .statof2-kpi-card {
        min-height: 124px;
        padding: 16px;
    }

    .statof2-kpi-value {
        font-size: 1.3rem;
    }

    .statof2-mobile-grid {
        grid-template-columns: 1fr 1fr;
    }

    .statof2-chart-wrap,
    .statof2-chart-wrap-lg {
        height: 240px;
    }
}


.statof2-view-switcher {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
}

.statof2-view-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: 500;
    line-height: 1;
}

.statof2-view-btn.active,
.statof2-view-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.statof2-view-section {
    display: none;
}

.statof2-view-section.active {
    display: block;
}

.statof2-cards-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

@media (max-width: 767.98px) {
    .statof2-view-switcher {
        display: grid;
        grid-template-columns: 1fr;
    }

    .statof2-view-btn {
        width: 100%;
        text-align: center;
    }
}


/* statof2 mobile collapse + sortable table */
.statof2-collapsible {
    overflow: hidden;
}

.statof2-collapse-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: transparent;
    color: var(--text-main);
    border: none;
    padding: 0;
    font-size: 1.02rem;
    font-weight: 700;
    text-align: left;
    margin-bottom: 16px;
}

.statof2-collapse-icon {
    font-size: 1.2rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.statof2-collapse-body {
    display: block;
}

.statof2-sortable-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.statof2-sortable-table th.sortable:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.statof2-sortable-table .sort-indicator {
    display: inline-block;
    min-width: 12px;
    margin-left: 4px;
    color: var(--text-muted);
}

.statof2-sortable-table th.sort-asc .sort-indicator::before {
    content: '↑';
    color: #fff;
}

.statof2-sortable-table th.sort-desc .sort-indicator::before {
    content: '↓';
    color: #fff;
}

@media (max-width: 767.98px) {
    .statof2-collapsible.collapsed .statof2-collapse-body {
        display: none;
    }

    .statof2-collapsible.collapsed .statof2-collapse-icon {
        transform: rotate(-90deg);
    }

    .statof2-collapse-toggle {
        padding-bottom: 2px;
        margin-bottom: 14px;
    }
}

@media (min-width: 768px) {
    .statof2-collapse-toggle {
        pointer-events: none;
    }

    .statof2-collapse-icon {
        display: none;
    }
}

/* mobile navigation */
.mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 64px;
}

.mobile-menu-toggle {
    border-color: rgba(255, 255, 255, 0.18) !important;
}

.mobile-sidebar-collapse {
    position: fixed;
    inset: 0;
    z-index: 1045;
    background: var(--bg-sidebar);
}

.mobile-sidebar-collapse.collapse:not(.show) {
    display: none;
}

.mobile-sidebar-collapse.collapsing,
.mobile-sidebar-collapse.show {
    display: block;
}

.mobile-sidebar-panel {
    width: 100vw;
    height: 100vh;
    padding: 18px 16px 24px;
    background: var(--bg-sidebar);
    overflow-y: auto;
}

.mobile-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mobile-sidebar-close {
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: transparent;
    color: var(--text-main);
    font-size: 2rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mobile-sidebar-close:hover,
.mobile-sidebar-close:focus {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.mobile-sidebar-nav .nav-link {
    font-size: 1.05rem;
    padding: 12px 14px !important;
    margin-bottom: 8px;
}

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

@media (min-width: 768px) {
    .mobile-sidebar-collapse,
    .mobile-topbar {
        display: none !important;
    }
}

/* grouped sidebar navigation */
.nav-menu {
    gap: 6px;
}

.nav-menu-section {
    margin-bottom: 7px;
}

.nav-group-toggle {
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
    font-weight: 600;
    transition: background .18s ease, color .18s ease;
}

.nav-group-toggle:hover,
.nav-group-toggle:focus,
.nav-group-toggle.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
    transform: rotate(180deg);
}

.nav-group-chevron {
    font-size: .78rem;
    opacity: .72;
    transition: transform .18s ease;
}

.nav-sub-link {
    display: block;
    margin: 4px 0 4px 14px;
    padding: 8px 12px 8px 18px !important;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 0 10px 10px 0;
    color: var(--text-muted) !important;
    font-size: .94rem;
}

.nav-sub-link:hover,
.nav-sub-link.active {
    color: var(--text-main) !important;
    border-left-color: var(--accent);
    background: rgba(0, 128, 0, 0.16);
}

.nav-sub-caption {
    margin: 12px 12px 5px 31px;
    color: var(--text-muted);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    opacity: .9;
}

.nav-exit-link {
    border-radius: 12px;
    padding: 10px 12px !important;
}

.mobile-sidebar-nav .nav-menu-section {
    margin-bottom: 10px;
}

.mobile-sidebar-nav .nav-group-toggle {
    min-height: 48px;
    font-size: 1.03rem;
    background: rgba(255, 255, 255, 0.045);
}

.mobile-sidebar-nav .nav-sub-link {
    margin-left: 12px;
    margin-bottom: 6px;
    font-size: .98rem;
}

.mobile-sidebar-nav .nav-sub-caption {
    margin-left: 29px;
    margin-top: 14px;
}

/* section tabs inside grouped reports */
.section-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    margin: 0 0 1rem;
}

.section-tabs .section-tab {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-muted);
    border-radius: 999px;
    padding: .55rem .85rem;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.035);
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.section-tabs .section-tab:hover,
.section-tabs .section-tab.active {
    color: var(--text-main);
    border-color: rgba(0, 128, 0, 0.75);
    background: rgba(0, 128, 0, 0.18);
    text-decoration: none;
}

@media (max-width: 767.98px) {
    .section-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: .25rem;
        -webkit-overflow-scrolling: touch;
    }

    .section-tabs .section-tab {
        white-space: nowrap;
    }
}


.network-restaurant-selector {
  padding: .9rem 1rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(255,255,255,.025);
}
.network-restaurant-select {
  min-height: 46px;
  border-radius: 12px;
  border-color: rgba(255,255,255,.16);
}
.network-restaurant-hint {
  min-height: 46px;
  display: flex;
  align-items: center;
  padding: .65rem .8rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: rgba(237,240,242,.74);
  line-height: 1.35;
}



body.excel-modal-open {
  overflow: hidden;
}
.excel-export-control {
  display: inline-flex;
  align-items: center;
}
.excel-export-open {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .5rem !important;
  min-height: 42px !important;
  padding: .7rem 1rem !important;
  border: 1px solid #008000 !important;
  border-radius: 12px !important;
  background: #008000 !important;
  color: #fff !important;
  font-size: .92rem !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-decoration: none !important;
  box-shadow: none !important;
  transition: background .2s ease, border-color .2s ease, transform .2s ease !important;
}
.excel-export-open:hover,
.excel-export-open:focus,
.excel-export-open:active {
  border-color: #0a990a !important;
  background: #0a990a !important;
  color: #fff !important;
  text-decoration: none !important;
  outline: none !important;
}
.excel-export-modal {
  position: fixed;
  inset: 0;
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.excel-export-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(2px);
}
.excel-export-dialog {
  position: relative;
  z-index: 1;
  width: min(860px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  background: rgba(17,19,21,.99);
  box-shadow: 0 28px 80px rgba(0,0,0,.58);
  text-align: left;
}
.excel-export-close {
  position: absolute;
  top: .75rem;
  right: .85rem;
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: .18s ease;
}
.excel-export-close:hover,
.excel-export-close:focus {
  border-color: rgba(0,128,0,.7);
  background: rgba(0,128,0,.18);
  outline: none;
}
.excel-export-modal-head {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: 1.2rem 4.25rem 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.excel-export-modal-head strong {
  font-size: 1.18rem;
}
.excel-export-modal .small-note {
  color: rgba(255,255,255,.68);
  font-size: .9rem;
}
.excel-export-body {
  overflow-y: auto;
  padding: 1rem 1.25rem 1.15rem;
}
.excel-columns-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .9rem;
}
.excel-columns-actions button {
  padding: .48rem .78rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 10px;
  background: rgba(255,255,255,.035);
  color: #dfe3e6;
  font-size: .85rem;
  font-weight: 700;
  transition: .18s ease;
}
.excel-columns-actions button:hover {
  color: #fff;
  border-color: rgba(0,128,0,.65);
  background: rgba(0,128,0,.16);
}
.excel-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .45rem .8rem;
}
.excel-column-option {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .52rem .62rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.025);
  color: #eef0f1;
  cursor: pointer;
  line-height: 1.25;
  transition: .16s ease;
}
.excel-column-option:hover {
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.045);
}
.excel-column-option input {
  margin-top: .13rem;
  accent-color: #008000;
}
.excel-export-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .65rem;
  padding: 1rem 1.25rem 1.2rem;
  border-top: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.018);
}
.excel-export-confirm {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .45rem;
}
.excel-form-export-panel {
  margin: .85rem 0;
}
@media (max-width: 767.98px) {
  .excel-export-control { width: 100%; }
  .excel-export-open { width: 100%; }
  .excel-export-dialog { width: min(100%, calc(100vw - 1rem)); max-height: calc(100vh - 1rem); border-radius: 18px; }
  .excel-export-modal { padding: .5rem; }
  .excel-export-modal-head { padding: 1rem 3.75rem .85rem 1rem; }
  .excel-export-body { padding: .85rem 1rem 1rem; }
  .excel-export-footer { padding: .85rem 1rem 1rem; }
  .excel-export-footer > * { flex: 1 1 auto; text-align: center; justify-content: center; }
}

/* Active restaurant selector for network managers */
.network-active-restaurant-desktop {
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 18px;
}

.network-active-restaurant-form {
    width: min(360px, 100%);
    margin: 0;
}

.network-active-restaurant-select {
    height: 44px;
    border-radius: 12px !important;
    font-weight: 600;
}

.mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mobile-topbar-context {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.mobile-topbar-brand {
    flex: 0 0 auto;
    margin-right: 0 !important;
    font-size: 1.18rem;
    line-height: 1;
}

.mobile-network-restaurant-form {
    min-width: 0;
    flex: 0 1 190px;
    width: min(190px, 100%);
    margin: 0;
}

.mobile-network-restaurant-select {
    width: 100%;
    height: 42px;
    min-height: 42px;
    padding-right: 1.8rem;
    border-radius: 12px !important;
    font-size: 0.88rem;
    font-weight: 600;
    text-overflow: ellipsis;
}

@media (max-width: 420px) {
    .mobile-topbar {
        gap: 8px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .mobile-topbar-brand {
        font-size: 1.08rem;
    }

    .mobile-network-restaurant-form {
        flex-basis: 155px;
        width: min(155px, 100%);
    }

    .mobile-network-restaurant-select {
        font-size: 0.82rem;
        padding-left: 0.55rem;
    }
}

/* Global report payment type filter */
body.payment-filter-open {
    overflow: hidden;
}

.payment-filter-strip {
    margin-top: .35rem;
    padding-top: .15rem;
}

.payment-filter-strip-inner {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .8rem 1rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: rgba(255, 255, 255, .045);
}

.payment-filter-summary {
    color: rgba(255, 255, 255, .88);
    font-size: .92rem;
    line-height: 1.35;
}

.payment-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 1085;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.payment-filter-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.payment-filter-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, calc(100vw - 2rem));
    max-height: min(78vh, 760px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: #1f252f;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .48);
}

.payment-filter-close {
    position: absolute;
    top: .85rem;
    right: 1rem;
    z-index: 2;
    width: 2.15rem;
    height: 2.15rem;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-size: 1.55rem;
    line-height: 1;
}

.payment-filter-close:hover,
.payment-filter-close:focus {
    background: rgba(255, 255, 255, .16);
    outline: none;
}

.payment-filter-head {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.15rem 4rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.payment-filter-head strong {
    font-size: 1.15rem;
}

.payment-filter-head span {
    color: rgba(255, 255, 255, .72);
    font-size: .92rem;
    line-height: 1.4;
}

.payment-filter-body {
    min-height: 0;
    overflow: auto;
    padding: 1rem 1.25rem 1.25rem;
}

.payment-filter-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-bottom: .85rem;
}

.payment-filter-status {
    min-height: 1.2rem;
    margin-bottom: .85rem;
}

.payment-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.payment-filter-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin: 0;
    padding: .72rem .85rem;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
    cursor: pointer;
}

.payment-filter-option:hover {
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .08);
}

.payment-filter-option input {
    flex: 0 0 auto;
    margin: 0;
}

.payment-filter-option span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.payment-filter-empty {
    padding: 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, .045);
    color: rgba(255, 255, 255, .72);
}

.payment-filter-footer {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: rgba(0, 0, 0, .16);
}

@media (max-width: 767.98px) {
    .payment-filter-strip {
        margin-top: .3rem;
        padding-top: .1rem;
    }

    .payment-filter-strip-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: .55rem;
        padding: .75rem;
        border-radius: 14px;
    }

    .payment-filter-open {
        width: 100%;
    }

    .payment-filter-dialog {
        width: min(100%, calc(100vw - 1rem));
        max-height: calc(100vh - 1rem);
        border-radius: 18px;
    }

    .payment-filter-modal {
        padding: .5rem;
    }

    .payment-filter-head {
        padding: 1rem 3.6rem .85rem 1rem;
    }

    .payment-filter-body {
        padding: .85rem 1rem 1rem;
    }

    .payment-filter-grid {
        grid-template-columns: 1fr;
    }

    .payment-filter-footer {
        flex-direction: column-reverse;
        padding: .85rem 1rem 1rem;
    }

    .payment-filter-footer .btn {
        width: 100%;
    }
}


/* Compact multi-line table headers: mirrors the Excel export rule.
   Headers with more than three words are split in JS into lines of up to three words. */
table.table thead th.rstaff-table-header-wrapped {
    white-space: normal !important;
    line-height: 1.16;
    vertical-align: middle;
    text-align: center;
    padding-top: .55rem;
    padding-bottom: .55rem;
}


/* Report table headers: centered both horizontally and vertically. */
table.table thead th {
    text-align: center !important;
    vertical-align: middle !important;
}


/* Release navigation shell: compact desktop sidebar and clearer menu hierarchy */
.app-layout-row {
    flex-wrap: nowrap;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sidebar-collapse-toggle {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-collapse-toggle:hover,
.sidebar-collapse-toggle:focus {
    color: #ffffff;
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.nav-primary-link,
.nav-group-toggle {
    min-height: 46px;
}

.nav-primary-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid transparent;
    font-weight: 500;
}

.nav-primary-link:hover,
.nav-primary-link.active {
    background-color: rgba(0, 179, 107, 0.16) !important;
    border-color: rgba(0, 179, 107, 0.28);
}

.nav-group-label {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.nav-icon {
    width: 18px;
    min-width: 18px;
    text-align: center;
}

.nav-label {
    white-space: normal;
}

.nav-context-caption {
    margin: 16px 10px 8px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.nav-separator {
    height: 1px;
    margin: 16px 8px;
    background: rgba(255, 255, 255, 0.08);
}

.nav-exit-link {
    display: flex !important;
    align-items: center;
    gap: 12px;
}

@media (min-width: 768px) {
    .desktop-sidebar {
        flex: 0 0 280px;
        max-width: 280px;
        transition: flex-basis 0.22s ease, max-width 0.22s ease;
    }

    .app-content-column {
        flex: 1 1 auto;
        max-width: calc(100% - 280px);
        transition: max-width 0.22s ease;
    }

    body.sidebar-collapsed .desktop-sidebar {
        flex-basis: 88px;
        max-width: 88px;
    }

    body.sidebar-collapsed .app-content-column {
        max-width: calc(100% - 88px);
    }

    body.sidebar-collapsed .sidebar-inner {
        padding-left: 14px;
        padding-right: 14px;
    }

    body.sidebar-collapsed .sidebar-brand-row {
        flex-direction: column;
        justify-content: flex-start;
        gap: 12px;
    }

    body.sidebar-collapsed .sidebar-brand {
        justify-content: center;
        width: 100%;
        font-size: 1rem;
        gap: 0;
    }

    body.sidebar-collapsed .sidebar-brand .brand-accent {
        display: none;
    }

    body.sidebar-collapsed .sidebar-brand .brand-main {
        font-size: 0;
    }

    body.sidebar-collapsed .sidebar-brand .brand-main::after {
        content: 'rS';
        font-size: 1.15rem;
        font-weight: 700;
        color: #ffffff;
    }

    body.sidebar-collapsed .sidebar-collapse-toggle i {
        transform: rotate(180deg);
    }

    body.sidebar-collapsed .nav-primary-link,
    body.sidebar-collapsed .nav-group-toggle,
    body.sidebar-collapsed .nav-exit-link {
        justify-content: center;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    body.sidebar-collapsed .nav-label,
    body.sidebar-collapsed .nav-group-chevron,
    body.sidebar-collapsed .nav-context-caption,
    body.sidebar-collapsed .nav-separator,
    body.sidebar-collapsed .nav-menu-section > .collapse,
    body.sidebar-collapsed .nav-menu-section > .collapsing {
        display: none !important;
    }

    body.sidebar-collapsed .nav-group-label {
        gap: 0;
    }

    body.sidebar-collapsed .nav-primary-link,
    body.sidebar-collapsed .nav-group-toggle,
    body.sidebar-collapsed .nav-exit-link {
        position: relative;
    }

    body.sidebar-collapsed .nav-primary-link::after,
    body.sidebar-collapsed .nav-group-toggle::after,
    body.sidebar-collapsed .nav-exit-link::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        z-index: 1150;
        opacity: 0;
        pointer-events: none;
        white-space: nowrap;
        padding: 8px 11px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: #17191d;
        color: #ffffff;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
        font-size: 0.86rem;
        transition: opacity 0.16s ease;
    }

    body.sidebar-collapsed .nav-primary-link:hover::after,
    body.sidebar-collapsed .nav-group-toggle:hover::after,
    body.sidebar-collapsed .nav-exit-link:hover::after {
        opacity: 1;
    }
}

@media (max-width: 991.98px) and (min-width: 768px) {
    .desktop-sidebar {
        flex-basis: 248px;
        max-width: 248px;
    }

    .app-content-column {
        max-width: calc(100% - 248px);
    }
}

@media (max-width: 767.98px) {
    .app-layout-row {
        flex-wrap: wrap;
    }

    .nav-primary-link {
        margin-bottom: 8px;
    }

    .nav-context-caption {
        margin-left: 4px;
        margin-right: 4px;
    }
}

/* Sticky first three columns for wide report tables. */
.table-responsive {
    overflow-x: auto;
}

.rstaff-sticky-table {
    border-collapse: separate;
    border-spacing: 0;
}

.rstaff-sticky-table .rstaff-sticky-column {
    position: sticky !important;
    z-index: 4;
    background-clip: padding-box;
}

.rstaff-sticky-table thead .rstaff-sticky-column {
    z-index: 7;
    background-color: var(--accent) !important;
}

.rstaff-sticky-table .rstaff-sticky-column-last {
    box-shadow: 8px 0 12px -12px rgba(0, 0, 0, 0.85);
}

.rstaff-sticky-table tbody tr:nth-of-type(odd) > .rstaff-sticky-column,
.content-card .rstaff-sticky-table tbody tr:nth-of-type(odd) > .rstaff-sticky-column {
    background-color: #2e3239 !important;
}

.rstaff-sticky-table tbody tr:nth-of-type(even) > .rstaff-sticky-column,
.content-card .rstaff-sticky-table tbody tr:nth-of-type(even) > .rstaff-sticky-column {
    background-color: #343941 !important;
}

.rstaff-sticky-table.table-dark tbody tr:hover > .rstaff-sticky-column,
.content-card .rstaff-sticky-table.table-hover tbody tr:hover > .rstaff-sticky-column {
    background-color: #3d434c !important;
}


/* Unified release table header style.
   All report table headers must look identical, including sticky/frozen columns. */
.table.table-dark thead th,
.content-card table.table thead th,
.table-responsive table.table thead th,
table.table thead th,
table.table thead tr > *,
.rstaff-sticky-table thead th,
.rstaff-sticky-table thead .rstaff-sticky-column,
.rstaff-sticky-table thead .rstaff-sticky-column-last,
.abc-table thead th,
.abc-analysis-table thead th,
.currency-table thead th,
.network-compare-matrix thead th,
.network-compare-matrix thead th.network-metric-col,
.network-category-matrix thead th,
.network-category-matrix thead th.network-category-metric-col {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    white-space: normal;
}

.rstaff-sticky-table thead .rstaff-sticky-column,
.rstaff-sticky-table thead .rstaff-sticky-column-last {
    z-index: 9 !important;
    box-shadow: none;
}


/* Sticky table headers for long report tables.
   Header cells stay visible during vertical page scrolling only while the
   current table is still in view. Combined with the first-three-column freeze,
   this keeps row values readable on smaller screens without affecting table data. */
:root {
    --rstaff-sticky-table-header-top: 0px;
}

@media (max-width: 767.98px) {
    :root {
        --rstaff-sticky-table-header-top: 64px;
    }
}

.rstaff-sticky-header-table thead th,
.rstaff-sticky-header-table thead tr > * {
    position: sticky !important;
    top: var(--rstaff-sticky-table-header-top) !important;
    z-index: 8 !important;
    background-color: var(--accent) !important;
    color: #ffffff !important;
    background-clip: padding-box;
    box-shadow: 0 8px 14px -14px rgba(0, 0, 0, 0.85);
}

.rstaff-sticky-header-table.rstaff-sticky-table thead .rstaff-sticky-column,
.rstaff-sticky-header-table.rstaff-sticky-table thead .rstaff-sticky-column-last {
    z-index: 12 !important;
    background-color: var(--accent) !important;
    color: #ffffff !important;
}

.rstaff-sticky-header-table thead th::after,
.rstaff-sticky-header-table thead tr > *::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
    pointer-events: none;
}

/* Reliable floating table header fallback.
   CSS sticky can be blocked by Bootstrap .table-responsive overflow wrappers;
   this JS-driven header clone stays visible only while the current table is in view. */
.rstaff-floating-table-header {
    position: fixed;
    display: none;
    overflow: hidden;
    z-index: 1075;
    pointer-events: none;
    border-radius: 0;
    box-shadow: 0 12px 22px -20px rgba(0, 0, 0, 0.95);
}

.rstaff-floating-table-header-main-clip,
.rstaff-floating-table-header-frozen-clip {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

.rstaff-floating-table-header-frozen-clip {
    z-index: 4;
    box-shadow: 8px 0 12px -12px rgba(0, 0, 0, 0.85);
}

.rstaff-floating-table-header table {
    margin-bottom: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

.rstaff-floating-table-header thead th,
.rstaff-floating-table-header thead tr > *,
.rstaff-floating-table-header .rstaff-sticky-column,
.rstaff-floating-table-header .rstaff-sticky-column-last {
    background-color: var(--accent) !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    white-space: normal;
}

.rstaff-floating-header-main-table {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform;
}

.rstaff-floating-header-frozen-table {
    position: absolute;
    top: 0;
    left: 0;
}

/* Release readability: table body values use the same compact wrapping logic as headers.
   This prevents long amounts/names from overflowing their own cells on smaller screens. */
.content-card table.table tbody td,
.table-responsive table.table tbody td,
table.table tbody td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
    line-height: 1.22;
    vertical-align: middle !important;
}

.content-card table.table tbody td.rstaff-table-cell-wrapped,
.table-responsive table.table tbody td.rstaff-table-cell-wrapped,
table.table tbody td.rstaff-table-cell-wrapped {
    white-space: normal !important;
    line-height: 1.18;
}

/* Numeric cells may contain large formatted values. Allow line breaks after
   thousands separators and keep the cell readable instead of forcing the table
   to stretch horizontally. */
.content-card table.table tbody td.text-right,
.table-responsive table.table tbody td.text-right,
table.table tbody td.text-right,
.content-card table.table tbody td[data-sort-type="number"],
.table-responsive table.table tbody td[data-sort-type="number"],
table.table tbody td[data-sort-type="number"] {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Local report styles sometimes set nowrap on table cells. The release table
   rule wins for actual data cells; navigation chips and KPI values are not affected. */
.cost-compare-table td,
.lfl-table td,
.abc-analysis-table tbody td,
.network-compare-matrix tbody td,
.network-category-matrix tbody td,
.cost-profit-table tbody td {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

/* Stage29 table readability rollback: calm headers, no breaking words.
   Wide tables are allowed to become wider than the screen; horizontal scroll +
   sticky first columns keep them readable without splitting words or numbers. */
:root {
    --rstaff-table-header-bg: #293048;
    --rstaff-table-header-border: rgba(255, 255, 255, 0.12);
}

.table-responsive > table.table {
    width: max-content;
    min-width: 100%;
}

/* Calm unified header style instead of bright green table heads. */
.table.table-dark thead th,
.content-card table.table thead th,
.table-responsive table.table thead th,
table.table thead th,
table.table thead tr > *,
.rstaff-sticky-table thead th,
.rstaff-sticky-table thead .rstaff-sticky-column,
.rstaff-sticky-table thead .rstaff-sticky-column-last,
.rstaff-sticky-header-table thead th,
.rstaff-sticky-header-table thead tr > *,
.rstaff-sticky-header-table.rstaff-sticky-table thead .rstaff-sticky-column,
.rstaff-sticky-header-table.rstaff-sticky-table thead .rstaff-sticky-column-last,
.rstaff-floating-table-header thead th,
.rstaff-floating-table-header thead tr > *,
.rstaff-floating-table-header .rstaff-sticky-column,
.rstaff-floating-table-header .rstaff-sticky-column-last,
.abc-table thead th,
.abc-analysis-table thead th,
.currency-table thead th,
.network-compare-matrix thead th,
.network-compare-matrix thead th.network-metric-col,
.network-category-matrix thead th,
.network-category-matrix thead th.network-category-metric-col {
    background-color: var(--rstaff-table-header-bg) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-color: var(--rstaff-table-header-border) !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

/* Body cells may wrap only at natural break points.  Do not split words,
   product names or formatted numbers inside a cell. */
.content-card table.table tbody td,
.table-responsive table.table tbody td,
table.table tbody td,
.content-card table.table tbody td.rstaff-table-cell-wrapped,
.table-responsive table.table tbody td.rstaff-table-cell-wrapped,
table.table tbody td.rstaff-table-cell-wrapped,
.cost-compare-table td,
.lfl-table td,
.abc-analysis-table tbody td,
.network-compare-matrix tbody td,
.network-category-matrix tbody td,
.cost-profit-table tbody td {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    line-height: 1.24;
    vertical-align: middle !important;
}

/* Numeric columns are kept on one line.  If the screen is narrow, the table
   scrolls horizontally instead of breaking the number into unreadable pieces. */
.content-card table.table tbody td.text-right,
.content-card table.table tbody td.text-end,
.table-responsive table.table tbody td.text-right,
.table-responsive table.table tbody td.text-end,
table.table tbody td.text-right,
table.table tbody td.text-end,
.content-card table.table tbody td[data-sort-type="number"],
.table-responsive table.table tbody td[data-sort-type="number"],
table.table tbody td[data-sort-type="number"] {
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-variant-numeric: tabular-nums;
}

/* Keep visually dense report cells readable without forcing word breaks. */
table.table tbody td:first-child,
table.table tbody td:nth-child(2),
table.table tbody td:nth-child(3) {
    min-width: 92px;
}

/* Dish/category/name-like columns need enough room for word-level wrapping. */
table.table th:nth-child(2),
table.table td:nth-child(2),
table.table th:nth-child(3),
table.table td:nth-child(3) {
    max-width: 360px;
}

/* --------------------------------------------------------------------------
   rStaff visual unification layer
   -------------------------------------------------------------------------- */
:root {
    --rstaff-panel: #20242a;
    --rstaff-panel-2: #252a31;
    --rstaff-panel-soft: rgba(255, 255, 255, 0.045);
    --rstaff-border: rgba(255, 255, 255, 0.10);
    --rstaff-border-strong: rgba(255, 255, 255, 0.16);
    --rstaff-radius-lg: 18px;
    --rstaff-radius-md: 14px;
}

.app-layout-container,
.main-content {
    background: var(--bg-main);
}

.main-content > .container,
.main-content > .container-fluid,
.main-content > .page-section,
.async-shell {
    max-width: 1640px;
    margin-left: auto;
    margin-right: auto;
}

.main-content > .container,
.main-content > .container-fluid {
    padding-top: 1.25rem !important;
    padding-bottom: 2rem !important;
}

.page-section,
.rstaff-page,
.mp-shell {
    padding-top: 1.1rem;
    padding-bottom: 2.25rem;
}

.page-title,
.main-content h1,
.main-content h2.mb-0,
.main-content h2.mb-1,
.mp-head h1 {
    letter-spacing: -0.02em;
}

.content-card,
.card.bg-dark,
.card.bg-secondary,
.card.border-secondary,
.rstaff-card,
.mp-panel,
.mp-card,
.mp-hero,
.mp-kpi,
.network-restaurant-selector {
    background: linear-gradient(180deg, var(--rstaff-panel-2), var(--rstaff-panel)) !important;
    border: 1px solid var(--rstaff-border) !important;
    border-radius: var(--rstaff-radius-lg) !important;
    box-shadow: var(--shadow);
    color: var(--text-main) !important;
}

.card.bg-dark .card-body,
.card.bg-secondary .card-body,
.card.border-secondary .card-body {
    color: var(--text-main);
}

.bg-secondary,
.input-group-text.bg-secondary,
.form-control.bg-secondary {
    background-color: var(--bg-input) !important;
    color: var(--text-main) !important;
    border-color: var(--border-color) !important;
}

.card-title,
.content-card h1,
.content-card h2,
.content-card h3,
.content-card h4,
.content-card h5,
.content-card h6 {
    color: var(--text-main);
}

.text-muted,
.form-text.text-muted,
small.text-muted {
    color: var(--text-muted) !important;
}

.form-control,
.custom-select,
.input-group-text {
    border-radius: 12px;
}

.form-control:not(.bg-dark),
.custom-select:not(.bg-dark),
select.form-control:not(.bg-dark),
textarea.form-control:not(.bg-dark),
input.form-control:not(.bg-dark),
.input-group-text {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

.form-control:not(.bg-dark):focus,
.custom-select:not(.bg-dark):focus,
select.form-control:not(.bg-dark):focus,
textarea.form-control:not(.bg-dark):focus,
input.form-control:not(.bg-dark):focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 179, 107, 0.18) !important;
}

.form-control[readonly],
.form-control:disabled {
    background-color: rgba(255, 255, 255, 0.065) !important;
    color: rgba(255, 255, 255, 0.78) !important;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
}

.btn-primary,
.btn-info {
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-info:focus {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    color: #fff !important;
}

.btn-outline-info {
    color: #8ee6a2 !important;
    border-color: rgba(142, 230, 162, 0.55) !important;
}

.btn-outline-info:hover,
.btn-outline-info:focus {
    color: #fff !important;
    background-color: rgba(0, 179, 107, 0.18) !important;
    border-color: var(--accent) !important;
}

.alert-light,
.alert-secondary,
.alert-info {
    background: rgba(255, 255, 255, 0.07) !important;
    border-color: var(--rstaff-border) !important;
    color: var(--text-main) !important;
}

.alert-warning {
    background: rgba(255, 193, 7, 0.12) !important;
    border-color: rgba(255, 193, 7, 0.25) !important;
    color: #ffe6a6 !important;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.13) !important;
    border-color: rgba(220, 53, 69, 0.32) !important;
    color: #ffc3c9 !important;
}

.alert-success {
    background: rgba(0, 179, 107, 0.13) !important;
    border-color: rgba(0, 179, 107, 0.32) !important;
    color: #bff5dc !important;
}

.badge-light {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
}

.badge-info,
.badge-primary {
    background: rgba(0, 179, 107, 0.22) !important;
    color: #d9f7df !important;
}

.table-responsive {
    border-radius: 14px;
}

.content-card.table-responsive,
.card .table-responsive,
.rstaff-table-shell {
    border: 1px solid var(--rstaff-border);
    background: rgba(255, 255, 255, 0.025);
}

.table-dark,
.table.table-dark {
    background: transparent !important;
}

.table-bordered th,
.table-bordered td {
    border-color: rgba(255, 255, 255, 0.10) !important;
}

.table-hover tbody tr:hover {
    color: #fff;
}

.border,
.border-secondary {
    border-color: var(--rstaff-border) !important;
}

.rounded {
    border-radius: var(--rstaff-radius-md) !important;
}

.login-card {
    border-radius: 22px !important;
    padding: 2rem !important;
    background: linear-gradient(180deg, #242931, #1b1e23) !important;
}

/* Legacy report pages kept for compatibility with old links. */
.main-content > .container > br:first-child,
.main-content > .container > br:first-child + br {
    display: none;
}

.main-content > .container h2.thin-font,
.main-content > .container-fluid h2.thin-font {
    font-size: 1.8rem;
    font-weight: 600 !important;
    margin-bottom: 0.35rem;
}

.main-content > .container .card.bg-dark.no-border,
.main-content > .container-fluid .card.bg-dark.no-border {
    border: 1px solid var(--rstaff-border) !important;
    background: linear-gradient(180deg, var(--rstaff-panel-2), var(--rstaff-panel)) !important;
}

/* Async pages use the same loader style in both admin and waiter shells. */
.async-loader-card,
.excel-export-card {
    background: linear-gradient(180deg, #242931, #1b1e23) !important;
    border: 1px solid var(--rstaff-border) !important;
    border-radius: 22px !important;
    box-shadow: var(--shadow);
}

.async-ring {
    border-top-color: var(--accent) !important;
}

@media (max-width: 767.98px) {
    .main-content > .container,
    .main-content > .container-fluid {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .content-card,
    .card.bg-dark,
    .card.bg-secondary,
    .card.border-secondary,
    .mp-panel,
    .mp-card {
        border-radius: 16px !important;
    }

    .btn,
    .form-control,
    .custom-select,
    .input-group-text {
        min-height: 42px;
    }
}

/* --------------------------------------------------------------------------
   rStaff table readability refresh
   --------------------------------------------------------------------------
   Wide report tables must stay readable on desktop and mobile.  The table is
   allowed to scroll horizontally; numbers and names are not broken into random
   letters, and headers use the same calm dark palette as the rest of rStaff.
*/
:root {
    --rstaff-table-head-bg: #293048;
    --rstaff-table-head-bg-2: #323a46;
    --rstaff-table-row-bg: #20252c;
    --rstaff-table-row-alt-bg: #252b33;
    --rstaff-table-row-hover-bg: #303845;
    --rstaff-table-cell-border: rgba(255, 255, 255, 0.095);
    --rstaff-table-text: #eef2f5;
    --rstaff-table-muted: #bac4ce;
}

.main-content,
.app-content-column {
    min-width: 0;
}

.rstaff-table-responsive,
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-radius: 14px;
    scrollbar-color: rgba(255, 255, 255, .28) rgba(255, 255, 255, .06);
    scrollbar-width: thin;
}

.rstaff-table-responsive::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 10px;
}

.rstaff-table-responsive::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .06);
    border-radius: 999px;
}

.rstaff-table-responsive::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .24);
    border-radius: 999px;
}

.rstaff-table-responsive::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .36);
}

.table-responsive > table.table,
table.table.rstaff-wide-table,
table.table.rstaff-extra-wide-table {
    width: max-content !important;
    min-width: 100% !important;
    table-layout: auto !important;
}

.table-responsive > table.table:not(.rstaff-wide-table):not(.rstaff-extra-wide-table) {
    width: 100%;
}

.table.table,
.content-card table.table,
.card table.table {
    color: var(--rstaff-table-text) !important;
    font-size: .88rem;
    line-height: 1.28;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.table.table th,
.table.table td,
.content-card table.table th,
.content-card table.table td,
.card table.table th,
.card table.table td {
    padding: .54rem .66rem !important;
    border-color: var(--rstaff-table-cell-border) !important;
    vertical-align: middle !important;
}

.table.table thead th,
.table.table thead tr > *,
.table-dark thead th,
.table-responsive table.table thead th,
.content-card table.table thead th,
.rstaff-sticky-table thead th,
.rstaff-sticky-table thead .rstaff-sticky-column,
.rstaff-sticky-table thead .rstaff-sticky-column-last,
.rstaff-sticky-header-table thead th,
.rstaff-sticky-header-table thead tr > *,
.rstaff-floating-table-header thead th,
.rstaff-floating-table-header thead tr > *,
.abc-table thead th,
.abc-analysis-table thead th,
.currency-table thead th,
.cost-profit-table thead th,
.cost-compare-table thead th,
.lfl-table thead th,
.network-compare-matrix thead th,
.network-category-matrix thead th {
    background: linear-gradient(180deg, var(--rstaff-table-head-bg-2), var(--rstaff-table-head-bg)) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    text-align: center !important;
    vertical-align: middle !important;
    border-color: rgba(255, 255, 255, .13) !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    min-width: 78px;
}

.table.table tbody tr,
.table.table tbody tr > *,
.table-dark tbody tr,
.table-dark tbody tr > * {
    color: var(--rstaff-table-text) !important;
}

.table.table tbody tr:nth-of-type(odd) > *,
.table.table.table-dark tbody tr:nth-of-type(odd) > *,
.content-card .table tbody tr:nth-of-type(odd) > * {
    background-color: var(--rstaff-table-row-bg) !important;
}

.table.table tbody tr:nth-of-type(even) > *,
.table.table.table-dark tbody tr:nth-of-type(even) > *,
.content-card .table tbody tr:nth-of-type(even) > * {
    background-color: var(--rstaff-table-row-alt-bg) !important;
}

.table-hover tbody tr:hover > *,
.table.table-hover tbody tr:hover > *,
.table-hover.table-dark tbody tr:hover > *,
.content-card .table-hover tbody tr:hover > * {
    background-color: var(--rstaff-table-row-hover-bg) !important;
    color: #ffffff !important;
}

.table.table tbody td,
.content-card table.table tbody td,
.table-responsive table.table tbody td,
.cost-compare-table td,
.lfl-table td,
.abc-analysis-table tbody td,
.network-compare-matrix tbody td,
.network-category-matrix tbody td,
.cost-profit-table tbody td {
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
    min-width: 78px;
}

.table.table tbody td.text-right,
.table.table tbody td.text-end,
.table.table tbody td[data-sort-type="number"],
.table.table tbody td.rstaff-number-cell,
.table.table tbody td.rstaff-money-cell {
    white-space: nowrap !important;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.table.table td.rstaff-dish-name-cell,
.table.table td.rstaff-name-cell,
.table.table td.rstaff-text-cell,
.table.table tbody td:nth-child(2),
.table.table tbody td:nth-child(3) {
    min-width: 170px;
    max-width: 340px;
    text-align: left;
}

.table.table thead th.rstaff-table-header-wrapped {
    line-height: 1.12;
    padding-top: .48rem !important;
    padding-bottom: .48rem !important;
}

.rstaff-sticky-table tbody tr:nth-of-type(odd) > .rstaff-sticky-column,
.content-card .rstaff-sticky-table tbody tr:nth-of-type(odd) > .rstaff-sticky-column {
    background-color: var(--rstaff-table-row-bg) !important;
}

.rstaff-sticky-table tbody tr:nth-of-type(even) > .rstaff-sticky-column,
.content-card .rstaff-sticky-table tbody tr:nth-of-type(even) > .rstaff-sticky-column {
    background-color: var(--rstaff-table-row-alt-bg) !important;
}

.rstaff-sticky-table.table-hover tbody tr:hover > .rstaff-sticky-column,
.content-card .rstaff-sticky-table.table-hover tbody tr:hover > .rstaff-sticky-column {
    background-color: var(--rstaff-table-row-hover-bg) !important;
}

.rstaff-sticky-table .rstaff-sticky-column-last {
    box-shadow: 10px 0 16px -16px rgba(0, 0, 0, .9);
}

.rstaff-floating-table-header thead th,
.rstaff-floating-table-header .rstaff-sticky-column,
.rstaff-floating-table-header .rstaff-sticky-column-last {
    background: linear-gradient(180deg, var(--rstaff-table-head-bg-2), var(--rstaff-table-head-bg)) !important;
}

@media (max-width: 1199.98px) {
    .table.table,
    .content-card table.table,
    .card table.table {
        font-size: .84rem;
    }

    .table.table th,
    .table.table td,
    .content-card table.table th,
    .content-card table.table td,
    .card table.table th,
    .card table.table td {
        padding: .48rem .56rem !important;
    }

    .table.table td.rstaff-dish-name-cell,
    .table.table td.rstaff-name-cell,
    .table.table td.rstaff-text-cell,
    .table.table tbody td:nth-child(2),
    .table.table tbody td:nth-child(3) {
        min-width: 150px;
        max-width: 300px;
    }
}

@media (max-width: 767.98px) {
    .rstaff-table-responsive,
    .table-responsive {
        margin-left: -.25rem;
        margin-right: -.25rem;
        padding-bottom: .25rem;
        border-radius: 12px;
    }

    .table.table,
    .content-card table.table,
    .card table.table {
        font-size: .8rem;
    }

    .table.table th,
    .table.table td,
    .content-card table.table th,
    .content-card table.table td,
    .card table.table th,
    .card table.table td {
        padding: .42rem .48rem !important;
    }

    .table.table thead th,
    .table.table tbody td {
        min-width: 72px;
    }

    .table.table td.rstaff-dish-name-cell,
    .table.table td.rstaff-name-cell,
    .table.table td.rstaff-text-cell,
    .table.table tbody td:nth-child(2),
    .table.table tbody td:nth-child(3) {
        min-width: 132px;
        max-width: 260px;
    }
}

/* rStaff interactive table layer */
.rstaff-table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
    margin: .35rem 0 .55rem;
    padding: .5rem .65rem;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    background: rgba(41, 48, 72, .36);
}

.rstaff-table-search-wrap {
    position: relative;
    min-width: min(100%, 280px);
    max-width: 420px;
    flex: 1 1 280px;
}

.rstaff-table-search-wrap .fa-search {
    position: absolute;
    left: .72rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .42);
    font-size: .82rem;
    pointer-events: none;
}

.rstaff-table-search {
    height: 34px;
    padding-left: 2.05rem !important;
    border-color: rgba(255, 255, 255, .12) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .06) !important;
    color: #f4f7fb !important;
    box-shadow: none !important;
}

.rstaff-table-search::placeholder {
    color: rgba(255, 255, 255, .5);
}

.rstaff-table-search:focus {
    border-color: rgba(34, 197, 94, .5) !important;
    background: rgba(255, 255, 255, .09) !important;
    box-shadow: 0 0 0 .15rem rgba(34, 197, 94, .12) !important;
}

.rstaff-table-status {
    flex: 0 0 auto;
    color: rgba(238, 244, 250, .64);
    font-size: .78rem;
    white-space: nowrap;
}

.rstaff-interactive-table thead th.rstaff-sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.35rem !important;
}

.rstaff-interactive-table thead th.rstaff-sortable-header::after {
    content: '↕';
    position: absolute;
    right: .42rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .36);
    font-size: .75rem;
    line-height: 1;
}

.rstaff-interactive-table.rstaff-existing-sort-table thead th.rstaff-sortable-header::after {
    content: '';
}

.rstaff-interactive-table thead th.rstaff-sort-asc::after {
    content: '↑';
    color: #8ee68e;
}

.rstaff-interactive-table thead th.rstaff-sort-desc::after {
    content: '↓';
    color: #8ee68e;
}

.rstaff-interactive-table tbody tr[style*="display: none"] {
    display: none !important;
}

@media (max-width: 767.98px) {
    .rstaff-table-toolbar {
        align-items: stretch;
        gap: .45rem;
    }

    .rstaff-table-search-wrap,
    .rstaff-table-status {
        flex-basis: 100%;
        width: 100%;
    }

    .rstaff-table-status {
        white-space: normal;
        line-height: 1.3;
    }
}

/* --------------------------------------------------------------------------
   Excel controls and table header wrapping — unified release rule
   -------------------------------------------------------------------------- */
.export-row,
.content-card .export-row,
.table-panel .export-row,
.section-space .export-row,
.rstaff-export-row {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: .75rem !important;
    margin: .35rem 0 1rem !important;
}

.excel-export-control,
.content-card .excel-export-control,
.table-panel .excel-export-control,
.section-space .excel-export-control,
.excel-form-export-panel {
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: .35rem 0 1rem !important;
}

.excel-export-open,
.excel-export-control .excel-export-open,
.excel-export-control button[data-excel-toggle],
.excel-export-control .btn[data-excel-toggle],
.export-btn.excel-export-open,
.cost-profit-export-btn.excel-export-open,
.menu-map-export-btn.excel-export-open,
.network-dashboard-shell .excel-export-open,
.network-dashboard-shell .export-btn.excel-export-open {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .5rem !important;
    min-height: 42px !important;
    padding: .68rem 1rem !important;
    border: 1px solid #008000 !important;
    border-radius: 12px !important;
    background: #008000 !important;
    color: #ffffff !important;
    font-size: .92rem !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

.excel-export-open:hover,
.excel-export-open:focus,
.excel-export-open:active,
.excel-export-control button[data-excel-toggle]:hover,
.excel-export-control button[data-excel-toggle]:focus,
.excel-export-control .btn[data-excel-toggle]:hover,
.excel-export-control .btn[data-excel-toggle]:focus {
    border-color: #0a990a !important;
    background: #0a990a !important;
    color: #ffffff !important;
    text-decoration: none !important;
    outline: none !important;
}

.table.table thead th.rstaff-table-header-wrapped,
.content-card table.table thead th.rstaff-table-header-wrapped,
.table-responsive table.table thead th.rstaff-table-header-wrapped,
.rstaff-sticky-table thead th.rstaff-table-header-wrapped,
.rstaff-floating-table-header thead th.rstaff-table-header-wrapped {
    white-space: normal !important;
    line-height: 1.08 !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding-top: .45rem !important;
    padding-bottom: .45rem !important;
}

@media (max-width: 767.98px) {
    .export-row,
    .content-card .export-row,
    .table-panel .export-row,
    .section-space .export-row,
    .rstaff-export-row,
    .excel-export-control,
    .content-card .excel-export-control,
    .table-panel .excel-export-control,
    .section-space .excel-export-control,
    .excel-form-export-panel {
        justify-content: stretch !important;
    }

    .excel-export-open,
    .excel-export-control .excel-export-open,
    .excel-export-control button[data-excel-toggle],
    .excel-export-control .btn[data-excel-toggle] {
        width: 100% !important;
    }
}

/* --------------------------------------------------------------------------
   Fix: multiline table headers must not look crossed out.
   The old centered sort marker was drawn over wrapped header text.  Keep the
   sort cue in the upper-right corner and explicitly remove text decorations
   from table headers and their generated clones.
*/
table.table thead th,
table.table thead th *,
.rstaff-floating-table-header thead th,
.rstaff-floating-table-header thead th *,
.rstaff-sticky-header-table thead th,
.rstaff-sticky-header-table thead th * {
    text-decoration: none !important;
    text-decoration-line: none !important;
}

.rstaff-interactive-table thead th.rstaff-sortable-header {
    padding-right: 1.55rem !important;
}

.rstaff-interactive-table thead th.rstaff-sortable-header::after {
    top: .38rem !important;
    right: .38rem !important;
    transform: none !important;
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(15, 23, 42, .34);
    color: rgba(255, 255, 255, .58);
    font-size: .68rem;
    line-height: 1;
    z-index: 3;
    pointer-events: none;
}

.rstaff-interactive-table thead th.rstaff-table-header-wrapped.rstaff-sortable-header::after {
    top: .32rem !important;
}

.rstaff-interactive-table thead th.rstaff-sort-asc::after,
.rstaff-interactive-table thead th.rstaff-sort-desc::after {
    background: rgba(34, 197, 94, .18);
    color: #a7f3a7;
}

.rstaff-interactive-table.rstaff-existing-sort-table thead th.rstaff-sortable-header::after {
    display: none !important;
}

/* rStaff Advisor 2.0 / Health index */
.health-component-pill {
    display:block;
    border-radius:12px;
    padding:.42rem .55rem;
    margin:.25rem 0;
    font-size:.78rem;
    line-height:1.25;
    border:1px solid rgba(41,48,72,.16);
    background:#f8fafc;
    color:#293048;
    text-align:left;
}
.health-component-pill small { color:#6c757d; }
.health-component-pill.good { border-color:rgba(0,128,0,.22); background:rgba(0,128,0,.06); }
.health-component-pill.warn { border-color:rgba(255,193,7,.35); background:rgba(255,193,7,.08); }
.health-component-pill.bad { border-color:rgba(220,53,69,.28); background:rgba(220,53,69,.08); }
.table-dark .health-component-pill { background:rgba(255,255,255,.06); color:#fff; border-color:rgba(255,255,255,.12); }
.table-dark .health-component-pill small { color:rgba(255,255,255,.68); }

/* rStaff contextual advisor + chart readability layer */
.rstaff-context-advisor {
    margin-top: .8rem;
    border-radius: 14px;
    background: rgba(14, 18, 27, .72);
    border: 1px solid rgba(255,255,255,.075);
    overflow: hidden;
}
.rstaff-context-advisor-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .55rem .7rem;
    color: rgba(255,255,255,.86);
    font-size: .84rem;
    font-weight: 800;
}
.rstaff-context-advisor-head i {
    color: #8ee6a2;
    margin-right: .35rem;
}
.rstaff-context-advisor-toggle {
    border: 1px solid rgba(0,179,107,.32);
    background: rgba(0,179,107,.1);
    color: #a8efb8;
    border-radius: 999px;
    padding: .22rem .58rem;
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}
.rstaff-context-advisor-toggle:hover {
    background: rgba(0,179,107,.18);
    color: #fff;
}
.rstaff-context-advisor-body {
    display: none;
    padding: 0 .8rem .75rem;
    color: rgba(255,255,255,.74);
    font-size: .88rem;
    line-height: 1.45;
}
.rstaff-context-advisor.open .rstaff-context-advisor-body {
    display: block;
}
.rstaff-context-advisor-title {
    color: #fff;
    font-weight: 900;
    margin-bottom: .25rem;
}
.rstaff-context-advisor-text {
    margin-bottom: .35rem;
}
.rstaff-context-advisor-action {
    border-left: 3px solid rgba(0,179,107,.65);
    padding-left: .55rem;
    color: rgba(255,255,255,.8);
}
.chart-panel canvas,
.flash-panel canvas,
.network-chart-card canvas,
.hall-chart-panel canvas,
.lfl-panel canvas,
.menu-map-panel canvas,
.menu-map-card canvas,
.daily-panel canvas,
.net-daily-panel canvas,
.network-plan-chart-panel canvas,
.restaurant-card-chart canvas,
.wr-panel canvas,
.compare-chart-card canvas {
    cursor: crosshair;
}
.compare-delta-text.up,
.text-success,
.rstaff-positive {
    color: #8ee6a2 !important;
}
.compare-delta-text.down,
.text-danger,
.rstaff-negative {
    color: #ff8f85 !important;
}
.compare-delta-text.flat,
.rstaff-neutral {
    color: rgba(255,255,255,.72) !important;
}
@media (max-width: 767.98px) {
    .rstaff-context-advisor-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .rstaff-context-advisor-toggle {
        width: 100%;
    }
}


/* ==========================================================================
   UX-пакет: пресеты периода и скелетоны загрузки
   ========================================================================== */

.period-presets {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: .35rem 0 .1rem;
    width: 100%;
}

.period-preset-btn {
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .04);
    color: #cfd6dd;
    border-radius: 999px;
    font-size: .78rem;
    line-height: 1;
    padding: .42rem .75rem;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    white-space: nowrap;
}

.period-preset-btn:hover,
.period-preset-btn:focus {
    background: rgba(0, 128, 0, .22);
    border-color: rgba(0, 160, 0, .55);
    color: #fff;
    outline: none;
}

.rstaff-skeleton {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: .5rem 0 1rem;
}

.skeleton-note {
    color: #8f979f;
    font-size: .92rem;
    margin-bottom: 1rem;
}

.skeleton-box {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, .055);
    border: 1px solid rgba(255, 255, 255, .05);
}

.skeleton-box::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .07), transparent);
    animation: rstaff-shimmer 1.4s infinite;
}

.skeleton-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .9rem;
    margin-bottom: 1rem;
}

.skeleton-card { height: 92px; }
.skeleton-chart { height: 190px; margin-bottom: 1rem; }

.skeleton-table .skeleton-row {
    height: 40px;
    margin-bottom: .5rem;
    border-radius: 8px;
}

.skeleton-table .skeleton-row-head {
    height: 46px;
    background: rgba(255, 255, 255, .085);
}

@media (max-width: 767.98px) {
    .skeleton-cards { grid-template-columns: repeat(2, 1fr); }
    .skeleton-chart { height: 140px; }
}

@keyframes rstaff-shimmer {
    100% { transform: translateX(100%); }
}


/* ==========================================================================
   Мобильный карточный вид таблиц (см. static/js/responsive_tables.js)
   ========================================================================== */

@media (max-width: 767.98px) {
    .rstaff-cards-table,
    .rstaff-cards-table tbody,
    .rstaff-cards-table tbody tr,
    .rstaff-cards-table tbody td {
        box-sizing: border-box;
        max-width: 100%;
    }

    .rstaff-cards-table {
        display: block;
        width: 100%;
        border: 0 !important;
        background: transparent !important;
    }

    .rstaff-cards-table thead,
    .rstaff-cards-table tfoot {
        display: none;
    }

    .rstaff-cards-table tbody {
        display: block;
        width: 100%;
    }

    .rstaff-cards-table tbody tr {
        display: block;
        margin-bottom: .85rem;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, .1);
        background: #1d1f21;
        box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
        overflow: hidden;
    }

    .rstaff-cards-table tbody td {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: .75rem;
        width: 100%;
        padding: .55rem .9rem !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, .06) !important;
        text-align: right;
        background: transparent !important;
        position: static !important; /* отключаем sticky-колонки на мобильном */
    }

    .rstaff-cards-table tbody td:last-child {
        border-bottom: 0 !important;
    }

    .rstaff-cards-table tbody td::before {
        content: attr(data-label);
        flex: 0 1 55%;
        color: #97a0a8;
        font-size: .78rem;
        text-align: left;
    }

    .rstaff-cards-table tbody td[data-label-empty]::before {
        content: '';
    }

    /* Первая ячейка строки — заголовок карточки (обычно название/имя). */
    .rstaff-cards-table tbody td:first-child {
        display: block;
        text-align: left;
        font-weight: 700;
        font-size: .98rem;
        background: rgba(255, 255, 255, .04) !important;
        border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
    }

    .rstaff-cards-table tbody td:first-child::before {
        display: block;
        margin-bottom: .1rem;
        font-weight: 400;
    }

    /* Обёртка прокрутки больше не нужна карточкам. */
    .table-responsive:has(> .rstaff-cards-table) {
        overflow: visible;
        border: 0;
    }

    /* Таблицы, оставшиеся таблицами (rstaff-no-cards, сводные) —
       плавная прокрутка на тач-экранах. */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
    }
}
