/**
 * Plan B Logistics — UI Kit CSS
 * Собраны все общие стили из admin.php, manager.php, index.php
 */

/* === CSS Custom Properties === */
:root {
  /* Dark theme (default) */
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-dark: #0f172a;
  --color-card: #1e293b;
  --color-border: #334155;
  --color-border-light: #1e293b;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-dim: #64748b;
  --color-muted: #94a3b8;
  
  --color-accent: #3b82f6;
  --color-accent-bg: #1e3a5f;
  --color-accent-light: #93c5fd;
  
  --color-green: #22c55e;
  --color-green-bg: #14532d;
  --color-green-light: #86efac;
  --color-success: #22c55e;
  
  --color-red: #ef4444;
  --color-red-bg: #450a0a;
  --color-red-light: #fca5a5;
  --color-error: #ef4444;
  
  --color-yellow: #ca8a04;
  --color-yellow-bg: #1c1400;
  --color-yellow-light: #fde68a;
  --color-warning: #f59e0b;
  
  --sidebar-bg: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-active-bg: rgba(59,130,246,0.15);
  --sidebar-active-text: #93c5fd;
  --topbar-bg: #1e293b;
  --table-header-bg: #1e293b;
  --table-row-hover: rgba(255,255,255,0.03);
  --input-bg: #0f172a;
  
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  
  --sidebar-width: 220px;
  --topbar-height: 52px;
  
  --shadow-sidebar: 4px 0 24px rgba(0,0,0,0.4);
  --transition-fast: 0.15s;
  --transition-normal: 0.25s cubic-bezier(.4,0,.2,1);
}

/* Light theme */
[data-theme="light"] {
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-dark: #f1f5f9;
  --color-card: #ffffff;
  --color-border: #e2e8f0;
  --color-border-light: #f1f5f9;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-dim: #94a3b8;
  --color-muted: #64748b;
  
  --color-accent: #3b82f6;
  --color-accent-bg: #dbeafe;
  --color-accent-light: #1d4ed8;
  
  --color-green: #16a34a;
  --color-green-bg: #dcfce7;
  --color-green-light: #15803d;
  --color-success: #16a34a;
  
  --color-red: #dc2626;
  --color-red-bg: #fee2e2;
  --color-red-light: #b91c1c;
  --color-error: #dc2626;
  
  --color-yellow: #ca8a04;
  --color-yellow-bg: #fef9c3;
  --color-yellow-light: #a16207;
  --color-warning: #d97706;
  
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-text: #475569;
  --sidebar-active-bg: rgba(255,107,0,0.08);
  --sidebar-active-text: #FF6B00;
  --topbar-bg: #ffffff;
  --table-header-bg: #f1f5f9;
  --table-row-hover: rgba(0,0,0,0.02);
  --input-bg: #f8fafc;
  
  --shadow-sidebar: 4px 0 24px rgba(0,0,0,0.15);
}

/* === Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--color-bg);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
}

/* === Typography === */
h1, h2, h3, h4 {
  font-weight: 700;
  color: var(--color-text);
}

h1 { font-size: 16px; }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-dim); }
h3 { font-size: 13px; }

a { color: var(--color-accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout: Sidebar === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-sidebar);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar.pinned {
  transform: translateX(0);
  box-shadow: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-logo-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo img {
  height: 26px;
  width: auto;
}

.sidebar-logo-text {
  font-size: 9px;
  color: #475569;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.sidebar-logo-role {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.sidebar-item:hover {
  background: var(--color-surface-dark);
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-item.active {
  background: var(--sidebar-active-bg);
  border-color: var(--color-accent);
  color: var(--sidebar-active-text);
}

.sidebar-item.logout:hover,
.sidebar-item.sidebar-logout:hover {
  background: var(--color-red-bg);
  color: var(--color-red-light);
  border-color: var(--color-red);
}

.sidebar-icon {
  font-size: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.sidebar-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-label {
  white-space: nowrap;
}

.pin-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-dim);
  font-size: 14px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.pin-btn.active {
  color: var(--color-accent);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

.sidebar-overlay.visible {
  display: block;
}

/* Pinned mode */
body.sidebar-pinned .sidebar-overlay {
  display: none !important;
}

body.sidebar-pinned .topbar {
  left: var(--sidebar-width);
}

body.sidebar-pinned .main {
  margin-left: var(--sidebar-width);
}

/* === Layout: Topbar === */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 100;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--color-border);
  transition: left var(--transition-normal);
}

.topbar h1 {
  font-size: 14px;
  font-weight: 600;
}

.topbar img {
  height: 26px;
  width: auto;
}

.topbar .spacer {
  flex: 1;
}

.topbar-user {
  color: var(--color-text-dim);
  font-size: 12px;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.hamburger:hover {
  background: var(--color-border);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-text-muted);
  border-radius: 2px;
  transition: all var(--transition-normal);
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Theme Toggle Button === */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.theme-toggle:hover {
  color: var(--color-text);
  border-color: var(--color-accent);
}

/* Show correct icon based on theme */
[data-theme="dark"] .icon-moon,
:root:not([data-theme]) .icon-moon {
  display: none;
}

[data-theme="light"] .icon-sun {
  display: none;
}

/* === Layout: Main === */
.main {
  padding: 24px;
  padding-top: calc(var(--topbar-height) + 24px);
  max-width: 1200px;
  margin: 0 auto;
  transition: margin-left var(--transition-normal);
}

/* === Navigation === */
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.nav a:hover,
.nav a.active {
  background: var(--color-accent-bg);
  border-color: var(--color-accent);
  color: var(--color-accent-light);
}

/* === Cards === */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 20px;
}

.card h2 {
  margin-bottom: 16px;
}

/* === Stats Grid === */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stat .val {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
}

.stat .lbl {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-top: 4px;
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  padding: 10px 12px;
  color: var(--color-text-dim);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  background: var(--table-header-bg);
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border-light);
}

tr:hover td {
  background: var(--table-row-hover);
}

/* Table column widths for orders */
.orders-table th:nth-child(1),
.orders-table td:nth-child(1) { min-width: 120px; }
.orders-table th:nth-child(2),
.orders-table td:nth-child(2) { min-width: 150px; }
.orders-table th:nth-child(3),
.orders-table td:nth-child(3) { min-width: 120px; }
.orders-table th:nth-child(4),
.orders-table td:nth-child(4) { min-width: 100px; }
.orders-table th:nth-child(5),
.orders-table td:nth-child(5) { min-width: 130px; }
.orders-table th:nth-child(6),
.orders-table td:nth-child(6) { min-width: 130px; }
.orders-table th:nth-child(7),
.orders-table td:nth-child(7) { width: 140px; }

/* === Badges === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.badge-pending {
  background: #1c1917;
  color: #78716c;
  border: 1px solid #44403c;
}

.badge-claimed {
  background: var(--color-yellow-bg);
  color: var(--color-yellow-light);
  border: 1px solid var(--color-yellow);
}

.badge-paid,
.badge-received {
  background: var(--color-accent-bg);
  color: var(--color-accent-light);
  border: 1px solid var(--color-accent);
}

.badge-sent {
  background: #1c2d1e;
  color: var(--color-green-light);
  border: 1px solid var(--color-green);
}

.badge-completed {
  background: var(--color-green-bg);
  color: #4ade80;
  border: 1px solid var(--color-green);
}

.badge-cancelled {
  background: var(--color-red-bg);
  color: var(--color-red-light);
  border: 1px solid var(--color-red);
}

.badge-unknown {
  background: var(--color-surface-dark);
  color: var(--color-text-dim);
  border: 1px solid var(--color-border);
}

/* === Buttons === */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  border: none;
  font-family: inherit;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.btn-blue {
  background: var(--color-accent-bg);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-light);
}

.btn-blue:hover {
  background: var(--color-accent);
  color: #fff;
}

.btn-green {
  background: var(--color-green-bg);
  border: 1px solid var(--color-green);
  color: var(--color-green-light);
}

.btn-green:hover {
  background: var(--color-green);
  color: #000;
}

.btn-red {
  background: var(--color-red-bg);
  border: 1px solid var(--color-red);
  color: var(--color-red-light);
}

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

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

/* Action buttons in tables */
.action-btn {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  min-width: 32px;
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-surface-dark);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* === Forms === */
form label {
  display: block;
  font-size: 11px;
  color: var(--color-text-dim);
  margin-bottom: 4px;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

form input,
form select,
form textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--color-text);
  font-size: 13px;
  font-family: inherit;
}

form input:focus,
form select:focus,
form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* === Grid === */
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

/* === Messages === */
.success {
  background: var(--color-green-bg);
  border: 1px solid var(--color-green);
  color: var(--color-green-light);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.error {
  background: var(--color-red-bg);
  border: 1px solid var(--color-red);
  color: var(--color-red-light);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

/* === Profile Info === */
.profile-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.info-item {
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.info-item .lbl {
  font-size: 10px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.info-item .val {
  font-size: 13px;
  color: var(--color-text);
}

/* === Rate Block === */
.rate-block {
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

/* === Modals === */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 400px;
  max-width: 90vw;
  border: 1px solid var(--color-border);
}

.modal-content h3 {
  margin: 0 0 20px;
  color: var(--color-text);
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .topbar {
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .topbar h1 { font-size: 14px; }
  .topbar .spacer { display: none; }
  
  .nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    gap: 4px;
    scrollbar-width: none;
  }
  
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; padding: 5px 10px; font-size: 11px; }
  
  .main { padding: 12px; padding-top: calc(var(--topbar-height) + 12px); }
  .card { padding: 14px; border-radius: var(--radius-lg); }
  .card h2 { font-size: 12px; }
  
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 12px; }
  .stat .val { font-size: 18px; }
  
  table { font-size: 12px; }
  th, td { padding: 7px 8px; }
  
  .grid2, .grid3 { grid-template-columns: 1fr; }
  
  .btn { padding: 7px 12px; font-size: 12px; }
  .btn-sm { padding: 4px 8px; font-size: 10px; }
  
  form input, form select, form textarea {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .profile-info { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .topbar { padding: 8px 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .main { padding: 8px; }
  .card { padding: 12px; margin-bottom: 12px; }
}

/* === Sandbox mode === */
.sandbox-banner {
    background: #f59e0b;
    color: #000;
    text-align: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 100;
    border-radius: 0;
}
.btn-sandbox {
    background: #f59e0b;
    color: #000;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}
.sandbox-bar {
    background: rgba(245,158,11,0.08);
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #f59e0b;
}

/* Orders counter */
.orders-counter {
  color: var(--color-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.orders-counter strong {
  color: var(--color-text);
}
/* =====================================================
   MOBILE RESPONSIVE ADDITIONS
   Добавляется в конец ui/assets/css/app.css
   ===================================================== */

/* === Responsive Tables === */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    margin: 0 -4px;
    padding: 0 4px;
}

.table-responsive table {
    min-width: 600px;
}

/* === Card View for Orders Table on Mobile === */
@media (max-width: 768px) {
    /* Скрываем заголовки таблицы заявок */
    .orders-table thead {
        display: none;
    }
    
    /* Каждая строка — карточка */
    .orders-table tbody tr.orders-row {
        display: block;
        background: var(--color-card);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        margin-bottom: 12px;
        padding: 16px;
    }
    
    .orders-table tbody tr.orders-row.sandbox-row {
        border-left: 3px solid #f59e0b;
    }
    
    .orders-table tbody tr.orders-row[style*="background:#2d1a00"] {
        border-left: 3px solid #f59e0b;
    }
    
    /* Каждая ячейка — строка с лейблом */
    .orders-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid var(--color-border-light);
        font-size: 13px;
    }
    
    .orders-table tbody td:last-child {
        border-bottom: none;
        padding-top: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Лейбл из data-label атрибута */
    .orders-table tbody td::before {
        content: attr(data-label);
        color: var(--color-muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        flex-shrink: 0;
        margin-right: 12px;
        font-weight: 500;
    }
    
    .orders-table tbody td:last-child::before {
        display: none;
    }
    
    /* Детальная строка тоже как карточка */
    .orders-table tbody tr[id^="detail_"] {
        display: none;
        background: var(--color-surface-dark);
        border-radius: var(--radius-lg);
        margin-top: -8px;
        margin-bottom: 12px;
        border: 1px solid var(--color-border);
    }
    
    .orders-table tbody tr[id^="detail_"][style*="table-row"] {
        display: block !important;
    }
    
    .orders-table tbody tr[id^="detail_"] td {
        display: block;
        border: none;
    }
    
    .orders-table tbody tr[id^="detail_"] td::before {
        display: none;
    }
}

/* === Mobile Topbar === */
@media (max-width: 768px) {
    .topbar,
    #admin-topbar {
        padding: 0 12px !important;
        height: 52px !important;
        gap: 8px !important;
    }
    
    /* Скрываем имя пользователя */
    .topbar-username,
    .topbar span[style*="font-size:12px"],
    #admin-topbar > span[style*="font-size:12px"] {
        display: none !important;
    }
    
    /* Скрываем текст "Административная панель" */
    .topbar-title-text,
    #admin-topbar > div[style*="flex:1"] + span,
    #admin-topbar div[style*="font-size:14px"] span {
        display: none;
    }
    
    /* Оставляем только лого */
    #admin-topbar > div[style*="display:flex"] span[style*="font-size:14px"] {
        display: none;
    }
    
    /* Компактный логотип */
    .topbar img,
    #admin-topbar img {
        height: 24px !important;
    }
    
    /* Контент сдвигается */
    .main {
        margin-left: 0 !important;
        padding: 12px !important;
        padding-top: calc(var(--topbar-height) + 12px) !important;
    }
    
    body.sidebar-pinned .main {
        margin-left: 0 !important;
    }
    
    body.sidebar-pinned #admin-topbar,
    body.sidebar-pinned .topbar {
        left: 0 !important;
    }
}

/* === Sidebar Overlay on Mobile === */
@media (max-width: 768px) {
    .sidebar,
    .admin-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        height: 100vh !important;
        width: 260px !important;
        z-index: 200 !important;
        transition: left 0.3s ease !important;
        transform: none !important;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3) !important;
    }
    
    .sidebar.open,
    .admin-sidebar.open {
        left: 0 !important;
        transform: none !important;
    }
    
    .sidebar.pinned,
    .admin-sidebar.pinned {
        left: -280px !important;
        transform: none !important;
    }
    
    .sidebar.pinned.open,
    .admin-sidebar.pinned.open {
        left: 0 !important;
    }
    
    /* Затемнение фона */
    .sidebar-overlay,
    #admin-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
    }
    
    .sidebar-overlay.visible,
    .sidebar-overlay.active,
    #admin-overlay.visible {
        display: block;
    }
    
    /* На мобильном pinned не работает */
    body.sidebar-pinned .sidebar-overlay,
    body.sidebar-pinned #admin-overlay {
        display: block;
    }
}

/* === Adaptive Stats Grid === */
@media (max-width: 768px) {
    .stats,
    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }
    
    .stat,
    .stats-card {
        padding: 14px !important;
    }
    
    .stat .val,
    .stats-value {
        font-size: 20px !important;
    }
    
    .stat .lbl {
        font-size: 10px !important;
    }
}

@media (max-width: 480px) {
    .stats,
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}

/* === Action Buttons on Mobile === */
@media (max-width: 768px) {
    /* Скрываем текст, оставляем только иконки */
    .action-btn .btn-text {
        display: none;
    }
    
    .action-btn {
        padding: 8px !important;
        min-width: 36px !important;
        justify-content: center;
    }
    
    /* Кнопка выхода — компактная */
    .topbar .btn-red,
    #admin-topbar .btn-red {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    /* Кнопки фильтров заявок */
    .card > div[style*="display:flex"] {
        flex-wrap: wrap !important;
    }
    
    .card > div[style*="display:flex"] .btn-sm {
        padding: 4px 8px !important;
        font-size: 10px !important;
    }
}

/* === Mobile Forms === */
@media (max-width: 768px) {
    .grid2,
    .grid3 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    form input,
    form select,
    form textarea {
        font-size: 16px !important; /* предотвращает зум на iOS */
        padding: 12px !important;
    }
    
    .btn {
        padding: 10px 16px !important;
        font-size: 13px !important;
    }
    
    .btn-sm {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
}

/* === Cards on Mobile === */
@media (max-width: 768px) {
    .card {
        padding: 14px !important;
        border-radius: var(--radius-lg) !important;
        margin-bottom: 12px !important;
    }
    
    .card h2 {
        font-size: 12px !important;
        margin-bottom: 12px !important;
    }
}

/* === Profile Info on Mobile === */
@media (max-width: 768px) {
    .profile-info {
        grid-template-columns: 1fr !important;
    }
    
    .info-item {
        padding: 10px !important;
    }
}

/* === Filters row on mobile === */
@media (max-width: 768px) {
    .card > div[style*="display:flex"][style*="justify-content:space-between"] {
        flex-direction: column !important;
        gap: 12px !important;
        align-items: stretch !important;
    }
    
    .card > div[style*="display:flex"][style*="justify-content:space-between"] > div[style*="display:flex"] {
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
    }
}

/* === Orders table actions on mobile === */
@media (max-width: 768px) {
    .orders-table td[onclick="event.stopPropagation()"] > div {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .orders-table td[onclick="event.stopPropagation()"] form {
        width: 100%;
    }
    
    .orders-table td[onclick="event.stopPropagation()"] select {
        flex: 1;
        min-width: 0;
    }
    
    .tx-field {
        margin-top: 8px !important;
    }
    
    .tx-field input[name="tx_hash"] {
        width: 100% !important;
        margin-bottom: 8px;
    }
}

/* === Detail row grid on mobile === */
@media (max-width: 768px) {
    .orders-table tr[id^="detail_"] td > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* === Badge sizes on mobile === */
@media (max-width: 768px) {
    .badge {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }
}

/* === Nav scrollable on mobile === */
@media (max-width: 768px) {
    .nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    
    .nav::-webkit-scrollbar {
        display: none;
    }
    
    .nav a {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* === Modal on mobile === */
@media (max-width: 768px) {
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        padding: 20px !important;
        margin: 10px;
    }
}

/* === Fix for table colgroup on mobile === */
@media (max-width: 768px) {
    .orders-table colgroup {
        display: none;
    }
}

/* === MOBILE FIX: Override min-width on mobile === */
@media (max-width: 768px) {
    /* Remove min-width constraints on mobile */
    .orders-table th,
    .orders-table td {
        min-width: 0 !important;
        width: auto !important;
    }
    
    /* Force table to not be a table on mobile */
    .orders-table,
    .orders-table tbody {
        display: block !important;
        width: 100% !important;
    }
    
    /* Make sure table-responsive doesn't interfere */
    .table-responsive {
        overflow-x: visible !important;
    }
    
    /* Stats grid fix - ensure 2 columns */
    .stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
}

@media (max-width: 480px) {
    .stats {
        grid-template-columns: 1fr !important;
    }
}

/* === FINAL FIX: Force 2 columns on stats for 390px+ === */
@media (min-width: 320px) and (max-width: 768px) {
    .stats {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .stat {
        min-width: 0 !important;
        padding: 12px !important;
    }
}

@media (max-width: 320px) {
    .stats {
        grid-template-columns: 1fr !important;
    }
}

/* === Logo visibility in light theme === */
[data-theme="light"] .topbar img,
[data-theme="light"] .sidebar-logo img {
    filter: brightness(0) saturate(100%); /* Делает белый SVG чёрным */
}

/* Light theme sidebar */
[data-theme="light"] .sidebar-nav {
  border-right: 1px solid var(--color-border);
  box-shadow: none;
}

[data-theme="light"] .sidebar-item {
  color: var(--sidebar-text);
}

[data-theme="light"] .sidebar-item:hover {
  background: rgba(0,0,0,0.04);
  color: #1e293b;
}

[data-theme="light"] .sidebar-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

[data-theme="light"] .sidebar-logo {
  border-bottom: 1px solid var(--color-border);
}

[data-theme="light"] .topbar {
  border-bottom: 1px solid var(--color-border);
  box-shadow: none;
}

/* Логотип — в светлой теме инвертируем белый в тёмный */
[data-theme="light"] .topbar img,
[data-theme="light"] .sidebar-logo img {
  filter: brightness(0) saturate(100%);
}

/* === Wallet === */
.wallet-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .wallet-grid {
        grid-template-columns: 1fr;
    }
}

.wallet-card {
    background: var(--color-card);
    border-radius: 16px;
    padding: 28px;
    border: 1px solid var(--color-border);
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wallet-card-center {
    text-align: center;
}

.wallet-label {
    font-size: 13px;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.wallet-title {
    font-weight: 600;
    font-size: 16px;
    color: var(--color-text);
    margin-bottom: 16px;
}

.wallet-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.wallet-address {
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--color-text);
    background: var(--color-surface-dark);
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--color-border);
}

.wallet-btn {
    padding: 8px 18px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
    transition: all 0.2s;
}

.wallet-btn:hover {
    border-color: var(--color-accent);
}

.wallet-btn-sm {
    padding: 6px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-dark);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
    transition: all 0.2s;
}

.wallet-btn-sm:hover {
    border-color: var(--color-accent);
}

.wallet-btn-refresh {
    padding: 5px 12px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-dark);
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text);
}

.wallet-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-sizing: border-box;
    font-size: 13px;
    background: var(--color-surface-dark);
    color: var(--color-text);
}

.wallet-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.wallet-input-mono {
    font-family: monospace;
}

.wallet-input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--color-muted);
}

.wallet-input-group {
    margin-bottom: 14px;
}

.wallet-input-group:last-child {
    margin-bottom: 0;
}

.wallet-select {
    background: var(--color-surface-dark);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.wallet-search {
    width: 100%;
    padding: 9px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-dark);
    color: var(--color-text);
    font-size: 13px;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.wallet-search:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Balance cards — семантические цвета остаются тёмными */
.wallet-balances {
    display: flex;
    gap: 16px;
}

.balance-usdt {
    flex: 1;
    background: #052e16;
    border: 1px solid #166534;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.balance-usdt .balance-label {
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    margin-bottom: 8px;
}

.balance-trx {
    flex: 1;
    background: #172554;
    border: 1px solid #1d4ed8;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.balance-trx .balance-label {
    font-size: 12px;
    color: #60a5fa;
    font-weight: 600;
    margin-bottom: 8px;
}

.balance-netts {
    flex: 1;
    background: #1a1a2e;
    border: 1px solid #7c3aed;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.balance-netts .balance-label {
    font-size: 12px;
    color: #a78bfa;
    font-weight: 600;
    margin-bottom: 8px;
}

.balance-value {
    font-size: 28px;
    font-weight: 700;
    color: #f1f5f9;
}

/* QR buttons — семантические цвета */
.wallet-qr-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.wallet-qr-btn-usdt {
    flex: 1;
    padding: 12px;
    border: 2px solid #16a34a;
    border-radius: 10px;
    background: #052e16;
    cursor: pointer;
    font-weight: 600;
    color: #16a34a;
}

.wallet-qr-btn-trx {
    flex: 1;
    padding: 12px;
    border: 2px solid #2563eb;
    border-radius: 10px;
    background: #172554;
    cursor: pointer;
    font-weight: 600;
    color: #60a5fa;
}

.wallet-qr-container {
    display: none;
    text-align: center;
}

.wallet-qr-code {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    margin-bottom: 12px;
}

.wallet-qr-label {
    font-size: 12px;
    color: var(--color-muted);
}

/* Send USDT form */
.wallet-send-btn {
    width: 100%;
    padding: 12px;
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.wallet-send-btn:hover {
    background: #15803d;
}

.wallet-send-btn:disabled {
    background: #64748b;
    cursor: not-allowed;
}

.wallet-error {
    display: none;
    color: #f87171;
    font-size: 13px;
    margin-bottom: 14px;
    padding: 10px;
    background: #450a0a;
    border-radius: 8px;
    border: 1px solid #7f1d1d;
}

.wallet-success {
    display: none;
    color: #4ade80;
    font-size: 13px;
    margin-bottom: 14px;
    padding: 10px;
    background: #052e16;
    border-radius: 8px;
    border: 1px solid #166534;
}

/* Transaction history */
.wallet-history-empty {
    text-align: center;
    color: var(--color-muted);
    padding: 20px;
}

.wallet-history-loading {
    text-align: center;
    color: var(--color-muted);
    padding: 20px;
}

.wallet-tx-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}

.wallet-tx-row:last-child {
    border-bottom: none;
}

.wallet-tx-info {
    flex: 1;
    min-width: 0;
}

.wallet-tx-address {
    font-size: 13px;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-tx-date {
    font-size: 11px;
    color: var(--color-muted);
    margin-top: 2px;
}

.wallet-tx-order {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.wallet-tx-payment-code {
    background: var(--color-surface);
    border: 1px solid #f59e0b;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 10px;
    color: #f59e0b;
    font-family: monospace;
    text-decoration: none;
}

.wallet-tx-payment-code:hover {
    text-decoration: none;
    border-color: #fbbf24;
}

.wallet-tx-order-num {
    font-size: 10px;
    color: var(--color-muted);
    text-decoration: none;
}

.wallet-tx-client {
    font-size: 10px;
    color: var(--color-muted);
    text-decoration: none;
}

.wallet-tx-amount {
    font-weight: 700;
    font-size: 15px;
    margin-left: 16px;
    white-space: nowrap;
}

.wallet-tx-amount a {
    text-decoration: none;
}

.wallet-tx-amount.incoming {
    color: #4ade80;
}

.wallet-tx-amount.incoming a {
    color: #4ade80;
}

.wallet-tx-amount.outgoing {
    color: #f87171;
}

.wallet-tx-amount.outgoing a {
    color: #f87171;
}

/* Pagination */
.wallet-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.wallet-pagination-btn {
    padding: 6px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-dark);
    color: var(--color-muted);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.wallet-pagination-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.wallet-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wallet-pagination-info {
    font-size: 12px;
    color: var(--color-muted);
}

/* === Mobile Wallet === */
@media (max-width: 768px) {
    .wallet-grid {
        grid-template-columns: 1fr;
    }
    
    .wallet-balances {
        flex-direction: column;
        gap: 12px;
    }
    
    .wallet-qr-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .balance-value {
        font-size: 24px;
    }
    
    .wallet-card {
        padding: 20px;
    }
}

/* === Admin Tables & Forms (dynamic theming) === */
.admin-select {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
}

.btn-danger-sm {
    background: var(--color-error);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.btn-secondary-sm {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

/* Warning row highlight — payment_claimed */
.row-warning {
    background: rgba(245, 158, 11, 0.08) !important;
    border-left: 3px solid #f59e0b !important;
}

[data-theme="dark"] .row-warning {
    background: rgba(45, 26, 0, 0.8) !important;
}

/* Inactive/muted indicator dot */
.indicator-inactive {
    background: var(--color-border);
}

/* Toggle switch track (off state) */
.toggle-track-off {
    background: var(--color-border);
}

/* Hamburger hover bg */
.hamburger-hover {
    background: var(--color-border);
}

/* Hamburger span bars */
.hamburger-bar {
    background: var(--color-text-muted);
}

/* Pin button hover */
.pin-btn-hover {
    background: var(--color-border);
    color: var(--color-text);
}

/* Sort button active/hover */
.sort-btn-active {
    background: var(--color-border);
    color: var(--color-text);
}

/* Upload zone dashed border */
.upload-zone-dashed {
    border: 2px dashed var(--color-border);
}

/* Step connector and inactive step */
.step-connector {
    background: var(--color-border);
}

.step-inactive .step-num {
    background: var(--color-border);
    color: var(--color-text-dim);
}

/* === LIGHT THEME FIX: Status Badges (adaptive) === */
.badge-pending {
  background: rgba(245,158,11,0.15) !important;
  color: #d97706 !important;
  border: 1px solid rgba(245,158,11,0.3) !important;
}

.badge-claimed {
  background: rgba(59,130,246,0.15) !important;
  color: #2563eb !important;
  border: 1px solid rgba(59,130,246,0.3) !important;
}

.badge-received,
.badge-paid {
  background: rgba(34,197,94,0.15) !important;
  color: #16a34a !important;
  border: 1px solid rgba(34,197,94,0.3) !important;
}

.badge-completed {
  background: rgba(34,197,94,0.15) !important;
  color: #16a34a !important;
  border: 1px solid rgba(34,197,94,0.3) !important;
}

.badge-cancelled {
  background: rgba(239,68,68,0.15) !important;
  color: #dc2626 !important;
  border: 1px solid rgba(239,68,68,0.3) !important;
}

.badge-sent {
  background: rgba(34,197,94,0.15) !important;
  color: #16a34a !important;
  border: 1px solid rgba(34,197,94,0.3) !important;
}

/* Dark theme — более насыщенные */
[data-theme="dark"] .badge-pending {
  background: rgba(120,53,15,0.5) !important;
  color: #fde68a !important;
}

[data-theme="dark"] .badge-claimed {
  background: rgba(30,58,138,0.5) !important;
  color: #93c5fd !important;
}

[data-theme="dark"] .badge-completed,
[data-theme="dark"] .badge-received,
[data-theme="dark"] .badge-paid,
[data-theme="dark"] .badge-sent {
  background: rgba(5,46,22,0.7) !important;
  color: #86efac !important;
}

[data-theme="dark"] .badge-cancelled {
  background: rgba(69,10,10,0.7) !important;
  color: #fca5a5 !important;
}

/* === Кнопки Блок/Разблок (adaptive) === */
.btn-block {
  background: var(--color-surface);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-unblock {
  background: var(--color-surface);
  border: 1px solid var(--color-success);
  color: var(--color-success);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-block:hover {
  background: var(--color-error);
  color: #fff;
}

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

/* === Badge Авто/Ручной === */
.badge-auto {
  background: rgba(34,197,94,0.15);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}

.badge-manual {
  background: var(--color-surface);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}

/* === Badge Активен/Неактивен === */
.badge-active {
  background: rgba(34,197,94,0.15);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}

.badge-inactive {
  background: var(--color-surface);
  color: var(--color-muted);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
}

/* === Alert Warning (payment_claimed) === */
.alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

[data-theme="dark"] .alert-warning {
  background: #78350f;
  border-color: #ca8a04;
}

.alert-warning-count {
  background: #ca8a04;
  color: #000;
  font-size: 20px;
  font-weight: 800;
  border-radius: 8px;
  padding: 6px 14px;
}

.alert-warning-title {
  font-size: 14px;
  font-weight: 700;
  color: #d97706;
}

.alert-warning-desc {
  font-size: 12px;
  color: #92400e;
  margin-top: 2px;
}

[data-theme="dark"] .alert-warning-title {
  color: #fde68a;
}

[data-theme="dark"] .alert-warning-desc {
  color: #d97706;
}

.alert-warning-btn {
  background: #ca8a04;
  color: #000;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  white-space: nowrap;
}

/* === Alert Info (Sandbox) === */
.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 10px;
  padding: 14px 18px;
  color: var(--color-text);
}

[data-theme="dark"] .alert-info {
  background: rgba(30, 58, 138, 0.3);
  border-color: #3b82f6;
}

/* === TX Fee Badge (wallet) === */
.tx-fee-badge {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
}

[data-theme="dark"] .tx-fee-badge {
  background: rgba(120, 53, 15, 0.5);
  color: #fde68a;
}

/* === Sandbox Warning (adaptive) === */
.alert-warning-sandbox {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

[data-theme="dark"] .alert-warning-sandbox {
  background: #1a1a0a;
  border-color: #854d0e;
}

.alert-warning-sandbox-title {
  font-size: 14px;
  color: #d97706;
  font-weight: 600;
  margin-bottom: 4px;
}

.alert-warning-sandbox-desc {
  font-size: 13px;
  color: #92400e;
}

[data-theme="dark"] .alert-warning-sandbox-title {
  color: #fcd34d;
}

[data-theme="dark"] .alert-warning-sandbox-desc {
  color: #a3a38a;
}

/* ================================================================
   UNIVERSAL FORM COMPONENTS
   ================================================================ */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--color-red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  font-size: 16px; /* 16px — iOS не зумит */
  font-family: inherit;
  background: var(--input-bg, var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  color: var(--color-text);
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-dim);
}

.form-hint {
  font-size: 12px;
  color: var(--color-text-dim);
  margin-top: 5px;
}

.form-error {
  font-size: 12px;
  color: var(--color-red);
  margin-top: 5px;
}

/* ================================================================
   PAGE HEADER
   ================================================================ */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

/* ================================================================
   ALERT BANNERS
   ================================================================ */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md, 8px);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--color-red-bg, #450a0a);
  border: 1px solid var(--color-red, #ef4444);
  color: var(--color-red-light, #fca5a5);
}

.alert-success {
  background: var(--color-green-bg, #14532d);
  border: 1px solid var(--color-green, #22c55e);
  color: var(--color-green-light, #86efac);
}

.alert-notice {
  border-left: 3px solid var(--color-text-dim);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md, 8px) var(--radius-md, 8px) 0;
  color: var(--color-text-muted);
  font-size: 13px;
}

/* ================================================================
   FORM ACTIONS ROW
   ================================================================ */

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
}

/* ================================================================
   AMOUNT ROW (двусторонний калькулятор)
   ================================================================ */

.amount-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.amount-col { flex: 1; }

.amount-currency {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.amount-arrow {
  display: flex;
  align-items: center;
  padding-top: 26px;
  color: var(--color-text-dim);
  font-size: 18px;
  flex-shrink: 0;
}

/* ================================================================
   CALC CARD (расчёт суммы)
   ================================================================ */

.calc-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  padding: 16px;
  margin-top: 16px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  font-size: 14px;
}

.calc-row + .calc-row {
  border-top: 1px solid var(--color-border);
}

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

.calc-value {
  font-weight: 600;
  color: var(--color-text);
}

.calc-value.highlight {
  color: var(--color-accent);
  font-size: 17px;
}

/* ================================================================
   MOBILE RESPONSIVE — @media (max-width: 640px)
   ================================================================ */

@media (max-width: 640px) {

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-title { font-size: 18px; }

  /* Card */
  .card { padding: 16px; }

  /* Buttons — full width on mobile */
  .form-actions { flex-direction: column; }
  .form-actions .btn,
  .form-actions a.btn,
  .form-actions button { width: 100%; justify-content: center; text-align: center; }

  /* Amount row — stack vertically */
  .amount-row { flex-direction: column; gap: 8px; }
  .amount-col { width: 100%; }
  .amount-arrow { padding-top: 0; align-self: center; transform: rotate(90deg); }

  /* Form inputs larger touch target */
  .form-input, .form-select, .form-textarea { padding: 13px 14px; }

  /* Tables → cards */
  .table-mobile thead { display: none; }
  .table-mobile tbody tr {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    margin-bottom: 12px;
    padding: 12px;
  }
  .table-mobile td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border: none !important;
    font-size: 13px;
    gap: 8px;
  }
  .table-mobile td::before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--color-text-muted);
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Calc card */
  .calc-row { font-size: 13px; }
  .calc-value.highlight { font-size: 15px; }

  /* Stats grid */
  .stats { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 380px) {
  .page-title { font-size: 16px; }
  .form-input, .form-select { font-size: 15px; }
}

/* ================================================================
   ADDITIONAL COMPONENTS FOR REFACTORING (2024-03)
   ================================================================ */

/* === Back Link === */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-text-dim);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
}

.back-link:hover {
  color: var(--color-text-muted);
  text-decoration: none;
}

/* === Info Block (labeled data) === */
.info-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.info-label {
  font-size: 11px;
  color: var(--color-text-dim);
  margin-bottom: 2px;
}

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

.info-value-lg {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.info-value-mono {
  font-family: monospace;
  font-size: 13px;
  word-break: break-all;
  background: var(--color-surface-dark);
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--color-text);
}

/* === Section Title (card h2) === */
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 16px;
}

/* === Grid Layouts === */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}

@media (max-width: 640px) {
  .grid-2col, .grid-auto {
    grid-template-columns: 1fr;
  }
}

/* === Text Colors === */
.text-green { color: var(--color-green); }
.text-red { color: var(--color-red); }
.text-muted { color: var(--color-text-dim); }
.text-accent { color: var(--color-accent); }

/* === Font Utilities === */
.font-mono { font-family: monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* === Spacing === */
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }

.mt-0 { margin-top: 0 !important; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

.pt-16 { padding-top: 16px; }
.pb-0 { padding-bottom: 0 !important; }

/* === Border utilities === */
.border-top { border-top: 1px solid var(--color-border); }

/* === Modal === */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-backdrop.open {
  display: flex;
}

.modal-box {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 32px;
  width: 400px;
  max-width: 90vw;
  border: 1px solid var(--color-border);
}

.modal-title {
  margin: 0 0 20px;
  color: var(--color-text);
  font-size: 16px;
  font-weight: 700;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.modal-actions .btn { flex: 1; }
.modal-actions .btn-submit { flex: 2; }

/* === Filter Form === */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 130px;
}

.filter-group.filter-search {
  min-width: 150px;
}

.filter-label {
  display: block;
  font-size: 11px;
  color: var(--color-text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

@media (max-width: 640px) {
  .filter-form {
    flex-direction: column;
  }
  .filter-group {
    width: 100%;
  }
}

/* === Orders List (mobile view) === */
.orders-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 8px;
  background: var(--color-surface-dark);
  margin-bottom: 8px;
  text-decoration: none;
  transition: background 0.15s;
}

.orders-list a:hover {
  background: var(--color-border);
  text-decoration: none;
}

/* === Empty State === */
.empty-state {
  color: var(--color-text-dim);
  font-size: 14px;
  padding: 20px 0;
  text-align: center;
}

/* === Pagination === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 0;
}

.pagination .btn {
  min-width: 36px;
  text-align: center;
}

/* === Btn outline === */
.btn-outline {
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.btn-outline:hover {
  background: var(--color-border);
  color: var(--color-text);
}

/* === Full width button === */
.btn-full { width: 100%; }

/* === Flex utilities === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* === Text align === */
.text-center { text-align: center; }
.text-right { text-align: right; }

/* === Width === */
.w-full { width: 100%; }

/* === Table header standard === */
.table-header {
  text-align: left;
  padding: 10px 12px;
  color: var(--color-text-dim);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  background: var(--table-header-bg);
}

/* === Detail row (expandable) === */
.detail-row {
  display: none;
  background: var(--color-surface-dark);
}

.detail-row.open {
  display: table-row;
}

.detail-content {
  padding: 16px 20px;
}

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

/* === Btn with icon === */
.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* === Hide text on mobile (for icon buttons) === */
@media (max-width: 640px) {
  .hide-mobile { display: none; }
}

/* === Action row (status change + delete) === */
.action-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.action-form {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  min-width: 150px;
}

/* === Rate recalc section === */
.rate-recalc {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.rate-recalc-title {
  color: var(--color-text-dim);
  font-size: 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.rate-recalc-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rate-field-group label {
  font-size: 11px;
  color: var(--color-text-dim);
  display: block;
  margin-bottom: 2px;
}

.rate-input {
  width: 100px;
  background: var(--input-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.rate-saved-msg {
  display: none;
  color: var(--color-green);
  font-size: 11px;
  margin-top: 14px;
}

/* === Client detail page === */
.client-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.client-header h2 {
  margin-bottom: 0;
}
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
}
.client-info-table {
  width: 100%;
}
.client-info-table td {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-primary);
}
.client-info-table tr:last-child td {
  border-bottom: none;
}
.info-label {
  color: var(--color-text-dim);
  width: 150px;
}
.text-dim {
  color: var(--color-text-dim);
}

/* === Clickable table rows === */
.row-clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.row-clickable:hover td {
  background: var(--bg-hover);
}

/* === KYC status colors === */
.kyc-approved {
  color: var(--color-success);
}
.kyc-rejected {
  color: var(--color-error);
}
.kyc-pending {
  color: var(--color-info);
}
.kyc-none {
  color: var(--color-text-dim);
}

/* === Clients table === */
.clients-table {
  width: 100%;
}
@media (max-width: 768px) {
  .client-grid {
    grid-template-columns: 1fr;
  }
  .info-label {
    width: 120px;
  }
}

/* === Requisites Block (widget step4_pay) === */
.requisites-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}

.requisites-row:last-child {
  border-bottom: none;
}

.requisites-row .label {
  color: var(--color-muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.requisites-row .value {
  font-size: 13px;
  text-align: right;
  word-break: break-all;
  color: var(--color-text);
}

/* === Upload Area fixes === */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 120px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg, 10px);
  padding: 20px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  background: var(--color-surface-dark);
  box-sizing: border-box;
}

.upload-area:hover {
  border-color: var(--color-accent);
  background: rgba(59, 130, 246, 0.05);
}

.upload-area.has-file {
  border-color: var(--color-green);
  background: rgba(34, 197, 94, 0.05);
}

.upload-area .icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-area .text {
  font-size: 13px;
  color: var(--color-muted);
  line-height: 1.5;
}

.upload-area .filename {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-green);
  font-weight: 500;
}

/* === Sandbox button spacing === */
.btn-sandbox {
  background: #f59e0b;
  color: #000;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  width: 100%;
  margin-bottom: 12px;
}

.btn-sandbox:hover {
  background: #d97706;
}

/* === Btn Success (widget) === */
.btn-success {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background: var(--color-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-md, 8px);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-success:hover:not(:disabled) {
  background: #16a34a;
}

.btn-success:disabled {
  background: var(--color-border);
  color: var(--color-muted);
  cursor: not-allowed;
}

/* === Btn Secondary (widget) === */
.btn-secondary {
  display: inline-block;
  padding: 12px 20px;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: var(--color-border);
  text-decoration: none;
}


/* === WIDGET INLINE STYLE REPLACEMENT === */

/* Hidden elements (JS-controlled toggle) */
.widget-hidden { display: none !important; }

/* OCR overlay - fullscreen */
.ocr-overlay {
  display: none; /* JS-controlled */
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ocr-overlay.active { display: flex; }

.ocr-spinner {
  width: 56px; height: 56px;
  border: 5px solid #333;
  border-top-color: #e8630a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.ocr-text-main {
  color: #fff;
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
}

.ocr-text-sub {
  color: #aaa;
  margin-top: 6px;
  font-size: 13px;
}

/* Close button (fullscreen mode) */
.widget-close-wrap {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 0;
}

.widget-close-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Section separators */
.section-sep.mt-0 { margin-top: 0; }

/* Text sizes */
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-md { font-size: 13px; }
.text-lg { font-size: 14px; }
.text-xl { font-size: 16px; }
.text-2xl { font-size: 18px; }
.text-3xl { font-size: 22px; }
.text-4xl { font-size: 28px; }
.text-5xl { font-size: 36px; }

/* Font weights */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Text colors */
.text-muted { color: var(--color-muted); }
.text-primary { color: var(--color-primary, var(--color-accent)); }
.text-success { color: var(--color-success, #22c55e); }
.text-error { color: var(--color-error, #ef4444); }
.text-warning { color: var(--color-warning, #f59e0b); }
.text-white { color: #fff; }

/* Line heights */
.leading-relaxed { line-height: 1.6; }
.leading-loose { line-height: 1.7; }

/* Spacing utilities (widget-specific) */
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.px-12 { padding-left: 12px; padding-right: 12px; }
.py-16 { padding-top: 16px; padding-bottom: 16px; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* Widget card styles */
.widget-card-center {
  text-align: center;
  padding: 20px 16px 16px;
}

.widget-icon-lg {
  font-size: 36px;
  margin-bottom: 8px;
}

.widget-icon-xl {
  font-size: 48px;
  margin-bottom: 12px;
}

/* Welcome text */
.widget-welcome-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
}

/* Form error messages */
.form-error-sm {
  font-size: 12px;
  color: #ef4444;
  margin-top: 4px;
  display: none; /* JS-controlled */
}

/* Order cards in mini-cabinet */
.lk-order-card {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm, 8px);
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lk-order-meta { font-size: 12px; color: var(--color-muted); }
.lk-order-num { font-size: 13px; font-weight: 700; color: var(--color-text); }
.lk-order-amt { font-size: 13px; font-weight: 600; color: var(--color-primary, var(--color-accent)); text-align: right; }
.lk-order-usdt { font-size: 11px; color: var(--color-muted); text-align: right; }

.badge-sm {
  font-size: 11px;
  padding: 2px 8px;
  margin-top: 4px;
  display: inline-flex;
}

/* Rate box */
.rate-box-hidden { display: none; }
.rate-box-visible { display: block; }

/* Fee row */
.fee-row-hidden { display: none; }
.fee-row-visible { display: flex; }

/* Wallet hint */
.wallet-hint {
  font-size: 12px;
  color: #e74c3c;
  margin-top: 5px;
  display: none; /* JS-controlled */
}

.wallet-warning {
  color: #aaa;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
}

/* OCR buttons */
.ocr-btn-wrap {
  display: flex;
  gap: 8px;
}

.btn-ocr {
  flex: 1;
  text-align: center;
}

/* OCR warning box */
.ocr-warning-box {
  display: none; /* JS-controlled */
  background: #7a3f00;
  border: 1px solid #e8630a;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 12px 0;
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
}

/* SMS code input */
.sms-code-input {
  letter-spacing: 4px;
  font-size: 22px;
  text-align: center;
}

/* Contract scroll area */
.contract-scroll-sm {
  max-height: 350px;
  overflow-y: scroll;
}

/* Payment section */
.pay-docs-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pay-doc-link {
  flex: 1;
  min-width: 120px;
  background: var(--color-card2, #1e2433);
  color: var(--color-warning, #f59e0b);
  border: 1px solid var(--color-warning, #f59e0b);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.pay-doc-link:hover {
  opacity: 0.9;
}

/* Copy button */
.copy-btn-orange {
  background: var(--color-warning, #f59e0b);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* QR image */
.qr-image {
  width: 200px;
  height: 200px;
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  display: block;
  margin: 0 auto;
}

/* Upload proof */
.upload-proof-label {
  display: block;
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 13px;
}

.proof-filename {
  font-size: 12px;
  color: var(--color-success, #22c55e);
  margin-top: 6px;
  text-align: center;
}

/* Disabled button style */
.btn-disabled-gray {
  background: #555 !important;
  color: #999 !important;
  cursor: not-allowed !important;
  opacity: 0.6;
}

/* Final status screen */
.status-screen-center {
  text-align: center;
  padding: 24px 16px;
}

.status-note-box {
  font-size: 12px;
  color: var(--color-muted);
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 20px;
}

/* Inline link primary color */
.link-primary {
  color: var(--color-primary, var(--color-accent));
}

/* Resend SMS link */
.resend-link {
  color: var(--color-accent);
  text-decoration: none;
}

/* Word break utility */
.break-all { word-break: break-all; }

/* Display block utility */
.d-block { display: block; }
.d-inline-block { display: inline-block; }

/* Text align right */
.text-right { text-align: right; }


/* Additional margin utilities */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }

/* KYC Warning Banner */
.kyc-warning {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: var(--color-warning-bg, rgba(255, 180, 0, 0.12));
    border: 1px solid var(--color-warning-border, rgba(255, 180, 0, 0.4));
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text);
}
.kyc-warning-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.kyc-warning-text { flex: 1; }

/* Form row 2 columns */
.form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* === OCR Two-page support === */
.ocr-section { margin-bottom: 12px; }
.ocr-section-label { font-size: 11px; color: var(--color-muted); margin-bottom: 6px; }
.ocr-hint { font-size: 12px; color: var(--color-muted); text-align: center; margin-bottom: 12px; padding: 8px; background: var(--color-surface); border-radius: var(--radius-md, 8px); }
.ocr-status-text { text-align: center; margin-bottom: 16px; font-size: 13px; color: var(--color-muted); }
.ocr-file-input { display: none; }
