/* Estilos Generales - Renfe Ingeniería y Mantenimiento */
:root {
    --primary-color: #6B1E7C;
    /* Renfe Purple */
    --accent-color: #E95D0F;
    /* Renfe Orange */
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-color: #2d2d2d;
    --border-color: #d0d0d0;
    --danger-color: #d32f2f;
    --success-color: #388e3c;
    --secondary-color: #4a4a4a;
    /* Dark Gray */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100vh;
}

/* Dashboard Styles */
.dashboard-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-container {
    max-width: 1200px;
    width: 100%;
    padding: 2rem;
}

.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Summary Widgets */
.summary-container {
    margin-bottom: 2.5rem;
}

.summary-group {
    margin-bottom: 2rem;
}

.summary-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.widget-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05);
    transition: transform 0.2s;
}

.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

.widget-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.widget-data h3 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.widget-data p {
    margin: 4px 0 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

@media (max-width: 768px) {
    .summary-widgets {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .widget-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

.module-card {
    background: var(--card-bg);
    padding: 1.5rem 1rem;
    /* More compact */
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.module-card h2 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
}

.module-card p {
    font-size: 0.85rem;
    color: #64748b;
}

.module-card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    border-color: var(--accent-color);
}

.module-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f1f5f9;
}

.module-icon {
    background: #fff3e0;
    padding: 0.75rem;
    /* Smaller padding */
    border-radius: 12px;
    /* Square with rounded corners looks more modern than circle for small icons */
    color: var(--accent-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.module-icon i {
    width: 24px;
    /* Force small size */
    height: 24px;
}

/* Structure Page Layout */
.app-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-header {
    background: var(--card-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .app-header {
        padding: 1rem;
    }

    .app-header>span {
        font-size: 0.9rem;
    }

    .header-right {
        display: flex;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .header-right .btn {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
    }
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.breadcrumb-item {
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.breadcrumb-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
}

.breadcrumb-separator {
    color: #cbd5e1;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.level-header {
    margin-bottom: 1.5rem;
}

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

.data-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    /* Compact padding */
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 40px;
    /* Force compact height */
}

.data-card:hover {
    border-color: var(--accent-color);
    background-color: #f8fafc;
}

.card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.card-info h3 {
    margin: 0;
    font-size: 0.95rem;
    /* Smaller font */
    color: var(--primary-color);
    font-weight: 600;
    min-width: 150px;
    /* Fixed width for alignment-like feel */
}

.card-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    padding: 0.25rem;
    /* Smaller buttons */

    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.btn-icon:hover {
    background: #f1f5f9;
    color: var(--accent-color);
}

.btn-icon.delete:hover {
    color: var(--danger-color);
}

/* Bottom Panel */
.bottom-panel {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.05);
}

.panel-content {
    max-width: 1200px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background: #bf4a00;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    max-height: 95vh;
    overflow-y: auto;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 1rem;
        width: 95%;
        border-radius: 8px;
    }

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #64748b;
}

/* Utilities */
.hidden {
    display: none !important;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    margin-left: 0.5rem;
}