/* SisPosto Licenças — identidade do site interfacesistemas.com (laranja do logo, grafite, Roboto). */
:root {
  --primary: #f04e23;
  --primary-dark: #d84315;
  --graphite: #58595b;
  --text: #3a3a3a;
  --muted: #7b7b7b;
  --border: #e4e4e4;
  --bg: #f5f5f5;
  --ok: #4caf50;
  --danger: #f44335;
  --radius: 0.75rem;
  font-family: "Roboto", "Helvetica", "Arial", sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2 { font-family: "Roboto Slab", "Roboto", serif; color: var(--graphite); }
h1 { font-size: 1.6rem; margin: 0; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.25rem; }
code { background: #eee; padding: 0 0.3em; border-radius: 4px; }
.muted { color: var(--muted); margin: 0.25rem 0 0.75rem; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; white-space: nowrap; }

.topbar { background: #fff; border-top: 4px solid var(--primary); box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: 0.6rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.9rem; color: var(--graphite); font-weight: 500; }
.brand img { height: 38px; }
.brand:hover { text-decoration: none; }
nav { display: flex; align-items: center; gap: 1.25rem; }
nav a { color: var(--graphite); padding: 0.3rem 0; border-bottom: 2px solid transparent; }
nav a.active, nav a:hover { color: var(--primary); border-bottom-color: var(--primary); text-decoration: none; }

.container { width: 100%; max-width: 1100px; margin: 1.75rem auto; padding: 0 1.25rem; flex: 1; }
.container.narrow { max-width: 640px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.card { background: #fff; border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,.05); overflow-x: auto; }
.card.padded { padding: 1.5rem; }
.card.meta { margin-top: 1rem; color: var(--muted); font-size: 0.9rem; }
.card.meta p { margin: 0.25rem 0; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 500; }
tbody tr:hover { background: #fafafa; }
td.actions, th.actions { text-align: right; white-space: nowrap; }
td.empty { text-align: center; color: var(--muted); padding: 2rem; }
td.ua { font-size: 0.8rem; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 500; background: #eee; color: var(--graphite); }
.badge-ok { background: #e8f5e9; color: #2e7d32; }
.badge-blocked { background: #fdecea; color: #c62828; }

.btn { display: inline-block; border: 1px solid var(--border); background: #fff; color: var(--graphite); padding: 0.55rem 1.1rem; border-radius: 0.5rem; font: inherit; font-weight: 500; cursor: pointer; }
.btn:hover { border-color: var(--graphite); text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-danger { color: var(--danger); border-color: #f5c2bd; }
.btn-ok { color: #2e7d32; border-color: #c8e6c9; }
.btn-small { padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.btn-block { width: 100%; margin-top: 1.25rem; }
.link { background: none; border: 0; color: var(--graphite); font: inherit; cursor: pointer; padding: 0; }
.link:hover { color: var(--primary); }
form.inline { display: inline; margin: 0; }

.search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search input { flex: 1; }
label { display: block; font-size: 0.85rem; color: var(--graphite); margin: 1rem 0 0.35rem; font-weight: 500; }
label.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; }
input[type=text], input[type=password], input[type=search], textarea {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; font: inherit; background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(240,78,35,.15); }
input.invalid { border-color: var(--danger); }
.error { color: var(--danger); font-size: 0.85rem; margin: 0.3rem 0 0; }
.form-actions { margin-top: 1.5rem; display: flex; justify-content: flex-end; }

.flash { background: #e8f5e9; color: #2e7d32; padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; }
.alert { background: #fdecea; color: #c62828; padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; }

.login-page { align-items: center; justify-content: center; background: linear-gradient(195deg, #58595b, #2b2b2b); }
.login-card { background: #fff; width: min(400px, 92vw); padding: 2rem; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.25); border-top: 4px solid var(--primary); }
.login-logo { width: 100%; max-width: 260px; display: block; margin: 0 auto 1rem; }
.login-card h1 { text-align: center; }
.login-card .muted { text-align: center; }

.footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 1.5rem; }

/* v2: grid, users, import */
.container.wide { max-width: 1240px; }
.topbar-inner { max-width: 1240px; }
.head-actions { display: flex; gap: 0.5rem; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 260px; width: auto; }
.filters select { padding: 0.55rem 0.6rem; border: 1px solid var(--border); border-radius: 0.5rem; font: inherit; background: #fff; }
.filters .spacer { flex: 1; }
.btn-ghost { border-color: transparent; background: transparent; }
a.sort { color: var(--muted); white-space: nowrap; }
a.sort:hover { color: var(--primary); text-decoration: none; }
.arrow { color: var(--primary); font-size: 0.7rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }
.small { font-size: 0.85rem; }
.center { text-align: center; }
.who { display: flex; align-items: center; gap: 0.75rem; padding-left: 1rem; border-left: 1px solid var(--border); }
.badge-primary { background: #fde9e3; color: var(--primary-dark); }
.stats { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.temp-password { font-size: 1.6rem; letter-spacing: 0.08em; background: #fff7f4; border: 1px dashed var(--primary); border-radius: 0.5rem; padding: 0.75rem 1rem; text-align: center; user-select: all; }
input[type=file] { display: block; margin-top: 0.25rem; }
input[type=email] { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; font: inherit; background: #fff; }
input[readonly] { background: #f3f3f3; color: var(--muted); }

/* v2 API: license key, integration */
.key-card { margin-top: 1rem; }
.key-card h2 { margin-top: 0; }
.key { font-size: 1.15rem; letter-spacing: 0.04em; background: #f7f7f7; border-radius: 0.5rem; padding: 0.6rem 0.9rem; margin: 0.5rem 0; }
.key.revealed { background: #fff7f4; border: 1px dashed var(--primary); user-select: all; }
.key-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
pre.code { background: #2b2b2b; color: #f5f5f5; padding: 0.9rem 1rem; border-radius: 0.5rem; overflow-x: auto; font-size: 0.85rem; }
pre.code.wrap { white-space: pre-wrap; word-break: break-all; }
details summary { cursor: pointer; color: var(--graphite); margin: 0.5rem 0; }
