/* =====================================================
   PAINEL GRUPO ZEN — Visual identity v2 (red gradient)
   ===================================================== */

:root {
    /* Base dark */
    --bg-base:        #0a0a0a;
    --bg-surface:     #131313;
    --bg-elevated:    #181818;
    --border:         #1f1f1f;
    --border-bright:  #2a2a2a;

    /* Texto */
    --text:           #f5f5f5;
    --text-dim:       #a3a3a3;
    --text-mute:      #6b6b6b;

    /* Vermelhos da Rosário */
    --red-deep:       #6a0000;
    --red:            #b80c14;
    --red-bright:     #e5141f;
    --red-coral:      #ff4d3d;
    --red-glow:       rgba(229, 20, 31, 0.18);

    /* Gradiente principal */
    --grad-primary:   linear-gradient(135deg, #ff4d3d 0%, #e5141f 50%, #6a0000 100%);
    --grad-soft:      linear-gradient(135deg, #ff4d3d, #e5141f);

    /* Status */
    --green:          #22c55e;
    --amber:          #f59e0b;

    /* Fontes */
    --font-sans:      "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
    --font-mono:      "JetBrains Mono", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg-base);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

::selection {
    background: var(--red-bright);
    color: white;
}

/* Texto com gradiente vermelho */
.grad {
    background: var(--grad-soft);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

/* Badge mono estilo "// dev · curioso · maker" */
.brand-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    border: 1px solid var(--border-bright);
    border-radius: 999px;
    background: rgba(229, 20, 31, 0.04);
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--red-coral);
    letter-spacing: 0.04em;
    box-shadow: 0 0 24px rgba(229, 20, 31, 0.08);
}

/* =====================================================
   LOGIN
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
    background-size: 56px 56px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.bg-glow {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 50% 0%, rgba(229, 20, 31, 0.12), transparent 70%),
        radial-gradient(ellipse 800px 500px at 100% 100%, rgba(255, 77, 61, 0.08), transparent 70%),
        radial-gradient(ellipse 500px 400px at 0% 80%, rgba(106, 0, 0, 0.15), transparent 70%);
    pointer-events: none;
}

.login-card {
    width: 100%;
    max-width: 440px;
    padding: 56px 44px 36px;
    background: rgba(19, 19, 19, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-bright);
    border-radius: 20px;
    position: relative;
    z-index: 1;
    animation: cardIn 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(180deg, rgba(229, 20, 31, 0.4), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.brand {
    text-align: center;
    margin-bottom: 40px;
}

.brand-logo {
    width: 96px;
    height: auto;
    margin: 0 auto 24px;
    display: block;
    filter: drop-shadow(0 8px 32px rgba(229, 20, 31, 0.4));
}

.brand .brand-badge {
    margin: 0 auto 18px;
}

.brand-name {
    font-family: var(--font-sans);
    font-size: 36px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    letter-spacing: -0.025em;
    line-height: 1.1;
}

.brand-tagline {
    font-size: 13px;
    color: var(--text-mute);
    letter-spacing: 0.01em;
}

.alert {
    padding: 12px 16px;
    background: rgba(229, 20, 31, 0.08);
    border: 1px solid rgba(229, 20, 31, 0.3);
    border-radius: 10px;
    color: var(--red-coral);
    font-size: 13px;
    margin-bottom: 24px;
    font-weight: 500;
}

.login-form { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.01em;
}

.field input {
    background: rgba(10, 10, 10, 0.6);
    border: 1px solid var(--border-bright);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    padding: 13px 16px;
    transition: all 0.2s;
    width: 100%;
}

.field input::placeholder { color: var(--text-mute); }

.field input:focus {
    outline: 0;
    border-color: var(--red-bright);
    background: rgba(10, 10, 10, 0.9);
    box-shadow: 0 0 0 3px rgba(229, 20, 31, 0.12);
}

.btn-primary {
    margin-top: 12px;
    padding: 15px 22px;
    background: var(--grad-soft);
    border: 0;
    border-radius: 10px;
    color: white;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow:
        0 8px 24px rgba(229, 20, 31, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.18), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 12px 32px rgba(229, 20, 31, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover::before { transform: translateX(100%); }

.btn-primary .arrow { transition: transform 0.2s; }
.btn-primary:hover .arrow { transform: translateX(3px); }

.footer-note {
    margin-top: 32px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-mute);
    letter-spacing: 0.02em;
}

/* =====================================================
   DASHBOARD
   ===================================================== */

.topbar {
    border-bottom: 1px solid var(--border);
    padding: 18px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(229, 20, 31, 0.4));
}

.topbar-title {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-right: 8px;
    border-right: 1px solid var(--border);
}

.user-name {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

.badge-admin {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.12em;
    padding: 4px 8px;
    background: var(--grad-soft);
    color: white;
    border-radius: 4px;
}

.nav-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    transition: color 0.2s;
    padding: 4px 0;
    position: relative;
}

.nav-link:not(.nav-soon):not(.nav-logout):hover { color: var(--text); }

.nav-soon {
    color: var(--text-mute);
    cursor: not-allowed;
}

.nav-logout {
    color: var(--text-mute);
}
.nav-logout:hover { color: var(--red-coral); }

/* Main content */

.dashboard {
    max-width: 1280px;
    margin: 0 auto;
    padding: 80px 40px 64px;
}

.dashboard-header {
    margin-bottom: 64px;
}

.dashboard-header .brand-badge {
    margin-bottom: 28px;
}

.display {
    font-family: var(--font-sans);
    font-size: clamp(44px, 6vw, 80px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 18px;
    color: var(--text);
}

.subtitle {
    font-size: 16px;
    color: var(--text-dim);
}

/* Cards de módulos */

.modulos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.modulo-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-bright);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modulo-card.modulo-ativo {
    cursor: pointer;
}

.modulo-card.modulo-ativo:hover {
    transform: translateY(-4px);
    border-color: var(--card-color);
    box-shadow:
        0 20px 50px -10px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--card-color),
        0 0 60px -20px var(--card-color);
}

.modulo-em-breve {
    opacity: 0.55;
}

/* Top do card — gradiente colorido */
.modulo-top {
    height: 140px;
    background:
        radial-gradient(ellipse at top right, rgba(255, 255, 255, 0.18), transparent 60%),
        linear-gradient(135deg, var(--card-color), color-mix(in srgb, var(--card-color) 60%, #000));
    position: relative;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    overflow: hidden;
}

.modulo-top::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 30% 80%, rgba(255,255,255,0.08), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0,0,0,0.15), transparent 50%);
    pointer-events: none;
}

.modulo-numero {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.05em;
    z-index: 1;
}

.modulo-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 5px 10px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-mute);
    display: inline-block;
}

.status-online .status-dot {
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* Body do card */

.modulo-body {
    padding: 24px 22px 22px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modulo-eyebrow {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text-mute);
    letter-spacing: 0.12em;
}

.modulo-nome {
    font-family: var(--font-sans);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
}

.modulo-descricao {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.55;
    flex-grow: 1;
}

.modulo-cta {
    margin-top: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-bright);
    font-size: 12px;
    font-weight: 600;
    color: var(--card-color);
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.arrow-up {
    transition: transform 0.25s;
    display: inline-block;
}

.modulo-card:hover .arrow-up { transform: translate(2px, -2px); }

/* Footer */

.page-footer {
    text-align: center;
    padding: 32px 40px;
    border-top: 1px solid var(--border);
    color: var(--text-mute);
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.02em;
}

.page-footer .dot { margin: 0 8px; opacity: 0.5; }

/* =====================================================
   RESPONSIVO
   ===================================================== */

@media (max-width: 768px) {
    .topbar {
        padding: 14px 20px;
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }
    .topbar-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 16px;
    }
    .user-info {
        width: 100%;
        border-right: 0;
        padding-right: 0;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border);
    }
    .dashboard { padding: 40px 20px 32px; }
    .dashboard-header { margin-bottom: 40px; }
    .display { font-size: 38px; }
    .modulos-grid { grid-template-columns: 1fr; }
    .login-card { padding: 40px 24px 28px; }
    .brand-name { font-size: 28px; }
    .brand-logo { width: 80px; }
}

/* =====================================================
   ADMIN PAGES — list, forms, tables, flash
   ===================================================== */

.topbar-brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
    text-decoration: none;
}

.nav-active {
    color: var(--text) !important;
    position: relative;
}

.nav-active::after {
    content: '';
    position: absolute;
    bottom: -22px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--grad-soft);
    border-radius: 1px;
}

.admin-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 40px 48px;
}

/* --- Page header --- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 36px;
    gap: 24px;
    flex-wrap: wrap;
}

.page-header .brand-badge { margin-bottom: 16px; }

.page-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 10px;
    color: var(--text);
}

.page-sub {
    font-size: 14px;
    color: var(--text-dim);
}

.page-sub strong { color: var(--text); font-weight: 700; }

.link-back {
    color: var(--text-dim);
    font-size: 13px;
    transition: color 0.2s;
}

.link-back:hover { color: var(--red-coral); }

/* --- Flash messages --- */
.flash-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
    animation: flashIn 0.3s ease-out;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.flash-ok {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
}
.flash-ok .flash-icon { background: var(--green); color: #000; }

.flash-erro {
    background: rgba(229, 20, 31, 0.08);
    border: 1px solid rgba(229, 20, 31, 0.3);
    color: var(--red-coral);
}
.flash-erro .flash-icon { background: var(--red-bright); color: white; }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--grad-soft);
    color: white;
    box-shadow:
        0 6px 20px rgba(229, 20, 31, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 10px 28px rgba(229, 20, 31, 0.32),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    border-color: var(--border-bright);
}
.btn-ghost:hover {
    color: var(--text);
    border-color: var(--text-mute);
    background: rgba(255, 255, 255, 0.02);
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 7px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-dim);
    border: 1px solid var(--border-bright);
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-mini:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--text-mute);
}

.btn-mini-danger:hover {
    color: var(--red-coral);
    border-color: var(--red);
    background: rgba(229, 20, 31, 0.08);
}

.btn-mini-disabled {
    background: transparent;
    color: var(--text-mute);
    border: 1px dashed var(--border-bright);
    cursor: not-allowed;
}

.inline-form { display: inline; }

/* --- Filter bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-input {
    flex: 1;
    min-width: 240px;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-bright);
    background: var(--bg-surface);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: all 0.2s;
}
.filter-input:focus {
    outline: 0;
    border-color: var(--red-bright);
    background: var(--bg-elevated);
}
.filter-input::placeholder { color: var(--text-mute); }

.filter-select { flex: 0 0 200px; }
.filter-select-sm { flex: 0 0 130px; }

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.filter-toggle input { accent-color: var(--red-bright); }

/* --- Tables --- */
.table-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border-bright);
    border-radius: 14px;
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-bright);
}

.data-table th {
    text-align: left;
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-mute);
}

.data-table td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    vertical-align: middle;
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table td strong { color: var(--text); font-weight: 600; }

.row-inativa { opacity: 0.45; }

.col-actions {
    text-align: right;
    white-space: nowrap;
}
.col-actions .btn-mini { margin-left: 6px; }
.col-actions .inline-form { margin-left: 6px; }

.col-time { width: 140px; white-space: nowrap; }

.mono { font-family: var(--font-mono); font-size: 12px; }
.small { font-size: 12px; }
.text-mute { color: var(--text-mute); }

.table-mono td { font-family: var(--font-mono); font-size: 12px; }
.table-mono td strong { font-family: var(--font-sans); font-size: 13px; }

/* --- Pills --- */
.pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.pill-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.pill-mute {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-mute);
    border: 1px solid var(--border-bright);
}
.pill-admin {
    background: var(--grad-soft);
    color: white;
}

.pill-acao {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: lowercase;
}
.pill-login {
    background: rgba(34, 197, 94, 0.10);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.pill-logout {
    background: rgba(245, 158, 11, 0.10);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.25);
}
.pill-empresa, .pill-usuario {
    background: rgba(168, 85, 247, 0.10);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.25);
}

/* --- Forms --- */
.form-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-bright);
    border-radius: 16px;
    padding: 32px 32px 28px;
    max-width: 920px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    margin-top: 28px;
    margin-bottom: 6px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.section-title:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.section-hint {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
}
.section-hint a { color: var(--red-coral); border-bottom: 1px solid currentColor; }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px 20px;
}

.field-full { grid-column: 1 / -1; }
.field-uf input { max-width: 80px; }

.form-card .field input,
.form-card .field textarea,
.form-card .field select {
    background: var(--bg-base);
    border: 1px solid var(--border-bright);
    border-radius: 9px;
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    padding: 11px 14px;
    transition: all 0.15s;
    width: 100%;
}

.form-card .field textarea { resize: vertical; font-family: var(--font-sans); }

.form-card .field input:focus,
.form-card .field textarea:focus {
    outline: 0;
    border-color: var(--red-bright);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(229, 20, 31, 0.10);
}

.form-card .field label {
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
}

.req { color: var(--red-coral); }

.hint-inline {
    color: var(--text-mute);
    font-weight: 400;
    font-size: 11px;
    text-transform: none;
}

.field-checkbox { padding: 8px 0; }

.checkbox-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
}
.checkbox-row input {
    margin-top: 3px;
    accent-color: var(--red-bright);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.checkbox-row strong {
    display: block;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 2px;
}
.checkbox-row .hint {
    display: block;
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 400;
}

/* --- Check grid (módulos / empresas) --- */
.check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.check-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-bright);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.check-card:hover { border-color: var(--text-mute); background: var(--bg-elevated); }

.check-card input[type="checkbox"] {
    margin-top: 2px;
    accent-color: var(--red-bright);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.check-card input:checked ~ .check-card-body .check-card-title {
    color: var(--red-coral);
}

.check-card:has(input:checked) {
    border-color: var(--red);
    background: rgba(229, 20, 31, 0.04);
}

.check-card-body { display: flex; flex-direction: column; gap: 2px; }

.check-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    transition: color 0.15s;
}

.check-card-meta {
    font-size: 11px;
    color: var(--text-mute);
}

/* --- Form actions --- */
.form-actions {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-bright);
    border-radius: 16px;
}
.empty-icon {
    font-size: 56px;
    color: var(--text-mute);
    line-height: 1;
    margin-bottom: 18px;
}
.empty-state h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text);
}
.empty-state p {
    color: var(--text-dim);
    margin-bottom: 20px;
}
.empty-state .btn { margin: 0 auto; }

/* --- JSON mini display --- */
.json-mini {
    font-family: var(--font-mono);
    font-size: 11px;
    background: var(--bg-base);
    color: var(--text-dim);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-block;
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* --- Responsivo admin --- */
@media (max-width: 768px) {
    .admin-page { padding: 32px 16px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .form-card { padding: 24px 20px; }
    .form-grid { grid-template-columns: 1fr; }
    .filter-input { min-width: 100%; }
    .filter-select, .filter-select-sm { flex: 1; min-width: 0; }
    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 12px; }
    .nav-active::after { display: none; }
}
