/* Lemmo Hub — estilos base */
:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #15212b;
  --muted: #5b6b78;
  --border: #dde3e8;
  --primary: #0b4f6c;
  --primary-hover: #093f57;
  --primary-soft: #e3eff4;
  --accent: #14a38b;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #13795b;
  --success-soft: #e5f5ef;
  --info: #1d5fa8;
  --info-soft: #e8f0fb;
  --warn: #9a6100;
  --warn-soft: #fdf3e1;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151b;
    --surface: #151f27;
    --surface-2: #1a2630;
    --text: #e6edf2;
    --muted: #98a8b4;
    --border: #2a3843;
    --primary: #3aa0c9;
    --primary-hover: #5bb4d8;
    --primary-soft: #16303d;
    --danger: #f97066;
    --danger-soft: #3a1a18;
    --success: #4fd1a5;
    --success-soft: #12302a;
    --info: #7fb2ef;
    --info-soft: #172840;
    --warn: #f2b84b;
    --warn-soft: #33270f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; }
.muted { color: var(--muted); }
code { font-size: .85em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; border: 1px solid var(--border); }

/* Marca */
.brand { display: inline-flex; align-items: center; gap: .55rem; color: var(--text); }
.brand-mark { width: 30px; height: 30px; }
.brand-mark rect { fill: var(--primary); }
.brand-mark path { fill: none; stroke: #fff; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-name { font-size: 1.05rem; font-weight: 500; }
.brand-name strong { font-weight: 700; }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; border-radius: 10px; border: 1px solid transparent; padding: .7rem 1.1rem; cursor: pointer; transition: background .15s, border-color .15s; text-decoration: none !important; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-sm { padding: .4rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* Formulários */
.form { display: grid; gap: 1rem; margin-top: 1.25rem; }
.field { display: grid; gap: .35rem; }
.field > span { font-size: .85rem; font-weight: 600; }
.field input { font: inherit; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); width: 100%; }
.field input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.hint { color: var(--muted); font-size: .8rem; }

/* Alertas */
.alert { border-radius: 10px; padding: .75rem .9rem; margin: 1rem 0 0; font-size: .9rem; border: 1px solid transparent; }
.alert ul { margin: 0; padding-left: 1.1rem; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }

/* Telas de autenticação */
body.auth { min-height: 100vh; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, 520px); }
.auth-aside { background: linear-gradient(155deg, #0b4f6c 0%, #0a3c52 55%, #0d5e57 100%); color: #e9f3f7; padding: 2.5rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-aside .brand { color: #fff; }
.auth-aside .brand-mark rect { fill: rgba(255, 255, 255, .14); }
.auth-aside-copy { max-width: 420px; }
.auth-aside-copy h2 { font-size: 2rem; font-weight: 700; color: #fff; }
.auth-aside-copy p { color: #bcd6e0; font-size: 1.05rem; }
.auth-aside small { color: #9fc0cd; }
.auth-card { background: var(--surface); padding: 3rem clamp(1.25rem, 5vw, 3.5rem); display: flex; flex-direction: column; justify-content: center; }
.auth-card h1 { margin-top: .5rem; }
.auth-mobile-brand { display: none; margin-bottom: 1.5rem; }
.auth-switch { margin-top: 1.5rem; color: var(--muted); font-size: .9rem; text-align: center; }
@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-brand { display: block; }
  .auth-card { padding: 2rem 16px; justify-content: flex-start; }
}

/* App */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1.5rem; padding: .75rem clamp(16px, 3vw, 2rem); background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar-brand { text-decoration: none !important; }
.topnav { display: flex; gap: .25rem; flex: 1; }
.topnav a { color: var(--muted); font-weight: 500; padding: .45rem .75rem; border-radius: 8px; text-decoration: none; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--primary-soft); color: var(--primary); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.topbar-user form { margin: 0; }
.user-chip { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none !important; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; display: grid; place-items: center; font-size: .78rem; font-weight: 700; }
.container { max-width: 1120px; margin: 0 auto; padding: 2rem clamp(16px, 3vw, 2rem) 3rem; }
.page-head { margin-bottom: 1.5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 600; color: var(--primary); margin: 0 0 .35rem; }
.section-title { margin: 2.5rem 0 .8rem; }
.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 0 16px 2rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .35rem; }
.card p { color: var(--muted); margin: 0 0 .75rem; flex: 1; }
.card-narrow { max-width: 480px; }
.card-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; margin-bottom: .5rem; }
.card-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.badge { align-self: flex-start; font-size: .78rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; }
.badge-soon { background: var(--warn-soft); color: var(--warn); }
.badge-ok { background: var(--success-soft); color: var(--success); }

.pill { font-size: .78rem; font-weight: 600; padding: .2rem .55rem; border-radius: 999px; white-space: nowrap; }
.pill-pending { background: var(--warn-soft); color: var(--warn); }
.pill-active { background: var(--success-soft); color: var(--success); }
.pill-disabled { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }

/* Tabelas */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .8rem 1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table-compact td { padding: .55rem 1rem; }
.right { text-align: right; }
.actions { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: .75rem; }
  .topnav { order: 3; flex-basis: 100%; }
  .user-name { display: none; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .table td { border: 0; padding: .3rem 1rem; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
  .actions { justify-content: flex-start; }
}
