/* Wistora IQ Solutions - brand: teal #14ADCD, navy #20275D */
:root {
  --teal: #14adcd; --teal-dark: #0e8aa6; --teal-soft: #e3f6fa;
  --navy: #20275d; --navy-soft: #eceefa;
  --ink: #1d2140; --muted: #6a7090; --line: #e3e6f0; --bg: #f5f7fb; --card: #fff;
  --green: #1f9d57; --red: #d64545; --amber: #e0a21b; --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --head: "Oswald", "Arial Narrow", var(--font);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; }
a { color: var(--teal-dark); text-decoration: none; }
h1, h2, h3 { font-family: var(--head); color: var(--navy); font-weight: 600; letter-spacing: .3px; margin: 0 0 .5rem; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
small, .muted { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 0; border-radius: 10px; padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer; background: var(--teal); color: #fff; }
.btn:hover { background: var(--teal-dark); }
.btn.navy { background: var(--navy); } .btn.green { background: var(--green); } .btn.red { background: var(--red); }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn.block { display: flex; width: 100%; }

/* cards & tables */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; border-top: 4px solid var(--teal); }
.stat b { display: block; font-family: var(--head); font-size: 2rem; color: var(--navy); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.warn { border-top-color: var(--red); } .stat.navy { border-top-color: var(--navy); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #fafbfe; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.badge { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 600; background: var(--navy-soft); color: var(--navy); white-space: nowrap; }
.badge.new { background: #e8f1ff; color: #2358b8; } .badge.converted, .badge.connected, .badge.sent, .badge.completed { background: #e0f5e9; color: #17743f; }
.badge.follow_up, .badge.callback, .badge.opened { background: #fff3d6; color: #8a6200; }
.badge.not_interested, .badge.wrong_number, .badge.failed, .badge.overdue { background: #fde6e6; color: #a32727; }
.badge.interested { background: var(--teal-soft); color: var(--teal-dark); }

/* forms */
.field { margin-bottom: .9rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; color: var(--navy); font-size: .9rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=datetime-local], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: .65rem .75rem; border: 1px solid #cfd4e6; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); border-color: var(--teal); }
select[multiple] { min-height: 160px; }
.errorlist { list-style: none; margin: .25rem 0 0; padding: 0; color: var(--red); font-size: .85rem; }
.helptext, .field small { display: block; color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.toolbar form { display: flex; flex-wrap: wrap; gap: .5rem; flex: 1; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.spacer { flex: 1; }
.pager { display: flex; gap: .6rem; justify-content: center; align-items: center; margin: 1rem 0; }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .7rem 1rem; border-radius: 10px; margin-bottom: .5rem; background: var(--teal-soft); border-left: 4px solid var(--teal); }
.messages li.error { background: #fde6e6; border-color: var(--red); }
.messages li.success { background: #e0f5e9; border-color: var(--green); }

/* manager layout */
body.manager { display: flex; min-height: 100vh; }
.sidebar { width: 230px; background: #fff; border-right: 1px solid var(--line); padding: 1.1rem .8rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar .logo { display: block; padding: .2rem .4rem 1.2rem; } .sidebar .logo img { width: 100%; }
.sidebar nav a { display: flex; gap: .6rem; align-items: center; padding: .65rem .8rem; border-radius: 10px; color: var(--ink); font-weight: 500; margin-bottom: 2px; }
.sidebar nav a:hover { background: var(--bg); }
.sidebar nav a.active { background: var(--navy); color: #fff; }
.sidebar .me { margin-top: auto; border-top: 1px solid var(--line); padding-top: .8rem; font-size: .85rem; }
.content { flex: 1; padding: 1.6rem 2rem; min-width: 0; max-width: 1250px; }
.page-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.bars { display: flex; align-items: flex-end; gap: .7rem; height: 150px; padding-top: .5rem; }
.bars div { flex: 1; text-align: center; font-size: .75rem; color: var(--muted); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars i { display: block; background: linear-gradient(var(--teal), var(--teal-dark)); border-radius: 6px 6px 0 0; min-height: 3px; margin-bottom: 4px; }
.bars b { color: var(--navy); font-size: .8rem; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress i { display: block; height: 100%; background: var(--teal); }
.two { grid-template-columns: 2fr 1fr; }
@media (max-width: 900px) {
  body.manager { display: block; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: .6rem; }
  .sidebar .logo { width: 150px; padding: 0 .5rem 0 0; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 2px; } .sidebar nav a { padding: .4rem .6rem; font-size: .85rem; }
  .sidebar .me { margin: 0 0 0 auto; border: 0; padding: 0; }
  .content { padding: 1rem; } .two { grid-template-columns: 1fr; }
}

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: linear-gradient(135deg, var(--teal-soft), var(--navy-soft)); }
.login-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; padding: 2rem; box-shadow: 0 12px 40px rgba(32, 39, 93, .15); }
.login-card img { width: 220px; display: block; margin: 0 auto 1.2rem; }

/* mobile app */
body.mobile { background: var(--bg); padding-bottom: 76px; }
.m-head { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; }
.m-head img { height: 34px; } .m-head .who { margin-left: auto; font-size: .85rem; color: var(--muted); text-align: right; }
.m-main { padding: 1rem; max-width: 640px; margin: 0 auto; }
.m-nav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.m-nav a { flex: 1; text-align: center; padding: .55rem 0 .5rem; color: var(--muted); font-size: .7rem; font-weight: 600; position: relative; }
.m-nav a span { display: block; font-size: 1.35rem; line-height: 1.2; }
.m-nav a.active { color: var(--navy); } .m-nav a.active::before { content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; background: var(--teal); border-radius: 0 0 3px 3px; }
.nav-badge { position: absolute; top: 2px; left: 56%; background: var(--red); color: #fff; border-radius: 99px; font-size: .65rem; padding: 0 .38rem; min-width: 1.1rem; }
.m-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.m-stats .stat { padding: .7rem; text-align: center; } .m-stats .stat b { font-size: 1.6rem; }
.row-item { display: flex; align-items: center; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; margin-bottom: .6rem; }
.row-item .info { flex: 1; min-width: 0; } .row-item .info b { display: block; color: var(--navy); }
.row-item .info small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 1.2rem; background: var(--green); color: #fff; flex-shrink: 0; }
.round.wa { background: #25d366; } .round.teal { background: var(--teal); } .round.navy { background: var(--navy); } .round.amber { background: var(--amber); }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: .6rem; }
.chips a { flex-shrink: 0; padding: .35rem .8rem; border-radius: 99px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-size: .85rem; }
.chips a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.lead-top { text-align: center; }
.lead-top h1 { margin-bottom: .1rem; }
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0; }
.actions a { display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .7rem .2rem; border-radius: 12px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-size: .78rem; font-weight: 600; }
.actions a .round { width: 42px; height: 42px; }
details.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .7rem; }
details.panel > summary { padding: .85rem 1rem; font-weight: 700; color: var(--navy); cursor: pointer; list-style: none; font-family: var(--head); font-size: 1.05rem; letter-spacing: .3px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; float: right; color: var(--teal); font-size: 1.3rem; line-height: 1; }
details.panel[open] > summary::after { content: "\2212"; }
details.panel > .body { padding: 0 1rem 1rem; }
.recorder { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .7rem; border: 1px dashed #b9c0d9; border-radius: 12px; margin-bottom: .9rem; }
.rec-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--red); color: #fff; font-size: 1.3rem; cursor: pointer; }
.rec-btn.on { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(214, 69, 69, .25); } }
.recorder audio { width: 100%; }
.timeline .item { border-left: 3px solid var(--teal); padding: .1rem 0 .1rem .8rem; margin-bottom: .8rem; }
.timeline audio { width: 100%; margin-top: .3rem; height: 36px; }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
