/* DR CRM: вход, формы, модалки, мелочи поверх styles.css */
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.pointer { cursor: pointer; }

/* ---------- вход ---------- */
.login {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background: radial-gradient(900px 500px at 50% -10%, #16313a 0%, transparent 60%), var(--bg);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 26px 26px;
  box-shadow: var(--shadow);
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-card h1 { font-size: 19px; margin: 0 0 6px; }
.login-card p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.login-card .field { margin-bottom: 14px; }
.login-error {
  display: none; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 107, 107, .1); color: #ffb3b3; font-size: 13px;
}
.login-error.show { display: block; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.field-hint { font-size: 11px; color: var(--muted-2); }
input[type="text"], input[type="search"], input[type="number"], input[type="date"],
input[type="tel"], input[type="password"], select, textarea {
  width: 100%;
  background: #0c131a;
  border: 1px solid var(--line-2);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 70px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .wide { grid-column: 1 / -1; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- кнопки ---------- */
.btn.sm { padding: 7px 11px; font-size: 12.5px; }
.btn.danger { background: rgba(255, 107, 107, .12); color: #ff9d9d; border: 1px solid rgba(255, 107, 107, .25); }
.btn.danger:hover { background: rgba(255, 107, 107, .2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-mini { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.icon-mini:hover { color: var(--text); background: #1c2632; }
.icon-mini.danger:hover { color: var(--red); }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font: inherit; }
.link-btn:hover { text-decoration: underline; }

/* ---------- панели/таблицы ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel.pad { padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 15px; }
.panel-head p { margin: 2px 0 0; color: var(--muted-2); font-size: 12px; }
.panel-body { padding: 16px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1100px) { .grid.two { grid-template-columns: 1fr; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a, .tabs button { padding: 7px 12px; border-radius: 9px; border: 1px solid transparent; color: var(--muted); font-size: 13px; cursor: pointer; background: transparent; }
.tabs a:hover, .tabs button:hover { color: var(--text); background: #16202a; }
.tabs a.active, .tabs button.active { color: var(--text); background: #18232e; border-color: var(--line-2); }
.empty { padding: 34px 16px; text-align: center; color: var(--muted-2); }
.empty b { display: block; color: var(--muted); margin-bottom: 4px; }
.table-wrap { overflow-x: auto; }
table.grid-table { width: 100%; border-collapse: collapse; }
table.grid-table th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.grid-table td { padding: 11px 12px; border-bottom: 1px solid #18222c; font-size: 13px; vertical-align: middle; }
table.grid-table tbody tr:hover td { background: #141c25; }
table.grid-table tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
table.grid-table .ta-r { text-align: right; }
table.grid-table tr.clickable { cursor: pointer; }
.low { color: var(--red); }
.badge-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #1c2836; color: var(--muted); font-size: 11px; }

/* ---------- доска заказов ---------- */
.order-card { cursor: pointer; }
.order-card .order-next { opacity: .55; transition: opacity .15s; }
.order-card:hover .order-next { opacity: 1; }
.order-client { color: var(--muted); font-size: 12px; }
.order-bottom .order-next { margin-left: 2px; }

/* ---------- карточка заказа / модалки ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 150; background: rgba(3, 7, 11, .72);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 18px;
  overflow-y: auto; backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%; max-width: 620px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); animation: pop .14s ease-out;
}
.modal-card.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(6px); opacity: 0; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.modal-body { padding: 4px 20px 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-close { background: transparent; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: #1b2530; }
.form-error { display: none; margin: 10px 0 0; padding: 9px 11px; border-radius: 9px; background: rgba(255,107,107,.12); color: #ffb3b3; font-size: 12.5px; }
.form-error.show { display: block; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted-2); }
.kv dd { margin: 0; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); margin: 18px 0 8px; }
.section-title:first-child { margin-top: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; background: #0e151d; border: 1px solid #1a242f; border-radius: 10px; font-size: 13px; }
.list-row .muted { font-size: 12px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; background: #1a2430; color: var(--muted); font-size: 11px; }
.tag.green { color: var(--accent); background: rgba(46,230,166,.1); }
.tag.red { color: #ff9d9d; background: rgba(255,107,107,.1); }

/* ---------- офлайн и черновики ---------- */
.offline-bar {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: none; align-items: center; gap: 10px;
  background: #3a2317; border: 1px solid #6b3d21; color: #ffcfa8;
  padding: 8px 14px; border-radius: 10px; font-size: 12.5px; box-shadow: var(--shadow);
}
.offline-bar.show { display: flex; }
.offline-bar button { background: transparent; border: 1px solid #8a5330; color: #ffcfa8; border-radius: 7px; padding: 3px 9px; cursor: pointer; font-size: 12px; }

/* ---------- продажа: строки ---------- */
.sale-row { display: flex; gap: 10px; align-items: flex-end; padding: 8px 0; border-bottom: 1px solid #18222c; }
.sale-row .field { min-width: 0; }
@media (max-width: 720px) { .sale-row { flex-wrap: wrap; } .sale-row .field { flex: 1 1 140px; } }

/* ---------- настройки: статусы ---------- */
.status-row { flex-wrap: wrap; }
.status-palette { flex-basis: 100%; }
.bar { display: block; }

/* ---------- график на главной ---------- */
.dash-chart { display: flex; align-items: flex-end; gap: 10px; min-height: 170px; padding-top: 22px; }
.dash-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
.dash-bar i { display: block; width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #2ee6a6, #178a63); opacity: .9; }
.dash-bar:hover i { opacity: 1; box-shadow: 0 0 0 2px rgba(46,230,166,.18); }
.dash-bar small { color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.dash-bar-value { color: var(--muted); font-size: 10.5px; white-space: nowrap; }

/* ---------- печать чека ---------- */
@media print {
  .sidebar, .topbar, .scrim, .modal-foot, .btn { display: none !important; }
  body, .main, .content, .modal-card { background: #fff !important; color: #000 !important; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal-card { border: 0; box-shadow: none; max-width: none; }
}
