/* NTTH WORK — Tema futurista */
:root {
    --bg: #05070d;
    --bg2: #0a0f1a;
    --surface: rgba(12, 18, 32, 0.72);
    --surface2: rgba(18, 26, 46, 0.85);
    --glass: rgba(14, 22, 40, 0.55);
    --border: rgba(0, 240, 255, 0.12);
    --border-hover: rgba(0, 240, 255, 0.28);
    --text: #e8f0ff;
    --muted: #7b8ca8;
    --cyan: #00f0ff;
    --cyan-dim: #00b8d4;
    --purple: #a855f7;
    --magenta: #ec4899;
    --accent: #00f0ff;
    --accent2: #34d399;
    --warn: #fbbf24;
    --danger: #f87171;
    --radius: 12px;
    --radius-lg: 16px;
    --sidebar-w: 260px;
    --font: "Inter", system-ui, sans-serif;
    --font-display: "Orbitron", "Inter", sans-serif;
    --mono: "Cascadia Code", Consolas, monospace;
    --glow-cyan: 0 0 24px rgba(0, 240, 255, 0.25);
    --glow-purple: 0 0 40px rgba(168, 85, 247, 0.2);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    overflow-x: hidden;
}

/* Fondo animado */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black 20%, transparent 75%);
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.45;
}

.bg-glow-1 {
    width: 500px; height: 500px;
    top: -120px; right: -80px;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.18), transparent 70%);
}

.bg-glow-2 {
    width: 400px; height: 400px;
    bottom: -100px; left: -60px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.15), transparent 70%);
}

/* Shell */
.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--surface2);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.brand-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-tag {
    display: block;
    font-size: 0.68rem;
    color: var(--muted);
    font-weight: 400;
    letter-spacing: 0;
    -webkit-text-fill-color: var(--muted);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.nav-group { margin-bottom: 1rem; }

.nav-group-label {
    display: block;
    padding: 0.35rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    opacity: 0.8;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    margin: 0.15rem 0;
    border-radius: 8px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.88rem;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.nav-item:hover {
    color: var(--text);
    background: rgba(0, 240, 255, 0.06);
    border-color: var(--border);
}

.nav-item.active {
    color: var(--cyan);
    background: rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.25);
    box-shadow: inset 3px 0 0 var(--cyan);
}

.nav-item.soon { opacity: 0.75; }

.nav-icon {
    width: 20px; height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg { width: 18px; height: 18px; }

.nav-label { flex: 1; }

.nav-soon {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.2);
    color: var(--purple);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

/* Main */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    background: rgba(8, 12, 22, 0.6);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

.topbar-title { flex: 1; }

.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0.75rem 0.35rem 0.35rem;
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #000;
}

.user-meta {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.user-name {
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
}

.user-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.user-link:hover {
    color: var(--cyan);
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--border);
}

.user-link.logout:hover { color: var(--danger); }

.container {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
}

.container.narrow { max-width: 640px; }

/* Glass */
.glass {
    background: var(--glass) !important;
    backdrop-filter: blur(12px);
    border-color: var(--border) !important;
}

/* Hero */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1.75rem 2rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.06), rgba(168, 85, 247, 0.06));
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--purple), transparent);
}

.hero-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cyan);
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.gradient-text {
    background: linear-gradient(135deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    color: var(--muted);
    max-width: 480px;
    font-size: 0.95rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Módulos */
.section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted);
    margin-bottom: 1rem;
}

.section-block { margin-bottom: 2rem; }

.modules-grid { margin-bottom: 2rem; }

.module-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.module-card {
    position: relative;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--border);
    text-decoration: none;
    color: var(--text);
    transition: all 0.25s;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.module-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--glow-cyan);
}

.module-card.active {
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.05);
}

.module-card.soon { opacity: 0.85; }

.module-icon {
    width: 36px; height: 36px;
    color: var(--cyan);
    margin-bottom: 0.25rem;
}

.module-icon svg { width: 28px; height: 28px; }

.module-status {
    position: absolute;
    top: 0.75rem; right: 0.75rem;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(168, 85, 247, 0.2);
    color: var(--purple);
}

.module-status.live {
    background: rgba(52, 211, 153, 0.15);
    color: var(--accent2);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius);
    background: var(--glass);
    border: 1px solid var(--border);
    transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--border-hover); }
.stat-card.accent { border-color: rgba(0, 240, 255, 0.3); }
.stat-card.warn { border-color: rgba(251, 191, 36, 0.3); }

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--cyan);
    font-variant-numeric: tabular-nums;
}

.stat-value.small { font-size: 1rem; }

.totals-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    color: var(--muted);
    border: 1px solid var(--border);
}

.totals-bar strong { color: var(--text); }

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Panels */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.panel-head h2 { font-size: 0.95rem; font-weight: 600; }

.link {
    color: var(--cyan);
    text-decoration: none;
    font-size: 0.82rem;
    transition: opacity 0.2s;
}

.link:hover { opacity: 0.8; }

/* Tables */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }

th, td {
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

th {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(0, 0, 0, 0.15);
}

tr:hover td { background: rgba(0, 240, 255, 0.02); }

.mono { font-family: var(--mono); }
.code-cell { color: var(--accent2); font-weight: 600; letter-spacing: 0.08em; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }
.truncate { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-ok { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }
.badge-warn { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.badge-danger { background: rgba(248, 113, 113, 0.15); color: #fca5a5; }
.badge-muted { background: rgba(123, 140, 168, 0.15); color: var(--muted); }
.badge-soon {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(168, 85, 247, 0.15));
    color: var(--cyan);
    padding: 0.35rem 0.85rem;
    font-size: 0.75rem;
}

/* Filters & buttons */
.filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.filters input, .filters select, .filters button,
.form-stack input, .form-stack select,
.form-inline input, .form-inline select {
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(5, 8, 15, 0.6);
    color: var(--text);
    font-size: 0.88rem;
    font-family: var(--font);
    transition: border-color 0.2s;
}

.filters input:focus, .form-stack input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--cyan-dim), var(--purple));
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.6rem 1.15rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.25s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--glow-cyan);
}

.btn-glow { font-family: var(--font-display); letter-spacing: 0.04em; }
.btn-block { width: 100%; }

.filters button { background: linear-gradient(135deg, var(--cyan-dim), #6366f1); border: none; color: #fff; }

.pagination { display: flex; gap: 0.35rem; margin-top: 1rem; flex-wrap: wrap; }

.pagination a {
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--muted);
    text-decoration: none;
    font-size: 0.84rem;
}

.pagination a.active, .pagination a:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--cyan);
    color: var(--cyan);
}

.info-box {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.35rem;
    margin-top: 1rem;
}

.info-box h3 { margin-bottom: 0.5rem; font-size: 1rem; }
.info-box p { color: var(--muted); margin-bottom: 0.5rem; }
.info-box ul { margin-left: 1.25rem; color: var(--muted); }
.info-box pre {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.85rem 1rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 0.8rem;
    border: 1px solid var(--border);
}

code {
    font-family: var(--mono);
    background: rgba(0, 240, 255, 0.08);
    padding: 0.12rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--cyan);
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid transparent;
}

.alert-ok { background: rgba(52, 211, 153, 0.1); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.25); }
.alert-danger { background: rgba(248, 113, 113, 0.1); color: #fca5a5; border-color: rgba(248, 113, 113, 0.25); }

.footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    color: var(--muted);
    font-size: 0.78rem;
    border-top: 1px solid var(--border);
    background: rgba(5, 8, 15, 0.5);
}

/* Coming soon */
.coming-soon {
    text-align: center;
    padding: 4rem 2rem;
    position: relative;
}

.coming-soon-glow {
    position: absolute;
    width: 300px; height: 300px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(0, 240, 255, 0.12), transparent 70%);
    pointer-events: none;
}

.coming-soon-icon { margin-bottom: 1.5rem; filter: drop-shadow(var(--glow-cyan)); }
.coming-soon-title { font-size: 1.5rem; margin-bottom: 0.5rem; }
.coming-soon-desc { color: var(--muted); max-width: 420px; margin: 0 auto 1rem; }

/* Login — centrado, logo transparente, fondo rico */
.login-body {
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.login-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #030508;
}

.login-bg-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 90% 60% at 50% -10%, rgba(0, 240, 255, 0.14) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 100% 50%, rgba(168, 85, 247, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 60% 45% at 0% 80%, rgba(0, 184, 212, 0.1) 0%, transparent 45%),
        linear-gradient(180deg, #050a12 0%, #030508 40%, #08051a 100%);
}

.login-bg-mesh {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(0, 240, 255, 0.04) 0%, transparent 8%),
        radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.04) 0%, transparent 8%);
    background-size: 120px 120px;
    opacity: 0.8;
}

.login-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 65% at 50% 45%, black 15%, transparent 72%);
}

.login-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    animation: orb-float 12s ease-in-out infinite;
}

.login-bg-orb-1 {
    width: 420px; height: 420px;
    top: -10%; left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 240, 255, 0.18);
}

.login-bg-orb-2 {
    width: 320px; height: 320px;
    bottom: 5%; right: -5%;
    background: rgba(168, 85, 247, 0.15);
    animation-delay: -4s;
}

.login-bg-orb-3 {
    width: 280px; height: 280px;
    bottom: 20%; left: -8%;
    background: rgba(34, 211, 238, 0.1);
    animation-delay: -8s;
}

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.7; }
    33% { transform: translate(20px, -15px) scale(1.05); opacity: 0.9; }
    66% { transform: translate(-15px, 10px) scale(0.95); opacity: 0.6; }
}

.login-bg-noise {
    position: absolute;
    inset: 0;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

.login-center {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.25rem 2rem 2rem;
    border-radius: 20px;
    background: rgba(10, 16, 30, 0.55);
    border: 1px solid rgba(0, 240, 255, 0.15);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 24px 64px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 240, 255, 0.06);
}

.login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

/* Logo SVG — fondo transparente nativo */
.login-logo-full {
    display: block;
    width: 100%;
    max-width: 240px;
    height: auto;
    margin: 0 auto;
    filter: drop-shadow(0 0 24px rgba(0, 240, 255, 0.3));
}

.login-logo {
    display: block;
    margin: 0 auto 1rem;
    filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.45));
}

.hero-logo {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 0 32px rgba(0, 240, 255, 0.35));
    animation: float 4s ease-in-out infinite;
}

.logo-img {
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.35));
    flex-shrink: 0;
}

.login-form label {
    display: block;
    margin-bottom: 1.1rem;
}

.login-form label span {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 240, 255, 0.12);
    background: rgba(3, 6, 14, 0.7);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.08);
}

.login-form input::placeholder { color: rgba(123, 140, 168, 0.6); }

.login-hint {
    margin-top: 1.25rem;
    text-align: center;
}

.login-body .btn-primary {
    margin-top: 0.25rem;
    padding: 0.75rem;
    font-size: 0.92rem;
}

/* Login legacy — ocultar si queda algo */
.login-split,
.login-showcase,
.login-panel { display: none; }


/* Forms */
.form-stack { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.form-stack label span, .form-inline label { font-size: 0.85rem; color: var(--muted); }

.form-inline {
    display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
    padding: 0.85rem; background: rgba(0, 0, 0, 0.2); border-radius: 8px;
}

.form-inline input, .form-inline select { width: auto; min-width: 140px; flex: 1; }
.checkbox { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.checkbox input { width: auto; }

.btn-small {
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--glass);
    color: var(--text);
    cursor: pointer;
    font-size: 0.82rem;
}

.btn-small.btn-primary { background: linear-gradient(135deg, var(--cyan-dim), var(--purple)); border: none; color: #fff; }

.edit-row { display: none; }
.edit-row.open { display: table-row; }
.edit-row td { background: rgba(0, 0, 0, 0.2); }

.roles-list { padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.role-item {
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.role-item h3 { font-size: 0.95rem; margin-bottom: 0.25rem; }

.profile-dl {
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.9rem;
}
.profile-dl dt { color: var(--muted); }
.profile-dl dd { margin: 0; }

/* Matriz de permisos ACL */
.perm-hint { margin-bottom: 1rem; }
.perm-section-title {
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
    color: var(--cyan);
}
.perm-matrix-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.perm-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.perm-matrix th,
.perm-matrix td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
}
.perm-matrix th:not(:first-child),
.perm-matrix td.perm-check {
    text-align: center;
    width: 90px;
}
.perm-matrix tbody tr:last-child td { border-bottom: none; }
.perm-matrix input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--cyan);
    cursor: pointer;
}
.perm-summary {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
    font-size: 0.8rem;
    color: var(--muted);
}
.perm-legend { padding: 0 1rem 1rem; }
.edit-user-form { padding: 1rem; }

/* Distribución TXT */
.dist-assignments { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.dist-card { padding: 1rem; border-radius: 10px; border: 1px solid var(--border); }
.dist-card-head {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.dist-card-head h3 { font-size: 1rem; margin: 0; }
.dist-card-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 0.25rem; }
.dist-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.dist-content-box {
    display: none; margin-top: 0.75rem;
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.dist-content-box.open { display: block; }
.dist-pre {
    margin: 0; padding: 0.75rem; max-height: 280px; overflow: auto;
    font-size: 0.78rem; line-height: 1.45; background: rgba(0,0,0,0.35);
    white-space: pre-wrap; word-break: break-all;
}
.dist-batch-detail { padding: 1rem; }
.dist-batch-detail h4 { margin: 0 0 0.75rem; font-size: 0.95rem; }
.dist-format-box {
    padding: 0.75rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}
.dist-format-code {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: rgba(0, 212, 255, 0.12);
    color: var(--cyan);
    font-size: 0.82rem;
}
.dist-format-example {
    margin: 0.5rem 0 0;
    padding: 0.5rem 0.65rem;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    color: var(--text);
}
.badge-cyan { background: rgba(0, 212, 255, 0.15); color: var(--cyan); border: 1px solid rgba(0, 212, 255, 0.35); }
.btn-danger { color: #ff8a8a; border-color: rgba(255, 80, 80, 0.4); }
.btn-danger:hover { background: rgba(255, 80, 80, 0.15); }
.inline-form { display: inline; }

.sec-stats { margin-bottom: 1.25rem; }

/* Responsive */
@media (max-width: 1024px) {
    .hero { flex-direction: column; text-align: center; }
    .hero-desc { margin: 0 auto; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .user-chip .user-meta { display: none; }
    .stat-value { font-size: 1.35rem; }
}

@media (max-width: 480px) {
    .container { padding: 1rem; }
    .module-cards { grid-template-columns: 1fr; }
}
