:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #d9e0e7;
    --text-main: #243447;
    --text-soft: #66788a;
    --primary: #2f6fad;
    --primary-hover: #255b8f;
    --danger-bg: #fdecec;
    --danger-text: #a94442;
    --success-bg: #eef8f1;
    --success-text: #2e7d32;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', Arial, Helvetica, sans-serif;
    font-size: 14px;
    letter-spacing: 0.2px;
    background: var(--bg-main);
    color: var(--text-main);
}

/* =========================
   TOPBAR
========================= */
.topbar {
    background: #ffffff;
    border-bottom: 3px solid #00730D;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    flex: 1 1 auto;
}

.topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 140px;
    max-width: 190px;
    overflow: hidden;
}

.topbar-logo img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.topbar-brand-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 10px;
}

.brand-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.1;
    margin: 0;
}

.brand-subtitle {
    font-size: 14px;
    color: var(--text-soft);
    margin-top: 4px;
    line-height: 1.3;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-left: auto;
}

.topbar-user {
    text-align: right;
}

.topbar-user-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.topbar-user-meta {
    margin-top: 4px;
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.3;
}

.topbar-links {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: 0.2s ease;
}

.top-link:hover {
    background: #eef4ff;
    color: var(--primary-hover);
}

.top-link-ghost {
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.top-link-ghost:hover {
    background: #eef2f7;
    color: var(--text-main);
}

.top-link-danger {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.top-link-danger:hover {
    background: #ffe4e8;
    color: #912018;
}

/* =========================
   LAYOUT GENERAL
========================= */
.layout {
    display: flex;
    min-height: calc(100vh - 65px);
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
    width: 230px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 18px 14px;
}

.sidebar-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-soft);
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    display: block;
    text-decoration: none;
    padding: 11px 13px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-main);
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.18s ease;
}

.menu-item:hover {
    text-decoration: none;
}

/* =========================
   TEMA N�0�7MINA
========================= */
.sidebar-theme-nomina .menu-item:hover {
    background: #eef4ff;
    border-color: #dbeafe;
    color: #1d4ed8;
}

.sidebar-theme-nomina .menu-item.active {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.18);
}

/* =========================
   TEMA FACTURACI�0�7N
========================= */
.sidebar-theme-facturacion .menu-item:hover {
    background: #f3f0ff;
    border-color: #ddd6fe;
    color: #5b3fd1;
}

.sidebar-theme-facturacion .menu-item.active {
    background: #6d4aff;
    border-color: #6d4aff;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(109, 74, 255, 0.20);
}

/* =========================
   CONTENIDO GENERAL
========================= */
.main-content {
    flex: 1;
    padding: 24px;
}

.container-page {
    max-width: 1220px;
}

/* =========================
   ENCABEZADOS DE PÁGINA
========================= */
.page-header {
    margin-bottom: 22px;
}

.page-header-between {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 700;
    color: var(--text-main);
}

.page-description {
    margin: 0;
    color: var(--text-soft);
    font-size: 15px;
    line-height: 1.5;
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* =========================
   TARJETAS / FORMULARIOS
========================= */
.form-card,
.panel-card,
.table-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.form-card {
    padding: 24px;
}

.panel-card {
    overflow: hidden;
}

.panel-card-header {
    padding: 18px 22px 10px;
    border-bottom: 1px solid #eef2f6;
}

.panel-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-main);
}

.panel-card-body {
    padding: 18px 22px 22px;
}

.panel-card-body p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-soft);
}

.mt-24 {
    margin-top: 24px;
}

/* =========================
   FORMULARIOS
========================= */
.grid-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin-bottom: 16px;
}

.form-group.full {
    grid-column: 1 / -1;
}

label,
.form-group label {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1f2a44;
}

input[type="text"],
input[type="password"],
input[type="file"],
select,
textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfd;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
}

input[type="file"] {
    padding: 9px 12px;
}

textarea {
    min-height: 136px;
    resize: vertical;
    line-height: 1.45;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 173, 0.10);
}

.help-text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-soft);
}

/* =========================
   ALERTAS
========================= */
.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid #f3c4c4;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #cfe7d5;
}

.alert-danger {
    background: #fff1f2;
    color: #b42318;
    border: 1px solid #fecdca;
}

.error-list {
    margin: 8px 0 0;
    padding-left: 18px;
}

/* =========================
   BOTONES
========================= */
.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn-primary,
.btn-secondary,
.btn-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    padding: 11px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-primary,
.btn-login {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-login:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f8fafc;
}

.btn-login {
    width: 100%;
    height: 46px;
    margin-top: 18px;
}

/* =========================
   DASHBOARD
========================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 220px;
    text-align: center;
}

.dashboard-card h2 {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.dashboard-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-soft);
}

.dashboard-card-body {
    flex: 1;
}

.dashboard-card-actions {
    margin-top: 18px;
}

/* =========================
   DASHBOARD HOME
========================= */
.dashboard-home {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-home .page-header {
    text-align: center;
}

.dashboard-grid-home {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 520px));
    justify-content: center;
    gap: 20px;
    margin-top: 24px;
}

.dashboard-grid-home .dashboard-card,
.dashboard-grid-home .dashboard-card-actions {
    text-align: center;
}

/* =========================
   TABLAS GENERALES
========================= */
.table-wrap {
    width: 100%;
    overflow-x: visible;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.modern-table {
    width: 100%;
    table-layout: fixed;
}

.data-table {
    width: 100%;
    min-width: 1600px;
    border-collapse: collapse;
    table-layout: auto;
}

.data-table thead th {
    background: #f8fafc;
    color: #16345c;
    font-weight: 700;
    font-size: 14px;
    text-align: center;
    padding: 14px 12px;
    border-bottom: 1px solid #d7dee8;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 12px;
    border-bottom: 1px solid #e5eaf1;
    vertical-align: middle;
    font-size: 14px;
    color: #334e68;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: #f8fbff;
}

.table-empty,
.empty-state,
.empty-state-box {
    text-align: center;
    color: var(--text-soft);
    font-size: 15px;
}

.table-empty {
    padding: 24px !important;
}

.empty-state,
.empty-state-box {
    padding: 40px 24px;
}

.empty-state-box {
    background: #ffffff;
}

/* =========================
   TABLA DE EMISORES
========================= */
.table-panel {
    overflow: hidden;
    border-radius: 16px;
}

.table-panel-header {
    padding: 20px 24px 14px;
    border-bottom: 1px solid var(--border);
    background: #fbfcfe;
}

.table-panel-title {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
}

.table-panel-subtitle {
    margin: 6px 0 18px;
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.5;
}

.modern-table-emisores .col-logo {
    width: 110px;
    max-width: 110px;
}

.modern-table-emisores th {
    text-align: left;
    padding: 14px 16px;
}

.modern-table-emisores .col-logo {
    width: 110px;
    text-align: center;
}

.modern-table-emisores .col-estado {
    width: 120px;
    text-align: center;
}

.modern-table-emisores .col-alta {
    width: 150px;
    text-align: left;
}

.modern-table-emisores .col-acciones {
    width: 120px;
    text-align: center;
}

.modern-table-emisores .col-rfc {
    width: 150px;
}

.modern-table-emisores .col-serie {
    width: 90px;
    text-align: center;
}

.modern-table-emisores .col-cert {
    width: 130px;
    text-align: center;
}

.modern-table-emisores th,
.modern-table-emisores td {
    white-space: normal;
    word-break: break-word;
    vertical-align: middle;
}

.table-logo-box {
    width: 90px;
    height: 56px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
    padding: 6px 8px;
    box-sizing: border-box;
}

.table-logo-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.table-logo-placeholder {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.table-main-text {
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.2;
}

.table-sub-text {
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.45;
    margin-top: 3px;
}

.table-actions-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.action-icon svg {
    width: 18px;
    height: 18px;
}

.action-edit {
    background: #eef4ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.action-edit:hover {
    background: #dbeafe;
    transform: translateY(-1px);
}

.action-view {
    background: #ecfdf5;
    color: #059669;
    border-color: #d1fae5;
}

.action-view:hover {
    background: #d1fae5;
    transform: translateY(-1px);
}

/* =========================
   CERTIFICADOS
========================= */
.cert-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
}

button.cert-btn {
    cursor: pointer;
}

.cert-btn-valid {
    background: #ecfdf5;
    color: #059669;
    border-color: #d1fae5;
}

.cert-btn-valid:hover {
    background: #d1fae5;
}

.cert-btn-expired {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

.cert-btn-expired:hover {
    background: #fee2e2;
}

.cert-btn-review {
    background: #eef4ff;
    color: #2563eb;
    border-color: #dbeafe;
}

.cert-btn-review:hover {
    background: #dbeafe;
}

.cert-btn-empty {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.cert-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.cert-modal {
    width: 100%;
    max-width: 680px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

.cert-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border);
}

.cert-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: var(--text-main);
}

.cert-modal-close {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    font-size: 34px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.cert-modal-close:hover {
    color: #475569;
}

.cert-modal-body {
    padding: 24px;
}

.cert-modal-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fbfcfe;
    padding: 22px;
}

.cert-modal-company {
    font-size: 20px;
    font-weight: 700;
    color: #0ea5e9;
    margin-bottom: 10px;
}

.cert-modal-rfc,
.cert-modal-row {
    font-size: 16px;
    color: var(--text-main);
    line-height: 1.6;
}

.cert-modal-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}

.cert-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

body.modal-open {
    overflow: hidden;
}

.cert-modal-backdrop[hidden] {
    display: none !important;
}

/* =========================
   PAGINACIÓN
========================= */
.pagination-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 14px;
    color: var(--text-soft);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-links {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pagination-btn,
.page-link {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: 1px solid #d9e2ec;
    color: #486581;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border-color: var(--border);
    color: var(--text-main);
}

.pagination-btn:hover,
.page-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.pagination-btn.active,
.page-link.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

/* =========================
   FOOTER
========================= */
.footer {
    border-top: 1px solid var(--border);
    background: #ffffff;
    padding: 14px 20px;
    margin-top: 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-soft);
}

/* =========================
   LOGIN
========================= */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 60px auto;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 32px 28px 24px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.logo-box {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    overflow: hidden;
}

.logo-box img {
    max-width: 300px; /* prueba 300–360 según te guste */
}

.login-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0 auto 18px auto;
}

.login-logo img {
    max-width: 450px;

}

.system-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}

.system-subtitle {
    margin: 0 0 24px;
    font-size: 14px;
    color: var(--text-soft);
    text-align: center;
}

.version-text {
    margin-top: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-soft);
}

.footer-text {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #7f8c98;
    line-height: 1.5;
}

.error-box {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 14px;
    border: 1px solid #f5c6cb;
}

/* =========================
   PASSWORD TOGGLE
========================= */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #6b7c8f;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
    background: #eef2f7;
    color: var(--text-main);
}

.password-toggle-icon {
    width: 18px;
    height: 18px;
    display: block;
}

.password-toggle-icon-hide {
    display: none;
}

.password-toggle.is-visible .password-toggle-icon-show {
    display: none;
}

.password-toggle.is-visible .password-toggle-icon-hide {
    display: block;
}

/* =========================
   DETALLE
========================= */
.detail-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 24px;
    align-items: start;
}

.detail-logo-col {
    display: flex;
}

.detail-logo-card {
    width: 180px;
    height: 180px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.detail-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.detail-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    font-weight: 700;
    color: var(--primary);
}

.detail-info-col {
    min-width: 0;
}

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

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fbfcfe;
}

.detail-item.full {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-soft);
}

.detail-value {
    font-size: 15px;
    color: var(--text-main);
    line-height: 1.5;
    word-break: break-word;
}

/* =========================
   NÓMINA - CARGA
========================= */
.form-grid-nomina {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
    align-items: end;
}

.form-col-3 { grid-column: span 3; }
.form-col-4 { grid-column: span 4; }
.form-col-6 { grid-column: span 6; }
.form-col-8 { grid-column: span 8; }
.form-col-12 { grid-column: span 12; }

.form-group input:not([type="file"]):not([type="checkbox"]),
.form-group select,
.form-group textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid #cfd8e3;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    color: #1f2a44;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    outline: none;
}

.form-group input:not([type="file"]):not([type="checkbox"]):focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #377dff;
    box-shadow: 0 0 0 4px rgba(55, 125, 255, 0.10);
}

.checkbox-inline {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 46px;
    padding-bottom: 2px;
}

.checkbox-inline label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2a44;
    cursor: pointer;
    margin: 0;
}

.checkbox-inline input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: auto;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
}

.file-upload-box {
    border: 1px dashed #b8c4d6;
    border-radius: 14px;
    background: #f8fbff;
    padding: 12px 16px 14px;
    overflow: visible;
}

.form-actions {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-top: 8px;
}

.templates-panel-body {
    padding-top: 6px;
}

.templates-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 16px;
    align-items: flex-start;
    margin-top: 6px;
}

.template-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border-radius: 999px;
    background: #eef5ff;
    color: #1f5fae;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    border: 1px solid #cfe0ff;
    transition: all 0.2s ease;
    white-space: nowrap;
    margin: 0;
}

.template-chip:hover {
    background: #dcecff;
    color: #114a8d;
    text-decoration: none;
    transform: translateY(-1px);
}

/* =========================
   TABLAS DE DATOS / ACCIONES
========================= */
.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-action-primary {
    background: #2f6fad;
    color: #fff;
}

.btn-action-primary:hover {
    background: #255d92;
}

.btn-action-danger {
    background: #fff1f2;
    color: #b42318;
    border-color: #fecdca;
}

.btn-action-danger:hover {
    background: #ffe4e8;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.status-success {
    background: #ecfdf3;
    color: #027a48;
}

.status-warning {
    background: #fffaeb;
    color: #b54708;
}

.status-danger {
    background: #fef3f2;
    color: #b42318;
}

.status-muted {
    background: #f2f4f7;
    color: #475467;
}

.status-info {
    background: #eff8ff;
    color: #175cd3;
}

/* =========================
   LOG
========================= */
.log-actions-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.log-table-wrap {
    width: 100%;
    overflow: visible;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.log-table th,
.log-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #d9e2ec;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.35;
}

.log-table th {
    background: #f8fafc;
    color: #173b63;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
}

.log-table tbody tr:hover {
    background: #f8fbff;
}

.log-table .col-id { width: 6%; }
.log-table .col-fecha { width: 14%; }
.log-table .col-periodo { width: 10%; }
.log-table .col-recibo { width: 8%; }
.log-table .col-usuario { width: 14%; }
.log-table .col-mensaje { width: 22%; }
.log-table .col-detalle { width: 26%; }

.log-table td:nth-child(1),
.log-table td:nth-child(2),
.log-table td:nth-child(3),
.log-table td:nth-child(4),
.log-table td:nth-child(5) {
    text-align: center;
}

/* =========================
   DETALLE DE PERIODO / RECIBOS
========================= */
.detalle-header-grid {
    display: grid;
    grid-template-columns: 1.4fr auto;
    gap: 20px;
    align-items: start;
}

.detalle-title {
    margin: 0 0 8px;
}

.detalle-subtitle {
    margin: 0;
    color: #5b708b;
}

.detalle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 12px;
    font-size: 14px;
    color: #486581;
}

.resumen-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.metric-card {
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 16px;
    padding: 16px 18px;
}

.metric-label {
    font-size: 12px;
    font-weight: 700;
    color: #627d98;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #102a43;
}

.metric-subvalue {
    margin-top: 4px;
    font-size: 12px;
    color: #627d98;
}

.acciones-masivas {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-soft,
.btn-danger-soft,
.btn-success-soft,
.btn-disabled-soft {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
}

.btn-soft {
    background: #eff6ff;
    color: #175cd3;
    border-color: #bfdbfe;
}

.btn-success-soft {
    background: #ecfdf3;
    color: #027a48;
    border-color: #abefc6;
}

.btn-danger-soft {
    background: #fef3f2;
    color: #b42318;
    border-color: #fecdca;
}

.btn-disabled-soft {
    background: #f8fafc;
    color: #98a2b3;
    border-color: #e4e7ec;
    cursor: not-allowed;
    pointer-events: none;
}

.filtros-recibos {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: end;
}

.filtro-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filtro-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #d9e2ec;
    color: #486581;
    background: #fff;
}

.filtro-chip.active {
    background: #2f6fad;
    color: #fff;
    border-color: #2f6fad;
}

.busqueda-inline input {
    min-width: 280px;
}

.periodos-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.periodos-table,
.periodo-table {
    width: 100%;
    min-width: 1350px;
    border-collapse: collapse;
    table-layout: fixed;
}

.periodos-table th,
.periodos-table td,
.periodo-table th,
.periodo-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #d9e2ec;
    vertical-align: middle;
    font-size: 13px;
    line-height: 1.3;
}

.periodos-table th,
.periodo-table th {
    background: #f8fafc;
    color: #173b63;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.periodos-table tbody tr:hover,
.periodo-table tbody tr:hover {
    background: #f8fbff;
}

.periodo-table .col-id { width: 5%; }
.periodo-table .col-acciones { width: 12%; }
.periodo-table .col-empleado { width: 19%; }
.periodo-table .col-rfc { width: 8%; }
.periodo-table .col-estatus { width: 10%; }
.periodo-table .col-mensaje { width: 12%; }
.periodo-table .col-tipo { width: 7%; }
.periodo-table .col-neto { width: 9%; }

.center { text-align: center; }
.right { text-align: right; }

.empleado-meta {
    color: #627d98;
    font-size: 12px;
}

.mb-20 {
    margin-top: 20px;
}

.form-actions-right {
    justify-content: flex-end;
}

/* =========================
   MODAL TIMBRADO MASIVO
========================= */
.timbrado-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.timbrado-modal.is-active {
    display: block;
}

.timbrado-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(16, 42, 67, 0.65);
}

.timbrado-modal-dialog {
    position: relative;
    max-width: 680px;
    margin: 60px auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 22px 24px;
    box-shadow: 0 20px 60px rgba(16, 42, 67, 0.25);
    z-index: 2;
}

.timbrado-modal-header {
    margin-bottom: 16px;
}

.timbrado-modal-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    color: #102a43;
}

.timbrado-modal-subtitle {
    margin: 0;
    font-size: 13px;
    color: #627d98;
}

.timbrado-modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.timbrado-progress-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timbrado-progress-bar {
    flex: 1;
    height: 10px;
    background: #e4e7ec;
    border-radius: 999px;
    overflow: hidden;
}

.timbrado-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2f6fad, #175cd3);
    transition: width 0.25s ease;
}

.timbrado-progress-percent {
    font-size: 12px;
    font-weight: 700;
    color: #175cd3;
    min-width: 38px;
    text-align: right;
}

.timbrado-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.timbrado-stat-card {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.timbrado-stat-label {
    font-size: 11px;
    font-weight: 700;
    color: #627d98;
    margin-bottom: 4px;
}

.timbrado-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #102a43;
}

.timbrado-resume-line {
    font-size: 13px;
    font-weight: 600;
    color: #486581;
}

.timbrado-status-panel {
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    padding: 10px;
}

.timbrado-status-label {
    font-size: 11px;
    font-weight: 700;
    color: #627d98;
    margin-bottom: 4px;
}

.timbrado-status-message {
    font-size: 13px;
    color: #102a43;
}

.timbrado-final-status {
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.timbrado-final-status.is-success {
    background: #ecfdf3;
    color: #027a48;
}

.timbrado-final-status.is-error {
    background: #fef3f2;
    color: #b42318;
}

.timbrado-final-status.is-info {
    background: #eff8ff;
    color: #175cd3;
}

.timbrado-final-status.is-warning {
    background: #fffaeb;
    color: #b54708;
}

.timbrado-modal-footer {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

.timbrado-modal-open {
    overflow: hidden;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px) {
    .form-col-3,
    .form-col-4,
    .form-col-6,
    .form-col-8 {
        grid-column: span 6;
    }
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
    }

    .topbar-brand {
        width: 100%;
    }

    .topbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .topbar-user {
        text-align: left;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .dashboard-grid-home {
        grid-template-columns: 1fr;
    }

    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-logo-col {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .table-panel-header,
    .pagination-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .timbrado-modal-dialog {
        margin: 20px;
    }

    .timbrado-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .form-grid-nomina {
        grid-template-columns: 1fr;
    }

    .form-col-3,
    .form-col-4,
    .form-col-6,
    .form-col-8,
    .form-col-12 {
        grid-column: span 1;
    }

    .checkbox-inline {
        justify-content: flex-start;
        min-height: auto;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .template-chip {
        white-space: normal;
        text-align: center;
    }
}

@media (max-width: 720px) {
    .grid-form {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 18px;
    }

    .page-title {
        font-size: 25px;
    }

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

    .detail-item.full {
        grid-column: auto;
    }

    .detail-logo-card {
        width: 140px;
        height: 140px;
    }
}

@media (max-width: 640px) {
    .topbar {
        padding: 14px 18px;
    }

    .topbar-brand {
        gap: 12px;
    }

    .topbar-logo {
        min-width: 90px;
        max-width: 120px;
    }

    .topbar-logo img {
        max-height: 50px;
        width: auto;
    }

    .brand-title {
        font-size: 22px;
    }

    .brand-subtitle {
        font-size: 13px;
    }

    .topbar-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .topbar-links {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 22px 20px 18px;
    }

    .system-title {
        font-size: 21px;
    }

    .logo-box img {
        max-width: 210px;
    }

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

    .filtros-recibos {
        grid-template-columns: 1fr;
    }

    .busqueda-inline input {
        min-width: 100%;
    }
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.table-responsive table {
    min-width: 1200px; /* 🔥 clave para forzar scroll */
    border-collapse: collapse;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.btn-mini-primary {
    background: #e8f1fb;
    color: #1f5fa9;
    border-color: #c9ddf5;
}

.btn-mini-primary:hover {
    background: #dceafb;
    color: #174d8a;
    text-decoration: none;
}

.btn-mini-neutral {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.btn-mini-neutral:hover {
    background: #e5e7eb;
    color: #1f2937;
    text-decoration: none;
}

.btn-mini-danger {
    background: #fdecec;
    color: #b42318;
    border-color: #f5c2c0;
}

.btn-mini-danger:hover {
    background: #fbd5d3;
    color: #8f1c13;
    text-decoration: none;
}

.btn-mini-disabled {
    background: #f5f5f5;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================
   FACTURACION THEME
========================= */

.facturacion-theme .dashboard-card h2 {
    color: inherit;
}

.facturacion-theme .btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* =========================
   DASHBOARD POR MÓDULO
========================= */

/* =========================
   NÓMINA (AZUL LIMPIO SIN DEGRADADO)
========================= */
.card-nomina {
    border-top: 4px solid #2563eb;
    background: #ffffff; /* ← sin degradado */
}

.card-nomina h2 {
    color: #1d4ed8;
}

.card-nomina .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

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


/* =========================
   FACTURACIÓN (MORADO LIMPIO SIN DEGRADADO)
========================= */
.card-facturacion {
    border-top: 4px solid #5B3FD1;
    background: #ffffff; /* ← sin degradado */
}

.card-facturacion h2 {
    color: #4b2fbf;
}

.card-facturacion .btn-primary {
    background: #5B3FD1;
    border-color: #5B3FD1;
    color: #ffffff;
}

.card-facturacion .btn-primary:hover {
    background: #4b2fbf;
    border-color: #4b2fbf;
}

.factura-footer-actions .acciones-masivas {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.factura-grid-4 .form-group {
    margin-top: 8px;
}

.concepto-captura-grid select {
    width: 100%;
    min-width: 180px;
}

.facturas-filtros-panel .panel-card-body {
    padding-top: 24px;
}

.facturas-filtros-panel .filtros-recibos {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
}

.facturas-filtros-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr auto;
    gap: 20px;
    align-items: end;
    width: 100%;
}

.facturas-chips-row {
    width: 100%;
}

.facturas-chips-row .filtro-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================
   DASHBOARD INTERNO FACTURACIÓN
========================= */
.facturacion-dashboard-grid .dashboard-card-facturacion-module {
    border-top: 4px solid #6D4AFF;
    background: #ffffff;
}

.facturacion-dashboard-grid .dashboard-card-facturacion-module h2 {
    color: #4c35b5;
}

.facturacion-dashboard-grid .dashboard-card-facturacion-module .btn-primary {
    background: #6D4AFF;
    border-color: #6D4AFF;
    color: #ffffff;
}

.facturacion-dashboard-grid .dashboard-card-facturacion-module .btn-primary:hover {
    background: #5b3fd1;
    border-color: #5b3fd1;
}

/* =========================
   DASHBOARD INTERNO NÓMINA (MISMO ESTILO QUE FACTURACIÓN)
========================= */
.dashboard-grid .dashboard-card-nomina-module {
    border-top: 4px solid #2563eb;
    background: #ffffff;
}

.dashboard-grid .dashboard-card-nomina-module h2 {
    color: #1d4ed8;
}

.dashboard-grid .dashboard-card-nomina-module .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

.dashboard-grid .dashboard-card-nomina-module .btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.catalogo-field {
    position: relative;
}

.catalogo-input-wrap {
    position: relative;
}

.catalogo-input-wrap input {
    padding-right: 35px;
}

.catalogo-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #e5e7eb;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    cursor: pointer;
}

.catalogo-resultados {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    background: #fff;
    border: 1px solid #ddd;
    max-height: 200px;
    overflow-y: auto;
}

.catalogo-resultado-item {
    padding: 8px;
    cursor: pointer;
}

.catalogo-resultado-item:hover {
    background: #f0f4f8;
}

/* Descuento más corto */
#c_descuento {
    max-width: 110px;
    width: 110px;
}

/* Tasa IVA más largo */
#c_tasa_iva {
    min-width: 220px;
    width: auto;
}

/* =========================================================
   MENÚ LATERAL NUEVO - HERMES / ESTILO TIPO GEES
========================================================= */

.menu-gees-like .sidebar-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.2;
}

.menu-gees-like .sidebar-subtitle {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.menu-gees-like .sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}

.menu-gees-like .menu-item,
.menu-gees-like .menu-group-toggle,
.menu-gees-like .submenu-item {
    text-decoration: none;
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    box-sizing: border-box;
    font: inherit;
    cursor: pointer;
}

.menu-gees-like .menu-item-root,
.menu-gees-like .menu-group-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 12px;
    color: #1f2a37;
    font-weight: 600;
    text-align: left;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.menu-gees-like .menu-item-root:hover,
.menu-gees-like .menu-group-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.menu-gees-like .menu-item-root.active,
.menu-gees-like .menu-group-toggle.active {
    background: rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.menu-gees-like .menu-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-gees-like .menu-icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.menu-gees-like .menu-label {
    flex: 1;
    min-width: 0;
}

.menu-gees-like .menu-caret {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease;
}

.menu-gees-like .menu-caret svg {
    width: 18px;
    height: 18px;
    display: block;
}

.menu-gees-like .menu-group.open .menu-caret {
    transform: rotate(90deg);
}

.menu-gees-like .submenu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0 10px 0;
    padding: 6px 0 0 18px;
}

.menu-gees-like .submenu[hidden] {
    display: none !important;
}

.menu-gees-like .submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #334155;
    font-weight: 500;
    transition: background-color .2s ease, color .2s ease;
}

.menu-gees-like .submenu-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #111827;
}

.menu-gees-like .submenu-item.active {
    background: rgba(37, 99, 235, 0.10);
    color: #1d4ed8;
    font-weight: 700;
}

.menu-gees-like .submenu-bullet {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.75;
    flex: 0 0 7px;
}

.menu-gees-like .submenu-label {
    flex: 1;
    min-width: 0;
}

/* =========================================================
   TEMAS POR MÓDULO
========================================================= */

.sidebar-theme-dashboard .menu-item-root.active,
.sidebar-theme-dashboard .menu-group-toggle.active,
.sidebar-theme-dashboard .submenu-item.active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.12);
}

.sidebar-theme-nomina .menu-item-root.active,
.sidebar-theme-nomina .menu-group-toggle.active,
.sidebar-theme-nomina .submenu-item.active {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.12);
}

.sidebar-theme-facturacion .menu-item-root.active,
.sidebar-theme-facturacion .menu-group-toggle.active,
.sidebar-theme-facturacion .submenu-item.active {
    color: #6d4aff;
    background: rgba(109, 74, 255, 0.12);
}

.sidebar-theme-usuarios .menu-item-root.active,
.sidebar-theme-usuarios .menu-group-toggle.active,
.sidebar-theme-usuarios .submenu-item.active {
    color: #475569;
    background: rgba(71, 85, 105, 0.12);
}

.sidebar-theme-acerca .menu-item-root.active,
.sidebar-theme-acerca .menu-group-toggle.active,
.sidebar-theme-acerca .submenu-item.active {
    color: #0f766e;
    background: rgba(15, 118, 110, 0.12);
}

/* =========================================================
   USUARIOS - AJUSTES VISUALES
========================================================= */

/* Contenedor de acciones en header */
.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Formulario de filtros en línea */
.inline-filters-form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.inline-filter-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.inline-filter-group select {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 13px;
}

/* Botones del header */
.card-header-buttons {
    display: flex;
    gap: 8px;
}

/* Chips de módulos */
.chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Badges (alineado a tu estilo general) */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

/* Variantes */
.status-badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge-info {
    background-color: #dbeafe;
    color: #1e3a8a;
}

.status-badge-neutral {
    background-color: #f3f4f6;
    color: #374151;
}

/* Acciones dentro de tabla */
.table-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Botones mini */
.btn-mini {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 6px;
}

/* Botones base (por si faltan) */
.btn-danger {
    background-color: #dc2626;
    color: #fff;
    border: none;
}

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

.btn-secondary {
    background-color: #6b7280;
    color: #fff;
    border: none;
}

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

/* Botón primario (alineado a tu sistema) */
.btn-primary {
    background-color: #2563eb;
    color: #fff;
    border: none;
}

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

/* Ajuste tabla */
.data-table td {
    vertical-align: middle;
}

/* Responsive */
@media (max-width: 768px) {
    .card-header-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .inline-filters-form {
        width: 100%;
        justify-content: space-between;
    }
}
