/* IVO Player dashboard — light theme, brand palette: black, red, yellow. */
:root {
  --ink: #16130d;
  --body: #3f3a32;
  --muted: #79716a;
  --faint: #a59c92;
  --line: #ece6dd;
  --surface: #ffffff;
  --surface-2: #fbf7f0;
  --bg-0: #fffaf2;
  --red: #e50914;
  --red-2: #ff1f3d;
  --red-soft: rgba(229, 9, 20, 0.08);
  --yellow: #f5b301;
  --gold: #ffc12b;
  --grad: linear-gradient(135deg, #ffc12b 0%, #f5970d 45%, #e50914 100%);
  --on-accent: #ffffff;
  --error: #e50914;
  --ok: #1f9d57;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 16px 40px rgba(33, 20, 4, 0.1);
  --ease: cubic-bezier(0.34, 1.4, 0.5, 1);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  color: var(--body);
  background: #ffffff;
  -webkit-font-smoothing: antialiased;
}

.logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo span {
  color: var(--red);
}
.logo-img-dash {
  height: 34px;
  width: auto;
  display: block;
  object-fit: contain;
}

/* ---------- Dashboard layout ---------- */
.dash {
  display: flex;
  min-height: 100vh;
  background: #fff;
}
.side {
  width: 250px;
  flex: none;
  padding: 24px 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #fffdf9;
}
.side-logo {
  padding: 0 10px 22px;
}
.side-logo img {
  height: 34px;
  width: auto;
}
.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--body);
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  text-align: left;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s var(--ease);
}
.nav:hover {
  color: var(--ink);
  background: #fff3e0;
}
.nav.active {
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 20px rgba(229, 9, 20, 0.25);
}
.nav .ico {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.side-sep {
  height: 1px;
  background: var(--line);
  margin: 12px 10px;
}
.nav.logout {
  color: var(--faint);
  margin-top: 8px;
}
.nav.logout:hover {
  color: var(--red);
  background: var(--red-soft);
}

/* ---------- Main ---------- */
.dash-main {
  flex: 1;
  min-width: 0;
  padding: 30px 36px 60px;
  animation: rise 0.35s var(--ease);
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.sec-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
h1 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h2 {
  margin: 0 0 6px;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.muted {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}
.hint {
  color: var(--faint);
  font-size: 12.5px;
  margin-top: 12px;
}
.device-chip {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold);
}

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 180px;
}

/* ---------- Inputs ---------- */
label {
  display: block;
  margin: 16px 0 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
}
input[type='text'],
input:not([type]),
input[type='password'] {
  width: 100%;
  padding: 13px 15px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder {
  color: var(--faint);
}
input:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.18);
}

/* ---------- Buttons ---------- */
.btn {
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: transform 0.14s var(--ease), filter 0.15s, box-shadow 0.15s;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn.primary {
  background: var(--grad);
  color: #fff;
  border: none;
  box-shadow: 0 8px 20px rgba(229, 9, 20, 0.25);
}
.btn.primary.alt {
  background: var(--ink);
  color: #fff;
  border: none;
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
}

/* ---------- Table ---------- */
.table {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.thead,
.trow {
  display: grid;
  grid-template-columns: 1.4fr 2fr 0.9fr 1.1fr 0.8fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
}
.thead {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.trow + .trow {
  border-top: 1px solid var(--line);
}
.trow {
  transition: background 0.15s;
}
.trow:hover {
  background: var(--surface-2);
}
.tname {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-weight: 700;
  color: var(--ink);
}
.turl,
.tuser {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}
.ta-right {
  text-align: right;
}
.tactions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 14px;
  transition: transform 0.12s var(--ease), border-color 0.15s;
}
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--yellow);
}
.icon-btn.del:hover {
  color: var(--red);
  border-color: rgba(229, 9, 20, 0.4);
}

/* ---------- Connections cell ---------- */
.tconn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.conn-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-weight: 700;
  white-space: nowrap;
  color: var(--ink);
}
.conn-pill .conn-active {
  color: var(--muted);
  font-weight: 600;
}
.conn-pill.conn-full {
  border-color: rgba(229, 9, 20, 0.45);
  color: var(--red);
}
.conn-dash {
  color: var(--faint);
}
.conn-refresh {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: transform 0.4s var(--ease), color 0.15s, border-color 0.15s;
}
.conn-refresh:hover {
  color: var(--ink);
  border-color: var(--yellow);
}
.conn-refresh.spinning {
  transform: rotate(360deg);
  opacity: 0.6;
}

.empty {
  color: var(--muted);
  margin-top: 20px;
}

/* ---------- Cards / sections ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  max-width: 640px;
}
.row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.row.end {
  justify-content: flex-end;
  margin-top: 24px;
}
.row input {
  flex: 1;
  min-width: 160px;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: end;
}
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}
.check input {
  width: auto;
}
.error {
  color: var(--error);
  font-size: 14px;
  margin-top: 12px;
}
.msg {
  font-size: 14px;
  margin-top: 12px;
}
.msg.ok {
  color: var(--ok);
}
.msg.bad {
  color: var(--error);
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: var(--red-soft);
  color: var(--red);
}
.tag.lock {
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted);
}

/* ---------- Credentials / settings rows ---------- */
.cred {
  margin-top: 14px;
  padding: 16px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.cred-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.cred-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  word-break: break-all;
  color: var(--red);
}
#copy-key-btn {
  margin-top: 16px;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  gap: 12px;
}
.set-row + .set-row {
  border-top: 1px solid var(--line);
}
.set-label {
  color: var(--muted);
}
.set-value {
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Payment options ---------- */
.pay-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.pay-opt {
  padding: 16px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--muted);
}
.pay-opt strong {
  color: var(--ink);
}

/* ---------- Segmented + modal ---------- */
.seg {
  display: flex;
  gap: 8px;
}
.seg-btn {
  flex: 1;
  padding: 11px;
  border-radius: 11px;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.seg-btn.active {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 4, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 10;
  animation: rise 0.2s var(--ease);
}
.modal-card {
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .dash {
    flex-direction: column;
  }
  .side {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    gap: 6px;
  }
  .side-logo {
    padding: 0 8px 0 4px;
  }
  .side-nav {
    flex-direction: row;
    flex-wrap: wrap;
    flex: 1;
    gap: 4px;
  }
  .nav {
    padding: 10px 12px;
  }
  .nav span {
    display: none;
  }
  .side-sep {
    display: none;
  }
  .dash-main {
    padding: 22px 16px 60px;
  }
  .thead,
  .trow {
    grid-template-columns: 1.4fr 1.4fr 0.9fr 0.7fr;
  }
  .tuser {
    display: none;
  }
  .pay-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 560px) {
  .thead {
    display: none;
  }
  .trow {
    grid-template-columns: 1.6fr 1fr 0.8fr;
  }
  .turl {
    display: none;
  }
  .dash-main {
    padding: 18px 12px 50px;
  }
  h1 {
    font-size: 22px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
}
