@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300..700;1,14..32,300..700&display=swap');

:root {
  --bg-card: #ffffff;

  /* ── Design System 1.0: Brand (olive green) ── */
  --c-brand-500:   #4A6B3C;
  --c-brand-600:   #3D5A32;
  --c-brand-100:   #D4E4CC;
  --c-brand-50:    #EDF4E9;

  /* ── Shell ── */
  --sidebar-bg:    #1E2C1C;
  --sidebar-text:  #C8D8C4;
  --sidebar-hover: rgba(255,255,255,.07);
  --sidebar-active:#4A6B3C;
  --sidebar-w:     240px;
  --topbar-h:      56px;
  --topbar-bg:     #FFFFFF;
  --topbar-border: #E5E7EB;
  --c-bg-base:     #F5F3EF;
  --c-bg-surface:  #FFFFFF;

  /* ── Timing (DS §30) ── */
  --dur-fast:      130ms;
  --dur-base:      200ms;
  --dur-drawer:    280ms;
  --ease-drawer:   cubic-bezier(0.4, 0, 0.2, 1);

  /* ── Legacy (kept for existing components) ── */
  --c-primary:   #4A6B3C;
  --c-primary-d: #3D5A32;
  --c-success:   #16a34a;
  --c-success-d: #15803d;
  --c-warning:   #d97706;
  --c-danger:    #dc2626;
  --c-bg:        #F5F3EF;
  --c-surface:   #ffffff;
  --c-text:      #0f172a;
  --c-muted:        #64748b;
  --c-text-muted:   #64748b;
  --c-border:    #e2e8f0;
  --c-header-bg: #4A6B3C;
  --radius:      12px;
  --radius-sm:   8px;
  --shadow:      0 1px 4px rgba(0,0,0,.10), 0 0 0 1px rgba(0,0,0,.04);
  --transition:  0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--c-bg-base);
  color: var(--c-text);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* ── Shell layout ─────────────────────────────────────────── */
#app.shell-active {
  max-width: none;
  margin: 0;
  flex-direction: row;
  height: 100dvh;     /* bound the shell so body never scrolls */
  overflow: hidden;
}

/* Hide per-screen headers when shell is active */
#app.shell-active .app-header { display: none; }

.app-shell {
  display: contents; /* children participate in #app flex directly */
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 28px; height: 28px;
  background: var(--sidebar-active);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: white; flex-shrink: 0;
}
.sidebar-brand-name { font-size: 14px; font-weight: 600; color: white; }

.sidebar-nav { flex: 1; padding: 6px 0 8px; overflow-y: auto; }

.sidebar-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: rgba(200,216,196,.4);
  padding: 14px 16px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 14px;
  color: var(--sidebar-text);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  line-height: 1.3;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-item:hover  { background: var(--sidebar-hover); }
.sidebar-item.active { background: var(--sidebar-active); color: white; font-weight: 600; }
.sidebar-item-icon   { flex-shrink: 0; opacity: .7; display: flex; align-items: center; }
.sidebar-item.active .sidebar-item-icon { opacity: 1; }

.sidebar-children { }
.sidebar-child {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 42px;
  font-size: 13px;
  color: rgba(200,216,196,.7);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-child:hover  { background: var(--sidebar-hover); color: var(--sidebar-text); }
.sidebar-child.active { color: white; font-weight: 600; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px;
  color: rgba(200,216,196,.55);
  flex-shrink: 0;
  line-height: 1.5;
}
.sidebar-footer-name { font-weight: 600; color: var(--sidebar-text); }

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-drawer) ease;
}

/* ── Main area ───────────────────────────────────────────── */
.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;  /* prevent main-area from triggering body scroll */
}

/* ── Top Bar ─────────────────────────────────────────────── */
.top-bar {
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--topbar-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  gap: 8px;
}
.top-bar-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.top-bar-right { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.top-bar-brand {
  font-size: 15px; font-weight: 700;
  color: var(--c-text); white-space: nowrap; flex-shrink: 0;
}

.breadcrumb {
  display: flex; align-items: center; gap: 2px;
  font-size: 13px; color: var(--c-muted);
  min-width: 0; overflow: hidden;
}
.bc-item  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bc-item.active { color: var(--c-text); font-weight: 500; }
.bc-sep   { color: var(--c-border); display: flex; align-items: center; flex-shrink: 0; }

.btn-topbar {
  width: 36px; height: 36px;
  border: none; border-radius: 8px;
  background: transparent; color: var(--c-muted);
  cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-topbar:hover:not(:disabled) { background: var(--c-bg-base); color: var(--c-text); }
.btn-topbar.stub { opacity: .35; cursor: default; }

.top-bar-user {
  font-size: 13px; font-weight: 600; color: var(--c-text);
  padding: 0 4px; white-space: nowrap;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
}

/* ── Workspace area ──────────────────────────────────────── */
.workspace-area {
  flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}

.workspace-header {
  background: var(--c-bg-base);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.wsh-body {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 16px 24px 14px;
}
.wsh-title { font-size: 20px; font-weight: 700; color: var(--c-text); line-height: 1.2; }
.wsh-date  { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.wsh-sub   { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.wsh-actions { flex-shrink: 0; }

.screen-content {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
/* Existing scroll-area inside screen-content */
.screen-content .scroll-area { padding-bottom: 32px; }
/* Home-screen flex fix */
.screen-content .home-screen { min-height: 0; flex: 1; }

/* ── Mobile (≤ 768px) ────────────────────────────────────── */
@media (max-width: 768px) {
  #app.shell-active { flex-direction: column; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100%; height: 100dvh;
    width: 280px;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform var(--dur-drawer) var(--ease-drawer);
  }
  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: block;
    pointer-events: none;
  }
  .sidebar-overlay.visible {
    opacity: 1; pointer-events: auto;
  }

  .main-area { height: 100dvh; min-height: unset; overflow: hidden; }
  .top-bar { padding: 0 8px 0 4px; padding-top: env(safe-area-inset-top); }
  .top-bar-brand { display: none; }
  .breadcrumb { display: none; }
  .top-bar-title {
    display: block;
    font-size: 16px; font-weight: 600; color: var(--c-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    flex: 1; min-width: 0;
    padding: 0 4px;
  }
  /* One nav button at a time */
  #top-bar:not(.has-back) .btn-topbar-back { display: none; }
  #top-bar.has-back #btn-menu-toggle { display: none; }
  #top-bar.has-back .btn-topbar-back { display: flex; }
  .sidebar-brand { padding-top: calc(18px + env(safe-area-inset-top)); }
  .wsh-body { padding: 12px 16px 10px; }
  .wsh-title { font-size: 17px; }
}

/* ── Desktop (> 768px) ───────────────────────────────────── */
@media (min-width: 769px) {
  #btn-menu-toggle { display: none; }
  .btn-topbar-back { display: none !important; }
  .top-bar-title { display: none !important; }
}

/* ── SPLASH ─────────────────────────────────────────────────── */
.splash {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: var(--c-primary);
  color: white;
}
.splash-icon { font-size: 56px; }
.splash-title { font-size: 22px; font-weight: 700; letter-spacing: -.3px; }

/* ── AUTH SCREENS ─────────────────────────────────────────── */
.auth-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 0 env(safe-area-inset-bottom);
}

.auth-header {
  background: var(--c-primary);
  color: white;
  padding: 48px 24px 40px;
  padding-top: calc(48px + env(safe-area-inset-top));
  text-align: center;
}

.auth-icon { font-size: 48px; margin-bottom: 12px; }
.auth-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.auth-title-brand { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.auth-label { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.9); }
.auth-subtitle { font-size: 15px; opacity: .85; }
.auth-subtitle b { opacity: 1; }
/* Phone input row: +7 prefix + digits */
.phone-input-wrap { display: flex; align-items: center; gap: 0; }
.phone-prefix {
  background: white;
  border: 1.5px solid var(--c-border);
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 0 10px;
  height: 48px;
  line-height: 48px;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
}
.phone-input-wrap .phone-input {
  flex: 1;
  border-radius: 0 10px 10px 0;
}

.auth-form {
  flex: 1;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ── HOME SCREEN ─────────────────────────────────────────── */
.home-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.app-header {
  background: var(--c-header-bg);
  color: white;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-info { flex: 1; min-width: 0; }
.header-name {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.header-role {
  font-size: 13px;
  opacity: .8;
  margin-top: 2px;
}

.scroll-area {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

.section-sublabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin: 12px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--c-border);
}

/* ── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.route-card { display: flex; flex-direction: column; gap: 12px; }

.route-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.route-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
}

.route-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--c-muted);
}

.detail-icon { width: 18px; text-align: center; flex-shrink: 0; }

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge-new       { background: #dbeafe; color: #1e40af; }
.badge-accepted  { background: #dcfce7; color: #15803d; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.badge-other     { background: #f1f5f9; color: #475569; }
.badge-role      { background: rgba(255,255,255,.2); color: white; font-size: 12px; }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  min-height: 52px;
  transition: opacity var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary { background: var(--c-primary); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--c-primary-d); }

.btn-accept    { background: var(--c-success); color: white; }
.btn-accept:hover:not(:disabled) { background: var(--c-success-d); }
.btn-secondary { background: #e2e8f0; color: var(--c-text); }
.btn-secondary:hover:not(:disabled) { background: #cbd5e1; }
.btn-danger    { background: var(--c-danger); color: white; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--c-border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: inherit;
}
.form-input:focus { border-color: var(--c-primary); outline: none; }
.form-input:disabled { opacity: .6; }

.btn-ghost {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-border);
  font-weight: 500;
}

.btn-icon {
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 18px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition);
}
.btn-icon:active { background: rgba(255,255,255,.25); }

.accepted-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-success);
  justify-content: center;
  padding: 6px 0;
}

/* ── INPUTS ──────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 15px 16px;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 16px;
  background: var(--c-surface);
  color: var(--c-text);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}
.input:focus  { border-color: var(--c-primary); }
.input:disabled { background: #f8fafc; color: var(--c-muted); }
.input.otp-input {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 8px;
  padding: 16px;
}

.hint { font-size: 13px; color: var(--c-muted); margin-top: -6px; }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  text-align: center;
}
.empty-icon { font-size: 40px; }
.empty-text { font-size: 15px; color: var(--c-muted); }

/* ── ERROR ───────────────────────────────────────────────── */
.error-msg {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--c-danger);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.4;
}

/* ── SPINNER ─────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.spinner-sm {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  vertical-align: middle;
}
.spinner-dark {
  border-color: rgba(29,78,216,.2);
  border-top-color: var(--c-primary);
}

/* ── SKELETON ────────────────────────────────────────────── */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
  height: 20px;
}
.skeleton-card { height: 120px; }

/* ── BADGE extra ─────────────────────────────────────────── */
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-cancelled { background: #fee2e2; color: #b91c1c; }
.badge-returned  { background: #fce7f3; color: #9d174d; }

/* ── RETURN NOTICE (driver 'Требует исправления') ────────── */
.return-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  margin-top: 10px;
}
.return-icon  { font-size: 20px; flex-shrink: 0; }
.return-body  { display: flex; flex-direction: column; gap: 4px; }
.return-title { font-weight: 600; color: #92400e; }
.return-comment { color: #78350f; font-style: italic; line-height: 1.4; }

/* ── CANCEL BUTTON ───────────────────────────────────────── */
.btn-cancel {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  background: #fee2e2;
  color: #b91c1c;
  transition: background var(--transition);
}
.btn-cancel:active  { background: #fecaca; }
.btn-cancel:disabled { opacity: .6; cursor: not-allowed; }

/* ── REPORT FORM ─────────────────────────────────────────── */
.report-form { display: flex; flex-direction: column; }

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 18px 0 10px;
  border-bottom: 1px solid var(--c-border);
  margin-bottom: 14px;
}
.form-section-title:first-child { padding-top: 4px; }

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-label {
  font-size: 13px;
  color: var(--c-muted);
  font-weight: 500;
}

.input-amount { font-variant-numeric: tabular-nums; }

textarea.input {
  resize: none;
  line-height: 1.5;
  min-height: 88px;
}

/* ── ACCEPTED ROW spacing ────────────────────────────────── */
.btn-submit-report { margin-top: 8px; }

/* ── LOGIST REPORT CARD ──────────────────────────────────── */
.logist-report-card { display: flex; flex-direction: column; gap: 12px; }

/* ── REPORT DETAIL FIELDS ────────────────────────────────── */
.detail-field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}
.detail-field-row:last-child { border-bottom: none; }
.dfl { color: var(--c-muted); flex-shrink: 0; max-width: 45%; }
.dfv { font-weight: 600; text-align: right; word-break: break-word; }
.detail-comment .dfv { text-align: left; font-weight: normal; color: var(--c-text); }

/* ── STAT GRID (manager dashboard) ──────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.stat-card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card--total {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid var(--c-primary);
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-text);
}

.stat-value--total { font-size: 34px; }

.stat-label {
  font-size: 11px;
  color: var(--c-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 4px;
}

.stat-card--warning .stat-value { color: var(--c-warning); }
.stat-card--danger  .stat-value { color: var(--c-danger); }
.stat-card--success .stat-value { color: var(--c-success); }
.stat-card--blue    .stat-value { color: var(--c-primary); }

/* ── REPORT SUCCESS ──────────────────────────────────────── */
.report-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  text-align: center;
  border-top: 4px solid var(--c-success);
}
.success-icon {
  width: 60px; height: 60px;
  background: #dcfce7;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: var(--c-success);
  font-weight: 700;
}
.success-title { font-size: 19px; font-weight: 700; }
.success-sub   { font-size: 14px; color: var(--c-muted); }
.success-id {
  font-size: 13px; font-weight: 600; color: var(--c-primary);
  background: #eff6ff;
  padding: 6px 16px;
  border-radius: 20px;
  margin-top: 4px;
}

/* ── MOBILE-STAB-4: guaranteed report delivery — pending screen ──
   Same layout as .report-success, amber/warning palette instead of
   green (matches the existing .rca-notice--warn tones) — this is a
   "still working on it" state, not a success or a hard error. */
.report-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 20px;
  text-align: center;
  border-top: 4px solid #fcd34d;
}
.pending-icon {
  width: 60px; height: 60px;
  background: #fffbeb;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  color: #92400e;
  font-weight: 700;
}
.pending-title { font-size: 19px; font-weight: 700; color: #92400e; }
.pending-sub   { font-size: 14px; color: var(--c-muted); }

/* ── Day Close (Web-20E) ─────────────────────────────────── */
.dc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 13px;
}
.dc-row-exp { cursor: pointer; }
.dc-row-exp:hover { background: rgba(0,0,0,.02); }
.dc-label { color: var(--c-text); }
.dc-amt   { font-weight: 600; display: flex; align-items: center; gap: 4px; }
.dc-arrow { font-size: 10px; color: var(--c-muted); margin-left: 2px; }
.dc-calc-block { margin-top: 4px; }
.dc-detail {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--c-primary);
}
.dc-detail-header {
  font-size: 11px; font-weight: 700; color: var(--c-primary);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px;
}
.dc-detail-region { margin-bottom: 6px; }
.dc-detail-region-label {
  font-size: 12px; font-weight: 600; color: var(--c-muted);
  margin-bottom: 4px;
}
.dc-detail-item {
  display: flex; justify-content: space-between;
  font-size: 12px; padding: 3px 0;
  border-bottom: 1px solid var(--c-border);
}
.dc-detail-empty { font-size: 12px; color: var(--c-muted); padding: 4px 0; }
.dc-amount-end {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-text);
  letter-spacing: -1px;
}
.dc-chain-gap {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: #9a3412;
}
.card-section-title {
  font-size: 11px; font-weight: 700; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}

/* ── UX-2: Bug fixes ─────────────────────────────────────────── */
.badge-warn { background: #fef3c7; color: #92400e; }
.action-row { display: flex; gap: 8px; margin-bottom: 12px; }
.stat-card--warn .stat-value { color: var(--c-warning); }

/* ── UX-2: Tab bar ───────────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 6px; padding: 8px 12px;
  background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
}
.tab-btn {
  flex: 1; white-space: nowrap; padding: 9px 4px; font-size: 13px; font-weight: 500;
  border-radius: 8px; border: 1.5px solid var(--c-border);
  background: white; cursor: pointer; transition: all .15s;
}
.tab-btn.active { background: var(--c-brand-500); color: white; border-color: var(--c-brand-500); }

/* ── UX-2: Action card ───────────────────────────────────────── */
.action-card {
  display: flex; align-items: center; gap: 16px; padding: 16px;
  border: 1.5px solid var(--c-border); border-radius: 12px;
  background: white; margin-bottom: 10px; cursor: pointer;
  transition: border-color .15s;
}
.action-card:hover         { border-color: var(--c-brand-500); }
.action-card-count         { font-size: 36px; font-weight: 800; color: var(--c-brand-500);
                             min-width: 52px; text-align: center; line-height: 1; }
.action-card-count--ok     { color: var(--c-success); font-size: 26px; }
.action-card-count--big    { font-size: 44px; font-weight: 900; color: var(--c-brand-600); }
.action-card-body          { flex: 1; }
.action-card-label         { font-size: 15px; font-weight: 600; color: var(--c-text); }
.action-card-sub           { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.action-card-chevron       { color: var(--c-muted); font-size: 18px; }

/* ── UX-2: Finance KPI ───────────────────────────────────────── */
.finance-kpi               { text-align: center; padding: 12px 8px; }
.finance-kpi-amount        { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1.15; }
.finance-kpi-label         { font-size: 11px; color: var(--c-muted); text-transform: uppercase;
                             letter-spacing: .6px; margin-top: 5px; }
.finance-kpi--success .finance-kpi-amount { color: var(--c-success); }
.finance-kpi--danger  .finance-kpi-amount { color: var(--c-danger); }
.finance-kpi--muted   .finance-kpi-amount { color: var(--c-muted); }

/* ── UX-2: Warning banner ────────────────────────────────────── */
.warning-card {
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 8px; font-size: 13px;
}
.warning-card strong { color: #92400e; }

/* ── UX-2: KPI grid (4 columns) ─────────────────────────────── */
.stat-grid--4col {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px;
}
.kpi-cell {
  background: var(--c-surface); border-radius: var(--radius); padding: 12px 8px;
  box-shadow: var(--shadow); text-align: center; cursor: pointer;
  transition: border-color .15s; border: 1.5px solid transparent;
}
.kpi-cell:hover              { border-color: var(--c-brand-500); }
.kpi-cell-value              { font-size: 26px; font-weight: 800; line-height: 1; color: var(--c-text); }
.kpi-cell-label              { font-size: 10px; color: var(--c-muted); margin-top: 4px;
                               text-transform: uppercase; letter-spacing: .4px; }
.kpi-cell--success .kpi-cell-value { color: var(--c-success); }
.kpi-cell--danger  .kpi-cell-value { color: var(--c-danger); }
.kpi-cell--warn    .kpi-cell-value { color: var(--c-warning); }

/* ── UX-2: Queue / Return card borders ──────────────────────── */
.queue-card  { border-left: 3px solid var(--c-brand-500); }
.return-card { border-left: 3px solid #f59e0b; }

/* ── UX-2: Day Close summary card ───────────────────────────── */
.dc-summary-card {
  background: white; border-radius: 14px; padding: 20px 16px;
  border: 1.5px solid var(--c-border); margin-bottom: 12px;
}
.dc-summary-divider {
  display: flex; align-items: center; gap: 8px;
  color: var(--c-muted); font-size: 12px; margin: 6px 0;
}
.dc-summary-divider::before,
.dc-summary-divider::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }
.dc-toggle-btn {
  width: 100%; background: none; border: none; color: var(--c-brand-500);
  font-size: 13px; font-weight: 600; padding: 10px 0 2px; cursor: pointer; text-align: center;
}
.dc-status-line {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 14px; font-weight: 600; padding: 10px 0; color: var(--c-text);
}
.dc-status-line--ok     { color: var(--c-success); }
.dc-status-line--warn   { color: var(--c-warning); }
.dc-status-line--muted  { color: var(--c-muted); font-weight: 400; padding-top: 0; }
.dc-updated-at {
  text-align: center; font-size: 11px; color: var(--c-muted); margin-top: 4px;
}

.biz-day-indicator {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; border-radius: 8px;
  padding: 4px 10px; margin: 4px 0 8px;
}
.biz-day-indicator--current { background: rgba(34, 197, 94, .12); color: var(--c-success); }
.biz-day-indicator--past    { background: rgba(148, 163, 184, .18); color: var(--c-muted); }

.dc-closed-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
  font-size: 13px; color: var(--c-success);
}
.dc-history-card { padding: 0; margin-bottom: 8px; overflow: hidden; }
.dc-history-toggle {
  width: 100%; background: none; border: none; text-align: left; cursor: pointer;
  padding: 12px 14px; font-size: 13px; font-weight: 600; color: var(--c-text);
}
.dc-history-table { padding: 0 14px 12px; overflow-x: auto; }
.dc-history-row {
  display: grid; grid-template-columns: 1.1fr 1.3fr 1fr 1fr 1fr 1.1fr;
  gap: 6px; font-size: 11px; padding: 6px 0; border-top: 1px solid var(--c-border);
  min-width: 480px;
}
.dc-history-row--head { color: var(--c-muted); font-weight: 600; border-top: none; }

/* ── UX-2: Manager header info ───────────────────────────────── */
.manager-header-info { padding: 4px 0; }
.manager-header-name { font-size: 17px; font-weight: 700; color: var(--c-text); }
.manager-header-role { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.manager-header-date { font-size: 12px; color: var(--c-muted); margin-top: 2px; }

/* ── UX-2: Empty subtext ─────────────────────────────────────── */
.empty-subtext { font-size: 12px; color: var(--c-muted); }

/* ── FEATURE: Глобальный индикатор операционного дня (top-bar) ── */
.global-biz-day { position: relative; display: flex; align-items: center; margin-right: 4px; }
.gbd-badge {
  display: flex; align-items: center; gap: 5px;
  background: rgba(34, 197, 94, .10); border-radius: 8px;
  padding: 4px 9px; font-size: 11px; line-height: 1.25; color: var(--c-text);
  white-space: nowrap;
}
.gbd-dot { font-size: 10px; }
.gbd-text--full { display: none; }
.gbd-text--compact { display: inline; }
@media (min-width: 769px) {
  .gbd-text--full { display: inline; text-align: left; }
  .gbd-text--compact { display: none; }
}
.gbd-warn {
  position: absolute; top: 100%; right: 0; margin-top: 4px; z-index: 50;
  background: rgba(234, 179, 8, .16); border: 1px solid rgba(234, 179, 8, .45);
  color: #92400e; border-radius: 8px; padding: 6px 10px;
  font-size: 11px; line-height: 1.4; white-space: nowrap;
}
@media (max-width: 480px) {
  .gbd-badge { padding: 3px 7px; font-size: 10px; }
  .gbd-warn { white-space: normal; max-width: 220px; right: -8px; }
}

/* ── UX-2 R3: Top-bar role line ──────────────────────────────── */
.top-bar-user-block { display: flex; flex-direction: column; align-items: flex-end; }
.top-bar-role {
  font-size: 11px; color: var(--c-muted); white-space: nowrap;
  line-height: 1.2; margin-top: 1px;
}

/* ── UX-2 R3: Workspace search + filter bar ─────────────────── */
.wsh-search-section {
  padding: 8px 16px 10px;
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.ws-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--c-bg-base);
  border: 1.5px solid var(--c-border);
  border-radius: 10px;
  padding: 0 12px;
  height: 38px;
  transition: border-color var(--dur-fast) ease;
}
.ws-search-wrap:focus-within { border-color: var(--c-primary); }
.ws-search-icon { color: var(--c-muted); display: flex; align-items: center; flex-shrink: 0; }
.ws-search-input {
  flex: 1; border: none; background: transparent;
  font-size: 14px; color: var(--c-text); outline: none;
  font-family: inherit;
}
.ws-search-input::placeholder { color: var(--c-muted); }
.ws-filter-bar {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.ws-filter-bar::-webkit-scrollbar { display: none; }
.ws-filter-chip {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-muted);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--dur-fast) ease;
  -webkit-tap-highlight-color: transparent;
}
.ws-filter-chip:hover:not(.active) { border-color: var(--c-primary); color: var(--c-primary); }
.ws-filter-chip.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: white;
  font-weight: 600;
}

/* ── Mobile UI Polish v1 ─────────────────────────────────────── */

/* Compact toggle buttons (Приход / Расход) */
.btn-sm {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
}

/* date input: prevent iOS Safari overflow + enforce 100% width */
input[type="date"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Forms: prevent any input from escaping its container */
.form-input,
select.form-input,
textarea.form-input {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Prevent horizontal scroll in scroll-area on narrow screens */
.scroll-area {
  overflow-x: hidden;
}

/* Sidebar child active state — add subtle bg so it reads clearly */
.sidebar-child.active {
  background: rgba(255,255,255,.06);
  color: var(--c-brand-100);
}

/* ── Narrow mobile (≤ 480px) ─────────────────────────────────── */
@media (max-width: 480px) {
  /* Hide user name + role from top bar — info already in sidebar footer */
  .top-bar-user-block { display: none; }

  /* Hide stub/placeholder buttons (search, notifications) */
  .btn-topbar.stub { display: none; }

  /* Tighten top-bar padding — safe-area-inset-top must be re-declared after shorthand resets it */
  .top-bar { padding: 0 8px 0 10px; padding-top: env(safe-area-inset-top); gap: 4px; }

  /* Scroll area: slightly tighter padding on very small phones */
  .scroll-area { padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); }

  /* Workspace header: compact */
  .wsh-body { padding: 10px 12px 8px; }
  .wsh-title { font-size: 16px; }

  /* Cards: reduce horizontal padding so content has room */
  .card { padding: 12px; }

  /* Stat grid: reduce gap */
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px 10px; }
  .stat-value { font-size: 24px; }
  .stat-value--total { font-size: 28px; }

  /* Buttons: standard height, no squeeze */
  .btn { min-height: 48px; padding: 13px; }
  .btn-sm { min-height: 34px; padding: 6px 12px; }
}

/* ── UX-3: Universal List ──────────────────────────────────── */
.universal-list { display: block; }
.ulist-thead    { display: none; }
.ulist-row {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ulist-td {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
  padding: 3px 0;
  gap: 8px;
}
.ulist-td::before {
  content: attr(data-label);
  color: var(--c-muted);
  font-size: 12px;
  flex-shrink: 0;
  min-width: 80px;
}
.ulist-row-icon  { font-size: 16px; margin-right: 6px; }
.ulist-row-badge { font-size: 11px; font-weight: 600; color: var(--c-muted); }

/* Row state modifiers */
.ulist-row--clickable { cursor: pointer; }
.ulist-row--clickable:hover .ulist-td { background: transparent; }
.ulist-row--clickable:hover { background: var(--c-bg-base); }
.ulist-row--warning { border-left: 3px solid var(--c-warning, #f59e0b); }
.ulist-row--danger  { border-left: 3px solid var(--c-danger, #ef4444); }

/* Density modifiers */
.universal-list--low  .ulist-row { padding: 16px 14px; }
.universal-list--high .ulist-row { padding: 8px 12px; }

/* Desktop: adaptive table layout */
@media (min-width: 768px) {
  .universal-list       { display: table; border-collapse: collapse; width: 100%; }
  .ulist-thead          { display: table-row; background: var(--c-bg-base); }
  .ulist-th {
    display: table-cell;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--c-muted);
    padding: 8px 12px;
    border-bottom: 2px solid var(--c-border);
    font-weight: 600;
  }
  .ulist-row            { display: table-row; background: var(--bg-card); }
  .ulist-row:hover      { background: var(--c-bg-base); }
  .ulist-td {
    display: table-cell;
    padding: 10px 12px;
    border-bottom: 1px solid var(--c-border);
    vertical-align: middle;
  }
  .ulist-td::before     { display: none; }
  .ulist-row-icon       { display: table-cell; padding: 10px 6px 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
  .ulist-row-badge      { display: table-cell; padding: 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
  .universal-list--high .ulist-td { padding: 7px 10px; font-size: 12px; }
  .ulist-row--warning   { border-left: 3px solid var(--c-warning, #f59e0b); }
  .ulist-row--danger    { border-left: 3px solid var(--c-danger, #ef4444); }
}

/* ── ROUTE CARD V2 (rc2) ──────────────────────────────── */
.rc2 { gap: 0; padding: 14px; }

.rc2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.rc2-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  flex: 1;
  color: var(--c-text);
}

.rc2-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.rci-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--c-muted);
}

.rci-icon { width: 16px; text-align: center; flex-shrink: 0; }

.rci-row--emphasis {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.rca { display: flex; flex-direction: column; gap: 6px; }

.rca-btn-primary {
  width: 100%;
  min-height: 44px;
  font-size: 15px;
  font-weight: 600;
}

.rca-btn--orange {
  background: #ea580c;
  border-color: #ea580c;
  color: white;
}
.rca-btn--orange:hover:not(:disabled) { background: #c2410c; border-color: #c2410c; }

.rca-status-ok {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-success);
  padding: 4px 0;
}

.rca-passive {
  font-size: 13px;
  color: var(--c-muted);
  padding: 4px 0;
}

.rca-passive--done { color: var(--c-success); }

.rca-notice {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  line-height: 1.4;
}

.rca-notice--warn {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.rca-notice--ok {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  font-weight: 600;
}

.rca-cash {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--c-muted);
  padding: 4px 0;
}

.rca-cash-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
}

.rca-decline-form { display: flex; flex-direction: column; gap: 6px; }

.rca-decline-btns { display: flex; gap: 8px; }

.btn-link-danger {
  background: none;
  border: none;
  color: var(--c-danger);
  font-size: 13px;
  padding: 6px 0;
  cursor: pointer;
  width: 100%;
  text-align: center;
  font-family: inherit;
  display: block;
}
.btn-link-danger:hover { text-decoration: underline; }

.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-purple { background: #ede9fe; color: #5b21b6; }

/* ── ROUTE READINESS CARD (rr) ────────────────────────────── */
.rr-card { padding: 14px; }

.rr-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.rr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.rr-date {
  font-size: 12px;
  color: var(--c-muted);
  white-space: nowrap;
}

.rr-empty {
  font-size: 13px;
  color: var(--c-muted);
  padding: 4px 0;
}

.rr-all-ok {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-success);
}

.rr-card--ok { border-left: 3px solid var(--c-success); }

.rr-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rr-stat {
  flex: 1 1 56px;
  min-width: 56px;
  border-radius: 8px;
  padding: 8px 10px;
  text-align: center;
}

.rr-stat-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.rr-stat-lbl {
  font-size: 11px;
  margin-top: 2px;
  font-weight: 500;
}

.rr-stat--neutral { background: var(--c-bg-base); color: var(--c-text); }
.rr-stat--green   { background: #dcfce7; color: #15803d; }
.rr-stat--yellow  { background: #fef9c3; color: #854d0e; }
.rr-stat--red     { background: #fee2e2; color: #b91c1c; }

.rr-other {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-muted);
}

/* ── ACCOUNTABLE CASHBOXES (Web-21A) ──────────────────────── */

.acb-date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.acb-date-input {
  flex: 1;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: var(--c-bg-card);
  color: var(--c-text);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.acb-date-input:focus { outline: none; border-color: var(--c-primary); }

/* ── BUGFIX: История маршрутов — заметная панель выбора даты ─── */
.route-history-date-panel {
  padding: 14px; margin-bottom: 14px;
  border: 1px solid var(--c-border);
}
.route-history-date-title {
  font-size: 13px; font-weight: 700; color: var(--c-text);
  margin-bottom: 8px;
}
.route-history-date-input {
  display: block; width: 100%; height: 48px;
  padding: 0 14px; margin-bottom: 10px;
  border: 2px solid var(--c-primary); border-radius: 10px;
  background: var(--c-bg-card); color: var(--c-text);
  font-size: 16px; font-family: inherit; font-weight: 600;
  cursor: pointer;
}
.route-history-date-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(74, 107, 60, .18); }
.route-history-date-actions {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.route-history-date-actions .btn { flex: 1; min-width: 110px; height: 42px; font-size: 13px; }
.route-history-date-actions #btn-rh-show { flex-basis: 100%; }
.route-history-current-date-label {
  font-size: 13px; font-weight: 600; color: var(--c-primary);
  text-align: center; padding-top: 4px; border-top: 1px dashed var(--c-border);
}
@media (max-width: 480px) {
  .route-history-date-actions { flex-direction: column; }
  .route-history-date-actions .btn { width: 100%; }
}

/* ── Возвраты: рабочий экран — группировка карточек по дате маршрута ── */
.returns-date-group { margin-bottom: 18px; }
.returns-date-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px;
}
.returns-date-big {
  font-size: 20px; font-weight: 700; color: var(--c-text);
}
.returns-date-group--old .returns-date-big { color: #92400e; }
.returns-old-badge {
  font-size: 11px; font-weight: 700; color: #92400e;
  background: rgba(234, 179, 8, .16); border: 1px solid rgba(234, 179, 8, .45);
  border-radius: 8px; padding: 3px 8px; white-space: nowrap;
}
.returns-date-divider {
  height: 2px; background: var(--c-border); margin-bottom: 10px;
}
.returns-date-group--old .returns-date-divider { background: rgba(234, 179, 8, .45); }

.acb-nav-btn {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 14px;
  cursor: pointer;
  color: var(--c-text);
  white-space: nowrap;
}

.acb-date-label {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.acb-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.acb-filter-btn {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 13px;
  cursor: pointer;
  color: var(--c-muted);
  transition: background .15s, color .15s;
}

.acb-filter-btn.active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
}

.acb-empty {
  text-align: center;
  color: var(--c-muted);
  font-size: 14px;
  padding: 32px 0;
}

/* ── List cards ── */

.acb-card {
  cursor: pointer;
  padding: 14px 16px;
  margin-bottom: 10px;
}

.acb-card:active { opacity: .85; }

.acb-card-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--c-text);
}

.acb-region {
  font-size: 12px;
  font-weight: 400;
  color: var(--c-muted);
  margin-left: 6px;
}

.acb-card-balance {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--c-text);
}

.acb-balance--negative { color: var(--c-danger); }

.acb-status {
  font-size: 13px;
  font-weight: 500;
}

.acb-status--open      { color: var(--c-success); }
.acb-status--closed    { color: var(--c-muted); }
.acb-status--reopened  { color: #b45309; }
.acb-status--corrected { color: #7c3aed; }

.acb-corrected-tag {
  font-size: 12px;
  color: #7c3aed;
  margin-left: 4px;
}

/* ── Detail ── */

.acb-back-row {
  margin-bottom: 12px;
}

.acb-detail-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
}

.acb-detail-date {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 14px;
}

.acb-balance-block {
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.acb-bal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 0;
}

.acb-bal-lbl {
  font-size: 13px;
  color: var(--c-muted);
}

.acb-bal-val {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.acb-bal-val--income  { color: var(--c-success); }
.acb-bal-val--expense { color: var(--c-danger); }
.acb-bal-val--total   { font-size: 18px; font-weight: 700; }

.acb-bal-sep {
  height: 1px;
  background: var(--c-border);
  margin: 6px 0;
}

/* ── Status block ── */

.acb-status-block {
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
}

.acb-status-block.acb-status--open      { background: #dcfce7; color: #15803d; }
.acb-status-block.acb-status--closed    { background: #f1f5f9; color: #475569; }
.acb-status-block.acb-status--reopened  { background: #fef9c3; color: #b45309; }
.acb-status-block.acb-status--corrected { background: #ede9fe; color: #5b21b6; }

.acb-status-detail {
  font-size: 12px;
  font-weight: 400;
  margin-top: 3px;
}

.acb-status-detail--muted { color: inherit; opacity: .65; }

/* ── Operations ── */

.acb-ops-empty {
  text-align: center;
  color: var(--c-muted);
  font-size: 13px;
  padding: 24px 0;
}

.acb-op-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--c-border);
}

.acb-op-row--cancelled { opacity: .5; }

.acb-op-time {
  font-size: 12px;
  color: var(--c-muted);
  min-width: 36px;
  padding-top: 2px;
}

.acb-op-body {
  flex: 1;
  min-width: 0;
}

.acb-op-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
}

.acb-op-persons {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}

.acb-op-comment {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
  font-style: italic;
}

.acb-op-cancelled-badge {
  display: inline-block;
  font-size: 11px;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 4px;
  padding: 1px 6px;
  margin-top: 3px;
}

.acb-op-amount {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  padding-top: 2px;
}

.acb-op-amount--income   { color: var(--c-success); }
.acb-op-amount--expense  { color: var(--c-danger); }
.acb-op-amount--cancelled { text-decoration: line-through; opacity: .6; }

/* ── Owner card ── */

.acb-owner-card {
  border-left: 3px solid var(--c-primary);
  padding-left: 13px;
}

.acb-owner-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-primary);
  margin-bottom: 4px;
}

.acb-no-data {
  font-size: 13px;
  font-weight: 400;
  color: var(--c-muted);
  font-style: italic;
}

/* ── Ops toggle ── */

.acb-ops-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 12px 0;
  background: none;
  border: none;
  border-top: 1px solid var(--c-border);
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-primary);
  cursor: pointer;
  text-align: left;
}

.acb-ops-list {
  padding-bottom: 8px;
}

/* ── Regional block ── */

.acb-regional-block {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--c-bg-card);
  border: 1px solid var(--c-border);
  border-radius: 10px;
}

.acb-regional-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 6px;
}

.acb-regional-note {
  font-size: 13px;
  color: var(--c-muted);
}

.acb-region-cards { display: flex; flex-direction: column; gap: 8px; }
.acb-region-card {
  border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px;
  background: var(--c-bg);
}
.acb-region-card--total {
  margin-top: 4px; border-color: var(--c-primary); background: rgba(74, 107, 60, .06);
}
.acb-region-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.acb-region-row {
  display: flex; justify-content: space-between; font-size: 12px;
  padding: 2px 0; color: var(--c-text);
}
.acb-region-row span:first-child { color: var(--c-muted); }
.acb-region-row--total {
  border-top: 1px dashed var(--c-border); margin-top: 4px; padding-top: 6px;
  font-weight: 700;
}
.acb-region-row--total span:first-child { color: var(--c-text); }

/* Placeholder to avoid accidental rule truncation */

/* ── WEB-21A: Деньги на водителях ───────────────────────────── */
.dm-header {
  background: var(--c-surface);
  border-radius: 12px;
  margin: 12px 12px 0;
  padding: 16px;
  text-align: center;
  border: 1px solid var(--c-border);
}
.dm-header-label {
  font-size: 13px;
  color: var(--c-muted);
  margin-bottom: 4px;
}
.dm-header-total {
  font-size: 26px;
  font-weight: 700;
  color: var(--c-text);
}
.dm-header-date {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}

.dm-region {
  margin: 16px 12px 0;
}
.dm-region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 2px;
  margin-bottom: 6px;
}
.dm-region-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.dm-region-total {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-text);
}

.dm-drivers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dm-driver-card {
  background: var(--c-surface);
  border-radius: 10px;
  border: 1px solid var(--c-border);
  overflow: hidden;
}
.dm-driver-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  gap: 8px;
}
.dm-driver-header:active { background: var(--c-bg); }
.dm-driver-info { flex: 1; min-width: 0; }
.dm-driver-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}
.dm-driver-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}
.dm-driver-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.dm-driver-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}

.dm-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.dm-badge--danger {
  background: #fee2e2;
  color: #b91c1c;
}
.dm-badge--warn {
  background: #fef3c7;
  color: #92400e;
}

.dm-items-list {
  border-top: 1px solid var(--c-border);
  padding: 4px 0;
}
.dm-item-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 8px;
}
.dm-item-row + .dm-item-row {
  border-top: 1px solid var(--c-border);
}
.dm-item-body { flex: 1; min-width: 0; }
.dm-item-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-item-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}
.dm-item-comment {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
  font-style: italic;
}
.dm-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.dm-item-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}

.dm-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.dm-receipts-block {
  margin: 20px 12px 0;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  background: var(--c-card, #fff);
  overflow: hidden;
}
.dm-receipts-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
}
.dm-receipts-total {
  font-weight: 700;
  color: var(--c-text);
}
.dm-receipts-list { padding: 4px 0; }
.dm-receipt-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 8px;
}
.dm-receipt-row + .dm-receipt-row {
  border-top: 1px solid var(--c-border);
}
.dm-receipt-main { flex: 1; min-width: 0; }
.dm-receipt-persons {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text);
}
.dm-receipt-meta {
  font-size: 12px;
  color: var(--c-muted);
  margin-top: 2px;
}
.dm-receipt-note {
  display: inline-block;
  font-size: 11px;
  margin-top: 4px;
  padding: 2px 7px;
  border-radius: 5px;
}
.dm-receipt-note--owner {
  background: #f1f5f9;
  color: #475569;
}
.dm-receipt-note--acb {
  background: #dbeafe;
  color: #1d4ed8;
}
.dm-receipt-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.dm-receipt-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
}

.dm-receipts-summary {
  padding: 4px 14px 10px;
  border-bottom: 1px solid var(--c-border);
}
.dm-receipt-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  gap: 8px;
}
.dm-receipt-summary-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dm-receipt-summary-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dm-receipt-summary-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── ACB Owner Cash Person card ──────────────────────────── */
.acb-owner-cash-person-card { border-left: 3px solid #8b5cf6; }
.acb-owner-badge--person { color: #8b5cf6; }

/* ── ACB Cashbox Close Modal ──────────────────────────────── */
.acb-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); z-index: 400;
}
.acb-modal-dialog {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--c-bg); border-radius: 16px 16px 0 0;
  padding: 24px 20px 32px; z-index: 401;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}
.acb-modal-title {
  font-size: 18px; font-weight: 700;
  margin-bottom: 4px;
}
.acb-modal-subtitle {
  font-size: 13px; color: var(--c-text-muted);
  margin-bottom: 16px;
}
.acb-modal-summary {
  background: var(--c-bg-2); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 16px;
}
.acb-modal-sum-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; font-size: 14px;
}
.acb-modal-sum-row--total {
  font-weight: 700;
  border-top: 1px solid var(--c-border);
  margin-top: 6px; padding-top: 8px;
}
.acb-modal-comment {
  width: 100%; min-height: 56px;
  border: 1px solid var(--c-border); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  resize: vertical; margin-bottom: 16px;
  box-sizing: border-box; background: var(--c-bg);
  color: var(--c-text);
}
.acb-modal-comment:focus { outline: none; border-color: var(--c-primary); }
.acb-modal-actions { display: flex; gap: 10px; }
.acb-modal-actions .btn { flex: 1; }
.acb-close-btn { width: 100%; margin-top: 12px; }

/* ── ACB Toast ───────────────────────────────────────────── */
.acb-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #1a1a2e; color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 14px; z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  white-space: nowrap;
}
.acb-toast--visible { opacity: 1; }

/* WEB-22B: Mobile back button (icon-only, CSS class controls visibility) */
.btn-topbar-back {
  display: none; /* base hidden; shown by has-back + mobile @media */
  align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--c-primary);
  width: 36px; height: 36px;
  padding: 0; cursor: pointer;
  border-radius: 8px; flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.btn-topbar-back:active { opacity: 0.6; }

/* Mobile screen title (hidden on desktop) */
.top-bar-title { display: none; }

/* WEB-22B: Interactive swipe-back animation */
.workspace-area.is-swiping {
  user-select: none;
  will-change: transform, opacity;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  pointer-events: none;
}

/* WEB-21D: Reopen / AddMissing / Reclose */
.acb-reopen-btn { color: var(--c-primary); }
.btn-warning {
  background: #e67e22; color: #fff; border: none;
  border-radius: 8px; padding: 10px 20px; cursor: pointer; font-size: 15px;
}
.btn-warning:disabled { opacity: .5; cursor: not-allowed; }
.acb-reopened-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.acb-modal-label { display: block; font-size: 13px; color: var(--c-muted); margin: 10px 0 4px; }
.acb-modal-select { width: 100%; padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 14px; background: var(--c-bg); color: var(--c-text); }
.acb-modal-input { width: 100%; padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 14px; background: var(--c-bg); color: var(--c-text); box-sizing: border-box; }
.acb-modal-static { font-size: 14px; color: var(--c-text); margin: 8px 0; }
.acb-modal-textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 14px; background: var(--c-bg); color: var(--c-text); resize: vertical; box-sizing: border-box; }
.acb-modal-error { color: #e74c3c; font-size: 13px; margin-top: 8px; }

/* WEB-21D: History block */
.acb-history-block { margin-top: 16px; padding: 12px; background: var(--c-surface); border-radius: 12px; border: 1px solid var(--c-border); }
.acb-history-title { font-size: 13px; font-weight: 600; color: var(--c-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .4px; }
.acb-history-item { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; background: var(--c-bg); }
.acb-history-item--reopen { border-left: 3px solid #e67e22; }
.acb-history-item--correction { border-left: 3px solid #3498db; }
.acb-history-item--reclose { border-left: 3px solid var(--c-danger, #e74c3c); }
.acb-history-ver { font-size: 12px; font-weight: 600; color: var(--c-muted); margin-bottom: 4px; }
.acb-history-row { font-size: 13px; color: var(--c-text); margin: 2px 0; }
.acb-history-muted { font-size: 12px; color: var(--c-muted); }

/* WEB-21D: Correction badge on operation rows */
.acb-op-row--correction { background: rgba(52,152,219,.06); border-radius: 6px; }
.acb-correction-badge { display: inline-block; font-size: 11px; color: #2980b9; background: rgba(52,152,219,.12); border-radius: 4px; padding: 1px 6px; margin-top: 3px; }

/* WEB-22B: Initial balance block */
.acb-init-bal-block { margin-bottom: 12px; padding: 12px 14px; background: var(--c-surface); border-radius: 12px; border: 1px solid var(--c-border); }
.acb-init-bal-block--set { border-color: #27ae60; background: rgba(39,174,96,.06); }
.acb-init-bal-block--pending { border-color: #d97706; background: rgba(217,119,6,.06); }
.acb-init-bal-block--rejected { border-color: #dc2626; background: rgba(220,38,38,.06); }

/* Web-20E frontend: заявки на начальный остаток */
.acb-ib-requests-block { margin-bottom: 16px; }
.acb-ib-requests-title { font-size: 13px; font-weight: 600; color: #d97706; margin-bottom: 8px; }
.acb-ib-req-card { border: 1px solid #d97706; background: rgba(217,119,6,.05); margin-bottom: 10px; padding: 12px 14px; border-radius: 12px; }
.acb-ib-req-name { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.acb-ib-req-amount { font-size: 16px; font-weight: 600; color: var(--c-text); }
.acb-ib-req-date, .acb-ib-req-created { font-size: 12px; color: var(--c-muted); }
.acb-ib-req-comment { font-size: 13px; color: var(--c-text); margin-top: 4px; }
.acb-ib-req-actions { display: flex; gap: 8px; margin-top: 10px; }
.acb-ib-req-actions .btn { flex: 1; }
.acb-ib-reject-input { width: 100%; margin-top: 6px; padding: 8px; border-radius: 8px; border: 1px solid var(--c-border); font-family: inherit; font-size: 13px; resize: vertical; }
.acb-init-bal-label { font-size: 12px; color: var(--c-muted); margin-bottom: 4px; }
.acb-init-bal-amount { font-size: 15px; font-weight: 600; color: var(--c-text); }
.acb-init-bal-comment { font-size: 12px; color: var(--c-muted); margin-top: 4px; }
.acb-init-bal-set-btn { margin-top: 8px; padding: 6px 14px; font-size: 13px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-bg); color: var(--c-accent); cursor: pointer; }
.acb-init-bal-set-btn:active { opacity: .7; }

/* BUGFIX UX: Day close → initial balance navigation */
.dc-init-bal-link { display: block; margin-top: 10px; padding: 7px 14px; font-size: 13px; font-weight: 500; color: var(--c-accent); background: rgba(var(--c-accent-rgb, 52,120,246),.08); border: 1px solid rgba(var(--c-accent-rgb, 52,120,246),.25); border-radius: 8px; cursor: pointer; width: 100%; text-align: center; }
.dc-init-bal-link:active { opacity: .7; }

/* ── WEB-23A: Bell badge ──────────────────────────────────────── */
.btn-bell { position: relative; }
.bell-badge {
  position: absolute; top: 4px; right: 2px;
  min-width: 16px; height: 16px;
  background: var(--c-danger, #e53e3e);
  color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 9px; padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; line-height: 1;
}
.bell-badge.hidden { display: none; }

/* ── WEB-23A: Notification panel ─────────────────────────────── */
.notif-overlay {
  display: none; position: fixed; inset: 0; z-index: 250;
  background: rgba(0,0,0,.35);
}
.notif-overlay.visible { display: block; }

.notif-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 320px; max-width: 100vw; z-index: 260;
  background: var(--c-surface, #fff);
  box-shadow: -4px 0 24px rgba(0,0,0,.14);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 260ms cubic-bezier(0.22,1,0.36,1);
}
.notif-panel.open { transform: translateX(0); }

@media (max-width: 768px) { .notif-panel { width: 100vw; } }

.notif-panel-header {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid var(--c-border, #e8e8e8);
  flex-shrink: 0;
}
.notif-panel-title { font-weight: 600; font-size: 15px; flex: 1; }
.btn-link-sm {
  font-size: 12px; color: var(--c-primary, #3182ce);
  background: none; border: none; cursor: pointer; padding: 4px 6px;
  border-radius: 4px; white-space: nowrap;
}
.btn-link-sm:hover { background: var(--c-hover, #f0f0f0); }
.btn-icon-sm {
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: none; font-size: 18px; line-height: 1;
  cursor: pointer; color: var(--c-muted, #888);
  display: flex; align-items: center; justify-content: center;
}
.btn-icon-sm:hover { background: var(--c-hover, #f0f0f0); }

.notif-list { flex: 1; overflow-y: auto; }
.notif-empty {
  padding: 40px 16px; text-align: center;
  color: var(--c-muted, #888); font-size: 14px;
}
.notif-item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--c-border, #e8e8e8);
  cursor: pointer; transition: background .12s;
}
.notif-item:hover         { background: var(--c-hover, #f5f5f5); }
.notif-item.notif-unread  { background: #ebf5ff; }
.notif-item.notif-unread:hover { background: #daeeff; }

.notif-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.notif-icon--info    { background: #e8f4fd; color: #3182ce; }
.notif-icon--success { background: #e8f8ef; color: #2f855a; }
.notif-icon--warning { background: #fff8e1; color: #c05621; }
.notif-icon--danger  { background: #fff5f5; color: #c53030; }

.notif-body    { flex: 1; min-width: 0; }
.notif-title   { font-weight: 600; font-size: 13px; margin-bottom: 2px;
                 color: var(--c-text, #1a202c); }
.notif-message { font-size: 12px; color: var(--c-muted, #555);
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time    { font-size: 11px; color: var(--c-muted, #888); margin-top: 4px; }

/* ── Report photo gallery (Web-24/24B) — компактные карточки-превью ── */
.photo-gallery-block { margin-bottom: 12px; }
.photo-gallery-block:last-child { margin-bottom: 0; }
.photo-gallery-title {
  font-size: 12px; font-weight: 600; color: var(--c-muted);
  margin-bottom: 6px;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 6px;
}
.photo-card {
  display: block; position: relative;
  width: 100%; aspect-ratio: 1 / 1;
  border: 1px solid var(--c-border); border-radius: 8px;
  overflow: hidden; background: var(--c-bg-surface, #fff);
  text-decoration: none;
}
.photo-card img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.photo-card--pdf {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: var(--c-bg, #F5F3EF);
}
.photo-card-icon { font-size: 22px; line-height: 1; }
.photo-card-label { font-size: 10px; color: var(--c-primary); font-weight: 600; }

/* ── WEB-ROUTE-HISTORY ────────────────────────────────────── */
.rh-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.rh-card { cursor: pointer; }
.rh-card:active { opacity: .85; }
.rh-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.rh-card-driver { font-size: 15px; font-weight: 600; color: var(--c-text); }
.rh-card-meta { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.rh-card-amount { font-size: 15px; font-weight: 700; color: var(--c-text); white-space: nowrap; }
.rh-card-status { font-size: 12px; color: var(--c-muted); margin-top: 6px; }
.rh-card-fin {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-border);
}
.rh-card-fin-item {
  display: flex; justify-content: space-between; font-size: 13px; gap: 6px;
}
.rh-card-fin-item span:first-child { color: var(--c-muted); }
.rh-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rh-badge {
  display: inline-block; font-size: 11px; font-weight: 500;
  border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
.rh-badge--ok    { background: #dcfce7; color: #166534; }
.rh-badge--warn  { background: #fef3c7; color: #92400e; }
.rh-badge--info  { background: #dbeafe; color: #1d4ed8; }

.rh-change-row { padding: 10px 0; }
.rh-change-row + .rh-change-row { border-top: 1px solid var(--c-border); }
.rh-change-label { font-size: 13px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.rh-change-vals { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.rh-change-tag {
  display: inline-block; font-size: 11px; font-weight: 500;
  background: var(--c-bg-2, #f1f5f9); color: var(--c-muted);
  border-radius: 5px; padding: 1px 6px; margin-right: 6px;
}
.rh-change-tag--rev { background: #fef3c7; color: #92400e; }

.da-card { cursor: pointer; }
.da-card:active { opacity: 0.8; }
.da-card-fio { font-size: 15px; font-weight: 600; margin-bottom: 8px; }

.da-item { padding: 12px 0; border-top: 1px solid var(--c-border); }
.da-item:first-child { border-top: none; }
.da-item--cancelled { opacity: 0.55; }
.da-item-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.da-item-type { font-size: 13px; font-weight: 600; }
.da-item-amount { font-size: 15px; font-weight: 700; color: var(--c-primary); }
