/* bill.css — unified light/dark theme-ready stylesheet
   Replace your current bill.css with this file.
   Light theme is default; add class "dark" on <body> for dark theme.
*/

/* -------------------------
   THEME VARIABLES
   Light theme = default ( :root )
   Dark theme = body.dark overrides
   ------------------------- */
input[type="number"] {
  width: 100px !important; /* Потому что размер имеет значение */
  height: 20px !important; /* И высота не исключение */
}



   :root{
  --primary-hex: #00c0ff;
 
  --primary-rgba-top: 0,192,255; /* rgb components without alpha */
  --brand: #29b6ab;
  --bg: #ecf0f1;
  --panel: #fafbfc;
  --muted-panel: #c4c4c4;
  --text: #0f1720;
  --muted: #474f56;
  --line: #e6e9ee;
  --brand-contrast: #ffffff;
  --danger: #c73333;
  --warn: #cfa500;
  --success: #10b981;
  --shadow: 0 6px 20px rgba(16,24,40,0.06);
  --glass: rgba(255,255,255,0.6);
  --live-badge-bg: rgba(255, 255, 255, 0.922);
  --live-badge-border: rgb(255, 255, 255);
  --zpanel-bg: #ffffff;
  --table-head-bg: #bdc3c7;
  --table-body-bg: #f4f4f4;
  --table-row-hover: rgba(79, 119, 116, 0.149);
  --icon-bg: #f8f8f3;
  --modal-backdrop: rgba(0,0,0,0.08);
  --card__head-bg: #2c3e50;
  --sescard__head-bg: #7f8c8d;
}

/* dark theme overrides */
body.dark{
  --brand: #30d5c8;
  --bg: #0f1216;
  --panel: #171b21;
  --muted-panel: #14161a;
  --text: #e7ebf0;
  --muted: #9aa6b2;
  --line: #26282d;
  --brand-contrast: #ffffff;
  --danger: #ff6b6b;
  --warn: #f59e0b;
  --success: #34d399;
  --shadow: 0 8px 24px rgba(0,0,0,0.5);
  --glass: rgba(21,21,21,0.5);
  --live-badge-bg: rgba(27,42,42,0.6);
  --live-badge-border: rgba(48,213,200,0.35);
  --zpanel-bg: #0e1316;
  --table-head-bg: #1b2129;
  --table-row-hover: rgba(255,255,255,0.02);
  --icon-bg: #0f141a;
  --modal-backdrop: rgba(0,0,0,0.45);
}

/* -------------------------
   Base & layout
   ------------------------- */
*{ box-sizing:border-box }
html,body{ height:100% }
body{
  margin:0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font:14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  transition: background .18s, color .18s;
}
.container{ max-width:1100px; margin:24px auto; padding:0 16px; flex: 1; min-height: 100%;}

/* -------------------------
   Topbar
   ------------------------- */
.topbar{
  position:sticky; top:0; z-index:10;
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding:10px 16px;
  background:var(--panel);
  border-bottom:1px solid var(--line);
}
.topbar .left{ display:flex; align-items:center; gap:10px }
.brand{ font-weight:800; color:var(--text); text-decoration:none; margin-right:6px }
.link{ color:var(--text); text-decoration:none; padding:6px 10px; border-radius:8px }
.link:hover{ background: color-mix(in srgb, var(--brand) 12%, transparent) }
.right{ display:flex; align-items:center; gap:12px }
.clock{ font-variant-numeric:tabular-nums; color:var(--muted) }

/* -------------------------
   Buttons / controls
   ------------------------- */
.btn{
  display:inline-block;
  padding:8px 12px;
  border-radius:10px;
  text-decoration:none;
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  cursor:pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.btn.new, .btn.primary{
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight:700;
  border-color: var(--brand);
}
.btn.ghost{ background:transparent; color:var(--text) }
.btn.lg{ padding:12px 16px; border-radius:12px; font-weight:700 }
.btn.danger{ background:var(--danger); color:#fff; border-color:transparent }
.btn.warn{ background:var(--warn); color: #fff; border-color:transparent }
.btn:focus{ outline: none; box-shadow: 0 4px 14px rgba(48,213,200,0.08) }

/* icon buttons */
.icon-btn{
  display:inline-flex; align-items:center; justify-content:center;
  width:34px; height:34px; border-radius:10px;
  border:1px solid var(--line); background:var(--icon-bg);
}
.icon-btn:hover{ border-color: var(--brand) }
.icon-btn svg{ width:18px; height:18px; opacity:.9 }
.icon-btn.danger{ width:34px; height:34px; border-radius:10px; opacity:.9;  color: var(--danger); }
.icon-btn.primary{ width:34px; height:34px; border-radius:10px; opacity:.9;   color: var(--success)}
.icon-btn.print{ width:34px; height:34px; border-radius:10px; opacity:.9;   color: var(--warn)}

/* -------------------------
   Menu / dropdown tweak (avoid hover gap)
   ------------------------- */
.menu{ position:relative; padding-bottom:4px }
.menu__btn{
  background:transparent; border:1px solid var(--line); color:var(--text);
  padding:8px 10px; border-radius:10px; cursor:pointer;
}
.menu__list{
  position:absolute; top:100%; left:0; display:none; min-width:200px;
  background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:6px;
  margin-top:4px;
}
.menu:hover .menu__list{ display:block }
.menu__list a{ display:block; padding:8px 10px; color:var(--text); text-decoration:none; border-radius:8px }
.menu__list a:hover{ background: color-mix(in srgb, var(--brand) 12%, transparent) }

/* -------------------------
   Flash messages
   ------------------------- */
.flash{ display:grid; gap:8px; margin:12px 0 }
.flash__item{ padding:10px 12px; border-radius:10px; background: color-mix(in srgb, var(--panel) 6%, transparent); border:1px solid var(--line) }
.flash__item.error{ background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: color-mix(in srgb, var(--danger) 12%, var(--line) 88%) }

/* -------------------------
   Tables
   ------------------------- */
.table{ width:100%; border-collapse:separate; border-spacing:0 8px }
.table thead th{ text-align:left; font-size:12px; color:var(--muted); padding:0 12px 4px 12px }
.table tbody tr{ background:var(--table-body-bg); border:1px solid var(--line); border-radius:10px; overflow:hidden }
.table tbody td{ padding:10px 12px; border-top:1px solid transparent; border-bottom:1px solid transparent }
.mono{ font-variant-numeric:tabular-nums }

/* unified clean table (sales/catalog style) */
.tbl-clean{ width:100%; border-collapse:separate; }
.tbl-clean thead th{
  text-align:left; font-weight:700; padding:12px 14px;
  background: var(--table-head-bg); position:sticky; top:0; z-index:1;
  border-bottom:1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.tbl-clean tbody td{ padding:10px 14px; border-bottom:1px solid color-mix(in srgb, var(--line) 40%, transparent);  }
.tbl-clean tbody tr{background: var(--table-body-bg); border-radius: 15px;}
.tbl-clean tbody tr:hover{ background: var(--table-row-hover) }

/* badge / pill */
.badge{ display:inline-block; padding:4px 8px; border-radius:999px; border:1px solid var(--line); background:var(--muted-panel); color:var(--text) }
.badge.warn{ border-color: color-mix(in srgb, var(--warn) 30%, var(--line) 70%); background:var(--warn); color: #fff; }
.badge.danger{ border-color: color-mix(in srgb, var(--danger) 30%, var(--line) 70%) }

/* badge-sort */
.badge-sort{
  font-size:12px; font-weight:600; letter-spacing:.02em;
  padding:4px 8px; border-radius:999px; background:var(--icon-bg); border:1px solid var(--line);
}
.badge-sort.active{ border-color:var(--brand); color:var(--brand) }

/* -------------------------
   Cards, panels, sections
   ------------------------- */
.panel, .settings-panel, .report-panel{
  background:var(--panel); color:var(--text);
  border:1px solid var(--line); border-radius:12px; padding:12px; margin:12px 0;
  box-shadow: var(--shadow);
}

.card{
  background:var(--panel); color:var(--text);
  border:1px solid var(--line); border-radius:12px; margin:12px 0;
  box-shadow: var(--shadow);
}

.card__head{
  background: var(--card__head-bg) ;color: #fff; padding:10px 14px; border-bottom:1px solid var(--line); border-top-left-radius:12px; border-top-right-radius: 12px;
}

.card__body{ padding: 12px; margin: 12px 12px;}

.sescard{  
  background:var(--panel); color:var(--text);
  border:1px solid var(--line); border-radius:12px; margin:12px 0;
  box-shadow: var(--shadow);
}

.sescard__body{ padding: 12px; margin: 12px 12px;}

.sescard__head{
  background: var(--sescard__head-bg) ;color: #fff; padding:10px 14px; border-bottom:1px solid var(--line); border-top-left-radius:12px; border-top-right-radius: 12px;
}

.panel__head, .section-head{
  background: color-mix(in srgb, var(--panel) 60%, transparent); padding:10px 14px; border-bottom:1px solid var(--line); margin-top: -12px;
}
.panel__title{ margin:0; font-size:16px; font-weight:700; color:var(--text) }

/* ribbon (highlight) */
.ribbon{
  background: var(--brand); color: var(--brand-contrast); border-radius:12px; padding:10px 14px; font-weight:800;
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  border:1px solid color-mix(in srgb, var(--brand) 60%, var(--line) 40%);
}

/* kv blocks */
.kv { display:grid; grid-template-columns: 1.2fr 1fr; gap:16px }
@media (max-width: 780px){ .kv{ grid-template-columns:1fr } }
.kv .block{ background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:14px }
.kv-row .k{ color:var(--muted) }
.kv-row .v.mono{ font-variant-numeric:tabular-nums }

/* section body */
.section-body{ background:var(--panel); border:1px solid var(--line); border-radius:0 0 12px 12px; padding:14px }

/* -------------------------
   Forms
   ------------------------- */
.form{ display:grid; gap:12px; max-width:620px }
.form.pretty{ display:grid; gap:14px; max-width:640px }
.form.pretty .field{ display:grid; gap:6px }
.form.pretty label{ color:var(--muted); font-size:13px }

.form.pretty input[type="text"],
.form.pretty input[type="number"],
.form.pretty select,
.form.pretty textarea{
  width:100%; padding:12px 14px; border-radius:12px;
  border:1px solid var(--line); background:var(--panel); color:var(--text);
  outline:none; transition:border .15s, box-shadow .15s;
}
.form.pretty textarea{ min-height:96px }
.form.pretty input:focus,
.form.pretty select:focus,
.form.pretty textarea:focus{
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line) 40%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}

/* small layout helpers */
.form__row-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px }
@media (max-width:640px){ .form__row-2{ grid-template-columns:1fr } }
.form__row-3{ display:grid; grid-template-columns:1fr 1fr auto; gap:12px }
.form__row{ display:grid; grid-template-columns:1fr 1fr; gap:12px }

/* field error and alerts */
.field {
  display: flex;
  flex-direction: column;
}

.field-error {
  min-height: 18px;          /* резервируем место */
  font-size: 13px;
  color: #e53935;
  margin-top: 4px;
  line-height: 1.2;
}
.alert.error{ background: color-mix(in srgb, var(--danger) 6%, transparent); border:1px solid color-mix(in srgb, var(--danger) 18%, var(--line) 82%); color: color-mix(in srgb, var(--danger) 80%, var(--text) 20%); padding:8px 10px; border-radius:8px }

/* -------------------------
   Order / Items list specifics
   ------------------------- */
.items-table .th, .items-table .tr{
  display:grid; grid-template-columns: 1fr 90px 120px 120px 90px; gap:10px;
}
.items-table .th{ color:var(--muted); font-size:12px; margin-bottom:6px }
.items-table .tr{ background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:8px 10px }
.items-table .x{ border:1px solid var(--line); border-radius:8px; padding:6px 8px; background:transparent; color:var(--text); cursor:pointer }
.items-table .x:hover{ background: color-mix(in srgb, var(--brand) 12%, transparent) }

/* add-grid */
.add-grid .row{ display:grid; grid-template-columns: 1fr 1fr 120px; gap:8px }
@media (max-width:720px){ .add-grid .row{ grid-template-columns:1fr } }

/* sidebar */
.sidebar .panel{ background:var(--panel); border:1px solid var(--line); border-radius:12px; margin-bottom:12px }
.sidebar .head{ padding:10px 12px; border-bottom:1px solid var(--line); background: color-mix(in srgb, var(--panel) 68%, transparent); border-radius:12px 12px 0 0; font-weight:700 }
.sidebar .list a{ color:var(--brand) }

/* -------------------------
   Live summary float
   ------------------------- */
#live-summary-badge{
  position:fixed; left:10px; bottom:120px; z-index:9999;
  width:34px; height:34px; border-radius:9px;
  background: var(--live-badge-bg); border:1px solid var(--live-badge-border);
  color:var(--brand); display:flex; align-items:center; justify-content:center;
  cursor:pointer; box-shadow:0 2px 10px rgba(0,0,0,0.08);
}
#live-summary-badge .ls-icon{ font-size:18px; line-height:1 }
#live-summary-panel{
  position:fixed; left:52px; bottom:120px; z-index:9999;
  width:290px; max-width:70vw;
  background: var(--zpanel-bg); color:var(--text);
  border:1px solid var(--live-badge-border);
  border-radius:10px; padding:10px 12px; box-shadow:0 10px 24px rgba(0,0,0,.08);
  display:none;
}
#live-summary-panel .ls-row{ display:flex; justify-content:space-between; gap:8px; margin:4px 0 }
#live-summary-panel hr{ border:none; border-top:1px dashed color-mix(in srgb, var(--line) 30%, transparent); margin:6px 0; }
#live-summary-panel[aria-hidden="false"]{ display:block }
#live-summary-badge:hover + #live-summary-panel, #live-summary-panel:hover{ display:block }

/* -------------------------
   Sales report styles (tbl-clean reuse)
   ------------------------- */
.report-panel{ border-radius:14px; padding:16px 18px; box-shadow:var(--shadow); background:var(--panel) }
.report-panel .panel__title{ font-weight:700; margin-bottom:10px }

.tbl-clean .muted{ color:var(--muted) }
.tbl-clean .money::after{ content:" ₸"; }
.tbl-clean .qty::after{ content:" шт."; }

/* badge-dot */
.badge-dot::before{ content:""; width:8px; height:8px; border-radius:50%; background: color-mix(in srgb, var(--brand) 40%, #2e9b8f 60%); }
.badge-dot.off::before{ background: color-mix(in srgb, var(--danger) 50%, #7a2222 50%) }

/* -------------------------
   Confirm modal
   ------------------------- */
.modal-backdrop{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:1000;
  background: var(--modal-backdrop);
}
.modal{
  width:min(520px,92vw); background:var(--panel); border:1px solid var(--line);
  border-radius:14px; box-shadow:0 12px 40px rgba(0,0,0,0.08);
}
.modal__head{ padding:12px 16px; border-bottom:1px solid var(--line) }
.modal__body{ padding:14px 16px }
.modal__actions{ padding:12px 16px; display:flex; gap:8px; justify-content:flex-end; border-top:1px solid var(--line) }

/* -------------------------
   Small helpers & utilities
   ------------------------- */
.kv.onecol{ grid-template-columns:1fr }
.muted{ color:var(--muted) }
.mono{ font-variant-numeric:tabular-nums }
.stat-bar{ display:flex; gap:10px; flex-wrap:wrap; margin:6px 0 10px }
.stat-pill{ background:var(--icon-bg); border:1px solid var(--line); border-radius:999px; padding:6px 10px; font-size:12px }
.stat-pill b{ color:var(--text) }

/* -------------------------
   Print styles for Z-slip
   ------------------------- */
@media print {
  body *{ visibility:hidden !important }
  #z-slip, #z-slip *{ visibility:visible !important }
  #z-slip{ position:absolute !important; left:0 !important; top:0 !important; width:100% !important; box-shadow:none !important; border:none !important; margin:0 !important }
  #z-slip .btn, #z-slip a{ display:none !important }
}

/* -------------------------
   Accessibility / focus
   ------------------------- */
:focus{ outline: 2px solid color-mix(in srgb, var(--brand) 24%, transparent); outline-offset: 2px }

/* -------------------------
   End of file
   ------------------------- */

   /* two-column page layout for forms + sidebar */
.page.two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .page.two-col {
    grid-template-columns: 1fr;
  }
}


/* ===== Flash / messages ===== */
.messages { position: fixed; top: 78px; right: 20px; z-index: 1200; display:flex; flex-direction:column; gap:8px; }
.msg {
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  font-weight: 500;
  min-width: 220px;
  max-width: 420px;
  line-height: 1.25;
  border: 1px solid transparent;
  opacity: 0.98;
}

/* Success (зелёный) */
.msg.success, .msg.success.extra, .msg.ok {
  background: color-mix(in srgb, #30d5c8 8%, white);
  color: #08736a;
  border-color: rgba(48,213,200,0.20);
}

/* Error / Danger (красный) */
.msg.error, .msg.danger {
  background: color-mix(in srgb, #e45757 10%, white);
  color: #7a1f1f;
  border-color: rgba(228,87,87,0.18);
}

/* Warning (жёлтый/orange) */
.msg.warning, .msg.warn {
  background: color-mix(in srgb, #ffb347 10%, white);
  color: #6a4300;
  border-color: rgba(255,179,71,0.18);
}

/* Info (голубой/нейтраль) */
.msg.info {
  background: color-mix(in srgb, #30d5c8 6%, white);
  color: #0a6870;
  border-color: rgba(48,213,200,0.12);
}

/* Мелкие стили: заголовок/иконка и кнопка закрытия (если будет) */
.msg .title { font-weight:700; margin-bottom:4px; display:block; }
.msg .muted { opacity:.85; font-size:13px; }

/* тонкая анимация появления/исчезновения */
.msg { transform-origin: right top; transition: transform .15s ease, opacity .18s ease; }
.msg.enter { transform: translateY(-6px) scale(.995); opacity:0; }
.msg.show { transform: translateY(0) scale(1); opacity:1; }

.reports-summary { margin: 14px 0; }
.report-card { flex:1; border-radius:8px; padding:12px; background:var(--card-bg,#f7fafb); box-shadow:0 1px 0 rgba(0,0,0,0.04); }
.card__head { font-weight:700; }
.report-total { font-size:20px; font-weight:700; color:var(--brand); margin-bottom:10px; }
.report-sub { font-size:15px;}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.report-card {
  flex: 1 1 calc(33.333% - 16px); /* три карточки в ряд */
  min-width: 250px;                /* не меньше 250px шириной */
}

/* Общий стиль полей (темная тема) */
.form-input {
  display: block;
  width: 100%;
  height: 48px;                 /* одинаковая высота с паролем/логином */
  padding: 12px 16px;
  padding-right: 48px;         /* место под суффикс если нужен */
  font-size: 15px;
  color: #E6EEF6;              /* светлый текст */
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.06));
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset, 0 6px 20px rgba(1,6,14,0.4);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .12s ease;
  -webkit-appearance: none;
  -moz-appearance: none;
}



