/* ============ Licence Hub — style.css v3 ============ */
:root {
    --bg: #0a0f1c; --bg2: #111827; --card: #1a2233; --border: #2a3548;
    --text: #e5e7eb; --muted: #9ca3af; --accent: #10b981; --accent2: #059669;
    --warn: #f59e0b; --danger: #ef4444; --ok: #22c55e;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
code { background: var(--bg); padding: 2px 8px; border-radius: 4px; font-family: Consolas, Monaco, monospace; color: var(--accent); font-size: .82rem; }
small { color: var(--muted); }

/* Boot / loading */
#tela-loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px; background: var(--bg); z-index: 100; }
.spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--muted); font-size: .9rem; letter-spacing: 1px; text-transform: uppercase; }
.loading-erro { display: none; text-align: center; max-width: 500px; padding: 20px; background: rgba(239,68,68,.1); border: 1px solid var(--danger); border-radius: 10px; }
.loading-erro h3 { margin: 0 0 8px; color: var(--danger); }
.loading-erro p { margin: 4px 0; color: var(--muted); font-size: .85rem; }

/* Login */
#tela-login { display: none; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.brand { text-align: center; margin-bottom: 24px; }
.brand-logo { display: inline-block; width: 60px; height: 60px; background: var(--accent); border-radius: 14px; line-height: 60px; text-align: center; color: #fff; font-weight: 900; font-size: 1.4rem; margin-bottom: 10px; overflow: hidden; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand h1 { margin: 0; font-size: 1.4rem; color: var(--text); font-weight: 700; }
.brand .sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* Painel */
#tela-painel { display: none; }
header.topbar { background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 20; }
.logo-mini { display: inline-block; width: 32px; height: 32px; background: var(--accent); color: #fff; border-radius: 8px; line-height: 32px; text-align: center; font-weight: 800; vertical-align: middle; margin-right: 10px; overflow: hidden; }
.logo-mini img { width: 100%; height: 100%; object-fit: contain; }
header.topbar h1 { display: inline; margin: 0; font-size: 1rem; letter-spacing: 1px; vertical-align: middle; }
.user-info { font-size: .8rem; color: var(--muted); }
.user-info b { color: var(--text); }

.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 60px); }
aside.side { background: var(--bg2); border-right: 1px solid var(--border); padding: 16px 0; }
aside.side button { display: block; width: 100%; text-align: left; background: transparent; color: var(--muted); border: none; padding: 12px 20px; cursor: pointer; font-size: .9rem; font-weight: 500; border-left: 3px solid transparent; transition: .15s; }
aside.side button:hover { color: var(--text); background: rgba(255,255,255,.03); }
aside.side button.active { color: var(--accent); border-left-color: var(--accent); background: rgba(16,185,129,.05); }
main.content { padding: 24px; overflow-x: auto; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-header h2 { margin: 0; font-size: 1.3rem; }
.page-header .sub { color: var(--muted); font-size: .85rem; margin-top: 2px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 20px; margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 1rem; }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) {
    .grid-2, .grid-4 { grid-template-columns: 1fr; }
    .layout { grid-template-columns: 1fr; }
    aside.side { border-right: none; border-bottom: 1px solid var(--border); }
    aside.side button { display: inline-block; width: auto; }
}

.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; display: flex; gap: 14px; align-items: center; }
.stat .icon { font-size: 1.8rem; opacity: .9; }
.stat .val { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 4px; }
.stat.stat-warn { border-color: var(--warn); }
.stat.stat-ok { border-color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: .85rem; }
thead { background: var(--bg2); }
th { text-align: left; padding: 10px 12px; color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

input, select, textarea { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 9px 12px; border-radius: 6px; width: 100%; font-family: inherit; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type=color] { padding: 3px; height: 40px; cursor: pointer; }
input[type=file] { padding: 5px; }
label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 5px; font-weight: 600; }

.btn { background: var(--accent); color: #fff; border: none; padding: 9px 18px; border-radius: 6px; cursor: pointer; font-size: .88rem; font-weight: 600; transition: .15s; }
.btn:hover:not(:disabled) { background: var(--accent2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sec { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-sec:hover { background: var(--border); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.badge-emitida, .badge-pendente { background: rgba(245,158,11,.2); color: var(--warn); }
.badge-activa, .badge-aprovado { background: rgba(34,197,94,.2); color: var(--ok); }
.badge-suspensa { background: rgba(59,130,246,.2); color: #60a5fa; }
.badge-expirada, .badge-revogada, .badge-rejeitado { background: rgba(239,68,68,.2); color: var(--danger); }

.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; align-items: flex-start; justify-content: center; z-index: 999; padding: 20px; overflow-y: auto; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 560px; width: 100%; margin: auto; }
.modal h3 { margin: 0 0 16px; }

.chave-out { background: var(--bg); border: 2px dashed var(--accent); padding: 20px; border-radius: 10px; text-align: center; font-family: Consolas, monospace; font-size: 1.2rem; color: var(--accent); letter-spacing: 3px; word-break: break-all; margin: 12px 0; user-select: all; }

.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 9999; font-size: .9rem; font-weight: 500; }
.toast-ok { background: var(--ok); color: #fff; }
.toast-err { background: var(--danger); color: #fff; }

.pw-strength { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 6px; }
.pw-strength > div { height: 100%; transition: .3s; }

.badge-num { background: var(--warn); color: #000; padding: 1px 6px; border-radius: 10px; font-size: .7rem; margin-left: 4px; display: none; }
.badge-num.visible { display: inline-block; }

.info-box { background: var(--bg); padding: 12px; border-radius: 8px; font-size: .82rem; color: var(--muted); }
.info-box strong { color: var(--text); }
.info-box .val { color: var(--accent); }

.checkbox-inline { display: flex; align-items: center; gap: 8px; }
.checkbox-inline input { width: auto; }
.checkbox-inline label { margin: 0; }

pre.log-box { background: var(--bg); padding: 12px; border-radius: 8px; max-height: 300px; overflow: auto; font-size: .75rem; color: var(--muted); white-space: pre-wrap; word-break: break-word; }
