/* public/assets/app.css */
/* === Base === */
:root{
    --bg0:#0b1220;
    --bg1:#0f1b33;
    --card:rgba(255,255,255,.06);
    --card2:rgba(255,255,255,.08);
    --line:rgba(255,255,255,.12);

    --text:#e5e7eb;
    --muted:rgba(229,231,235,.72);

    --brand:#2563eb;
    --brand2:#1d4ed8;
    --ok:#22c55e;
    --warn:#f59e0b;
    --bad:#ef4444;

    --radius:16px;
    --radius2:12px;
    --shadow:0 12px 35px rgba(0,0,0,.35);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
    margin:0;
    font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
    color:var(--text);
    background:
            radial-gradient(900px 500px at 20% 10%, rgba(37,99,235,.22), transparent 55%),
            radial-gradient(900px 600px at 90% 20%, rgba(34,197,94,.10), transparent 60%),
            linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* === Layout helpers === */
.container{width:min(1100px,92vw); margin:0 auto; padding:24px 0}
.center{min-height:100vh; display:flex; align-items:center; justify-content:center}
.grid{display:grid; gap:14px}
.row{display:flex; gap:12px; flex-wrap:wrap}
.spacer{height:12px}

/* === Cards === */
.card{
    background:var(--card);
    border:1px solid var(--line);
    border-radius:var(--radius);
    box-shadow:var(--shadow);
    backdrop-filter: blur(10px);
}
.card .card-body{padding:18px}
.card .card-title{margin:0 0 6px 0; font-size:18px}
.card .card-subtitle{margin:0; color:var(--muted); font-size:13px}

/* === Top bar === */
.topbar{
    position:sticky; top:0; z-index:50;
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 18px;
    background:rgba(11,18,32,.75);
    border-bottom:1px solid rgba(255,255,255,.08);
    backdrop-filter: blur(10px);
}
.brand{
    display:flex; align-items:center; gap:10px;
    font-weight:800; letter-spacing:.3px;
}
.brand .dot{
    width:10px;height:10px;border-radius:99px;background:var(--brand);
    box-shadow:0 0 0 6px rgba(37,99,235,.15);
}
.userpill{
    display:flex; align-items:center; gap:10px;
    padding:8px 10px; border-radius:999px;
    background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.10);
    color:var(--muted); font-size:13px;
}

/* === Forms === */
label{display:block; margin:10px 0 6px; font-size:13px; color:var(--muted)}
input,select,textarea{
    width:100%;
    padding:10px 12px;
    border-radius:var(--radius2);
    border:1px solid rgba(255,255,255,.12);
    background:rgba(0,0,0,.25);
    color:var(--text);
    outline:none;
}
input:focus,select:focus,textarea:focus{
    border-color:rgba(37,99,235,.55);
    box-shadow:0 0 0 4px rgba(37,99,235,.18);
}
.help{font-size:12px;color:var(--muted);margin-top:6px}

/* === Buttons === */
.btn{
    display:inline-flex; align-items:center; justify-content:center;
    gap:8px;
    padding:10px 10px;
    border-radius:var(--radius2);
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.06);
    color:var(--text);
    cursor:pointer;
    text-decoration:none;
    font-weight:650;
}
.btn:hover{background:rgba(255,255,255,.09)}
.btn-primary{
    background:linear-gradient(180deg, var(--brand), var(--brand2));
    border-color:rgba(37,99,235,.45);
}
.btn-primary:hover{filter:brightness(1.06)}
.btn-danger{
    background:rgba(239,68,68,.14);
    border-color:rgba(239,68,68,.38);
}
.btn-block{width:100%}

/* === Alerts === */
.alert{
    padding:10px 12px;
    border-radius:var(--radius2);
    border:1px solid rgba(255,255,255,.12);
    background:rgba(255,255,255,.06);
    color:var(--text);
    font-size:13px;
}
.alert-ok{border-color:rgba(34,197,94,.35); background:rgba(34,197,94,.10)}
.alert-warn{border-color:rgba(245,158,11,.40); background:rgba(245,158,11,.12)}
.alert-bad{border-color:rgba(239,68,68,.40); background:rgba(239,68,68,.12)}

/* === Tables === */
.table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    overflow:hidden;
    border-radius:var(--radius);
    border:1px solid rgba(255,255,255,.10);
    background:rgba(255,255,255,.04);
}
.table th,.table td{
    padding:10px 10px;
    border-bottom:1px solid rgba(255,255,255,.08);
    font-size:13px;
}
.table th{color:rgba(229,231,235,.85); text-align:left; background:rgba(255,255,255,.06)}
.table tr:hover td{background:rgba(255,255,255,.03)}

/* === Login box === */
.auth-wrap{width:min(420px,92vw)}
.auth-logo{
    display:flex; align-items:center; gap:10px;
    margin-bottom:10px;
}
.auth-logo .shield{
    width:40px;height:40px;border-radius:12px;
    background:rgba(37,99,235,.18);
    border:1px solid rgba(37,99,235,.35);
    display:flex;align-items:center;justify-content:center;
}
.auth-logo .title{font-size:18px;font-weight:800;margin:0}
.small-muted{color:var(--muted); font-size:12px}

/* === Footer small === */
.footer-note{margin-top:12px; font-size:12px; color:var(--muted); text-align:center}

/* ===== SIAFIC IA - Ajustes visuais (Acessa Órgão) ===== */

/* Sobe o miolo da página ~20% */
.center{
    align-items: flex-start !important;
    padding-top: 6vh !important;   /* ajusta fino: 4vh (mais alto) ou 8vh (mais baixo) */
}

/* Botões verdes + hover */
.btn-green{
    background: #16a34a; /* verde */
    border: 1px solid rgba(255,255,255,.08);
    color: #fff;
}
.btn-green:hover{
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.btn-green:active{
    transform: translateY(0px);
}

/* Hover no botão do login (se for btn-primary) */
.btn-primary:hover{
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.btn-primary:active{
    transform: translateY(0px);
}
/* Campos mais escuros, sem “clarão”, e fonte 1 ponto maior */
input, select, textarea {
    font-size: 16px;                 /* +1 ponto */
    background: rgba(15, 23, 42, .65);
    border: 1px solid rgba(148, 163, 184, .25);
    color: rgba(255,255,255,.92);
}

input::placeholder { color: rgba(203, 213, 225, .65); }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: rgba(56, 189, 248, .55);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, .18);
}

/* Botão desabilitado com cara de desabilitado */
button:disabled, .btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* ===== Ajustes EXCLUSIVOS do LOGIN ===== */

/* Desce o card do login ~15% da altura da tela */
body.login-page .center{
    align-items: flex-start !important;
    padding-top: 15vh !important;
}

/* Hover do botão do login: azul normal, no hover fica verde bonitão */
body.login-page .btn-primary{
    transition: filter .15s ease, transform .15s ease, background .15s ease, border-color .15s ease;
}

body.login-page .btn-primary:hover{
    background: linear-gradient(180deg, #16a34a, #15803d); /* verde */
    border-color: rgba(34,197,94,.55);
    filter: brightness(1.05);
    transform: translateY(-1px);
}

body.login-page .btn-primary:active{
    transform: translateY(0px);
}

/* ===== LOGIN: regras próprias, sem afetar o Acessa Órgão ===== */

/* Desce o card do login ~15% */
.login-center{
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh; /* desce 15% */
}

/* Hover verde bonitão no botão do login */
.login-btn{
    transition: filter .15s ease, transform .15s ease, background .15s ease, border-color .15s ease;
}

.login-btn:hover{
    background: linear-gradient(180deg, #16a34a, #15803d) !important;
    border-color: rgba(34,197,94,.55) !important;
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.login-btn:active{
    transform: translateY(0px);
}

/* ===== Ajustes FINOS – ACESSA ORGÃO ===== */

/* ===== Container exclusivo do Acessa Órgão ===== */
.acessa-wrap{
    width: min(760px, 92vw);
}

/* Linha dos botões */
.acessa-actions{
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

/* Botões mais estreitos (25% menores) */
.acessa-actions .btn{
    width: 38%;          /* em vez de 50% */
    padding: 10px 0;
}

/* === Botão ENTRAR (azul -> verde no hover) === */
.btn-enter{
    background: linear-gradient(180deg, var(--brand), var(--brand2));
    border-color: rgba(37,99,235,.45);
    color: #fff;
    transition: background .15s ease, transform .15s ease, filter .15s ease;
}

.btn-enter:hover{
    background: linear-gradient(180deg, #16a34a, #15803d); /* verde */
    border-color: rgba(34,197,94,.55);
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-enter:active{
    transform: translateY(0);
}

/* === Botão VOLTAR (cinza -> vermelho no hover) === */
.btn-back{
    background: rgba(148,163,184,.25); /* cinza médio */
    border-color: rgba(148,163,184,.45);
    color: #fff;
    transition: background .15s ease, transform .15s ease, filter .15s ease;
}

.btn-back:hover{
    background: linear-gradient(180deg, #dc2626, #b91c1c); /* vermelho */
    border-color: rgba(239,68,68,.55);
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-back:active{
    transform: translateY(0);
}

/* ===== PAINEL PRINCIPAL ===== */

.ctxbar{
    flex: 1;
    display:flex;
    justify-content:center;
    align-items:center;
    gap:14px;
    flex-wrap:wrap;
    padding: 0 10px;
}

.ctxitem{ text-align:center; }
.ctxlabel{ font-size:11px; color:var(--muted); letter-spacing:.2px; }
.ctxvalue{ font-size:13px; font-weight:800; color:rgba(255,255,255,.92); max-width: 260px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.ctxsep{
    width:1px;
    height:26px;
    background: rgba(255,255,255,.10);
}

.pill{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    border-radius:999px;
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.10);
    color:rgba(229,231,235,.85);
    font-size:12px;
    font-weight:700;
}

/* Grid de apps */
.apps-grid{
    margin-top: 14px;
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.app-card{
    display:block;
    padding: 14px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.10);
    text-decoration:none;
    color: var(--text);
    transition: transform .15s ease, filter .15s ease, background .15s ease, border-color .15s ease;
}
.app-card:hover{
    transform: translateY(-2px);
    filter: brightness(1.03);
    background: rgba(255,255,255,.07);
    border-color: rgba(56, 189, 248, .25);
}
.app-card.is-disabled{
    opacity:.65;
    cursor:not-allowed;
}
.app-top{ display:flex; align-items:center; gap:10px; }
.app-ico{
    width:34px; height:34px;
    border-radius: 12px;
    display:flex; align-items:center; justify-content:center;
    background: rgba(37,99,235,.18);
    border: 1px solid rgba(37,99,235,.28);
    font-weight:900;
}
.app-title{ font-weight:900; font-size:14px; }

.app-meta{
    margin-top:10px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
}
.tag{
    font-size:11px;
    padding:4px 8px;
    border-radius:999px;
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.10);
    color: rgba(229,231,235,.85);
    font-weight:700;
}

/* Permissões compactas */
.perm{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:22px; height:18px;
    border-radius:6px;
    font-size:11px;
    font-weight:900;
    border:1px solid rgba(255,255,255,.12);
    margin-left:4px;
}
.perm.on{ background: rgba(34,197,94,.12); border-color: rgba(34,197,94,.35); }
.perm.off{ opacity:.45; }

/* Details expansível */
.details-card summary{
    list-style:none;
    cursor:pointer;
    user-select:none;
}
.details-card summary::-webkit-details-marker{ display:none; }

.details-sum{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    padding: 14px 18px;
}
.prebox{
    margin:0;
    padding:12px;
    border-radius: var(--radius2);
    border:1px solid rgba(255,255,255,.10);
    background: rgba(0,0,0,.28);
    overflow:auto;
    max-height: 260px;
    font-size: 12px;
    line-height: 1.35;
}
.mini-title{
    font-weight:900;
    margin-bottom:8px;
}

/* ===== Painel: Brasão no topo ===== */
.brasao{
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.06);
    box-shadow: 0 8px 18px rgba(0,0,0,.25);
}

.brasao-fallback{
    display:flex;
    align-items:center;
    justify-content:center;
    color: rgba(255,255,255,.90);
    font-weight: 900;
}

/* Topbar: centro responsivo (não estoura) */
.ctxbar{
    min-width: 0; /* importantíssimo dentro de flex */
}

.ctxvalue{
    max-width: 220px; /* ajuste fino */
}

@media (max-width: 900px){
    .ctxvalue{ max-width: 160px; }
    .ctxsep{ display:none; }
    .ctxbar{ gap:10px; }
}

/* ===== MENU ADMINISTRATIVO: categorias ===== */
.cat-head{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
}

.cat-title{
    font-size:16px;
    font-weight: 950;
    letter-spacing:.2px;
}

/* Checkbox alinhado corretamente */
.form-check{
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.form-check input[type="checkbox"]{
    width: 16px;
    height: 16px;
    accent-color: #22c55e; /* verde bonito */
    cursor: pointer;
}

.form-check label{
    margin: 0;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
}

.pwd-wrap{
    display:flex;
    gap:10px;
    align-items:center;
}

.pwd-wrap input{
    flex:1;
}

.pwd-eye{
    width:44px;
    height:42px;
    padding:0;
}

/* === Ações padrão (Novo + Voltar) – tamanho reduzido === */
.page-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:10px;
    margin:10px 0;
}

/* tamanho equivalente ao botão Buscar */
.page-actions .btn{
    min-width:80px;
    padding:6px 12px;
    font-size:13px;          /* igual Buscar */
    font-weight:600;
    line-height:1.2;
}

/* ===== LIST HEADER (padrão Usuários/Grupos) ===== */
.list-head{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    flex-wrap:wrap;
}

.list-head-left{
    min-width:260px;
}

.list-head-right{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    flex:1;
    min-width:320px;
}

.list-search{
    display:flex;
    align-items:center;
    gap:10px;
    flex:1;
    min-width:300px;
}

.list-search .field{
    flex:1;
    min-width:260px;
}

.list-search label{
    display:none; /* no padrão da imagem o label fica “implícito” pelo placeholder */
}

.list-search input{
    width:100%;
}

.list-btn{
    white-space:nowrap;
}

/* Botões compactos (mesmo tamanho do Buscar) */
.btn-sm{
    padding:8px 12px;
    font-size:14px;
    border-radius:12px;
}
