/* ============================================================
   Termal OS - portail compte client
   ============================================================ */

/* ---------- Auth box ---------- */
.auth-outer {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.auth-box {
  width: 100%;
  max-width: 420px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  padding: 32px;
  display: grid;
  gap: 20px;
}
.auth-brand {
  text-align: center;
}
.auth-brand .brand {
  font-size: 16px;
}
.auth-sub {
  color: var(--mut);
  font-size: 13px;
  margin-top: 5px;
}
.auth-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--mut);
  cursor: pointer;
  transition: background .13s, color .13s;
}
.auth-tab.active {
  background: rgba(255,255,255,.06);
  color: var(--txt);
}
.auth-form {
  display: grid;
  gap: 14px;
}
.auth-form.hidden { display: none; }
.auth-hint {
  font-size: 12.5px;
  color: var(--dim);
  text-align: center;
}
.auth-hint a { color: var(--mut); text-decoration: none; }
.auth-hint a:hover { color: var(--accent); }
.btn.full { width: 100%; justify-content: center; }

/* ---------- Form fields ---------- */
.af-field {
  display: grid;
  gap: 5px;
}
.af-field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 6px;
}
.af-hint {
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
}
.af-field input {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--txt);
  font-family: Inter, sans-serif;
  font-size: 14px;
  transition: border-color .13s, box-shadow .13s;
  width: 100%;
  box-sizing: border-box;
}
.af-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54,224,192,.12);
}
.af-field input:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.af-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---------- Alerts ---------- */
.acct-alert {
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  border: 1px solid;
}
.acct-alert.err {
  background: rgba(255,100,100,.07);
  border-color: rgba(255,100,100,.25);
  color: #ff7a7a;
}
.acct-alert.ok {
  background: rgba(72,224,138,.07);
  border-color: rgba(72,224,138,.25);
  color: var(--green);
}

/* ---------- Dashboard layout ---------- */
.dash-layout {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 24px;
  align-items: start;
}
.dash-sidebar {
  position: sticky;
  top: 80px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  min-width: 0;
}
.dash-avatar {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #06121a;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-user-info { min-width: 0; }
.dash-uname {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-uemail {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.dash-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--mut);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.dash-nav-item svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: .65;
}
.dash-nav-item:hover { background: rgba(255,255,255,.05); color: var(--txt); }
.dash-nav-item.active { background: rgba(54,224,192,.09); color: var(--accent); }
.dash-nav-item.active svg { opacity: 1; }
.dash-signout {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* Dashboard content */
.dash-content { min-width: 0; }
.dash-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  display: none;
}
.dash-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  padding: 22px 24px;
}
.dash-card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.dash-card-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--mut);
}
.dash-empty {
  text-align: center;
  padding: 52px 32px;
}
.dash-empty-ic { font-size: 38px; margin-bottom: 16px; }
.dash-empty h3 { font-size: 18px; margin-bottom: 8px; font-family: 'Space Grotesk', sans-serif; }
.dash-empty p { color: var(--mut); font-size: 14.5px; max-width: 44ch; margin: 0 auto; line-height: 1.6; }
.acct-cta-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- Plan badges ---------- */
.acct-plan-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.acct-plan-badge.plan-free     { color: var(--mut);    border-color: var(--line); }
.acct-plan-badge.plan-preview  { color: #36e0c0;       border-color: rgba(54,224,192,.35);  background: rgba(54,224,192,.1); }
.acct-plan-badge.plan-pro      { color: var(--accent2); border-color: rgba(124,140,255,.35); background: rgba(124,140,255,.08); }
.acct-plan-badge.plan-pro-plus { color: var(--accent);  border-color: rgba(54,224,192,.35);  background: rgba(54,224,192,.08); }
.acct-plan-badge.plan-team     { color: #c084fc;       border-color: rgba(192,132,252,.35); background: rgba(192,132,252,.08); }
.acct-plan-badge.plan-business { color: var(--warn);   border-color: rgba(254,188,46,.35);  background: rgba(254,188,46,.08); }

/* ---------- License card ---------- */
.lic-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.lic-status-dot {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
}
.lic-status-dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.lic-status-dot.ok  { color: var(--green); }
.lic-status-dot.off { color: var(--dim); }

.lic-dl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.lic-dl > div {
  background: rgba(255,255,255,.025);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
}
.lic-dl dt {
  font-size: 10.5px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  margin-bottom: 5px;
}
.lic-dl dd {
  font-size: 15px;
  font-weight: 600;
  color: var(--txt);
}
.lic-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Devices table ---------- */
.dev-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.dev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.dev-table th,
.dev-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.dev-table thead th {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--dim);
  background: rgba(255,255,255,.018);
  font-weight: 400;
}
.dev-table tbody tr:last-child td { border-bottom: none; }
.dev-table tbody tr:hover td { background: rgba(255,255,255,.018); }
.dev-hostname { font-weight: 500; }
.mono { font-family: 'JetBrains Mono', monospace; }
.fs-12 { font-size: 12px; }
.dev-revoke {
  background: none;
  border: 1px solid rgba(255,100,100,.25);
  color: #ff7a7a;
  font-family: Inter, sans-serif;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.dev-revoke:hover { background: rgba(255,100,100,.09); border-color: rgba(255,100,100,.45); }

/* ---------- Payments ---------- */
.pay-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  text-transform: capitalize;
}
.pay-paid     { background: rgba(72,224,138,.12); color: var(--green); }
.pay-failed   { background: rgba(255,100,100,.12); color: #ff7a7a; }
.pay-refunded { background: rgba(124,140,255,.12); color: var(--accent2); }
.pay-pending  { background: rgba(255,188,46,.12);  color: var(--warn); }

/* ---------- Footer ---------- */
.acct-footer {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  margin-top: 60px;
}

/* ---------- Admin dashboard ---------- */
.dash-nav-sep {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--dim);
  padding: 12px 10px 4px;
  opacity: .7;
}
.admin-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--warn);
  background: rgba(254,188,46,.1);
  border: 1px solid rgba(254,188,46,.25);
  border-radius: 999px;
  padding: 2px 8px;
}
.admin-page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}
.admin-back {
  font-size: 13.5px;
  color: var(--mut);
  text-decoration: none;
  transition: color .12s;
}
.admin-back:hover { color: var(--accent); }
.user-status-dot {
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--dim);
}
.user-status-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.user-status-dot.ok  { color: var(--green); }
.user-status-dot.off { color: #ff7a7a; }

/* Assign license form */
.admin-assign-details {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.admin-assign-details summary {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--mut);
  cursor: pointer;
  padding: 4px 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color .12s;
}
.admin-assign-details summary:hover { color: var(--txt); }
.admin-assign-details summary::before { content: '▶'; font-size: 9px; }
.admin-assign-details[open] summary::before { content: '▼'; }
.admin-assign-form {
  margin-top: 16px;
  display: grid;
  gap: 14px;
}
.admin-select {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--txt);
  font-family: Inter, sans-serif;
  font-size: 14px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
}
.admin-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(54,224,192,.12);
}
.af-field input[type="date"],
.af-field input[type="number"] {
  color-scheme: dark;
}

/* Admin stats */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 4px;
}
.admin-stat {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  padding: 20px 22px;
}
.admin-stat-val {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--txt);
  line-height: 1.1;
}
.admin-stat-lbl {
  font-size: 12.5px;
  color: var(--mut);
  margin-top: 5px;
}

/* Plan bars */
.admin-plan-bars { display: grid; gap: 10px; }
.admin-plan-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.admin-plan-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.06);
  border-radius: 999px;
  overflow: hidden;
}
.admin-plan-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  min-width: 4px;
  transition: width .3s;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: static;
  }
  .dash-user {
    display: none;
  }
  .dash-nav {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .dash-nav-item {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .dash-signout {
    display: none;
  }
  .lic-dl {
    grid-template-columns: 1fr 1fr;
  }
  .af-grid-2 {
    grid-template-columns: 1fr;
  }
  .auth-box {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .lic-dl {
    grid-template-columns: 1fr;
  }
}
