/* AppleCare Warranty Sync on the Apple HIG glass kit (hig-glass.css loads first).
   Only the components these pages use; every colour comes from the kit tokens, so
   light, dark and auto all work without per-theme rules. Scoped to body.hig. */

body.hig .page { max-width: 900px; margin: 0 auto; padding: 20px 20px 120px; }
body.hig h1, body.hig h2, body.hig h3, body.hig p { margin: 0; }
body.hig [hidden] { display: none !important; }

/* ---- Header ------------------------------------------------------------- */
body.hig .hig-topbar { margin: 0 auto; max-width: 1120px; flex-wrap: wrap; }
body.hig a.hig-btn { color: var(--label); text-decoration: none; }
body.hig a.hig-btn.primary { color: #fff; }
body.hig .brand img { width: 30px; height: 30px; border-radius: 7px; flex: none; }
body.hig .brand-text { min-width: 0; }
body.hig .hig-topbar .right { flex-wrap: wrap; justify-content: flex-end; }
body.hig .user-name { font-size: 13px; color: var(--secondary-label); white-space: nowrap; }
body.hig .tenant-picker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--secondary-label); }
body.hig .tenant-picker select { padding: 5px 30px 5px 10px; font-size: 13px; border-radius: 8px; max-width: 220px; }

/* ---- Cards and section headers ----------------------------------------- */
body.hig .card { padding: 24px; margin-bottom: 20px; }
body.hig .section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
body.hig .section-head .num {
  flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--system-blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
body.hig .section-head h2 { font-size: 17px; font-weight: 600; line-height: 28px; }
body.hig .section-head p { font-size: 13px; color: var(--secondary-label); margin-top: 2px; }
body.hig .intro { font-size: 13px; color: var(--secondary-label); margin: 4px 4px 16px; }

/* ---- Buttons ----------------------------------------------------------- */
body.hig .hig-btn.md { padding: 9px 18px; font-size: 15px; border-radius: 10px; }
body.hig .hig-btn.confirming { color: var(--system-red); background: rgba(255,59,48,.10); border-color: rgba(255,59,48,.30); }
body.hig .form-actions, body.hig .btn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
body.hig .btn-row { margin-top: 12px; }
body.hig .cta-wrap { margin-top: 20px; }

/* ---- Forms ------------------------------------------------------------- */
body.hig .form-group { margin-bottom: 16px; }
body.hig .form-group > label, body.hig .field-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
body.hig .form-group small, body.hig .hint { display: block; font-size: 12px; color: var(--secondary-label); margin: -2px 0 6px; line-height: 1.45; }
body.hig .form-group input[type=text], body.hig .form-group input[type=number], body.hig .form-group input[type=time],
body.hig .form-group input[type=date], body.hig .form-group select, body.hig .form-group textarea { width: 100%; box-sizing: border-box; }
body.hig input[type=number], body.hig input[type=time], body.hig input[type=date] {
  padding: 10px 14px; border: 1px solid var(--separator); border-radius: 10px; font: inherit; font-size: 15px;
  background: var(--background); color: var(--label);
}
body.hig textarea { resize: vertical; font-family: "SF Mono", SFMono-Regular, Menlo, monospace; font-size: 13px; }
body.hig .checkbox-label { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
body.hig .checkbox-label input[type=checkbox], body.hig .checkbox-label input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--system-blue); flex: none; }
body.hig .checkbox-label + .checkbox-label { margin-top: 10px; }
body.hig .schedule-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* iOS switch */
body.hig .switch-row { justify-content: space-between; font-weight: 500; padding: 12px 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); margin: 16px 0 0; }
body.hig .switch-row input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; margin: 0;
  background: var(--system-gray3); position: relative; cursor: pointer; transition: background .3s; flex: none;
}
body.hig .switch-row input[type=checkbox]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .3s;
}
body.hig .switch-row input[type=checkbox]:checked { background: var(--system-green); }
body.hig .switch-row input[type=checkbox]:checked::after { transform: translateX(18px); }

/* Collapsible groups */
body.hig .collapsible-section { border-top: 1px solid var(--hairline); }
body.hig .collapsible-section:last-of-type { border-bottom: 1px solid var(--hairline); }
body.hig .collapsible-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: none; border: 0; padding: 14px 0; font: inherit; font-size: 15px; font-weight: 600;
  color: var(--label); cursor: pointer; text-align: left;
}
body.hig .collapse-icon { color: var(--secondary-label); font-size: 18px; font-weight: 400; transition: transform .2s; }
body.hig .collapsible-section.open .collapse-icon { transform: rotate(45deg); }
body.hig .collapsible-content { display: none; padding: 2px 0 16px; }
body.hig .collapsible-section.open .collapsible-content { display: block; }

/* Upload box */
body.hig .dropzone {
  border: 1px dashed var(--separator); border-radius: 10px; padding: 18px; text-align: center; cursor: pointer;
  font-size: 13px; color: var(--secondary-label); background: var(--background); transition: border-color .2s, color .2s;
}
body.hig .dropzone:hover { border-color: var(--system-blue); color: var(--system-blue); }
body.hig .dropzone input { display: none; }
body.hig .dropzone .ok { color: var(--system-green); font-weight: 500; }
body.hig .file-status { font-size: 13px; color: var(--secondary-label); margin-top: 8px; }

/* Callout (parsed Jamf credentials) */
body.hig .credentials-parsed { margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 13px;
  background: rgba(0,122,255,.05); border: 1px solid rgba(0,122,255,.15); }
body.hig .credentials-parsed strong { display: block; font-size: 14px; margin-bottom: 2px; }

/* Inline test results */
body.hig .inline-status { font-size: 13px; }
body.hig .inline-status.ok { color: var(--system-green); }
body.hig .inline-status.err { color: var(--system-red); }
body.hig .inline-status.busy { color: var(--secondary-label); }

/* Field picker */
body.hig .field-help { display: block; font-size: 12px; color: var(--secondary-label); line-height: 1.45; }
body.hig .field-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin-top: 8px; }
body.hig .field-group-title { grid-column: 1 / -1; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px; color: var(--secondary-label); margin-top: 10px; padding-bottom: 4px; border-bottom: 1px solid var(--hairline); }
@media (max-width: 600px) { body.hig .field-list { grid-template-columns: 1fr; } }
body.hig .field-option { align-items: flex-start; }
body.hig .field-list .checkbox-label + .checkbox-label { margin-top: 0; }
body.hig .field-option span { display: flex; flex-direction: column; }
body.hig .field-option small { font-size: 12px; color: var(--secondary-label); }

/* ---- Tabs (underline) and segmented controls --------------------------- */
body.hig .workflow-tabs { display: flex; border-bottom: 1px solid var(--separator); margin-bottom: 16px; }
body.hig .workflow-tab-btn {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 20px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--secondary-label); cursor: pointer;
}
body.hig .workflow-tab-btn.active { color: var(--system-blue); border-bottom-color: var(--system-blue); }
body.hig .segmented, body.hig .weekday-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
body.hig .segmented button, body.hig .chip {
  padding: 8px 16px; border-radius: 10px; border: 1px solid var(--separator); background: var(--background);
  color: var(--label); font: inherit; font-size: 14px; cursor: pointer; transition: background .2s, border-color .2s;
}
body.hig .chip { padding: 6px 12px; font-size: 13px; }
body.hig .segmented button.active, body.hig .chip.active { background: var(--system-blue); border-color: var(--system-blue); color: #fff; }

/* ---- Progress ---------------------------------------------------------- */
body.hig .job-progress { margin-top: 20px; }
body.hig .progress-track { height: 6px; border-radius: 3px; background: var(--system-gray5); overflow: hidden; }
body.hig .progress-fill-bar { height: 100%; width: 4%; background: var(--system-blue); border-radius: 3px; transition: width .4s; }
body.hig .progress-label { font-size: 13px; color: var(--secondary-label); margin-top: 8px; }

/* ---- Status badges (kit tint recipe) ----------------------------------- */
body.hig .sync-pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 8px; white-space: nowrap; line-height: 1.5; font-family: inherit; }
body.hig .sync-pill-ok   { color: var(--system-green);  background: rgba(52,199,89,.10); border: 1px solid rgba(52,199,89,.30); }
body.hig .sync-pill-warn { color: var(--system-orange); background: rgba(255,149,0,.10); border: 1px solid rgba(255,149,0,.30); }
body.hig .sync-pill-err  { color: var(--system-red);    background: rgba(255,59,48,.10); border: 1px solid rgba(255,59,48,.30); }
body.hig .sync-pill-idle { color: var(--secondary-label); background: var(--system-gray6); border: 1px solid var(--hairline); }
body.hig .pill-button { cursor: pointer; }
body.hig .pill-button.active { box-shadow: 0 0 0 2px currentColor; }
body.hig .results-header { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

/* ---- Tables ------------------------------------------------------------ */
body.hig .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
body.hig .sync-table { width: 100%; border-collapse: collapse; font-size: 12px; }
body.hig .sync-table th { text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  color: var(--secondary-label); padding: 8px; border-bottom: 1px solid var(--separator); white-space: nowrap; }
body.hig .sync-table td { padding: 8px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
body.hig .sync-table tr:last-child td { border-bottom: 0; }
body.hig .sync-table td small { display: block; color: var(--secondary-label); font-size: 11px; margin-top: 2px; }
body.hig .sync-table .mono { font-family: "SF Mono", SFMono-Regular, Menlo, monospace; }
body.hig .sync-table .change { white-space: nowrap; }
body.hig .sync-table .change span, body.hig .sync-table .change em { color: var(--secondary-label); }
body.hig .sync-table .item-note { max-width: 260px; white-space: normal; }
body.hig .sync-table .pill-cell { display: flex; flex-wrap: wrap; gap: 4px; }
body.hig .sync-table .empty-row { text-align: center; color: var(--secondary-label); padding: 24px 8px; }
body.hig .history-table tr.clickable { cursor: pointer; }
body.hig .history-table tr.clickable:hover td { background: var(--system-gray6); }
body.hig .history-controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
body.hig .results-meta { font-size: 13px; color: var(--secondary-label); margin: -12px 0 14px 40px; }

/* ---- Schedule extras --------------------------------------------------- */
body.hig .gate-note { display: block; font-size: 12px; color: var(--secondary-label); margin-top: 8px; }
body.hig .next-runs { font-size: 13px; margin-top: 14px; line-height: 1.6; }
body.hig .next-runs .muted { color: var(--secondary-label); }

/* ---- Empty state, toast, footer --------------------------------------- */
body.hig .empty-state { text-align: center; padding: 40px 24px; }
body.hig .empty-state h2 { font-size: 20px; font-weight: 600; margin-bottom: 6px; }
body.hig .empty-state p { font-size: 14px; color: var(--secondary-label); margin: 0 auto 18px; max-width: 420px; }
body.hig .toast {
  position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--label); color: var(--background); padding: 10px 16px; border-radius: 10px; font-size: 14px;
  max-width: min(520px, calc(100vw - 32px)); z-index: 200; transition: opacity .3s, transform .3s;
}
body.hig .toast.show { opacity: 1; transform: translate(-50%, 0); }
body.hig .toast.error { background: var(--system-red); color: #fff; }
body.hig .footer { text-align: center; font-size: 12px; color: var(--secondary-label); margin-top: 28px; }

/* ---- Sign-in page ------------------------------------------------------ */
body.hig .login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
body.hig .login-card { max-width: 420px; width: 100%; padding: 40px 32px; text-align: center; box-sizing: border-box; }
body.hig .login-card img { width: 64px; height: 64px; border-radius: 14px; margin-bottom: 16px; }
body.hig .login-card h1 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
body.hig .login-card p { font-size: 14px; color: var(--secondary-label); margin: 6px 0 24px; }
body.hig .login-card .ms-logo { width: 18px; height: 18px; }
body.hig .login-fine { font-size: 12px !important; margin: 20px 0 0 !important; }
body.hig .login-theme { position: fixed; top: 16px; right: 16px; }

@media (max-width: 600px) {
  body.hig .page { padding: 12px 12px 100px; }
  body.hig .card { padding: 18px; }
  body.hig .schedule-row { grid-template-columns: 1fr; }
  body.hig .hig-topbar { padding: 12px 14px; }
  body.hig .hig-topbar .right { width: 100%; justify-content: flex-start; }
  body.hig .user-name { display: none; }
  body.hig .tenant-picker > span { display: none; }
  body.hig .tenant-picker select { max-width: 150px; }
  body.hig .workflow-tab-btn { padding: 10px 12px; }
  body.hig .results-meta { margin-left: 0; }
}
