/* DukanChat — shared shell. One stylesheet for every page that isn't the
   legacy chat/orders screens, which keep their own inline styles for now. */

:root {
  --brand:        #00a884;
  --brand-dark:   #008069;
  --brand-tint:   #e7f8f4;
  --bg:           #f0f2f5;
  --card:         #ffffff;
  --text:         #111b21;
  --muted:        #667781;
  --border:       #e3e8ea;
  --danger:       #b3261e;
  --danger-tint:  #ffe5e3;
  --warn:         #7a5c00;
  --warn-tint:    #fff3cd;
  --ok:           #075e54;
  --ok-tint:      #d9fdd3;
  --radius:       14px;
  --shadow:       0 1px 3px rgba(11, 20, 26, .08);
  --shadow-lg:    0 8px 30px rgba(11, 20, 26, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-dark); }

/* ---------------------------------------------------------------- topbar */
.topbar {
  background: var(--brand-dark);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}
.topbar .brand { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.topbar .brand span { opacity: .75; font-weight: 400; }
.topbar nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
  color: #d7f5ee;
  text-decoration: none;
  font-size: 14px;
  padding: 7px 13px;
  border-radius: 9px;
  transition: background .15s;
  white-space: nowrap;
}
.topbar nav a:hover { background: rgba(255, 255, 255, .14); }
.topbar nav a.active { background: rgba(255, 255, 255, .22); color: #fff; font-weight: 600; }

/* ------------------------------------------------------------------ page */
.wrap { max-width: 1120px; margin: 26px auto 70px; padding: 0 16px; }
.wrap.narrow { max-width: 560px; }
.wrap.wide { max-width: 1400px; }

h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
h2 { font-size: 18px; font-weight: 650; margin-bottom: 12px; }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ------------------------------------------------------------------ card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.card h2 { display: flex; align-items: center; gap: 9px; }
.card .hint { color: var(--muted); font-size: 13px; margin-bottom: 16px; }

/* ----------------------------------------------------------------- forms */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #3b4a54;
}
.field .help { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.45; }
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field input[type=url],
.field input[type=tel],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 168, 132, .14);
}
.field textarea { resize: vertical; min-height: 88px; }
.field input[readonly] { background: #f6f8f9; color: var(--muted); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .row { grid-template-columns: 1fr; } }

.check { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 14px; font-size: 14px; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); }

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--brand-dark); border: 1.5px solid var(--border); }
.btn.ghost:hover { background: var(--brand-tint); border-color: var(--brand); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8f1e17; }
.btn.small { padding: 7px 13px; font-size: 13px; }

/* --------------------------------------------------------------- notices */
.notice {
  padding: 13px 16px;
  border-radius: 11px;
  font-size: 14px;
  margin-bottom: 18px;
  border-left: 4px solid;
}
.notice.ok    { background: var(--ok-tint);     color: var(--ok);     border-color: var(--brand); }
.notice.err   { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }
.notice.warn  { background: var(--warn-tint);   color: var(--warn);   border-color: #e0b400; }
.notice.info  { background: #e3f2fd;            color: #0b4f8a;       border-color: #1976d2; }
.notice strong { display: block; margin-bottom: 3px; }

/* ------------------------------------------------------------ copy field */
.copybox {
  display: flex;
  align-items: stretch;
  gap: 8px;
  background: #f6f8f9;
  border: 1.5px dashed var(--brand);
  border-radius: 10px;
  padding: 4px 4px 4px 12px;
  margin-top: 6px;
}
.copybox code {
  flex: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  word-break: break-all;
  align-self: center;
  padding: 6px 0;
  user-select: all;
}
.copybox button {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.copybox button:hover { background: var(--brand-dark); }

/* --------------------------------------------------------------- badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.ok      { background: var(--ok-tint);     color: var(--ok); }
.badge.pending { background: var(--warn-tint);   color: var(--warn); }
.badge.err     { background: var(--danger-tint); color: var(--danger); }
.badge.muted   { background: #eceff1;            color: var(--muted); }

/* --------------------------------------------------------------- tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.table-scroll { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }

/* ----------------------------------------------------------------- steps */
.steps { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.step {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1.5px solid var(--border);
  font-size: 13px;
  color: var(--muted);
}
.step b { display: block; color: var(--text); font-size: 13.5px; }
.step.done { border-color: var(--brand); background: var(--brand-tint); color: var(--ok); }
.step.done b { color: var(--ok); }
.step.current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 168, 132, .14); }

/* ----------------------------------------------------------------- stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stat .n { font-size: 27px; font-weight: 700; line-height: 1.15; }
.stat .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty .icon { font-size: 40px; margin-bottom: 10px; opacity: .55; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 16px; }
.footer a { color: var(--muted); }
