a { color: inherit; }
button, input, textarea, select { font: inherit; }

/* ===========================
   SmileTap UI — Global Styles
   =========================== */

/* Base color system (accent provided inline from PHP: :root { --accent: #... } ) */
:root{
  --bg: #f8fafc;            /* slate-50 */
  --card: #ffffff;
  --text: #0f172a;          /* slate-900 */
  --muted: #64748b;         /* slate-500 */
  --line: #e2e8f0;          /* slate-200 */
  --soft: #f1f5f9;          /* slate-100 */
  --accent: #0ea5e9;        /* sky-500 (fallback) */
  --accent-600: #0284c7;    /* sky-600 */
  --danger: #b91c1c;        /* red-700 */
  --success: #16a34a;       /* green-600 */
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2,6,23,.08);
  --shadow-soft: 0 5px 18px rgba(2,6,23,.06);
}

/* Dark mode */
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b1220;
    --card:#0f172a;
    --text:#e5e7eb;
    --muted:#94a3b8;
    --line:#1f2937;
    --soft:#111827;
    --shadow: 0 10px 30px rgba(0,0,0,.5);
    --shadow-soft: 0 5px 18px rgba(0,0,0,.35);
  }
}

/* Reset-ish */
*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  margin:0;
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Links, focus, selections */
a{ color: inherit; text-decoration: none; }
a:hover{ text-decoration: underline; text-decoration-thickness: 1.5px; }
:focus-visible{
  outline: 3px solid color-mix(in srgb, var(--accent) 70%, white);
  outline-offset: 2px;
  border-radius: 8px;
}
::selection{ background: color-mix(in srgb, var(--accent) 18%, #0000); }

/* Layout helpers */
.wrap{ max-width: 960px; margin: 32px auto; padding: 0 16px; }
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.center{ text-align: center; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; }
.soft{ background: var(--soft); }

/* Buttons */
.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover{ transform: translateY(-1px); box-shadow: var(--shadow-soft); text-decoration: none; }
.btn:active{ transform: translateY(0); }
.btn--primary{
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--ghost{
  background: var(--soft);
}
.btn--danger{
  background: color-mix(in srgb, var(--danger) 92%, #fff);
  border-color: color-mix(in srgb, var(--danger) 92%, #fff);
  color: #fff;
}
.pill{
  display:inline-flex; align-items:center; gap:6px;
  padding: 8px 12px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600;
}


.pill.secondary{ background: #475569; color:#fff; }
.pill.ghost{ background: var(--soft); color: var(--text); }
.pill.danger{ background: var(--danger); }

/* Kill underline on all pill variants (links + buttons) in every state */
a.pill,
a.pill:link,
a.pill:visited,
a.pill:hover,
a.pill:focus,
a.pill:active,
button.pill,
button.pill:hover,
button.pill:focus {
  text-decoration: none !important;
  outline: none;
}

/* Make non-link pills (spans) inert and non-hoverable */
span.pill {
  pointer-events: none;   /* no click/hover */
  cursor: default;        /* not a hand */
  box-shadow: none;
  transform: none;
}

span.pill:hover,
span.pill:focus {
  text-decoration: none;
  box-shadow: none;
  transform: none;
}

/* Hover shadow only for interactive pills (links/buttons), not for span badges */
a.pill, button.pill {
  box-shadow: none;
  transition: box-shadow .15s ease;
}

/* Desktop hover: subtle elevation */
@media (hover:hover) and (pointer:fine) {
  a.pill:hover,
  button.pill:hover {
    box-shadow: 0 2px 2px rgba(2,6,23,.12);
  }
}

/* Keep non-interactive status pills inert (from earlier) */
span.pill { pointer-events: none; cursor: default; box-shadow: none; }


/* Inputs & forms */
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="color"], input[type="file"], textarea, select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
}
textarea{ resize: vertical; min-height: 90px; }
label{ display:block; margin: 6px 0; color: var(--muted); font-size: 12px; }
fieldset{ border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); }
legend{ padding: 0 6px; color: var(--muted); }

/* Tables */
table{ width: 100%; border-collapse: collapse; }
th, td{ border:1px solid var(--line); padding: 10px; text-align: left; }
th{ background: var(--soft); color: var(--muted); font-weight: 700; }

/* Utilities */
.grid{ display: grid; gap: 12px; }
.grid.two{ grid-template-columns: 1fr 1fr; }
.grid.three{ grid-template-columns: repeat(3, 1fr); }
.row{ margin: 8px 0; }
.hidden{ display: none !important; }

/* ===========================
   Public Profile Page
   =========================== */
.profile-card{ text-align: center; padding: 24px; }
.profile-logo{
  width: 120px; height: 120px; object-fit: contain;
  border-radius: 16px; border: 1px solid var(--line); background: #fff; margin: 0 auto;
}
.profile-title{ font-size: 28px; font-weight: 800; margin: 14px 0 8px; }
.profile-desc{ color: color-mix(in srgb, var(--text) 85%, #fff); max-width: 60ch; margin: 0 auto 12px; }
.link-button{
  display:block; width: 100%;
  padding: 14px 16px; margin: 10px 0;
  border-radius: 12px; font-weight: 700; text-align: center;
  border: 1px solid var(--line);
  color: #fff; background: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 22%, #0000);
  transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease;
}
.link-button .icon{ opacity: .9; margin-right: 8px; }
.link-button:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 28%, #0000);
  text-decoration: none;
}
.profile-contact{ text-align:left; margin-top: 16px; color: var(--muted); }
.profile-contact a{ color: inherit; text-decoration: underline; text-decoration-thickness: 1.5px; }
.profile-footer{ text-align:center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* ===========================
   Admin: Integrated Button Editor
   =========================== */
.btns-header{
  display:grid;
  grid-template-columns: 28px 1.2fr 1.8fr 1.2fr 120px 80px 80px 80px 60px;
  gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card);
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.btn-row{
  display:grid;
  grid-template-columns: 28px 1.2fr 1.8fr 1.2fr 120px 80px 80px 80px 60px;
  gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--soft);
}
.btn-row + .btn-row{ margin-top: 8px; }
.handle{
  cursor: grab; text-align: center; user-select: none;
  color: var(--muted); font-weight: 800;
}
.handle:active{ cursor: grabbing; }

/* Buttons inside rows */
.btn-row button{ border: 0; }
.btn-row .pill{ padding: 6px 10px; }
.btn-row input[type="checkbox"]{ width: 18px; height: 18px; }

/* Admin layout polish */
.admin-head{ display:flex; align-items:center; gap:10px; justify-content: space-between; margin: 10px 0 16px; }
.admin-actions{ display:flex; gap:8px; flex-wrap: wrap; }
.admin-subtle{ color: var(--muted); font-size: 13px; }

/* QR preview tweaks */
.qr-img{ max-width: 320px; height: auto; border:1px solid var(--line); border-radius: 10px; display:block; }
.qr-meta code{ background: var(--soft); padding: 2px 6px; border-radius: 6px; }

/* Login card centering helper (optional) */
.full-center{ min-height: 100dvh; display:grid; place-items:center; }

/* ===========================
   Responsive
   =========================== */
@media (max-width: 900px){
  .grid.two{ grid-template-columns: 1fr; }
  .grid.three{ grid-template-columns: 1fr; }
}
@media (max-width: 1100px){
  .btns-header,
  .btn-row{
    grid-template-columns: 28px 1fr 1.4fr 1fr 100px 70px 80px 80px 60px;
  }
}
@media (max-width: 760px){
  .btns-header,
  .btn-row{
    grid-template-columns: 28px 1fr 1fr 0.8fr 100px 60px 70px 80px 60px;
  }
}

/* ===========================
   Motion preferences
   =========================== */
@media (prefers-reduced-motion: reduce){
  .btn, .link-button{ transition: none; }
}
