/* CSS Variables для темной/светлой темы */
:root {
  --bg-body: #f3f4f6;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-table: #ffffff;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --shadow: rgba(0, 0, 0, 0.05);
  --btn-primary-bg: #2563eb;
  --btn-primary-hover: #1d4ed8;
  --btn-secondary-bg: #6b7280;
  --btn-secondary-hover: #4b5563;
  --btn-success-bg: #22c55e;
  --btn-danger-bg: #ef4444;
  --badge-bg: #6b7280;
  --progress-bg: rgba(108, 117, 125, 0.15);
  --progress-used: linear-gradient(90deg, #22c55e, #16a34a);
  --progress-remaining: rgba(148, 163, 184, 0.7);
  --row-expired: rgba(255, 193, 7, 0.15);
  --row-has-receipt: rgba(25, 135, 84, 0.12);
  --row-complete: rgba(34, 197, 94, 0.14);
  --card-shadow: rgba(0, 0, 0, 0.08);
  --card-border: #e5e7eb;
  --avatar-default: #94a3b8;
  --avatar-text: #ffffff;
  --progress-used-color: linear-gradient(90deg, #fb923c, #f97316);
  --progress-rem-color: rgba(148, 163, 184, 0.55);
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --bg-table: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow: rgba(0, 0, 0, 0.3);
  --btn-primary-bg: #3b82f6;
  --btn-primary-hover: #2563eb;
  --btn-secondary-bg: #64748b;
  --btn-secondary-hover: #475569;
  --btn-success-bg: #10b981;
  --btn-danger-bg: #f87171;
  --badge-bg: #64748b;
  --progress-bg: rgba(148, 163, 184, 0.2);
  --progress-used: linear-gradient(90deg, #10b981, #059669);
  --progress-remaining: rgba(100, 116, 139, 0.5);
  --row-expired: rgba(251, 191, 36, 0.2);
  --row-has-receipt: rgba(34, 197, 94, 0.2);
  --row-complete: rgba(34, 197, 94, 0.22);
  --card-shadow: rgba(0, 0, 0, 0.4);
  --card-border: #475569;
  --avatar-default: #64748b;
  --avatar-text: #ffffff;
  --progress-used-color: linear-gradient(90deg, #fb923c, #f97316);
  --progress-rem-color: rgba(100, 116, 139, 0.6);
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Auth (login) screen */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  background:
    radial-gradient(1200px 500px at 10% 10%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(900px 420px at 90% 20%, rgba(34, 197, 94, 0.10), transparent 55%),
    var(--bg-body);
}

[data-theme="dark"] .auth-screen {
  background:
    radial-gradient(1200px 500px at 10% 10%, rgba(59, 130, 246, 0.20), transparent 60%),
    radial-gradient(900px 420px at 90% 20%, rgba(16, 185, 129, 0.14), transparent 55%),
    var(--bg-body);
}

.auth-container {
  width: 100%;
  max-width: 420px;
}

.auth-card {
  border: 1px solid var(--border-color) !important;
  background: var(--bg-card) !important;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

[data-theme="dark"] .auth-card {
  box-shadow: 0 18px 44px rgba(0,0,0,0.42);
}

.auth-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--btn-primary-bg), #7c3aed);
}

/* Merchant cabinet tables */
.requisites-cell {
  min-width: 260px;
}
.requisites-cell .mono {
  white-space: pre-wrap;
  word-break: break-word;
}

.merchant-list-card {
  border: 1px solid var(--card-border) !important;
  border-radius: 14px !important;
  box-shadow: 0 2px 8px var(--card-shadow), 0 1px 2px rgba(0, 0, 0, 0.1) !important;
  overflow: hidden;
}

.merchant-expand-table {
  width: 100% !important;
  min-width: 100% !important;
  display: table !important;
  table-layout: fixed !important;
}

.merchant-expand-table .requisites-cell {
  min-width: 0;
}

.merchant-expand-table th,
.merchant-expand-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.merchant-expand-table .expand-col-amount {
  padding-right: 20px !important;
}

.merchant-expand-table .expand-col-created {
  padding-left: 20px !important;
}

/* Merchant rows in operator style */
.op-scroll-merchant .op-row {
  flex-wrap: nowrap;
  min-width: 1400px;
}

.op-scroll-merchant .op-col {
  flex: 1 1 0;
  min-width: 0;
}

/* Bootstrap utility overrides: make text/bg classes theme-aware */
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-body,
.text-dark,
.link-dark {
  color: var(--text-primary) !important;
}

.bg-light,
.bg-white {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

/* Links */
a { color: var(--btn-primary-bg); }
a:hover { color: var(--btn-primary-hover); }

/* Forms / inputs */
.form-control,
.form-select,
.form-control:disabled,
.form-select:disabled {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

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

.form-control:focus,
.form-select:focus {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15) !important;
}

/* Offcanvas / dropdowns */
.offcanvas,
.dropdown-menu {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.dropdown-item { color: var(--text-primary) !important; }
.dropdown-item:hover,
.dropdown-item:focus { background-color: var(--bg-body) !important; }

/* Status badges */
.badge-status {
  font-weight: 700;
  letter-spacing: 0.1px;
  border: 1px solid transparent;
}

.badge-status[data-status="Processing"] {
  background-color: rgba(107, 114, 128, 0.18) !important;
  border-color: rgba(107, 114, 128, 0.35) !important;
  color: #6b7280 !important;
}

.badge-status[data-status="Canceled"] {
  background-color: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.35) !important;
  color: #ef4444 !important;
}

.badge-status[data-status="Confirmed"] {
  background-color: rgba(34, 197, 94, 0.18) !important;
  border-color: rgba(34, 197, 94, 0.35) !important;
  color: #22c55e !important;
}

.badge-status[data-status="Working"] {
  background-color: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  color: #f59e0b !important;
}

.badge-status[data-status="Waiting"] {
  background-color: rgba(59, 130, 246, 0.18) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  color: #3b82f6 !important;
}

.app-shell {
  min-height: 100vh;
  display: flex;
}

.app-main {
  flex: 1 1 auto;
  min-width: 0; /* критично для flex, чтобы контент не схлопывался/не пропадал */
}

.top-right-panel {
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  z-index: 1020;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-color);
}

.top-right-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-primary);
}

.top-right-settings {
  align-items: flex-start;
}

.top-right-settings-list {
  max-height: 120px;
  min-width: 280px;
  overflow: auto;
  padding-right: 4px;
}

.app-layout { min-height: 100vh; }
.main-content { background: transparent; }

.card, .table, .offcanvas, .form-control, .btn, .alert { border-radius: 10px; }

/* Cards (detail pages use Bootstrap cards heavily) */
.card {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}
.card-header,
.card-footer {
  background-color: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Labels inside forms on dark theme */
.form-label { color: var(--text-secondary) !important; }

/* pre blocks used for requisites/comments in details */
pre {
  background-color: var(--bg-body) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  padding: 10px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

hr { border-color: var(--border-color) !important; opacity: 1; }

/* Matching detail cards */
.match-card { padding-top: 46px !important; }
.match-card-status {
  position: absolute;
  top: 12px;
  left: 12px;
}

.match-metrics {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px; /* keeps scrollbar from touching text on some browsers */
}
.match-metric {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-body);
  border-radius: 10px;
  white-space: nowrap;
}
.match-metric-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: none;
}
.match-metric-value {
  color: var(--text-primary);
  font-weight: 800;
}

/* Таблицы: без жесткого min-width, чтобы строки не "уезжали" при ресайзе */
.table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.table {
  background: var(--bg-table);
  color: var(--text-primary);
  border-color: var(--border-color);
  /* На ресайзе таблица не должна схлопываться/исчезать.
     Делаем её минимум ширины контейнера, но разрешаем расширяться (скролл в .table-responsive). */
  min-width: 100%;
  width: auto;
  display: inline-table;
  table-layout: auto;
  margin-bottom: 0;
}

.table thead th {
  background: var(--bg-sidebar);
  color: var(--text-primary);
  border-color: var(--border-color);
  font-weight: 600;
  white-space: nowrap;
}

.table tbody td {
  border-color: var(--border-color);
  color: var(--text-primary);
  background: var(--bg-table);
}

/* Обрезаем длинные значения (чтобы при сужении окна строка не "пропадала") */
.table th,
.table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  /* ВАЖНО: не используем max-width:0 для table-cells — это может схлопнуть таблицу до 0px
     и визуально "спрятать" её при ресайзе. */
  /* min-width:0 оставляем, но без max-width:0 (опасно для table-cell) */
  min-width: 0;
}

.table tbody tr:hover { background: var(--bg-sidebar); }

/* Progress bar */
.progress-fillbar { height: 8px; border-radius: 999px; overflow: hidden; background: var(--progress-bg); }
.progress-fillbar-segment-used { background: var(--progress-used); }
.progress-fillbar-segment-remaining { background: var(--progress-remaining); }
.progress-fillbar-labels { font-size: 11px; display: flex; justify-content: space-between; margin-top: 2px; color: var(--text-secondary); }
.progress-fillbar-labels span { white-space: nowrap; }

/* Sidebar */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  height: 100vh;
  flex: 0 0 280px;
  width: 280px;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* keep sidebar static; scroll only inside sidebar-grow / mini-list */
}
.sidebar-logo { color: var(--text-primary); }
.sidebar-separator { border-color: var(--border-color); }

.sidebar-grow {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 4px;
}

.sidebar-footer {
  flex: 0 0 auto;
  margin-top: auto;
}

.sidebar-mini-list {
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}

.sidebar-rates-list {
  max-height: 260px;
}

.sidebar-rate-row {
  padding: 4px 0;
  border-bottom: 1px dashed var(--border-color);
}

.sidebar-rate-row:last-child {
  border-bottom: 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 4px;
}
.sidebar-nav .nav-link:hover { background: var(--bg-body); color: var(--text-primary); }
.sidebar-nav .nav-link .nav-icon { width: 18px; text-align: center; font-size: 13px; }
.sidebar-nav .nav-link.active { background: var(--btn-primary-bg); color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25); }

.sidebar-user { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.sidebar-user-name { color: var(--text-primary); font-weight: 500; }
.sidebar-db { margin-top: 8px; font-size: 11px; color: var(--text-muted); }
.sidebar-db .label { font-weight: 500; }

.mobile-topbar { background: var(--bg-sidebar); border-bottom: 1px solid var(--border-color); }
.mobile-logo { color: var(--text-primary); }

/* Buttons */
.btn {
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary { 
  background-color: var(--btn-primary-bg); 
  border-color: var(--btn-primary-bg); 
  color: #fff;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover { 
  background-color: var(--btn-primary-hover); 
  border-color: var(--btn-primary-hover);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-outline-secondary { 
  color: var(--text-secondary); 
  border-color: var(--border-color);
  background: var(--bg-card);
  border-width: 1.5px;
}
.btn-outline-secondary:hover { 
  background-color: var(--btn-secondary-bg); 
  border-color: var(--btn-secondary-bg); 
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.btn-outline-secondary:active {
  transform: translateY(0);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-success {
  background-color: var(--btn-success-bg);
  border-color: var(--btn-success-bg);
  color: #fff;
  box-shadow: 0 2px 4px rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
  background-color: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--btn-danger-bg);
  border-color: var(--btn-danger-bg);
  color: #fff;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
  box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.btn-outline-primary {
  color: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  background: transparent;
  border-width: 1.5px;
}

.btn-outline-primary:hover {
  background-color: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

/* Special row colors */
.row-expired { background: var(--row-expired) !important; }
.row-has-receipt { background: var(--row-has-receipt) !important; }
.row-complete {
  background: var(--row-complete) !important;
  border-color: rgba(34, 197, 94, 0.45) !important;
}

/* Background for раскрывающихся деталей (вместо bootstrap bg-light) */
.details-cell {
  background: var(--bg-card) !important;
}

/* Theme toggle */
.theme-toggle { background: transparent; border: 1px solid var(--border-color); color: var(--text-secondary); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 18px; }
.theme-toggle:hover { background: var(--bg-body); color: var(--text-primary); border-color: var(--text-primary); }

/* Operator-style rows (разделение заявок по блокам как на скриншоте) */
.op-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.op-card {
  background: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: 0 2px 8px var(--card-shadow), 0 1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.op-card:hover {
  box-shadow: 0 4px 12px var(--card-shadow), 0 2px 4px rgba(0, 0, 0, 0.1);
  border-color: var(--border-color);
}

.op-row-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-width: 0;
  border-bottom: 2px solid var(--border-color);
  background: var(--bg-sidebar);
}

.op-row-header .op-label {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
}

.op-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-width: 0;
  transition: background-color 0.2s ease;
  height: auto;
  min-height: 50px;
}

.op-expander-placeholder,
.op-avatar-placeholder,
.op-actions-placeholder {
  width: 36px;
  flex: 0 0 auto;
}

.op-row:hover {
  background: var(--bg-body);
}

.op-expander {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  flex: 0 0 auto;
  transition: all 0.2s ease;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.op-expander:hover {
  background: var(--btn-primary-bg);
  color: #ffffff;
  border-color: var(--btn-primary-bg);
  transform: scale(1.08);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.merchant-expander {
  width: 28px;
  height: 28px;
  font-size: 16px;
  line-height: 1;
}

.op-expander:active {
  transform: scale(1.02);
}

.op-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--avatar-text);
  background: var(--avatar-default);
  flex: 0 0 auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.op-avatar:hover {
  transform: scale(1.1);
}

.op-avatar.success { 
  background: var(--btn-success-bg);
  color: #ffffff;
}
.op-avatar.warn { 
  background: #facc15;
  color: #0b1220;
}
.op-avatar.primary { 
  background: var(--btn-primary-bg);
  color: #ffffff;
}

.op-col {
  min-width: 0;
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  align-self: stretch;
}

.op-row-header .op-col {
  justify-content: flex-start;
}

.op-col.wide { flex: 1.5 1 200px; }
.op-col.tight { flex: 0 0 100px; }
.op-col.timer { flex: 0 0 90px; }

/* Matching list: фиксируем ширины колонок, чтобы все заявки были ровно по сетке */
.op-scroll-matching .op-row {
  flex-wrap: nowrap;
  min-width: 0;
}

.op-scroll-matching .op-avatar { flex: 0 0 34px; }

/* Почти фиксированные ширины: центральную колонку оставляем гибкой,
   чтобы карточка занимала всю доступную ширину без пустого пространства справа. */
.op-scroll-matching .op-col.matchid { flex: 0 0 60px; }
.op-scroll-matching .op-col.pair-ids { flex: 1 1 220px; min-width: 170px; }
.op-scroll-matching .op-col.pair-merchants { flex: 1 1 220px; min-width: 170px; }
.op-scroll-matching .op-col.pair-subdirs { flex: 1 1 200px; min-width: 150px; }
.op-scroll-matching .op-col.amount { flex: 0 0 100px; }
.op-scroll-matching .op-col.timer { flex: 0 0 95px; }
.op-scroll-matching .op-col.status { flex: 0 0 115px; }
.op-scroll-matching .op-col.created { flex: 0 0 105px; }

.op-scroll-matching .op-value.pair-lines {
  display: block;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.2;
}

/* Блок действий всегда прижат к правому краю карточки. */
.op-scroll-matching .op-actions {
  flex: 0 0 212px;
  margin-left: auto;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.op-label {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.2;
  margin-bottom: 4px;
  white-space: nowrap;
}

.op-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.op-sub {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  margin-top: 2px;
}

.op-bars { 
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.op-bar {
  height: 20px;
  border-radius: 999px;
  background: var(--progress-bg);
  overflow: hidden;
  position: relative;
}

.op-bar .seg-used {
  height: 100%;
  float: left;
  background: var(--progress-used-color);
  transition: width 0.3s ease;
}

.op-bar .seg-rem {
  height: 100%;
  float: left;
  background: var(--progress-rem-color);
}

.op-bar-labels {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.op-bar-labels span { white-space: nowrap; }

.fillbar-col {
  min-width: 320px;
}

.op-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.op-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  align-self: center;
}

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
}

.icon-btn svg {
  display: block;
  width: 16px;
  height: 16px;
}

.icon-btn.success svg rect {
  transition: fill 0.15s ease;
}

.icon-btn.danger svg rect {
  transition: fill 0.15s ease;
}

.icon-btn:hover:not([disabled]) {
  background: var(--bg-body);
  color: var(--text-muted);
  border-color: var(--border-color);
}

.icon-btn:active:not([disabled]) {
  transform: scale(0.95);
}

.icon-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  background: transparent;
}

.icon-btn[disabled] svg {
  opacity: 0.5;
}

.icon-btn[disabled] svg rect {
  fill: #94a3b8 !important;
}

.icon-btn[disabled] svg path {
  stroke: #94a3b8 !important;
}

/* Цветовые варианты для icon-btn - только фон */
.icon-btn.success:hover:not([disabled]) {
  background: rgba(34, 197, 94, 0.15);
  color: var(--text-muted);
  border-color: transparent;
}

.icon-btn.success:hover:not([disabled]) svg rect {
  fill: rgba(34, 197, 94, 0.3);
}

.icon-btn.danger:hover:not([disabled]) {
  background: rgba(239, 68, 68, 0.15);
  color: var(--text-muted);
  border-color: transparent;
}

.icon-btn.danger:hover:not([disabled]) svg rect {
  fill: rgba(239, 68, 68, 0.3);
}

.icon-btn.warning:hover:not([disabled]) {
  background: rgba(250, 204, 21, 0.15);
  color: var(--text-muted);
  border-color: transparent;
}

.icon-btn.info:hover:not([disabled]) {
  background: rgba(96, 165, 250, 0.15);
  color: var(--text-muted);
  border-color: transparent;
}

.op-details {
  border-top: 1px solid var(--border-color);
  padding: 12px 14px;
  background: var(--bg-card);
  transition: background-color 0.2s ease;
}

@media (max-width: 992px) {
  .op-col.tight { display: none; }
}

@media (max-width: 576px) {
  .op-col.timer { display: none; }
}
