/* ═══════════════════════════════════════════════
   KARETA.KZ — ORDER SYSTEM STYLES
═══════════════════════════════════════════════ */

/* ── Order Wizard Overlay ── */
.owiz-overlay {
  display: none;
  position: fixed; inset: 0;
  z-index: 800;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: flex-end; justify-content: center;
}
.owiz-overlay.open { display: flex; }

@media (min-width: 640px) {
  .owiz-overlay { align-items: center; }
}

.owiz-box {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 92dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: slideUp .32s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp { from{transform:translateY(40px);opacity:0} to{transform:none;opacity:1} }

@media (min-width: 640px) {
  .owiz-box { border-radius: 16px; max-width: 620px; max-height: 88vh; }
}

.owiz-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.owiz-title {
  font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
}
.owiz-close {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); color: var(--text3); font-size: 20px;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s;
}
.owiz-close:hover { background: var(--surface2); color: var(--text); }

/* Steps bar */
.owiz-steps {
  display: flex; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
  overflow-x: auto; scrollbar-width: none; gap: 0;
}
.owiz-steps::-webkit-scrollbar { display: none; }
.owiz-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px; flex-shrink: 0; position: relative;
}
.owiz-step-dot {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface2); border: 1.5px solid var(--line);
  color: var(--text3); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: .25s; z-index: 1;
}
.owiz-step.active .owiz-step-dot { background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 0 0 4px rgba(255,107,0,.15); }
.owiz-step.done   .owiz-step-dot { background: rgba(34,197,94,.15); border-color: #22c55e; color: #22c55e; }
.owiz-step-label { font-size: 9px; font-weight: 700; color: var(--text3); white-space: nowrap; }
.owiz-step.active .owiz-step-label { color: var(--orange); }
.owiz-step.done   .owiz-step-label { color: #22c55e; }
.owiz-step-line {
  position: absolute; top: 14px; left: 50%; width: calc(100% + 24px);
  height: 1.5px; background: var(--line); z-index: 0;
}
.owiz-step.done .owiz-step-line { background: #22c55e; }

/* Body */
.owiz-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

/* Footer */
.owiz-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid var(--line); flex-shrink: 0;
  padding-bottom: max(14px, env(safe-area-inset-bottom, 14px));
  gap: 10px;
}
.owiz-footer .btn { flex: 1; justify-content: center; }

/* ── Wizard content styles ── */
.owiz-section-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1.2px; margin-bottom: 12px;
}
.owiz-cat-label {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px;
}
.owiz-svc-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
}
.owiz-svc-chip {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 12px; cursor: pointer; transition: .2s;
}
.owiz-svc-chip:hover { border-color: var(--orange-brd); background: var(--orange-dim); }
.owiz-svc-chip.sel  { border-color: var(--orange); background: var(--orange-dim); }
.owiz-svc-ico   { font-size: 22px; display: block; margin-bottom: 6px; }
.owiz-svc-name  { font-size: 12px; font-weight: 700; margin-bottom: 3px; }
.owiz-svc-price { font-size: 11px; color: var(--orange); font-weight: 600; }

.owiz-priority-row { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.owiz-prio-btn {
  padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; transition: .2s;
}
.owiz-prio-btn.sel { border-color: var(--orange); background: var(--orange-dim); color: var(--orange); }

.owiz-days-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none;
}
.owiz-days-scroll::-webkit-scrollbar { display: none; }
.owiz-day-btn {
  flex-shrink: 0; padding: 8px 14px; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; transition: .2s;
  white-space: nowrap;
}
.owiz-day-btn:hover { border-color: var(--orange-brd); }
.owiz-day-btn.sel   { background: var(--orange); border-color: var(--orange); color: #fff; }
.owiz-day-btn.weekend { color: var(--text3); }

.owiz-times-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 4px;
}
.owiz-time-btn {
  padding: 10px 4px; border-radius: 8px; font-size: 13px; font-weight: 700; text-align: center;
  background: var(--surface); border: 1.5px solid var(--line); cursor: pointer; transition: .2s;
}
.owiz-time-btn:hover { border-color: var(--orange-brd); }
.owiz-time-btn.sel  { background: var(--orange); border-color: var(--orange); color: #fff; }
.owiz-time-btn.busy { opacity: .45; cursor: not-allowed; background: var(--surface2); }
.owiz-pick-hint { font-size: 13px; color: var(--text3); padding: 12px 0; text-align: center; }

.owiz-masters-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px;
}
.owiz-master-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: 10px; cursor: pointer; transition: .2s;
  background: var(--surface); border: 1.5px solid var(--line); min-width: 80px;
}
.owiz-master-card:hover { border-color: var(--orange-brd); }
.owiz-master-card.sel   { border-color: var(--orange); background: var(--orange-dim); }
.owiz-master-av {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-size: 14px; font-weight: 700;
}
.owiz-master-name { font-size: 12px; font-weight: 700; }
.owiz-master-spec { font-size: 10px; color: var(--text3); }

/* Client step */
.owiz-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
@media (max-width: 500px) { .owiz-form { grid-template-columns: 1fr; } }
.owiz-field label { display: block; font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.owiz-input {
  width: 100%; box-sizing: border-box;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: 14px;
  color: var(--text); font-family: 'Mulish', sans-serif;
  outline: none; transition: .2s;
}
.owiz-input:focus { border-color: var(--orange-brd); }
.owiz-input textarea { resize: vertical; }

.owiz-divider {
  display: flex; align-items: center; gap: 10px; margin: 14px 0;
  color: var(--text3); font-size: 12px;
}
.owiz-divider::before, .owiz-divider::after { content:''; flex:1; height:1px; background:var(--line); }

.owiz-cl-dropdown {
  display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
  background: var(--bg2); border: 1px solid var(--orange-brd);
  border-radius: 0 0 10px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  max-height: 200px; overflow-y: auto;
}
.owiz-cl-item {
  padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--line); transition: .15s;
}
.owiz-cl-item:hover { background: var(--orange-dim); }
.owiz-client-selected {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px; margin-top: 10px;
  background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25); font-size: 13px;
}
.owiz-cs-ico { color: #22c55e; font-size: 16px; font-weight: 700; }

/* Confirm step */
.owiz-confirm-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.owiz-cc-row {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.owiz-cc-row span:first-child { color: var(--text3); min-width: 130px; flex-shrink: 0; }
.owiz-cc-row span:last-child  { font-weight: 600; flex: 1; }
.owiz-cc-total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; background: var(--orange-dim);
  font-size: 13px; font-weight: 700;
}
.owiz-cc-price { font-family: 'Oswald', sans-serif; font-size: 22px; color: var(--orange); }

/* ═══════════════════════════════════════════════
   ORDER DETAIL PANEL
═══════════════════════════════════════════════ */
.odet-overlay {
  display: none; position: fixed; inset: 0; z-index: 750;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.odet-overlay.open { display: flex; }
@media (min-width: 700px) { .odet-overlay { align-items: center; } }

.odet-panel {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; width: 100%; max-height: 92dvh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .3s cubic-bezier(.16,1,.3,1);
}
@media (min-width: 700px) { .odet-panel { border-radius: 16px; max-width: 560px; max-height: 88vh; } }

.odet-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0;
  position: relative;
}
.odet-id { font-family: 'Oswald', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.odet-status {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 99px;
}
.odet-body { flex: 1; overflow-y: auto; }
.odet-section { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.odet-section-title { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.odet-info-grid { display: grid; gap: 1px; }
.odet-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.04); }
.odet-key { font-size: 12px; color: var(--text3); min-width: 120px; flex-shrink: 0; }
.odet-val { font-size: 13px; font-weight: 600; flex: 1; }

.odet-status-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.odet-status-btn {
  padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--line);
  color: var(--text3); cursor: pointer; transition: .2s;
}
.odet-status-btn.active { background: var(--sc, var(--orange))22; border-color: var(--sc, var(--orange)); color: var(--sc, var(--orange)); }
.odet-status-btn:hover:not(.active) { border-color: var(--sc, var(--line)); opacity: .85; }

.odet-masters-row { display: flex; gap: 8px; flex-wrap: wrap; }
.odet-master-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer; transition: .2s;
  background: var(--surface); border: 1.5px solid var(--line); font-size: 12px; font-weight: 700;
}
.odet-master-chip:hover { border-color: var(--orange-brd); }
.odet-master-chip.active { border-color: var(--orange); background: var(--orange-dim); color: var(--orange); }
.odet-mc-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 700;
}

/* Timeline */
.odet-timeline { display: flex; flex-direction: column; gap: 0; }
.odet-tl-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 0;
}
.odet-tl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface2); border: 1.5px solid var(--line);
  color: var(--text3); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px; transition: .25s;
}
.odet-tl-item.done .odet-tl-dot { background: rgba(34,197,94,.12); border-color: #22c55e; }
.odet-tl-label { font-size: 13px; font-weight: 600; }
.odet-tl-item.done .odet-tl-label { color: #22c55e; }
.odet-tl-time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.odet-add-stage-btn {
  font-size: 11px; font-weight: 700; color: var(--orange);
  background: var(--orange-dim); border: 1px solid var(--orange-brd);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: .2s;
}
.odet-add-stage-btn:hover { background: rgba(255,107,0,.2); }

.odet-report-card {
  background: rgba(255,107,0,.06); border: 1px solid var(--orange-brd);
  border-left: 3px solid var(--orange); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
}
.odet-report-head { font-size: 11px; font-weight: 700; color: var(--orange); margin-bottom: 5px; }
.odet-report-text { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ── Clients panel toolbar ── */
.cpanel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.cpanel-toolbar { display: flex; gap: 10px; align-items: center; }

/* ═══════════════════════════════════════════════
   ORDER DETAIL PANEL
═══════════════════════════════════════════════ */
.odet-overlay {
  display: none; position: fixed; inset: 0; z-index: 750;
  background: rgba(0,0,0,.65); backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end; justify-content: center;
}
.odet-overlay.open { display: flex; }
@media (min-width: 700px) { .odet-overlay { align-items: center; } }

.odet-panel {
  background: var(--bg2); border: 1px solid var(--line);
  border-radius: 20px 20px 0 0; width: 100%; max-height: 92dvh;
  display: flex; flex-direction: column; overflow: hidden;
  animation: slideUp .3s cubic-bezier(.16,1,.3,1);
}
@media (min-width: 700px) { .odet-panel { border-radius: 16px; max-width: 560px; max-height: 88vh; } }
@keyframes slideUp { from{transform:translateY(30px);opacity:0} to{transform:none;opacity:1} }

.odet-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 20px 14px; border-bottom: 1px solid var(--line);
  flex-shrink: 0; position: relative;
}
.odet-id { font-family:'Oswald',sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.odet-status-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.odet-body { flex: 1; overflow-y: auto; }
.odet-section { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.odet-sec-title {
  font-size: 11px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.odet-row { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.03); }
.odet-key { font-size: 12px; color: var(--text3); min-width: 110px; flex-shrink: 0; }
.odet-val { font-size: 13px; font-weight: 600; flex: 1; }

.odet-status-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.odet-st-btn {
  padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1.5px solid var(--line);
  color: var(--text3); cursor: pointer; transition: .2s;
}
.odet-st-btn.active { background: color-mix(in srgb, var(--sc) 15%, transparent); border-color: var(--sc); color: var(--sc); }
.odet-st-btn:hover:not(.active) { border-color: var(--sc); opacity: .8; }

.odet-masters-row { display: flex; gap: 8px; flex-wrap: wrap; }
.odet-master-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 10px; cursor: pointer; transition: .2s;
  background: var(--surface); border: 1.5px solid var(--line); font-size: 12px; font-weight: 700;
}
.odet-master-chip:hover  { border-color: var(--orange-brd); }
.odet-master-chip.active { border-color: var(--orange); background: var(--orange-dim); color: var(--orange); }
.odet-mc-av {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family:'Oswald',sans-serif; font-size: 11px; font-weight: 700;
}

.odet-timeline { display: flex; flex-direction: column; }
.odet-tl-item { display: flex; align-items: flex-start; gap: 12px; padding: 7px 0; }
.odet-tl-dot {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface2); border: 1.5px solid var(--line);
  color: var(--text3); font-size: 13px;
  display: flex; align-items: center; justify-content: center; transition: .25s;
}
.odet-tl-item.done .odet-tl-dot { background: rgba(34,197,94,.12); border-color: #22c55e; }
.odet-tl-label { font-size: 13px; font-weight: 600; }
.odet-tl-item.done .odet-tl-label { color: #22c55e; }
.odet-tl-time { font-size: 11px; color: var(--text3); margin-top: 2px; }
.odet-add-btn {
  font-size: 11px; font-weight: 700; color: var(--orange);
  background: var(--orange-dim); border: 1px solid var(--orange-brd);
  border-radius: 6px; padding: 4px 10px; cursor: pointer; transition: .2s;
}
.odet-add-btn:hover { background: rgba(255,107,0,.2); }
.odet-report-card {
  background: rgba(255,107,0,.06); border: 1px solid var(--orange-brd);
  border-left: 3px solid var(--orange); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px;
}
.odet-report-head { font-size: 11px; font-weight: 700; color: var(--orange); margin-bottom: 5px; }
.odet-report-text { font-size: 13px; color: var(--text2); line-height: 1.5; }


/* ═══════════════════════════════════════════════
   MODAL / DETAIL VISUAL SYSTEM PATCH v9.4.62
═══════════════════════════════════════════════ */
.owiz-box,
.odet-panel{
  position:relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)),
    linear-gradient(180deg, rgba(255,107,0,.04), transparent 32%),
    var(--bg2);
  border:1px solid rgba(255,255,255,.08);
  box-shadow: 0 30px 100px rgba(0,0,0,.48), 0 14px 36px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
}
@media (min-width:640px){
  .owiz-box{ border-radius:24px; max-width:700px; }
}
@media (min-width:700px){
  .odet-panel{ border-radius:24px; max-width:760px; }
}
.owiz-header,
.odet-header{
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0));
  border-bottom:1px solid rgba(255,255,255,.07);
}
.owiz-body,
.odet-body{ scrollbar-width:thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.owiz-section-card,
.odet-section,
.odet-report-card{
  border-radius:18px;
}
.odet-section{
  margin:14px 16px 0;
  border:1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,.012));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.odet-body .odet-section:last-child{ margin-bottom:16px; }
.odet-row{ border-bottom:1px solid rgba(255,255,255,.05); }
.odet-row:last-child{ border-bottom:0; }
.odet-status-btn,
.odet-st-btn,
.odet-master-chip,
.owiz-prio-btn,
.owiz-svc-chip{
  border-radius:14px;
}
.odet-report-card{
  background: linear-gradient(180deg, rgba(255,107,0,.09), rgba(255,107,0,.035));
  border:1px solid rgba(255,107,0,.24);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.client-modal-summary,
.order-modal-summary,
.master-schedule-surface{
  border:1px solid rgba(255,255,255,.07);
  background: linear-gradient(180deg, rgba(255,255,255,.024), rgba(255,255,255,.012));
  border-radius:18px;
}


/* HOTFIX v14.2 — detail scroll + flex containment */
#odet-panel .owiz-box{ min-height:0; }
#odet-panel-inner.odet-panel{ display:flex; flex-direction:column; min-height:0; width:100%; max-height:inherit; }
#odet-panel-inner.odet-panel .odet-body{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
}
