/* ============================================================
   Orion + Mira — Unified Styles (единый файл для всей экосистемы)
   ============================================================ */

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

html { font-size: 13px; }

/* ----- Variables ----- */
:root {
  /* Palette */
  --bg:            #0a0d10;
  --surface:       #111418;
  --surface2:      #181c21;
  --border:        #262b33;
  --text:          #e6eaf0;
  --muted:         #788290;
  --faint:         #404854;
  --brand:         #ffaa00;
  --accent:        #5b8def;
  --green:         #3cb878;
  --red:           #e0556a;
  --yellow:        #e0a030;

  /* Typography */
  --font:          system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono:          'SF Mono', Consolas, 'Cascadia Code', monospace;
  --text-base:     13px;
  --text-sm:       11px;
  --text-xs:       10px;

  /* Spacing */
  --radius:        8px;
  --radius-sm:     3px;
  --space-xs:      4px;
  --space-sm:      8px;
  --space-md:      12px;
  --space-lg:      16px;
  --space-xl:      24px;
  --space-2xl:     28px;

  /* Effects */
  --glass:         color-mix(in srgb, var(--bg) 94%, transparent);
  --transition:    0.18s ease;
}

/* ----- Body (единая раскладка: topbar → content → input) ----- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.45;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea {
  font: inherit; background: none; border: none; color: inherit; outline: none;
}

a { color: var(--accent); text-decoration: none; }
.hidden { display: none !important; }

/* ----- Scrollbar ----- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--faint); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ----- Utility ----- */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ============================================================
   Topbar (единый для Ориона и Миры)
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
  z-index: 100;
  position: sticky;
  top: env(safe-area-inset-top, 0px);
}

.topbar-title {
  font-weight: 600; color: var(--brand); font-size: 14px;
  white-space: nowrap; letter-spacing: -0.3px;
}

.topbar-sub {
  color: var(--muted); font-size: var(--text-xs); white-space: nowrap;
}

.topbar a {
  color: var(--accent); font-size: 14px; text-decoration: none; flex-shrink: 0;
}

.topbar-left {
  display: flex; align-items: center; gap: var(--space-sm); flex: 1; min-width: 0;
}

.topbar-right {
  display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0;
}

/* ----- Badges ----- */
.micro-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 6px;
  font-size: var(--text-xs); line-height: 1;
  border: 1px solid var(--border); border-radius: var(--radius);
  white-space: nowrap; flex-shrink: 0;
}
.micro-badge.muted  { color: var(--muted); }
.micro-badge.faint  { color: var(--faint); font-family: var(--mono); }

.api-dot {
  width: 5px; height: 5px; border-radius: 5px; background: var(--faint);
  transition: background var(--transition); flex-shrink: 0;
}
.api-dot.on  { background: var(--green); box-shadow: 0 0 4px var(--green); }
.api-dot.off { background: var(--red); }
.api-dot.connecting { background: var(--yellow); animation: apiPulse 0.8s ease-in-out infinite alternate; }
@keyframes apiPulse {
  from { opacity: 0.3; box-shadow: 0 0 2px var(--yellow); }
  to   { opacity: 1;   box-shadow: 0 0 6px var(--yellow); }
}

.api-badge.on  { border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.api-badge.off { border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.api-badge.connecting { border-color: color-mix(in srgb, var(--yellow) 35%, transparent); }

/* ----- Icon button ----- */
.icon-btn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius); font-size: 12px; color: var(--muted);
  cursor: pointer; background: none; border: none; flex-shrink: 0;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }
.icon-btn:active { transform: scale(0.95); }

/* ============================================================
   Mira — Chat
   ============================================================ */

/* --- Layout --- */
#app.cy-app { flex:1; display:flex; flex-direction:column; overflow:hidden; }
#app.cy-app .cy-page { flex:1; overflow-y:auto; }

.chat-wrap {
  flex:1; overflow-y:auto; padding:12px;
  -webkit-overflow-scrolling:touch; display:flex; flex-direction:column;
}
.chat-inner {
  margin-top:auto; display:flex; flex-direction:column; gap:6px;
}

/* --- Welcome --- */
.chat-wrap .welcome {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; padding:16px; text-align:center; margin-bottom:4px;
}
.chat-wrap .welcome h3 { font-size:15px; color:var(--brand); margin-bottom:6px; }
.chat-wrap .welcome p { font-size:12px; color:var(--muted); line-height:1.5; }

.quick-actions {
  display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; justify-content:center;
}
.qa-btn {
  padding:7px 12px; font-size:11px; border-radius:16px;
  border:1px solid var(--border); color:var(--muted);
  background:var(--surface2); cursor:pointer; transition:.15s;
}
.qa-btn:active { border-color:var(--accent); color:var(--text); }

/* --- Messages --- */
.msg {
  max-width:85%; padding:10px 14px; border-radius:14px; font-size:13px;
  line-height:1.5; word-wrap:break-word; animation:in .2s ease;
}
.msg.user {
  align-self:flex-end; background:var(--accent); color:#fff;
  border-bottom-right-radius:4px;
}
.msg.bot {
  align-self:flex-start; background:var(--surface2);
  border:1px solid var(--border); border-bottom-left-radius:4px; white-space:pre-wrap;
}
.msg .time { font-size:10px; opacity:.45; margin-top:4px; }
.msg.user .time { text-align:right; }
.msg img { max-width:200px; border-radius:8px; margin-top:4px; cursor:pointer; }
.msg audio { max-width:200px; margin-top:4px; }

/* --- Typing indicator --- */
.typing {
  align-self:flex-start; display:flex; gap:4px; padding:12px 14px;
}
.typing span {
  width:6px; height:6px; background:var(--muted); border-radius:50%;
  animation:bounce 1.4s infinite;
}
.typing span:nth-child(2) { animation-delay:.2s; }
.typing span:nth-child(3) { animation-delay:.4s; }
@keyframes bounce { 0%,80%,100%{transform:scale(0)} 40%{transform:scale(1)} }
@keyframes in { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }

/* --- Input bar --- */
.input-bar {
  display:flex; flex-direction:column; gap:0; border-top:1px solid var(--border);
  background:var(--glass); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
  flex-shrink:0; position:sticky; bottom:0; z-index:100;
  padding-bottom:max(6px, env(safe-area-inset-bottom, 6px));
}
.input-row { display:flex; gap:8px; padding:6px 12px 8px; align-items:flex-end; }
.input-bar textarea {
  flex:1; background:var(--surface2); border:1px solid var(--border);
  border-radius:18px; padding:8px 14px; font-size:14px; color:var(--text);
  outline:none; resize:none; max-height:100px; font-family:var(--font);
  line-height:1.4; transition:border-color .15s;
}
.input-bar textarea:focus { border-color:var(--accent); }
.input-bar .cy-btn-round {
  width:36px; height:36px; border-radius:50%; background:var(--surface2);
  border:1px solid var(--border); color:var(--muted); font-size:16px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.input-bar .cy-btn-round:active { background:var(--border); }
.input-bar .cy-btn-send {
  width:36px; height:36px; border-radius:50%; background:var(--accent);
  color:#fff; font-size:16px; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
  transition:opacity .15s;
}
.input-bar .cy-btn-send:disabled { opacity:.4; }
.input-bar .cy-btn-send:active { opacity:.7; }
.input-bar .mic.recording {
  background:var(--red); border-color:var(--red); color:#fff;
  animation:pulse .8s infinite;
}
@keyframes pulse {
  0%,100%{box-shadow:0 0 0 0 rgba(224,85,106,.4)}
  50%{box-shadow:0 0 0 8px rgba(224,85,106,0)}
}

.preview-row { display:none; flex-wrap:wrap; gap:4px; padding:4px 12px 0; }
.preview-thumb {
  display:inline-flex; align-items:center; gap:4px;
  background:var(--surface2); border:1px solid var(--border);
  border-radius:8px; padding:4px 8px; font-size:11px; margin:4px 0;
}
.preview-thumb img { width:40px; height:40px; object-fit:cover; border-radius:8px; }
.preview-thumb .remove { color:var(--red); cursor:pointer; font-size:14px; margin-left:4px; }

/* --- Reload button --- */
#reloadBtn:hover { background:var(--surface2); color:var(--text); transform:scale(1.1); }
#reloadBtn:active { transform:scale(0.95); }

/* ============================================================
   Login Screen (общий)
   ============================================================ */
.login-screen {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 24px)) 24px max(24px, env(safe-area-inset-bottom, 24px));
  animation: fadeIn 0.3s ease;
}
.login-card {
  width: 340px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-2xl);
  animation: slideUp 0.35s ease;
}
.login-title {
  font-size: 15px; font-weight: 600; margin-bottom: 2px;
}
.login-version {
  color: var(--muted); font-size: var(--text-xs); margin-bottom: var(--space-xl);
}
.form-block { display: flex; flex-direction: column; gap: var(--space-md); }
.field { display: flex; flex-direction: column; gap: 2px; }
.field label {
  font-size: var(--text-xs); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.4px;
}
.input, .select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus, .select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}
.field-check { display: flex; align-items: center; gap: var(--space-sm); }
.field-check label { font-size: var(--text-xs); color: var(--muted); cursor: pointer; }
.field-check input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.btn-primary {
  background: var(--accent); color: #fff; border-radius: var(--radius);
  padding: 10px 20px; font-weight: 500; cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ============================================================
   Orion — App Layout
   ============================================================ */
.app {
  display: flex; flex-direction: column; flex: 1; overflow: hidden;
  animation: fadeIn 0.25s ease;
}

/* --- Status Tabs --- */
.status-tabs { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.status-tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  height: 22px; display: inline-flex; align-items: center; padding: 0 12px;
  font-size: var(--text-sm); color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
  line-height: 1;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.tab-btn:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 40%, transparent); }
.tab-btn.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.tab-count { margin-left: 3px; opacity: 0.45; font-size: var(--text-xs); }
.mobile-select { display: none; }

/* --- Designer Row --- */
.designer-row {
  padding: 0 12px 1px; display: flex; gap: 4px; flex-wrap: wrap;
  font-size: var(--text-xs); animation: slideDown 0.2s ease;
}
.subtab-btn {
  padding: 3px 8px; font-size: var(--text-xs); color: var(--muted);
  cursor: pointer; border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}
.subtab-btn:hover { background: var(--surface2); }
.subtab-btn.active { background: var(--surface2); color: var(--text); font-weight: 500; }

/* --- Toolbar --- */
.toolbar {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 6px 12px; flex-wrap: wrap; animation: slideDown 0.2s ease;
}
.search-wrap { position: relative; flex: 1; min-width: 140px; max-width: 320px; }
.search-input {
  width: 100%; height: 24px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0 10px 0 32px; font-size: var(--text-xs); line-height: 1;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent); }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: var(--text-sm); pointer-events: none; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  color: var(--muted); cursor: pointer; font-size: 14px; padding: 2px 4px;
  border-radius: var(--radius-sm); display: none; transition: color var(--transition);
}
.search-clear:hover { color: var(--text); }
.search-clear.visible { display: block; }
.sort-btn {
  display: inline-flex; align-items: center; gap: 4px; height: 24px;
  padding: 0 10px; font-size: var(--text-xs); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--muted); cursor: pointer;
  white-space: nowrap; line-height: 1;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.sort-btn:hover { background: var(--surface2); color: var(--text); }
.sort-btn.active { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.sort-arrow { font-size: 10px; transition: transform var(--transition); }
.sort-btn.asc .sort-arrow { transform: rotate(0deg); }
.sort-btn.desc .sort-arrow { transform: rotate(180deg); }
.group-btn { font-weight: 600; letter-spacing: 0.3px; }
.group-btn.active { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* --- Page & Board --- */
.page { flex:1; overflow-y:auto; padding:0 12px 16px; -webkit-overflow-scrolling:touch; }
.chips-wrap { padding: 6px var(--space-lg) var(--space-sm); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.chip {
  padding: 3px 8px; font-size: var(--text-xs); border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), opacity var(--transition);
  user-select: none;
}
.chip:hover { border-color: var(--faint); }
.chip.active { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.chip.off { opacity: 0.35; }
.chip-reset { border-color: var(--red); color: var(--red); font-weight: 500; }
.chip-reset:hover { background: color-mix(in srgb, var(--red) 10%, transparent); border-color: var(--red); }
.board { display: flex; flex-direction: column; }
mark.search-match { background: color-mix(in srgb, var(--yellow) 30%, transparent); color: var(--text); border-radius: 2px; padding: 0 1px; }

/* --- Groups --- */
.group { border-bottom: 1px solid var(--border); }
.group-head {
  width: 100%; display: flex; align-items: center; gap: var(--space-sm);
  padding: 7px var(--space-lg); cursor: pointer; user-select: none;
  transition: background var(--transition);
}
.group-head:hover { background: var(--surface); }
.group-title { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text); }
.group-badge { font-size: var(--text-xs); color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, transparent); padding: 1px 6px; border-radius: 10px; font-weight: 500; }
.group-toggle { margin-left: auto; font-size: var(--text-xs); color: var(--muted); transition: transform var(--transition); }
.group.open .group-toggle { transform: rotate(180deg); }
.group-body { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; }
.group.open .group-body { max-height: 9999px; }

/* --- Orders --- */
.order { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); transition: background var(--transition); }
.order:first-child { border-top: none; }
.order.has-debt .order-head { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.order.has-debt .order-head:hover { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.order-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 6px var(--space-lg); cursor: pointer; transition: background var(--transition);
}
.order-head:hover { background: var(--surface); }
.order-id { font-family: var(--font); font-size: var(--text-sm); font-weight: 500; color: var(--text); min-width: 32px; text-align: left; }
.order-date { font-size: var(--text-sm); color: var(--muted); min-width: 52px; text-align: left; }
.order-product { font-size: var(--text-sm); color: var(--muted); min-width: 80px; text-align: left; }
.order-desc-short { flex:1; font-size: var(--text-sm); color: var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; text-align:left; }
.order-money { margin-left:auto; display:flex; gap:var(--space-sm); align-items:center; flex-shrink:0; font-size:var(--text-sm); }
.debt-positive { color: var(--yellow); }
.paid { color: var(--green); }
.money-short { display: none; }
.highlight { font-weight: 600; color: var(--brand); }
.order-chevron { font-size: 10px; color: var(--faint); margin-left: 2px; transition: transform var(--transition); }
.order.open .order-chevron { transform: rotate(90deg); }
.order-body {
  overflow: hidden; max-height: 0; padding: 0 var(--space-lg) 0 48px;
  border-top: 1px solid var(--border); background: var(--surface);
  transition: max-height 0.25s ease, padding 0.25s ease;
}
.order.open .order-body { max-height: 400px; padding: 10px var(--space-lg) 10px 48px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: var(--space-md); }
.detail-card { display: flex; flex-direction: column; gap: 1px; }
.detail-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.detail-value { font-size: 1rem; text-align: left; }
.detail-card--wide { grid-column: 1 / -1; }
.detail-client-row { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; }
.client-name { font-weight: 500; }
.client-phone { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); white-space: nowrap; }
.msg-icon { flex-shrink: 0; opacity: 0.7; }
.phone-link { color: var(--accent); text-decoration: none; transition: color var(--transition); }
.phone-link:hover { color: var(--text); text-decoration: underline; }

/* --- Status Actions --- */
.status-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.status-btn {
  padding: 5px 12px; font-size: var(--text-xs); border-radius: var(--radius);
  border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}
.status-btn:hover { border-color: var(--faint); color: var(--text); transform: translateY(-1px); }
.status-btn:active { transform: translateY(0); }
.status-btn.primary  { border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--accent); }
.status-btn.success  { border-color: color-mix(in srgb, var(--green) 30%, transparent);  color: var(--green); }
.status-btn.warn     { border-color: color-mix(in srgb, var(--brand) 30%, transparent);  color: var(--brand); }
.status-btn.danger   { border-color: color-mix(in srgb, var(--red) 30%, transparent);    color: var(--red); }
.status-btn.primary:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.status-btn.success:hover { background: color-mix(in srgb, var(--green) 10%, transparent); }
.status-btn.warn:hover    { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.status-btn.danger:hover  { background: color-mix(in srgb, var(--red) 10%, transparent); }

/* --- Drag & Drop --- */
.order.dragging { opacity: 0.4; transform: scale(0.98); transition: opacity 0.15s ease, transform 0.15s ease; }
.order.drag-over { border-top: 2px solid var(--accent); }
.drop-zone {
  min-height: 40px; border: 1px dashed var(--border); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: var(--text-xs);
  transition: border-color var(--transition), background var(--transition); margin-top: var(--space-xs);
}
.drop-zone.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }

/* --- Empty State --- */
.empty { text-align: center; padding: 64px var(--space-lg); color: var(--muted); font-size: 1rem; }
.empty-icon { font-size: 36px; display: block; margin-bottom: var(--space-sm); opacity: 0.4; }

/* ============================================================
   Toast & Modal
   ============================================================ */
.toast-wrap {
  position: fixed; bottom: 16px; right: 16px; z-index: 999;
  display: flex; flex-direction: column; gap: 6px; pointer-events: none;
}
.toast {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px; font-size: var(--text-sm);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards; pointer-events: auto;
}
.toast.err { border-color: var(--red); background: color-mix(in srgb, var(--red) 8%, var(--surface2)); }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-lg); animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: var(--space-xl);
  max-width: 420px; width: 100%; animation: modalIn 0.25s ease;
}
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 10px; }
.modal p { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-sm); white-space: pre-wrap; }
.modal .msg-preview {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px; font-size: var(--text-sm); margin-bottom: var(--space-md); white-space: pre-wrap; text-align: left;
}
.modal-btns { display: flex; gap: var(--space-sm); justify-content: flex-end; }

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp   { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn   { from { opacity: 0; transform: translateY(20px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn   { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut  { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 768px) {
  .topbar { flex-wrap: wrap; gap: 4px; padding: 6px 10px; }
  .topbar-left { flex-wrap: wrap; gap: 4px; }
  .topbar-title { margin-right: 2px; }
  .topbar-sub { margin-left: 0; }
  .api-text { display: none; }
  .api-badge { min-width: 24px; justify-content: center; }
  .icon-btn { width: 22px; height: 22px; padding: 0; font-size: 12px; }
  .status-tabs { display: none; }
  .mobile-select {
    display: block; height: 22px; background: var(--surface2);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 0 6px; font-size: var(--text-xs); color: var(--text); max-width: 160px; line-height: 1;
  }
  .toolbar { padding: 6px 10px; gap: 6px; }
  .search-wrap { max-width: none; }
  .page { padding: var(--space-xs) 0; }
  .chips-wrap { padding: var(--space-xs) 8px 6px; }
  .group-head { padding: 6px 10px; }
  .order-head { padding: 6px 10px; gap: 6px; }
  .order-id { min-width: 24px; font-size: var(--text-xs); }
  .order-date { min-width: 44px; font-size: var(--text-xs); }
  .order-product { min-width: 0; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .order-desc-short { font-size: var(--text-sm); }
  .order-money { font-size: var(--text-xs); gap: var(--space-xs); }
  .order.open .order-body { padding: 10px 10px 10px 10px; max-height: 500px; }
  .details-grid { grid-template-columns: 1fr; gap: var(--space-sm); }
  .status-actions { justify-content: stretch; }
  .status-btn { flex: 1; text-align: center; }
  .detail-client-row { gap: var(--space-sm); }
  .client-phone { font-size: var(--text-xs); }
  .msg-icon { width: 12px; height: 12px; }
  .money-full  { display: none; }
  .money-short { display: inline; }
  .modal { margin: 10px; max-width: none; border-radius: var(--radius) var(--radius) 0 0; }

  .chat-wrap { padding: 8px; }
  .input-row { padding: 6px 8px 8px; }
}
