/* ===== Securizor CRM — Corporate Theme ===== */

:root {
  --primary:        #1251A3;
  --primary-dark:   #0A3875;
  --primary-light:  #1A6BC4;
  --accent:         #3B8BEB;
  --accent-light:   #EAF2FF;
  --sidebar-bg:     #0A2E5C;
  --sidebar-item:   rgba(255,255,255,0.10);
  --sidebar-hover:  rgba(255,255,255,0.14);
  --sidebar-active: #1A6BC4;
  --sidebar-text:   #FFFFFF;
  --sidebar-muted:  rgba(255,255,255,0.55);
  --bg-body:        #F2F5F9;
  --bg-card:        #FFFFFF;
  --border:         #D6E3F5;
  --border-light:   #ECF3FB;
  --text-main:      #1A2A3A;
  --text-secondary: #5A6E85;
  --text-muted:     #8FA3B8;
  --danger:         #C0392B;
  --danger-light:   #FDECEA;
  --success:        #1E7E34;
  --success-light:  #E6F4EA;
  --warning:        #B7620A;
  --warning-light:  #FEF3E2;
  --info-light:     #EAF2FF;
  --sidebar-width:  230px;
  --topbar-height:  56px;
  --radius:         6px;
  --shadow:         0 1px 4px rgba(10,46,92,0.08), 0 2px 12px rgba(10,46,92,0.04);
  --shadow-md:      0 4px 20px rgba(10,46,92,0.12);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-main);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 18px;
  height: var(--topbar-height);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 14px; font-weight: 700;
  color: var(--sidebar-text);
  letter-spacing: 0.2px;
  white-space: nowrap;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: 10px;
  color: var(--sidebar-muted);
  font-weight: 400;
  letter-spacing: 0.3px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--sidebar-muted);
  padding: 14px 18px 5px;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: background 0.15s;
  white-space: nowrap;
  position: relative;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-item);
  color: #fff;
  font-weight: 600;
  border-left-color: var(--accent);
}

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

/* SVG иконки */
.nav-icon svg {
  width: 16px; height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  vertical-align: middle;
}

.nav-badge {
  margin-left: auto;
  background: #E53935;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 16px;
}

.sidebar-footer {
  padding: 8px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== TOPBAR ===== */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 1px 3px rgba(10,46,92,0.06);
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  flex: 1;
  letter-spacing: 0.1px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-info { line-height: 1.3; }

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.user-dept {
  font-size: 11px;
  color: var(--text-muted);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-logout:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary);
}

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FAFCFF;
}

.card-header h2,
.card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
  flex: 1;
  letter-spacing: 0.1px;
}

.card-body { padding: 20px; }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow 0.15s;
  text-decoration: none;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 20px; height: 20px;
  stroke-width: 1.8;
}

.stat-icon.blue   { background: var(--accent-light); color: var(--primary); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
  white-space: nowrap;
  letter-spacing: 0.1px;
}

.btn svg {
  width: 14px; height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary {
  background: var(--accent-light);
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #D8EAFF; border-color: var(--accent); }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #A93226; color: #fff; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #155724; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover { background: var(--accent-light); }

.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

thead th {
  padding: 10px 14px;
  background: #F4F8FF;
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border-light); transition: background 0.12s; }
tbody tr:hover { background: var(--accent-light); }
tbody tr:last-child { border-bottom: none; }
tbody td { padding: 10px 14px; vertical-align: middle; }

/* ===== BADGES / STATUS ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-new      { background: var(--accent-light); color: var(--primary); border: 1px solid #C2D9F5; }
.badge-progress { background: var(--warning-light); color: var(--warning); border: 1px solid #F5D9A8; }
.badge-done     { background: var(--success-light); color: var(--success); border: 1px solid #B7DFC1; }
.badge-cancel   { background: var(--danger-light);  color: var(--danger);  border: 1px solid #F5C6C3; }
.badge-assigned { background: #F0EBFC; color: #5B2C9E; border: 1px solid #D6C6F5; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1.5px solid #C8D8EC;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--text-main);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  font-family: inherit;
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,139,235,0.12);
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ===== FILTERS BAR ===== */
.filters-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.filters-bar .form-control { max-width: 200px; }
.filters-bar .form-label { display: none; }

/* ===== SEARCH ===== */
.search-box { position: relative; flex: 1; max-width: 300px; }
.search-box input { padding-left: 34px; }
.search-box .search-icon {
  position: absolute;
  left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.search-box .search-icon svg {
  width: 14px; height: 14px;
  stroke: currentColor; stroke-width: 2; fill: none;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.2px;
}

/* ===== DETAIL LAYOUT ===== */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-light);
}
.info-row:last-child { border-bottom: none; }

.info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  min-width: 130px;
  flex-shrink: 0;
  padding-top: 1px;
}

.info-value { font-size: 13.5px; color: var(--text-main); }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 14px; }

.timeline-dot {
  position: absolute;
  left: -17px; top: 5px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-content {
  background: #F8FAFF;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 13px;
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.timeline-type {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  background: var(--accent-light);
  padding: 1px 7px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.timeline-date { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.timeline-text { font-size: 13px; color: var(--text-main); }
.timeline-author { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,46,92,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(10,46,92,0.2);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FAFCFF;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-close {
  background: none; border: none;
  font-size: 18px; color: var(--text-muted);
  cursor: pointer; padding: 2px 6px; border-radius: 4px;
  line-height: 1;
}
.modal-close:hover { background: #f0f4f8; color: var(--text-main); }

.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; justify-content: flex-end;
  background: #FAFCFF;
}

/* ===== ALERTS ===== */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-width: 1px;
  border-style: solid;
}

.alert-danger  { background: var(--danger-light);  border-color: #F5C6C3; color: var(--danger); }
.alert-success { background: var(--success-light); border-color: #B7DFC1; color: var(--success); }
.alert-info    { background: var(--info-light);    border-color: var(--border); color: var(--primary); }
.alert-warning { background: var(--warning-light); border-color: #F5D9A8; color: var(--warning); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* ===== PRIORITY ===== */
.priority-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.priority-low    { background: var(--text-muted); }
.priority-normal { background: var(--accent); }
.priority-high   { background: var(--warning); }
.priority-urgent { background: var(--danger); }

/* ===== FILE UPLOAD ===== */
.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.file-upload-area:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}
.file-upload-area input[type="file"] { display: none; }

/* ===== LOGIN PAGE ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary-light) 100%);
}

.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 64px rgba(10,46,92,0.25);
}

.login-logo { text-align: center; margin-bottom: 28px; }

.login-logo .logo-box {
  width: 52px; height: 52px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 22px; color: #fff; font-weight: 900;
}

.login-logo h1 { font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.login-logo p  { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== DEPT CHIPS ===== */
.dept-chip {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
}
.dept-client_relations { background: var(--accent-light); color: var(--primary); }
.dept-engineering      { background: var(--success-light); color: var(--success); }
.dept-technical        { background: var(--warning-light); color: var(--warning); }
.dept-accounting       { background: #F0EBFC; color: #5B2C9E; }

/* ===== CHECKBOX ITEMS ===== */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 8px; }

.checkbox-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  background: #fff;
  color: var(--text-main);
}
.checkbox-item:has(input:checked) {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--primary);
  font-weight: 600;
}
.checkbox-item input { cursor: pointer; accent-color: var(--primary); }

/* ===== AVITO CHAT ===== */
.chat-bubble-in {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 4px 12px 12px 12px;
}
.chat-bubble-out {
  background: var(--primary);
  color: #fff;
  border-radius: 12px 4px 12px 12px;
}

/* ===== SYNC STATUS ===== */
.sync-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted);
}
.sync-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== RESPONSIVE ===== */

/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  flex-shrink: 0;
  margin-right: 8px;
}
.hamburger-btn:hover { background: var(--bg-hover); }

/* Sidebar overlay — hidden on desktop */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 199;
}
.sidebar-overlay.active { display: block; }

@media (max-width: 1024px) {
  :root { --sidebar-width: 52px; }
  .nav-item span:not(.nav-badge), .nav-section-title, .logo-text, .logo-sub { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .sidebar-logo { justify-content: center; padding: 0; }
  .nav-badge { display: none; }
  .user-info { display: none; }
}

@media (max-width: 768px) {
  /* Layout: sidebar becomes a slide-in overlay */
  :root { --sidebar-width: 0px; }

  .sidebar {
    position: fixed;
    left: -260px;
    top: 0; bottom: 0;
    width: 240px !important;
    z-index: 200;
    transition: left 0.25s ease;
    box-shadow: none;
  }
  .sidebar.sidebar-mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.18);
  }

  /* Show full sidebar labels on mobile when open */
  .sidebar.sidebar-mobile-open .nav-item span:not(.nav-badge),
  .sidebar.sidebar-mobile-open .nav-section-title,
  .sidebar.sidebar-mobile-open .logo-text,
  .sidebar.sidebar-mobile-open .logo-sub { display: block; }
  .sidebar.sidebar-mobile-open .nav-badge { display: inline-flex; }
  .sidebar.sidebar-mobile-open .nav-item { justify-content: flex-start; padding: 10px 16px; }
  .sidebar.sidebar-mobile-open .sidebar-logo { justify-content: flex-start; padding: 0 16px; }

  /* Make all nav-items touch-friendly */
  .nav-item { min-height: 44px; }

  /* Main wrapper takes full width */
  .main-wrapper { margin-left: 0 !important; }

  /* Topbar */
  .hamburger-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 0; }
  .topbar-title { font-size: 15px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .user-badge { gap: 6px; }
  .user-info { display: none; }
  .btn-logout { display: none; }

  /* Page content */
  .page-content { padding: 12px; }

  /* Page header: stack h1 and buttons */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .page-header h1 { font-size: 18px; }
  .page-header > div,
  .page-header > a,
  .page-header > form { align-self: stretch; }
  .page-header > div { display: flex; flex-wrap: wrap; gap: 6px; }

  /* Grids */
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Filters bar */
  .filters-bar {
    flex-wrap: wrap;
    gap: 8px;
  }
  .filters-bar .form-control,
  .filters-bar select { width: 100%; min-width: 0; }

  /* Tables: horizontal scroll */
  .table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 480px; }

  /* Cards */
  .card-body { padding: 14px; }
  .card-header { padding: 12px 14px; }

  /* Buttons full-width in stacked contexts */
  .btn { min-height: 40px; }

  /* Chat / avito bubbles */
  .chat-messages { max-height: 300px; }

  /* Dashboard stats */
  .stat-value { font-size: 24px; }

  /* Info rows */
  .info-row { flex-wrap: wrap; gap: 4px; }
  .info-label { min-width: 0; width: 100%; color: var(--text-muted); font-size: 11px; margin-bottom: 0; }
  .info-value { width: 100%; }

  /* Audit / history tables */
  .table-responsive { overflow-x: auto; }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 16px; }
  table { min-width: 360px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C8D8EC; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border-light); margin: 16px 0; }

/* ===== QUICK ACTION ROW ===== */
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
