@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #020617;
    --bg-accent: #0f172a;
    --surface: rgba(15, 23, 42, 0.88);
    --surface-strong: rgba(15, 23, 42, 0.96);
    --surface-soft: rgba(30, 41, 59, 0.82);
    --surface-muted: rgba(51, 65, 85, 0.5);
    --line: rgba(148, 163, 184, 0.18);
    --line-strong: rgba(96, 165, 250, 0.28);
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --heading: #f8fafc;
    --accent: #38bdf8;
    --accent-strong: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #38bdf8;
    --shadow-lg: 0 28px 80px rgba(2, 6, 23, 0.55);
    --shadow-md: 0 18px 45px rgba(2, 6, 23, 0.32);
    --radius-xl: 26px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

* {
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.2), transparent 28%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.15), transparent 24%),
        linear-gradient(160deg, #020617 0%, #07101f 35%, #0f172a 100%);
    color: var(--text);
    font-family: 'Fira Sans', sans-serif;
    letter-spacing: 0.01em;
}

a {
    color: #7dd3fc;
}

a:hover {
    color: #bae6fd;
}

.app-body {
    margin: 0;
}

.app-shell {
    min-height: 100vh;
    padding: 24px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.78));
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    color: var(--heading);
    text-decoration: none;
}

.brand-link:hover {
    color: #fff;
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    padding: 0.35rem;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.26), rgba(14, 165, 233, 0.08));
    border: 1px solid rgba(125, 211, 252, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.brand-kicker,
.sidebar-kicker,
.section-kicker,
.page-eyebrow {
    margin: 0;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #7dd3fc;
}

.brand-title {
    margin: 0.2rem 0 0;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--heading);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    color: var(--heading);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.user-pill .bi {
    color: #7dd3fc;
}

.user-pill small {
    display: block;
    color: var(--text-muted);
}

.role-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.role-chip.role-admin {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
}

.role-chip.role-tech {
    background: rgba(56, 189, 248, 0.14);
    color: #7dd3fc;
}

.mobile-shortcuts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.mobile-shortcuts .shortcut-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    text-decoration: none;
}

.mobile-shortcuts .shortcut-link.active {
    border-color: rgba(56, 189, 248, 0.45);
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.3), rgba(14, 165, 233, 0.16));
}

.app-layout {
    display: grid;
    grid-template-columns: 288px minmax(0, 1fr);
    gap: 1rem;
}

.page-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.72));
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.page-sidebar .nav-link,
.page-sidebar .sidebar-link-ext {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    padding: 0.82rem 0.95rem;
    border-radius: 16px;
    color: var(--text-muted);
    font-weight: 500;
    transition: 180ms ease;
}

.page-sidebar .nav-link:hover,
.page-sidebar .sidebar-link-ext:hover,
.page-sidebar .nav-link.active {
    transform: translateX(3px);
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.28), rgba(14, 165, 233, 0.14));
    border-color: rgba(56, 189, 248, 0.18);
    text-decoration: none;
}

.page-sidebar .sidebar-link-ext {
    padding-block: 0.62rem;
    font-size: 0.92rem;
}

.page-sidebar .bi {
    color: #7dd3fc;
}

.page-main {
    min-width: 0;
}

.page-container {
    min-height: calc(100vh - 140px);
    padding: 1.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.66));
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
}

.page-title {
    color: var(--heading);
    font-weight: 700;
}

.page-subtitle,
.text-muted,
.form-text,
.breadcrumb-item,
.small,
.meta-row,
.auditoria-badge {
    color: var(--text-muted) !important;
}

.card,
.view-card,
.form-card,
.card-custom,
.table-card,
.filter-card,
.login-card,
.setup-card,
.metric-card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-lg) !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.74)) !important;
    box-shadow: var(--shadow-md) !important;
    overflow: hidden;
}

.card-header,
.view-card .card-header {
    border-bottom: 1px solid var(--line) !important;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.88), rgba(15, 23, 42, 0.9)) !important;
    color: var(--heading) !important;
}

.card-body,
.view-card .card-body,
.login-body {
    background: transparent !important;
    color: var(--text);
}

.card-header.bg-primary,
.btn-primary,
.badge.bg-primary,
.bg-primary {
    background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
    border-color: rgba(125, 211, 252, 0.22) !important;
    color: #eff6ff !important;
}

.btn {
    border-radius: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-sm {
    border-radius: 12px;
}

.btn-primary,
.btn-success,
.btn-warning,
.btn-danger,
.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-info,
.btn-outline-light {
    box-shadow: none;
}

.btn-primary:hover,
.btn-success:hover,
.btn-warning:hover,
.btn-danger:hover {
    filter: brightness(1.05);
}

.btn-outline-primary,
.btn-outline-secondary,
.btn-outline-danger,
.btn-outline-info,
.btn-outline-light {
    border-color: rgba(148, 163, 184, 0.24);
    color: var(--text);
    background: rgba(15, 23, 42, 0.58);
}

.btn-outline-primary:hover,
.btn-outline-info:hover,
.btn-outline-light:hover {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(125, 211, 252, 0.32);
    color: #fff;
}

.btn-outline-secondary:hover {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.3);
    color: #fff;
}

.btn-outline-danger:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.34);
    color: #fff;
}

.btn-warning,
.badge.bg-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316) !important;
    border-color: rgba(253, 186, 116, 0.25) !important;
    color: #fff !important;
}

.btn-success,
.badge.bg-success {
    background: linear-gradient(135deg, #16a34a, #22c55e) !important;
    border-color: rgba(134, 239, 172, 0.2) !important;
    color: #f0fdf4 !important;
}

.badge.bg-danger,
.btn-danger {
    background: linear-gradient(135deg, #dc2626, #ef4444) !important;
    border-color: rgba(252, 165, 165, 0.16) !important;
    color: #fff !important;
}

.badge.bg-secondary,
.btn-secondary,
.bg-secondary {
    background: rgba(71, 85, 105, 0.72) !important;
    color: #e2e8f0 !important;
}

.badge.bg-info,
.bg-info {
    background: rgba(56, 189, 248, 0.18) !important;
    color: #7dd3fc !important;
}

.badge {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 999px;
    padding: 0.5em 0.82em;
}

.alert {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.88);
    color: var(--text);
}

.alert-danger {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(127, 29, 29, 0.28);
    color: #fecaca;
}

.alert-warning,
.bloqueado-alert,
.alerta-bloqueado {
    border-color: rgba(251, 191, 36, 0.3) !important;
    background: rgba(120, 53, 15, 0.28) !important;
    color: #fde68a !important;
}

.alert-success {
    border-color: rgba(74, 222, 128, 0.28);
    background: rgba(20, 83, 45, 0.36);
    color: #bbf7d0;
}

.alert-info {
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(7, 89, 133, 0.28);
    color: #bae6fd;
}

.form-control,
.form-select,
.input-group-text,
textarea.form-control {
    border-color: rgba(148, 163, 184, 0.18) !important;
    background: rgba(15, 23, 42, 0.74) !important;
    color: var(--text) !important;
    border-radius: 14px !important;
}

.input-group > .form-control,
.input-group > .form-select,
.input-group > .input-group-text {
    min-height: 48px;
}

.input-group-text {
    color: #7dd3fc !important;
}

.form-control::placeholder,
textarea.form-control::placeholder {
    color: rgba(148, 163, 184, 0.8);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(56, 189, 248, 0.55) !important;
    box-shadow: 0 0 0 0.22rem rgba(14, 165, 233, 0.16) !important;
}

.form-check-input {
    background-color: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.28);
}

.form-check-input:checked {
    background-color: #0ea5e9;
    border-color: #38bdf8;
}

.form-label,
.fw-semibold,
label {
    color: var(--heading);
}

.breadcrumb {
    margin-bottom: 0;
}

.breadcrumb-item.active,
.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

.breadcrumb a {
    color: #7dd3fc;
    text-decoration: none;
}

.table {
    color: var(--text);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-hover-color: var(--heading);
    --bs-table-hover-bg: rgba(30, 41, 59, 0.52);
    --bs-table-border-color: rgba(148, 163, 184, 0.14);
}

.table > :not(caption) > * > * {
    padding: 0.9rem 1rem;
    border-bottom-color: rgba(148, 163, 184, 0.12);
    background: transparent;
}

.table thead th,
.table-dark th,
.table-light th {
    font-family: 'Fira Code', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #cbd5e1 !important;
    background: rgba(15, 23, 42, 0.8) !important;
}

.table-responsive {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.table-active,
.row-own {
    background: rgba(37, 99, 235, 0.14) !important;
}

.table code,
code {
    color: #7dd3fc;
    background: rgba(15, 23, 42, 0.72);
    padding: 0.12rem 0.4rem;
    border-radius: 8px;
}

.filter-card .card-body,
.card-body.border-bottom,
.meta-row {
    border-color: rgba(148, 163, 184, 0.12) !important;
}

.info-block,
.tempo-block,
.cliente-info-box,
.descricao-box,
.texto-field,
.arquivo-item,
.complemento-item,
.complemento-form,
.upload-area {
    border: 1px solid rgba(148, 163, 184, 0.14) !important;
    background: rgba(15, 23, 42, 0.62) !important;
    color: var(--text) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.info-block .label,
.section-title,
.section-divider {
    color: #7dd3fc !important;
    font-family: 'Fira Code', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem !important;
}

.info-block .value,
.descricao-box,
.texto-field,
.comp-texto {
    color: var(--heading) !important;
}

.descricao-box,
.texto-field {
    border-left-width: 3px !important;
}

.cliente-dropdown {
    border: 1px solid rgba(148, 163, 184, 0.16) !important;
    background: rgba(15, 23, 42, 0.96) !important;
    box-shadow: var(--shadow-md) !important;
}

.cliente-option {
    border-bottom-color: rgba(148, 163, 184, 0.1) !important;
}

.cliente-option:hover {
    background: rgba(37, 99, 235, 0.16) !important;
}

.cliente-option .razao,
.cliente-selected-badge {
    color: var(--heading) !important;
}

.cliente-selected-badge {
    background: rgba(37, 99, 235, 0.18) !important;
    border: 1px solid rgba(96, 165, 250, 0.22) !important;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.54);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.status-badge.aberto {
    color: #fcd34d !important;
}

.status-badge.finalizado {
    color: #86efac !important;
}

.status-dot.aberto {
    background: #f59e0b !important;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12) !important;
}

.status-dot.finalizado {
    background: #22c55e !important;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12) !important;
}

.empty-state {
    padding: 2.4rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

.metric-card {
    padding: 1.35rem;
}

.metric-label {
    margin-bottom: 0.45rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.metric-value {
    margin: 0;
    color: var(--heading);
    font-size: 1.9rem;
    font-weight: 700;
}

.login-body-premium,
.setup-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-screen,
.setup-screen {
    width: min(1080px, 100%);
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
    gap: 1.5rem;
    align-items: stretch;
}

.auth-hero,
.auth-panel,
.setup-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.72));
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-hero {
    padding: 2.25rem;
    position: relative;
}

.auth-hero::after {
    content: '';
    position: absolute;
    inset: auto -10% -30% auto;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.26), transparent 70%);
}

.auth-panel {
    padding: 2rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
    font-size: 0.88rem;
}

.list-clean {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
}

.list-clean li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    color: #cbd5e1;
}

.list-clean .bi {
    margin-top: 0.1rem;
    color: #7dd3fc;
}

.setup-card {
    padding: 2rem;
}

.setup-header,
.auth-panel-header {
    margin-bottom: 1.4rem;
}

.results-stack > * + * {
    margin-top: 0.9rem;
}

pre,
.mono-block {
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid var(--line);
    color: #cbd5e1;
    border-radius: 14px;
    padding: 1rem;
}

@media (max-width: 1199.98px) {
    .app-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991.98px) {
    .app-shell {
        padding: 16px;
    }

    .app-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .page-container {
        padding: 1rem;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575.98px) {
    .brand-title {
        font-size: 0.96rem;
    }

    .user-pill {
        width: 100%;
        justify-content: center;
    }

    .topbar-actions {
        gap: 0.75rem;
    }

    .mobile-shortcuts {
        grid-template-columns: 1fr;
    }
}
