/* Prevenir scroll horizontal global */
html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
    padding: 1.5rem;
    max-width: 100%;
    overflow-x: hidden;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-primary {
    padding: 0.5rem 1.25rem;
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background-color: #1d4ed8;
}

.btn-secondary {
    padding: 0.5rem 1.25rem;
    border: 1px solid #cbd5f5;
    color: #1f2937;
    background: #ffffff;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-danger {
    padding: 0.5rem 1rem;
    background-color: #f43f5e;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #e11d48;
}

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background-color: #f1f5f9;
    color: #475569;
    letter-spacing: 0.08em;
}

.badge-success {
    background-color: #d1fae5;
    color: #047857;
}

.badge-warning {
    background-color: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background-color: #fee2e2;
    color: #b91c1c;
}

.table-wrapper {
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    overflow-y: visible;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-head {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    background: #f8fafc;
}

.table-cell {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: #1f2937;
    border-bottom: 1px solid #e2e8f0;
}

.table-row:hover .table-cell {
    background: #f8fafc;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.form-input,
.form-textarea,
select.form-input {
    margin-top: 0.25rem;
    display: block;
    width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: #1f2937;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
select.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-input[disabled],
.form-textarea[disabled],
select.form-input[disabled] {
    background: #f8fafc;
    cursor: not-allowed;
    color: #94a3b8;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.auth-login-form .auth-field {
    position: relative;
}

.auth-login-form .auth-field + .auth-field {
    margin-top: 2.25rem;
}

[data-client-autocomplete] .form-input {
    padding-right: 2.5rem;
}

.autocomplete-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.autocomplete-toggle:hover,
.autocomplete-toggle:focus-visible {
    color: #1d4ed8;
    background-color: #eef2ff;
    border-color: #cbd5f5;
    outline: none;
}

.autocomplete-toggle svg {
    transition: transform 0.2s ease;
}

.autocomplete-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

[data-client-autocomplete] [data-suggestions] {
    max-height: 16rem;
    overflow-y: auto;
}

.readonly-field {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.status-pill .status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
}

.status-pill.success {
    background: #dcfce7;
    color: #15803d;
}

.status-pill.success .status-dot {
    background: #15803d;
}

.status-pill.warning {
    background: #fef3c7;
    color: #b45309;
}

.status-pill.warning .status-dot {
    background: #b45309;
}

.status-pill.danger {
    background: #fee2e2;
    color: #b91c1c;
}

.status-pill.danger .status-dot {
    background: #b91c1c;
}

.report-card {
    display: block;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    padding: 1.5rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.report-card:hover {
    transform: translateY(-2px);
    border-color: #2563eb;
    box-shadow: 0 20px 30px rgba(37, 99, 235, 0.15);
}

.report-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.report-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2563eb;
}

.report-subtitle {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.report-description {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
    background: #f1f5f9;
    color: #1d4ed8;
}

.nav-link .icon {
    font-size: 1.1rem;
}

.uppercase {
    text-transform: uppercase;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.modal-card {
    position: relative;
    background: #ffffff;
    border-radius: 0.75rem;
    width: min(480px, 90vw);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.modal-body {
    padding: 1rem 1.5rem;
    overflow-y: auto;
}

.modal-close {
    font-size: 1.5rem;
    color: #64748b;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

.input-mask {
    letter-spacing: 0.5px;
}

.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 300px;
    max-width: 100%;
}

.empty-state {
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px dashed #cbd5f5;
    text-align: center;
    background: #f8fafc;
    color: #475569;
}

.stepper {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.stepper-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    color: #64748b;
    font-weight: 500;
}

.stepper-step.active {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 15px 25px rgba(37, 99, 235, 0.25);
}

.stepper-index {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
}

.sidebar {
    transition: transform 0.2s ease;
}

@media (max-width: 767px) {
    .sidebar {
        display: none;
        position: fixed;
        inset: 0 auto 0 0;
        width: 16rem;
        height: 100vh;
        z-index: 60;
        background: #ffffff;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.24);
    }

    body.sidebar-open .sidebar {
        display: flex;
    }
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 40;
}

body.theme-light {
    background-color: #f8fafc;
    color: #1f2937;
}

body.theme-dark {
    background-color: #0f172a;
    color: #e2e8f0;
}

body.theme-dark .bg-white,
body.theme-dark .card,
body.theme-dark .nav-link,
body.theme-dark .sidebar,
body.theme-dark .modal-card {
    background-color: #1f2937 !important;
    color: #e2e8f0 !important;
}

body.theme-dark .card,
body.theme-dark .modal-card,
body.theme-dark .sidebar,
body.theme-dark .nav-link,
body.theme-dark .table-wrapper,
body.theme-dark .table-responsive,
body.theme-dark .table-cell,
body.theme-dark .table-head {
    border-color: #334155 !important;
}

body.theme-dark .nav-link:hover {
    background: #0f172a !important;
    color: #93c5fd !important;
}

body.theme-dark .btn-primary {
    background-color: #1d4ed8;
    box-shadow: 0 10px 20px rgba(29, 78, 216, 0.35);
}

body.theme-dark .btn-primary:hover {
    background-color: #2563eb;
}

body.theme-dark .btn-secondary {
    background-color: #1f2937;
    border-color: #334155;
    color: #cbd5f5;
}

body.theme-dark .btn-secondary:hover {
    background-color: #0f172a;
}

body.theme-dark .bg-slate-100 {
    background-color: #0f172a !important;
}

body.theme-dark .text-slate-700,
body.theme-dark .text-slate-600,
body.theme-dark .text-slate-500 {
    color: #cbd5f5 !important;
}

body.theme-dark .table-head {
    background: #1f2937 !important;
}

body.theme-dark .table-row:hover .table-cell,
body.theme-dark .nav-link:hover {
    background: #0f172a !important;
}

body.theme-dark .sidebar {
    border-color: #1f2937;
}

body.theme-dark #themeToggle {
    background-color: #1f2937;
    color: #f8fafc;
    border-color: #334155;
}

body.theme-dark .avatar-placeholder {
    background: #1e293b;
    color: #e2e8f0;
}

.timeline {
    position: relative;
    padding-left: 1.75rem;
}

.timeline::before {
    content: "";
    position: absolute;
    inset: 0;
    left: 0.5rem;
    width: 2px;
    background: #e2e8f0;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -1.09rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 9999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-soft.blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-soft.emerald {
    background: #ecfdf5;
    color: #047857;
}

.badge-soft.amber {
    background: #fef3c7;
    color: #b45309;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    background: #e2e8f0;
    color: #475569;
}

.table-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    border-radius: 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.table-summary-item {
    flex: 1 1 160px;
}

.table-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.table-summary-value {
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.pill.blue {
    background: #eff6ff;
    color: #2563eb;
}

.pill.green {
    background: #dcfce7;
    color: #16a34a;
}

.pill.gray {
    background: #e2e8f0;
    color: #475569;
}

.avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    object-fit: cover;
    background: #e2e8f0;
}

.avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #1f2937;
    text-transform: uppercase;
    background: #e0e7ff;
}

.avatar.small {
    width: 2rem;
    height: 2rem;
}

.avatar.tiny {
    width: 1.5rem;
    height: 1.5rem;
}

.table-divider {
    margin: 1.5rem 0;
    border-bottom: 1px dashed #cbd5f5;
}

.list-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.list-inline > li {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.list-inline .bullet {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.table-highlight {
    background: #eff6ff;
}

.table-highlight .table-cell {
    border-color: #bfdbfe;
}

.table-highlight .table-cell:first-child {
    border-left: 4px solid #2563eb;
}

.highlight-box {
    border-radius: 0.75rem;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    padding: 1rem;
}

.highlight-box.success {
    border-color: #bbf7d0;
    background: #ecfdf5;
}

.highlight-box.warning {
    border-color: #fde68a;
    background: #fefce8;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.section-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 1rem;
}

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

@media (min-width: 768px) {
    .grid-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .grid-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.stacked-list {
    display: grid;
    gap: 1rem;
}

.stacked-item {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    padding: 1.25rem;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.stacked-item:hover {
    border-color: #bfdbfe;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.08);
}

.stacked-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.stacked-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.stacked-item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.stacked-item-content {
    font-size: 0.875rem;
    color: #475569;
    line-height: 1.6;
}

.list-divider {
    height: 1px;
    background: linear-gradient(to right, rgba(226, 232, 240, 0), rgba(226, 232, 240, 1), rgba(226, 232, 240, 0));
    margin: 1rem 0;
}

.shadow-soft {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.border-dashed {
    border-style: dashed;
}

.pill-group {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pill-muted {
    background: #f1f5f9;
    color: #475569;
}

.pill-accent {
    background: #e0e7ff;
    color: #3730a3;
}

.alert {
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #b45309;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.badge-rounded {
    border-radius: 9999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.badge-rounded.blue {
    background: #eff6ff;
    color: #1d4ed8;
}

.badge-rounded.gray {
    background: #f1f5f9;
    color: #475569;
}

.badge-rounded.slate {
    background: #e2e8f0;
    color: #1e293b;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
}

.table-responsive table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-responsive th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 1rem;
    text-align: left;
}

.table-responsive td {
    font-size: 0.875rem;
    color: #1f2937;
    padding: 0.75rem 1rem;
    border-top: 1px solid #e2e8f0;
}

.table-responsive tr:hover td {
    background: #f8fafc;
}

.table-responsive tr:last-child td {
    border-bottom: none;
}

.progress-bar {
    height: 0.5rem;
    border-radius: 9999px;
    background: #e2e8f0;
    overflow: hidden;
}

.progress-bar .progress {
    height: 100%;
    background: #2563eb;
    border-radius: 9999px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    background: #f1f5f9;
    color: #475569;
}

.chip .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: currentColor;
}

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

@media (min-width: 768px) {
    .grid-two {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
