/* public/css/style.css — shared branding for the SoftTech MDM dashboard + installer */

:root {
  --st-bg: #0b1220;
  --st-surface: #121a2b;
  --st-surface-2: #182440;
  --st-border: #26324a;
  --st-text: #e8ecf5;
  --st-text-dim: #9aa6bd;
  --st-accent: #3b82f6;
  --st-accent-dark: #2563eb;
  --st-green: #22c55e;
  --st-red: #ef4444;
  --st-amber: #f59e0b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--st-bg);
  color: var(--st-text);
  line-height: 1.5;
}

a { color: var(--st-accent); }

.st-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 20px;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
  border-bottom: 1px solid var(--st-border);
  background: var(--st-surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.st-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.st-brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--st-accent);
  box-shadow: 0 0 10px var(--st-accent);
}

.st-container {
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.st-card {
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.st-card h2 {
  margin-top: 0;
  font-size: 17px;
}

.st-step {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--st-border);
}
.st-step:last-child { border-bottom: none; }

.st-step .num {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--st-accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.st-step .body { flex: 1; min-width: 0; }
.st-step .body h3 { margin: 0 0 6px; font-size: 15px; }
.st-step .body p { margin: 0 0 8px; color: var(--st-text-dim); font-size: 14px; }

code, .st-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #0a0f1c;
  border: 1px solid var(--st-border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
}

.st-codeblock {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0a0f1c;
  border: 1px solid var(--st-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0;
  overflow-x: auto;
}
.st-codeblock code {
  border: none;
  background: none;
  padding: 0;
  white-space: pre;
  flex: 1;
}

.st-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--st-border);
  background: var(--st-surface-2);
  color: var(--st-text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.st-btn:hover { border-color: var(--st-accent); }
.st-btn.primary { background: var(--st-accent); border-color: var(--st-accent); }
.st-btn.primary:hover { background: var(--st-accent-dark); }
.st-btn.danger { background: #3a1414; border-color: var(--st-red); color: #fecaca; }
.st-btn.danger:hover { background: #4a1818; }
.st-btn.small { padding: 5px 10px; font-size: 12px; }
.st-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.st-warn {
  background: #2a1f0a;
  border: 1px solid var(--st-amber);
  color: #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  margin: 10px 0;
}

.st-pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.st-pill.active { background: #0f3321; color: var(--st-green); }
.st-pill.suspended { background: #3a1414; color: #fca5a5; }
.st-pill.pending { background: #2a2a0a; color: var(--st-amber); }
.st-pill.done { background: #0f3321; color: var(--st-green); }
.st-pill.failed { background: #3a1414; color: #fca5a5; }
.st-pill.delivered { background: #0a2a3a; color: #93c5fd; }

input, select, textarea {
  background: #0a0f1c;
  border: 1px solid var(--st-border);
  color: var(--st-text);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  width: 100%;
}

label { font-size: 13px; color: var(--st-text-dim); display: block; margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--st-border); }
th { color: var(--st-text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.st-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.st-muted { color: var(--st-text-dim); font-size: 13px; }
.st-err { color: #fca5a5; font-size: 13px; margin-top: 6px; }
.st-ok { color: #86efac; font-size: 13px; margin-top: 6px; }

.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) {
  .st-grid { grid-template-columns: 1fr; }
}

.st-footer {
  text-align: center;
  color: var(--st-text-dim);
  font-size: 12px;
  padding: 30px 0 10px;
}


/* ---------- Oct 2026: shared nav, installer, mobile ---------- */
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
img, video, canvas { max-width: 100%; }
.st-h1 { font-size: 22px; line-height: 1.25; margin: 0 0 8px; }
.st-nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.st-nav a, .st-nav button {
  color: var(--st-text-dim); text-decoration: none; font-weight: 600; font-size: 14px;
  padding: 8px 12px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; font-family: inherit;
  min-height: 40px; display: inline-flex; align-items: center;
}
.st-nav a:hover, .st-nav button:hover { color: var(--st-text); border-color: var(--st-border); }
.st-nav a[aria-current="page"] { color: var(--st-text); background: var(--st-surface-2); border-color: var(--st-border); }
.st-label { font-size: 12px; color: var(--st-text-dim); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.st-tiny { font-size: 12.5px; color: var(--st-text-dim); margin: 8px 0 0; }
.st-btn.big { width: 100%; justify-content: center; padding: 14px 18px; font-size: 16px; margin-top: 14px; min-height: 50px; }
[hidden] { display: none !important; }

.st-server { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #0a0f1c; border: 1px solid var(--st-border); border-radius: 10px; padding: 12px 14px; margin-top: 12px; }
.st-server > div { min-width: 0; }
.st-server-url { display: block; border: 0; background: none; padding: 0; font-size: 15px; color: #bfdbfe; word-break: break-all; margin-top: 2px; }

.st-stepnum { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--st-accent-dark);
  align-items: center; justify-content: center; font-size: 13px; margin-right: 6px; vertical-align: 1px; }

.st-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.st-choice { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 14px; border: 1px solid var(--st-border);
  border-radius: 10px; background: var(--st-surface-2); cursor: pointer; color: var(--st-text); font-size: 14px; }
.st-choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; accent-color: var(--st-accent); }
.st-choice.on { border-color: var(--st-accent); box-shadow: 0 0 0 1px var(--st-accent) inset; background: #12203d; }
.st-choice-body { display: flex; flex-direction: column; gap: 4px; }
.st-choice-title { font-weight: 700; font-size: 15px; }
.st-choice-text { color: var(--st-text-dim); font-size: 13px; line-height: 1.4; }

.st-checklist { margin: 12px 0 0; padding-left: 22px; font-size: 14px; }
.st-checklist li { margin: 0 0 8px; color: var(--st-text-dim); }
.st-checklist b { color: var(--st-text); }
.st-check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--st-text); margin: 12px 0 0; min-height: 40px; }
.st-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--st-accent); }
.st-ol { margin: 0; padding-left: 22px; font-size: 14px; }
.st-ol li { margin: 0 0 8px; }

.st-progress { margin-top: 16px; }
.st-steps { list-style: none; margin: 0; padding: 0; }
.st-s { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--st-border); }
.st-s:first-child { border-top: 0; }
.st-s-icon { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--st-border); margin-top: 1px; position: relative; }
.st-s.run .st-s-icon { border-color: var(--st-accent); border-top-color: transparent; animation: st-spin .8s linear infinite; }
.st-s.ok .st-s-icon { background: var(--st-green); border-color: var(--st-green); }
.st-s.ok .st-s-icon::after { content: "✓"; position: absolute; inset: 0; color: #04210f; font-size: 13px; font-weight: 900; text-align: center; line-height: 18px; }
.st-s.fail .st-s-icon { background: var(--st-red); border-color: var(--st-red); }
.st-s.fail .st-s-icon::after { content: "!"; position: absolute; inset: 0; color: #fff; font-size: 13px; font-weight: 900; text-align: center; line-height: 18px; }
.st-s.skip .st-s-icon { background: var(--st-amber); border-color: var(--st-amber); }
.st-s.wait { opacity: .55; }
.st-s-body { flex: 1; min-width: 0; }
.st-s-label { font-weight: 600; font-size: 14px; }
.st-s-detail { font-size: 13px; color: var(--st-text-dim); word-break: break-word; white-space: pre-wrap; }
.st-bar { height: 6px; background: #0a0f1c; border-radius: 3px; margin-top: 6px; overflow: hidden; }
.st-bar i { display: block; height: 100%; width: 0; background: var(--st-accent); transition: width .15s; }
@keyframes st-spin { to { transform: rotate(360deg); } }
.st-result { margin-top: 12px; border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.st-result p { margin: 6px 0 0; }
.st-result.good { background: #0f2a1b; border: 1px solid #1f7a45; color: #d1fae5; }
.st-result.bad { background: #2a1212; border: 1px solid #7f1d1d; color: #fecaca; }

.st-downloads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.st-dl { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 2px 12px;
  padding: 12px 14px; border: 1px solid var(--st-border); border-radius: 10px; background: var(--st-surface-2); color: var(--st-text); text-decoration: none; }
.st-dl:hover { border-color: var(--st-accent); }
.st-dl-name { font-weight: 700; }
.st-dl-meta { font-size: 12.5px; color: var(--st-text-dim); grid-row: 2; }
.st-dl .st-btn { grid-row: 1 / span 2; grid-column: 2; }
.st-details { margin-top: 12px; }
.st-details summary { cursor: pointer; font-size: 14px; color: var(--st-text-dim); padding: 8px 0; min-height: 40px; }

/* dashboard state chips */
.st-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--st-border); color: var(--st-text-dim); background: #0a0f1c; white-space: nowrap; }
.st-chip.ok { color: #86efac; border-color: #1f7a45; background: #0f2a1b; }
.st-chip.warn { color: #fde68a; border-color: #92400e; background: #2a1f0a; }
.st-chip.info { color: #bfdbfe; border-color: #1e40af; background: #0c1a3a; }
.st-chip.bad { color: #fca5a5; border-color: #7f1d1d; background: #2a1212; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.st-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.st-stat { background: var(--st-surface-2); border: 1px solid var(--st-border); border-radius: 10px; padding: 10px 12px; }
.st-stat b { display: block; font-size: 22px; line-height: 1.2; }
.st-stat span { font-size: 12.5px; color: var(--st-text-dim); }
.st-device { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid var(--st-border); padding: 12px 0; }
.st-device:last-child { border-bottom: 0; }
.st-device > div { min-width: 0; }
.st-field { flex: 1 1 180px; min-width: 0; }
.st-table-wrap { overflow-x: auto; }
td code { word-break: break-all; }
td { overflow-wrap: anywhere; }
#audit-table td:last-child { font-size: 12px; }

/* touch: comfortable tap targets */
@media (pointer: coarse), (max-width: 640px) {
  .st-btn { min-height: 44px; padding: 10px 16px; }
  .st-btn.small { min-height: 40px; padding: 8px 12px; font-size: 13px; }
  input, select { min-height: 44px; font-size: 16px; } /* 16px stops iOS zoom-on-focus */
  textarea { font-size: 16px; }
}

@media (max-width: 760px) {
  .st-choices { grid-template-columns: 1fr; }
  .st-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .st-header { padding: 10px 14px; }
  .st-brand { font-size: 17px; }
  .st-nav { width: 100%; justify-content: space-between; }
  .st-nav a, .st-nav button { flex: 1 1 auto; justify-content: center; padding: 8px 6px; font-size: 13.5px; }
  .st-container { padding: 14px 12px 48px; }
  .st-card { padding: 16px 14px; border-radius: 12px; margin-bottom: 14px; }
  .st-h1 { font-size: 20px; }
  .st-downloads { grid-template-columns: 1fr; }
  .st-codeblock code { white-space: pre-wrap; word-break: break-all; }
  .st-row > .st-btn, .st-row > button { flex: 1 1 auto; justify-content: center; }
  .st-row > input, .st-row > select, .st-row > div { flex: 1 1 100% !important; width: 100% !important; min-width: 0 !important; }
  .st-device { flex-direction: column; align-items: stretch; }
  .st-device .st-btn { justify-content: center; }
  /* tables become cards: each cell shows its column name (set by /js/ui.js from the header) */
  table.st-cards thead { display: none; }
  table.st-cards, table.st-cards tbody, table.st-cards tr, table.st-cards td { display: block; width: 100%; }
  table.st-cards tr { border: 1px solid var(--st-border); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; background: var(--st-surface-2); }
  table.st-cards td { border: 0; padding: 4px 0; display: flex; gap: 10px; justify-content: space-between; text-align: right; word-break: break-word; }
  table.st-cards td::before { content: attr(data-label); color: var(--st-text-dim); font-size: 12px; text-transform: uppercase; font-weight: 600; text-align: left; flex: 0 0 auto; padding-top: 1px; }
  table.st-cards td:empty { display: none; }
}

details.st-collapse > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 40px; }
details.st-collapse > summary::-webkit-details-marker { display: none; }
details.st-collapse > summary h2 { margin: 0; }
details.st-collapse > summary::after { content: "Show"; font-size: 13px; color: var(--st-accent); font-weight: 600; }
details.st-collapse[open] > summary::after { content: "Hide"; }
details.st-collapse[open] > summary { margin-bottom: 10px; }

/* MDM v0.4 restrictions */
.rs-row{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid var(--st-border);padding:10px 0}
.rs-row:first-of-type{border-top:0}
.rs-label{font-weight:600;min-width:0}
.rs-row select{width:auto;flex:0 0 auto;min-width:150px}
.rs-on{color:#fca5a5}.rs-off{color:#86efac}
@media (max-width:640px){.rs-row{flex-wrap:wrap}.rs-row select{width:100%;flex:1 1 100%}}

/* ---------- v1.12: installer connects the phone to the dashboard ---------- */
.st-link { border: 1px solid var(--st-border); background: var(--st-surface-2); border-radius: var(--radius); padding: 12px 14px; margin: 4px 0 14px; }
.st-link .st-label { margin-bottom: 2px; }
.st-link-form input { width: 100%; margin-bottom: 8px; }
.st-link input:not([type=radio]), .st-link select { width: 100%; box-sizing: border-box; }
.st-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.st-choice { display: flex; gap: 14px; flex-wrap: wrap; margin: 8px 0; }
.st-radio { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--st-text); margin: 0; cursor: pointer; }
.st-radio input { width: auto; margin: 0; }
.st-bigcode { font: 700 34px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 6px; text-align: center; background: var(--st-bg); border: 1px dashed var(--st-accent); border-radius: var(--radius); padding: 12px; margin: 8px 0; }
.st-connected { color: var(--st-green); font-weight: 700; }

/* v1.26: installer — accounts on the phone must be removed before the device-owner step. Navy, no amber. */
.st-s.need .st-s-icon { background: #1e3a8a; border-color: var(--st-accent); }
.st-s.need .st-s-icon::after { content: "i"; position: absolute; inset: 0; color: #dbeafe; font-size: 12px; font-weight: 900; text-align: center; line-height: 18px; font-style: italic; }
.st-result.need { background: #0f1d3d; border: 1px solid #2c4a8f; color: #dbe6ff; }
.st-result.need .st-acct-title { display: block; font-size: 15px; margin-bottom: 4px; }
.st-acct-list { margin: 4px 0 8px; padding-left: 20px; font-size: 14px; overflow-wrap: anywhere; }
.st-result.need .st-ol { margin: 8px 0 12px; }
.st-result.need .st-row .st-btn { flex: 1 1 auto; }
.st-acct-note { margin: 8px 0 0; min-height: 1em; }
.st-btn.ghost { background: transparent; border-color: transparent; color: #93b4ff; }

/* v1.32: Kyocera MDM report card */
.ky-rep-list{margin:6px 0 0;padding-left:18px;max-height:220px;overflow:auto}.ky-rep-list li{margin:3px 0;overflow-wrap:anywhere}

/* v1.37: live search above the classic page's installed-apps table (admin.js filterInventory). Navy + cyan. */
.st-app-search { position: relative; margin: 0 0 10px; }
.st-app-search input { width: 100%; padding: 10px 44px 10px 12px; border-radius: var(--radius); border: 1px solid var(--st-border); background: var(--st-surface-2); color: var(--st-text); font: inherit; }
.st-app-search input:focus { outline: none; border-color: #22d3ee; box-shadow: 0 0 0 3px rgba(34,211,238,.18); }
.st-app-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.st-app-search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(34,211,238,.14); color: #a5f3fc; font-size: 20px; line-height: 1; cursor: pointer; }
