@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #020617;
    --surface: rgba(8, 13, 33, 0.82);
    --surface-ghost: rgba(12, 22, 48, 0.55);
    --surface-accent: rgba(49, 46, 129, 0.65);
    --stroke: rgba(255, 255, 255, 0.08);
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: linear-gradient(120deg, #6366f1, #8b5cf6 40%, #ec4899 100%);
    --accent-soft: linear-gradient(120deg, rgba(99, 102, 241, 0.15), rgba(14, 165, 233, 0.15));
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at 20% 20%, #0e1331 0%, var(--bg) 55%);
    color: var(--text);
    position: relative;
}

.bg-gradient {
    position: fixed;
    inset: -10%;
    background: radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.5), transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.4), transparent 55%),
        radial-gradient(circle at 60% 80%, rgba(14, 165, 233, 0.35), transparent 60%);
    filter: blur(80px);
    opacity: 0.85;
    pointer-events: none;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(226, 232, 240, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.04) 1px, transparent 1px);
    background-size: 120px 120px;
    mix-blend-mode: screen;
    opacity: 0.4;
    pointer-events: none;
}

.bg-orb {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.65;
    pointer-events: none;
}

.orb-one {
    background: radial-gradient(circle, rgba(99, 102, 241, 0.5), transparent 70%);
    top: -120px;
    right: 5%;
}

.orb-two {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.4), transparent 70%);
    bottom: -160px;
    left: -5%;
}

.auth-viewport {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 3rem 1.5rem 4rem;
}

.dashboard-page {
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.auth-hero {
    text-align: center;
    max-width: 640px;
    padding: 1.5rem 1rem;
    color: rgba(226, 232, 240, 0.85);
}

.auth-hero h1 {
    font-size: clamp(2.3rem, 6vw, 3.2rem);
}

.auth-hero p {
    margin: 0 auto 1rem;
    max-width: 460px;
    color: rgba(226, 232, 240, 0.7);
}

.auth-hero ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    color: rgba(226, 232, 240, 0.55);
    font-size: 0.9rem;
}

.auth-hero__badge {
    display: inline-flex;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(12, 18, 41, 0.5);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #c084fc;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    font-weight: 600;
    font-size: 0.85rem;
}

.pill.is-idle {
    border-color: rgba(249, 115, 22, 0.35);
    background: rgba(249, 115, 22, 0.12);
    color: #fb923c;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(226, 232, 240, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(226, 232, 240, 0.04) 1px, transparent 1px);
    background-size: 120px 120px;
    mix-blend-mode: screen;
    opacity: 0.4;
    pointer-events: none;
}

.bg-orb {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.65;
    pointer-events: none;
}

.dashboard-header {
    width: min(1180px, 100%);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    padding: 1rem 0;
}

.dashboard-header__title h1 {
    font-size: clamp(2.5rem, 6vw, 3.2rem);
}

.dashboard-header h1 {
    margin: 0.2rem 0;
}

.dashboard-header p {
    margin: 0;
    color: rgba(226, 232, 240, 0.7);
}

.dashboard-actions,
.dashboard-buttons,
.pill-stack,
.pill--ghost,
.pill--ghost i,
.btn-soft {
    display: none;
}

.module-card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 1.5rem;
    padding: 1.75rem;
    box-shadow: 0 20px 40px rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(18px);
}

.module-card--accent {
    background: var(--surface-accent);
    border-color: rgba(99, 102, 241, 0.4);
}

.module-card__head {
    margin-bottom: 1.25rem;
}

.module-card__head h2 {
    margin: 0.2rem 0;
}

.module-card__head p {
    margin: 0;
    color: rgba(226, 232, 240, 0.72);
}

.module-card--neo {
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.15);
    background: radial-gradient(circle at top, rgba(99, 102, 241, 0.25), transparent 55%),
        rgba(8, 13, 33, 0.9);
    overflow: hidden;
}

.module-card--neo::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, rgba(99, 102, 241, 0.35), rgba(236, 72, 153, 0.3));
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

.module-card--neo > * {
    position: relative;
}

.module-card__hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.hero-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1.1rem;
    background: linear-gradient(150deg, rgba(99, 102, 241, 0.4), rgba(14, 165, 233, 0.3));
    display: grid;
    place-items: center;
    color: #f5f5ff;
    font-size: 1.6rem;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.2);
}

.module-card__hero h2 {
    margin: 0.1rem 0;
}

.module-card__hero p {
    margin: 0;
    color: rgba(226, 232, 240, 0.7);
}

.module-divider {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.3), transparent);
    margin: 1.4rem 0;
}

.pill--glass {
    margin-left: 0;
    border-color: rgba(148, 163, 184, 0.25);
    background: rgba(15, 23, 42, 0.45);
    color: rgba(226, 232, 240, 0.9);
}

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.form-actions .btn-primary {
    flex: 1 1 220px;
}

.form-actions .btn-outline {
    flex: 0 0 auto;
    border-radius: 999px;
}

.form-grid--dual {
    grid-template-columns: 1fr;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

label span {
    font-size: 0.85rem;
    color: var(--muted);
}

.input-shell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.95rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.35);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.input-shell i {
    color: #a5b4fc;
    font-size: 1.1rem;
}

.input-shell input {
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 1rem;
    flex: 1;
}

.input-shell:focus-within {
    border-color: rgba(99, 102, 241, 0.8);
    background: rgba(37, 99, 235, 0.18);
}

.input-shell input:focus {
    outline: none;
}

input,
select {
    padding: 0.85rem 1rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    font-size: 1rem;
}

.select-shell {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.9rem;
    padding: 0.15rem 0.5rem 0.15rem 0.25rem;
    background: rgba(15, 23, 42, 0.35);
}

.select-shell select {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.7rem 0.6rem;
    color: var(--text);
    -webkit-appearance: none;
    appearance: none;
}

.select-shell select:focus {
    outline: none;
}

.select-shell select option {
    background: #0f172a;
    color: #e2e8f0;
}

.report-request-admin-controls {
    display: flex;
    justify-content: flex-end;
}

.report-request-list,
.admin-request-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.report-request-list__item,
.admin-request-card {
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 1rem;
    padding: 1rem 1.2rem;
    background: rgba(15, 23, 42, 0.55);
}

.report-request-list__header,
.admin-request-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}

.report-request-list__title,
.admin-request-card__title {
    font-weight: 600;
    font-size: 1rem;
}

.report-request-list__meta,
.admin-request-card__meta,
.admin-request-card__timestamps {
    font-size: 0.85rem;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.report-request-list__description,
.admin-request-card__description,
.admin-request-card__error {
    margin: 0.2rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(226, 232, 240, 0.85);
}

.admin-request-card__error {
    color: #fda4af;
}

.admin-request-card__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.6rem;
}

.report-request-list__error {
    color: #fda4af;
    font-size: 0.85rem;
}

.select-shell i {
    color: rgba(226, 232, 240, 0.5);
    font-size: 1rem;
    pointer-events: none;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.2rem;
    border-radius: 0.95rem;
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.35);
}

.btn-icon:hover {
    transform: translateY(-1px);
}

.btn-icon i {
    font-size: 1.25rem;
}

.btn-primary {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.95rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(120deg, #6366f1, #a855f7, #ec4899);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 20px 35px rgba(99, 102, 241, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 40px rgba(99, 102, 241, 0.45);
}

.btn-outline {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: transparent;
    color: var(--text);
    padding: 0.85rem 1.2rem;
    border-radius: 0.95rem;
    cursor: pointer;
    font-weight: 600;
    transition: border-color 0.2s ease, transform 0.1s ease;
}

.btn-outline:hover {
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.btn-full {
    width: 100%;
}

.btn-ghost {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c4b5fd;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-ghost:hover {
    background: rgba(99, 102, 241, 0.2);
}

.form-link {
    text-align: center;
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
}

.form-link a {
    color: rgba(226, 232, 240, 0.85);
    text-decoration: none;
    transition: color 0.2s ease;
}

.form-link a:hover {
    color: #c084fc;
}

.form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.78rem;
    color: rgba(148, 163, 184, 0.85);
}

.company-tree {
    margin-top: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

.company-tree__list {
    list-style: none;
    margin: 0;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.company-tree__node {
    padding: 0.4rem 0.2rem 0.4rem 0.4rem;
    border-left: 1px solid rgba(148, 163, 184, 0.25);
}

.company-tree__children {
    margin-top: 0.35rem;
    margin-left: 1.1rem;
}

.company-tree__label {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.88rem;
}

.company-tree__title {
    font-weight: 600;
    color: #e2e8f0;
}

.company-tree__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: rgba(226, 232, 240, 0.7);
}

.company-tree__actions {
    margin-top: 0.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.company-tree__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(12, 18, 41, 0.4);
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.company-tree__btn i {
    font-size: 0.85rem;
}

.company-tree__btn:hover {
    border-color: rgba(94, 234, 212, 0.5);
    background: rgba(45, 212, 191, 0.12);
}

.company-tree__btn--danger {
    border-color: rgba(248, 113, 113, 0.6);
    color: #fca5a5;
}

.company-tree__btn--danger:hover {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(239, 68, 68, 0.8);
}

.permission-log {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

.permission-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.permission-list__item {
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(12, 18, 41, 0.55);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.permission-list__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.permission-badge {
    padding: 0.1rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80;
    background: rgba(34, 197, 94, 0.15);
}

.permission-list__meta {
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.75);
}

.permission-list__actions {
    display: flex;
    justify-content: flex-end;
}

.permission-revoke-btn {
    border: 1px solid rgba(248, 113, 113, 0.5);
    background: transparent;
    color: #fca5a5;
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.permission-revoke-btn:hover {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.8);
}

.data-shell {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
    max-height: 320px;
    overflow-y: auto;
}

.data-shell--tall {
    max-height: 420px;
}

.user-directory,
.report-directory {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.user-directory__item,
.report-directory__item {
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 1rem;
    padding: 0.9rem 1rem;
    background: rgba(12, 18, 41, 0.55);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.user-directory__header,
.report-directory__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.user-directory__username,
.report-directory__title {
    font-size: 1rem;
    font-weight: 600;
}

.role-badge,
.report-id-badge {
    padding: 0.15rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.role-badge {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.4);
}

.role-badge--admin {
    border-color: rgba(147, 197, 253, 0.6);
    color: #bae6fd;
}

.role-badge--empresa {
    border-color: rgba(52, 211, 153, 0.6);
    color: #a7f3d0;
}

.role-badge--cliente {
    border-color: rgba(251, 191, 36, 0.55);
    color: #fde68a;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.status-chip--active,
.status-chip--success {
    border-color: rgba(74, 222, 128, 0.45);
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
}

.status-chip--inactive,
.status-chip--danger {
    border-color: rgba(248, 113, 113, 0.6);
    color: #fecaca;
    background: rgba(248, 113, 113, 0.12);
}

.status-chip--pending {
    border-color: rgba(251, 191, 36, 0.6);
    color: #fcd34d;
    background: rgba(251, 191, 36, 0.15);
}

.user-directory__meta,
.report-directory__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: rgba(226, 232, 240, 0.75);
}

.user-directory__company,
.report-directory__company {
    flex: 1 1 100%;
}

.user-directory__timestamp {
    color: rgba(148, 163, 184, 0.9);
}

.report-id-badge {
    border: 1px solid rgba(94, 234, 212, 0.4);
    color: #99f6e4;
    background: rgba(45, 212, 191, 0.12);
}

.report-directory__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.9rem;
}

.report-amount {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fef3c7;
}

.report-company-controls {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.report-company-controls__field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.report-company-controls__refresh {
    align-self: flex-start;
}

@media (min-width: 640px) {
    .report-company-controls {
        flex-direction: row;
        align-items: flex-end;
    }

    .report-company-controls__field {
        flex: 1;
    }

    .report-company-controls__refresh {
        flex: 0 0 auto;
    }
}

.company-tree__status {
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
}

.is-hidden {
    display: none;
}

.module-footer {
    margin-top: 1.2rem;
    display: flex;
    justify-content: flex-end;
}

.module-grid--dashboard {
    width: min(1180px, 100%);
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    margin: 0 auto;
}

@media (max-width: 720px) {
    .auth-viewport {
        padding-top: 2.5rem;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-actions,
    .dashboard-buttons {
        display: none;
    }

    .module-card__hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .pill--glass {
        margin-left: 0;
    }

    .module-footer {
        flex-direction: column;
        align-items: flex-start;
    }
}
