/* Techanek brand — blue #0496FF, cyan accent #00D4E0, Barlow type */
:root {
  --brand: #0496ff;
  --brand-600: #0080e6;
  --brand-50: #eef7ff;
  --brand-100: #d9eeff;
  --cyan: #00d4e0;
  --grad: linear-gradient(120deg, #0496ff 0%, #22b8f0 100%);
  --ink: #0f1b2d;
  --ink-2: #44526a;
  --muted: #8592a6;
  --line: #e4e9f1;
  --bg: #f6f9fc;
  --card: #ffffff;
  --danger: #e5484d;
  --ok: #12a150;
  --hot: #e5484d;
  --warm: #e8960c;
  --cold: #0496ff;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 8px 24px rgba(15, 27, 45, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ================= visitor form ================= */
.page-top { height: 4px; background: var(--grad); }
.form-wrap { max-width: 520px; margin: 0 auto; padding: 32px 16px 40px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 28px; }
.brand img { height: 34px; width: auto; }
.tagline { font-size: .72rem; font-weight: 600; letter-spacing: .28em; color: var(--brand); text-transform: uppercase; }
.intro { text-align: center; margin-bottom: 24px; }
.intro h1 { font-size: 1.75rem; line-height: 1.2; font-weight: 700; margin: 0 0 8px; letter-spacing: -.01em; }
.intro h1 span { color: var(--brand); }
.intro p { margin: 0; color: var(--ink-2); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.section-label {
  font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 4px 0 14px; display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.section-label:not(:first-of-type) { margin-top: 26px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; color: var(--ink); }
.field .req { color: var(--brand); }
.field .hint { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #a9b3c2; }
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%238592a6' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  cursor: pointer;
}
select:invalid, select.placeholder { color: #a9b3c2; }
select option { color: var(--ink); }
input:hover, select:hover, textarea:hover { border-color: #cdd5e1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(4, 150, 255, .15); }
.other-input { margin-top: 8px; display: none; }
.other-input.show { display: block; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 11px 18px;
  font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2;
  background: var(--brand); color: #fff; text-decoration: none !important;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: var(--brand-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--grad); box-shadow: 0 6px 16px rgba(4, 150, 255, .28); }
.btn.primary:hover { filter: brightness(.96); }
.btn.block { width: 100%; padding: 14px; font-size: 1.02rem; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.btn.soft { background: var(--brand-50); color: var(--brand); }
.btn.soft:hover { background: var(--brand-100); }
.btn.danger { background: #fff; color: var(--danger); border-color: #f3d0d1; }
.btn.danger:hover { background: #fdf0f0; }
.btn.rec { background: var(--danger); }
.btn.rec:hover { background: #cf3a3f; }
.btn.sm { padding: 7px 11px; font-size: .86rem; border-radius: 8px; }
.btn.icon { padding: 7px; }
.error-msg { color: var(--danger); font-size: .92rem; margin: 0 0 12px; display: none; }
.error-msg.show { display: block; }
.privacy { text-align: center; font-size: .8rem; color: var(--muted); margin: 12px 0 0; }

.done { text-align: center; display: none; padding: 8px 0; }
.done.show { display: block; }
.done .check {
  width: 64px; height: 64px; border-radius: 50%; margin: 4px auto 16px;
  background: var(--brand-50); color: var(--brand); display: grid; place-items: center;
}
.done .check svg { width: 30px; height: 30px; stroke-width: 2.4; }
.done h2 { margin: 0 0 6px; font-size: 1.4rem; }
.done p { color: var(--ink-2); margin: 0 0 20px; }
.done .again { display: inline-block; margin-top: 16px; font-size: .92rem; }

.offer {
  margin-top: 20px; border-radius: var(--radius); padding: 16px 20px; color: #fff;
  background: var(--grad); display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.offer b { font-size: 1.05rem; }
.offer small { display: block; opacity: .85; }
.footer { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 24px; }
.footer a { color: var(--ink-2); }

/* ================= login ================= */
.login { max-width: 380px; margin: 0 auto; padding: 12vh 16px 40px; }
.login .brand { margin-bottom: 20px; }
.login h2 { margin: 0 0 4px; font-size: 1.3rem; }
.login .sub { margin: 0 0 20px; color: var(--muted); font-size: .92rem; }

/* ================= admin ================= */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 12px 24px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar .left { display: flex; align-items: center; gap: 14px; }
.topbar img { height: 24px; }
.topbar .divider { width: 1px; height: 22px; background: var(--line); }
.topbar .title { font-weight: 600; color: var(--ink-2); }
.topbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-main { padding: 24px; max-width: 1440px; margin: 0 auto; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .k { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 1.6rem; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.new { background: #b3bccb; } .dot.hot { background: var(--hot); } .dot.warm { background: var(--warm); } .dot.cold { background: var(--cold); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.search { position: relative; flex: 1; max-width: 360px; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 150px; }
.toolbar .check { display: flex; gap: 8px; align-items: center; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.toolbar .check input { width: 16px; height: 16px; accent-color: var(--brand); }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #fafbfd; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.row { cursor: pointer; transition: background .1s; }
tr.row:hover td { background: #f8fbff; }
tr.row.open td { background: var(--brand-50); border-bottom-color: transparent; }
tr.detail td { background: #fbfdff; padding: 20px 24px 24px; }
.muted { color: var(--muted); }
.sub { color: var(--muted); font-size: .85rem; }
.nowrap { white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 280px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; text-transform: capitalize; border: 1px solid var(--line); background: #fff; color: var(--ink-2); }
.rec-cell { display: flex; align-items: center; gap: 6px; }
.rec-count { display: inline-flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--ink-2); min-width: 34px; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.panel h3 { margin: 0 0 10px; font-size: .74rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.panel + .panel { margin-top: 20px; }
.status-pick { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.status-pick button { border: 0; border-right: 1px solid var(--line); background: transparent; padding: 8px 16px; cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600; text-transform: capitalize; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.status-pick button:last-child { border-right: 0; }
.status-pick button:hover { background: var(--bg); }
.status-pick button.active { background: var(--ink); color: #fff; }
.save-note { font-size: .78rem; color: var(--ok); text-transform: none; letter-spacing: 0; font-weight: 500; }

.rec-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.rec-live { display: inline-flex; align-items: center; gap: 8px; color: var(--danger); font-weight: 600; font-variant-numeric: tabular-nums; padding: 0 6px; }
.rec-live::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rec-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.rec-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.rec-item .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); margin-bottom: 8px; flex-wrap: wrap; }
.rec-item .meta .src { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; }
.rec-item audio { width: 100%; height: 40px; }
.rec-item .row-actions { display: flex; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.empty-rec { border: 1px dashed var(--line); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: .9rem; background: #fff; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink-2); font-size: 1.05rem; margin-bottom: 4px; }
.info-list { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: .92rem; margin: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; word-break: break-word; }

/* admin table → stacked cards on tablets/phones */
@media (max-width: 960px) {
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  tr.row {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 12px;
    padding: 16px; border-bottom: 1px solid var(--line);
  }
  tr.row td { border: 0; padding: 0; background: transparent !important; width: auto; }
  tr.row.open { background: var(--brand-50); border-bottom-color: transparent; }
  tr.row:hover { background: #f8fbff; }
  .c-id { display: none !important; }
  .c-name { grid-column: 1; grid-row: 1; }
  .c-status { grid-column: 2; grid-row: 1; justify-self: end; }
  .c-time { grid-column: 2; grid-row: 2; justify-self: end; font-size: .82rem; }
  .c-contact { grid-column: 1; grid-row: 2; }
  .c-ind { grid-column: 1 / -1; }
  .c-prob { grid-column: 1 / -1; color: var(--ink-2); }
  .c-prob .clamp { max-width: none; }
  .c-rec { grid-column: 1 / -1; padding-top: 6px !important; }
  tr.detail { border-bottom: 1px solid var(--line); }
  tr.detail td { padding: 16px; }
}
@media (max-width: 600px) {
  .topbar { padding: 12px 16px; }
  .admin-main { padding: 16px; }
  .topbar .divider, .topbar .title { display: none; }
}
