/* Dashboard - Filas */
.dashboard-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

/* Cards grandes (facturas) */
.dash-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border-left: 4px solid #667eea;
}

.dash-card-lg {
    flex: 1;
    padding: 20px;
}

.dash-card-title {
    color: #555;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 15px;
}

.dash-card-body {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.dash-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.dash-icon.warning {
    background: #fff3e0;
    color: #f57c00;
}

.dash-icon.success {
    background: #e8f5e9;
    color: #43a047;
}

.dash-icon.partial {
    background: #fff3e0;
    color: #ff9800;
}

.dash-value {
    font-size: 32px;
    font-weight: bold;
    color: #333;
}

.dash-card-footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-label {
    color: #888;
    font-size: 12px;
}

.dash-amount {
    font-size: 16px;
    font-weight: 600;
}

.dash-amount.warning {
    color: #f57c00;
}

.dash-amount.success {
    color: #43a047;
}

.dash-amount.partial {
    color: #ff9800;
}

/* Cards pequenas (ordenes) */
.dash-card-sm {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: none;
}

.dash-icon-sm {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.dash-icon-sm.primary {
    background: #e8eaf6;
    color: #5c6bc0;
}

.dash-icon-sm.success {
    background: #e8f5e9;
    color: #43a047;
}

.dash-icon-sm.info {
    background: #fff3e0;
    color: #ff9800;
}

.dash-info {
    display: flex;
    flex-direction: column;
}

.dash-value-sm {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.dash-label-sm {
    color: #888;
    font-size: 13px;
}

/* Seccion actividad */
.dash-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.dash-section h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Lista de actividad */
.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item i {
    width: 30px;
    color: #667eea;
    font-size: 14px;
}

.activity-text {
    flex: 1;
    color: #555;
    font-size: 14px;
}

.activity-text strong {
    color: #333;
}

.activity-time {
    color: #999;
    font-size: 13px;
}

/* Grid legacy (empleado/system) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.dashboard-card .card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.dashboard-card .card-header i {
    font-size: 18px;
}

.dashboard-card .card-value {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

.dashboard-card .card-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-card:nth-child(2) {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    box-shadow: 0 4px 15px rgba(17, 153, 142, 0.3);
}

.dashboard-card:nth-child(3) {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    box-shadow: 0 4px 15px rgba(235, 51, 73, 0.3);
}

.dashboard-card:nth-child(4) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.3);
}

.dashboard-section {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
    font-size: 16px;
    margin-bottom: 10px;
}

.dashboard-section h3 i {
    color: #667eea;
}

.dashboard-section p {
    color: #666;
    font-size: 14px;
}

/* Empresas del grupo */
.dash-empresas {
    background: white;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.dash-empresas-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
}

.dash-empresas-title i {
    color: #667eea;
}

.dash-empresas-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.empresa-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8eaf6 100%);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    font-size: 13px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.empresa-chip:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.empresa-chip i {
    font-size: 12px;
    color: #667eea;
}

.empresa-chip:hover i {
    color: white;
}

.empresa-chip.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.empresa-chip.active i {
    color: white;
}

/* Stats cards - Dashboard System */
.dash-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 13px;
    color: #888;
}

/* Modules section */
.dash-modules {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.dash-modules h3 {
    color: #333;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.modules-loading {
    color: #9ca3af;
    font-size: 0.9rem;
    padding: 12px 0;
}

.module-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s;
}

.module-card {
    cursor: pointer;
}

.module-card:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.module-card.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f2ff 0%, #e8eaf6 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.module-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.module-info {
    display: flex;
    flex-direction: column;
}

.module-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.module-status {
    font-size: 12px;
}

.module-status.online {
    color: #22c55e;
}

.module-status.offline {
    color: #ef4444;
}

.module-status.warning {
    color: #f59e0b;
}

.module-status.disabled {
    color: #9ca3af;
}

/* Placeholder en sección de ajustes */
.dash-section-placeholder {
    color: #9ca3af;
    font-size: 14px;
}

/* Header de sección con acciones */
.dash-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.dash-section-header h3 {
    margin-bottom: 0;
}

#dash-section-acciones {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

/* Esquemas HANA */
.hana-schemas {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btn-sync-hana {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-sync-hana:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-sync-hana:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Inputs en tabla de usuarios */
.pu-input {
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 4px 7px;
    font-size: 12px;
    width: 130px;
    background: #f8fafc;
    transition: border-color 0.2s;
}

.pu-input:focus {
    outline: none;
    border-color: #7c3aed;
    background: #fff;
}

.pu-input-num {
    width: 60px;
    text-align: center;
}

/* Botón editar por renglón */
.btn-icono-editar {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 7px;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-icono-editar:hover {
    background: #dbeafe;
    border-color: #60a5fa;
    color: #1e40af;
}

.btn-icono-editar.editing {
    background: #dcfce7;
    border-color: #22c55e;
    color: #16a34a;
}

.btn-icono-editar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Sesiones */
.sesion-actual {
    background: #f0f4ff;
    font-weight: 500;
}

.btn-terminar-sesion {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    background: #fee2e2;
    color: #dc2626;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-terminar-sesion:hover {
    background: #fecaca;
}

.btn-terminar-sesion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hana-ambiente-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.hana-ambiente-titulo:hover {
    color: #667eea;
}

.hana-ambiente-titulo-texto {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hana-ambiente-titulo i {
    color: #667eea;
}

.hana-chevron {
    transition: transform 0.25s ease;
    font-size: 11px;
    color: #999;
}

.hana-ambiente-body {
    overflow-y: hidden;
    overflow-x: auto;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 2000px;
    opacity: 1;
}

.hana-ambiente.collapsed .hana-ambiente-body {
    max-height: 0;
    opacity: 0;
}

.hana-ambiente.collapsed .hana-chevron {
    transform: rotate(-90deg);
}

.hana-ambiente-count {
    background: #e8eaf6;
    color: #5c6bc0;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

.prov-vacio {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 6px;
    color: #888;
    font-size: 13px;
}

.hana-empresa-titulo {
    font-size: 11px;
    margin-bottom: 6px;
    padding: 4px 6px;
    background: #f5f6fa;
    border-radius: 4px;
}

.schema-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.schema-table thead tr {
    background: #b0b8c8;
}

.schema-table th {
    text-align: left;
    padding: 8px 12px;
    color: #2d3748;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid #9aa3b3;
    position: sticky;
    top: 0;
    z-index: 1;
    background: #b0b8c8;
}

.schema-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
}

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

.schema-table tbody tr:nth-child(even) td {
    background: #d5dae3;
}

.schema-table tbody tr:hover td {
    background: #c5cbe8;
}

.schema-db {
    font-family: monospace;
    font-size: 12px;
    color: #6b7280;
}

.schema-rfc {
    font-size: 12px;
    color: #6b7280;
}

.schema-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
}

.schema-badge.sl {
    background: #dcfce7;
    color: #16a34a;
}

.schema-badge.no {
    background: #f3f4f6;
    color: #9ca3af;
}

/* Columnas de certificados */
.th-cert {
    width: 60px;
    text-align: center;
}

.cert-col {
    text-align: center;
    white-space: nowrap;
}

.cert-cell, .pwd-display, .pwd-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.cert-ok   { color: #22c55e; font-size: 14px; }
.cert-falta { color: #d1d5db; font-size: 14px; }

.btn-cert {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

.btn-cert:hover {
    color: #667eea;
    background: #f0f2ff;
}

.pwd-input {
    width: 120px;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    outline: none;
}

.pwd-input:focus {
    border-color: #667eea;
}

/* Banner modo SAP - Proveedores */
.prov-sap-banner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid transparent;
}

.prov-sap-prod {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.prov-sap-prueb {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.prov-sap-otros {
    background: #f9fafb;
    color: #6b7280;
    border-color: #e5e7eb;
}
