/*
  Estilos globais modernos e responsivos (mobile-first),
  com suporte a tema claro/escuro e componentes reutilizáveis.
*/

:root {
  --bg: #0b1214;
  --surface: #0f1720;
  --text: #e6edf3;
  --muted: #93a1a1;
  --primary: #0ea5a6;
  --primary-600: #0f766e;
  --ring: #22d3ee33;
  --card: #111827;
  --border: #253341;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7fafc;
    --surface: #ffffff;
    --text: #0f1720;
    --muted: #4b5563;
    --primary: #0ea5a6;
    --primary-600: #0f766e;
    --ring: #06b6d433;
    --card: #ffffff;
    --border: #e5e7eb;
  }
}

html[data-theme="light"] {
  --bg: #f7fafc;
  --surface: #ffffff;
  --text: #0f1720;
  --muted: #4b5563;
  --primary: #0ea5a6;
  --primary-600: #0f766e;
  --ring: #06b6d433;
  --card: #ffffff;
  --border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 28px; height: 28px; border-radius: 6px; background: #0000; }
.brand h1 { font-size: 18px; margin: 0; font-weight: 600; }
.back { color: var(--text); text-decoration: none; margin-right: 6px; opacity: .85; }
.back:hover { opacity: 1; }

.header-actions { display: flex; gap: 8px; align-items: center; }
.btn { cursor: pointer; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 12px; transition: background .2s, border-color .2s; }
.btn:hover { background: var(--card); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn.ghost { background: transparent; }

.container { max-width: 1100px; margin: 0 auto; padding: 16px; }
.intro { margin-bottom: 8px; }
.searchbar input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }

.grid {
  display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 680px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card, .app-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 0 0 1px var(--ring) inset;
}

.app-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); }
.app-card .thumb { width: 100%; aspect-ratio: 1/1; border-radius: 10px; border: 1px solid var(--border); display: grid; place-items: center; background: #0b2530; overflow: hidden; }
.app-card img { width: 70%; height: 70%; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.app-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.app-card p { margin: 0; color: var(--muted); font-size: 12px; }
.app-card:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--ring); }

.empty { text-align: center; opacity: .8; }

.footer { text-align: center; padding: 24px; color: var(--muted); }

/* Forms */
.form { display: grid; gap: 12px; }
.form-row { display: grid; gap: 6px; }
.form-row.inline { grid-auto-flow: column; align-items: center; justify-content: start; gap: 8px; }
.form input[type="text"], .form input[type="search"], .form input[type="number"], .form textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.details { border-top: 1px dashed var(--border); padding-top: 10px; }

.status { font-size: 12px; color: var(--muted); }
.dot::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 999px; margin-right: 6px; background: currentColor; }
.gray { color: #9ca3af; }
.green { color: #10b981; }
.yellow { color: #f59e0b; }
.red { color: #ef4444; }

.messages { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.messages li { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--surface); }
.messages .title { font-weight: 600; }
.messages .meta { color: var(--muted); font-size: 12px; }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

