/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --info-color: #9b59b6;
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-light: #ecf0f1;
    --bg-white: #ffffff;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 5px 20px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header mejorado con ISO badge */
.main-header {
    background-color: var(--primary-color);
    color: white;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

.iso-badge {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 10px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.notifications {
    position: relative;
    cursor: pointer;
}

.notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--accent-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Quality Bar */
.quality-bar {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.quality-bar i {
    margin-right: 0.5rem;
    color: var(--success-color);
}

.audit-info {
    color: var(--warning-color);
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 80px;
    right: -350px;
    width: 350px;
    background: white;
    box-shadow: var(--shadow-hover);
    border-radius: 0 0 0 10px;
    transition: right 0.3s ease;
    z-index: 999;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.notification-panel.show {
    right: 0;
}

.notification-panel h3 {
    padding: 1rem;
    background: var(--bg-light);
    margin: 0;
    border-bottom: 1px solid var(--border-color);
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-content strong {
    display: block;
    margin-bottom: 0.25rem;
}

.notification-content small {
    color: var(--text-light);
}

.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }
.text-success { color: var(--success-color); }

/* Main Nav */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--secondary-color);
}

/* User Info */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info i {
    font-size: 1.5rem;
}

/* Main Content */
.main-content {
    margin-top: 120px;
    min-height: calc(100vh - 200px);
}

/* Section Base */
.section {
    display: none;
    padding: 2rem 0;
}

.section.active {
    display: block;
}

/* Welcome Section */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px;
}

.welcome-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.lead {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* ISO Status in welcome */
.iso-status {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    margin-top: 1rem;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-header i {
    font-size: 2rem;
    color: var(--secondary-color);
}

.card-body {
    padding: 1.5rem;
}

/* Mission Vision */
.mission-vision {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Quality Indicators Summary */
.quality-summary {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.quality-summary h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.indicator-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.indicator-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.indicator-card.green {
    border-color: var(--success-color);
}

.indicator-card.yellow {
    border-color: var(--warning-color);
}

.indicator-card.red {
    border-color: var(--accent-color);
}

.indicator-card i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.indicator-card.green i { color: var(--success-color); }
.indicator-card.yellow i { color: var(--warning-color); }
.indicator-card.red i { color: var(--accent-color); }

.indicator-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.indicator-label {
    color: var(--text-light);
    margin-top: 0.5rem;
}

.indicator-trend {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-weight: 500;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-white);
    padding: 2rem;
    text-align: center;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.stat-card i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.stat-card h4 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Quick Links */
.quick-links {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.quick-links h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

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

.quick-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.quick-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-3px);
}

.quick-link i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* News Section */
.news-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

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

.news-card {
    background: var(--bg-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-card.featured {
    grid-column: span 2;
}

.news-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--accent-color);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
}

.news-category.quality {
    background: var(--info-color);
}

.news-content {
    padding: 1.5rem;
}

.news-content h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.news-meta {
    display: flex;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.news-meta i {
    margin-right: 0.25rem;
}

.read-more {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 1rem;
}

/* Directory Section */
.directory-search {
    display: flex;
    max-width: 600px;
    margin: 2rem auto;
}

.directory-search input {
    flex: 1;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-right: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
}

.btn-search {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-search:hover {
    background: var(--primary-color);
}

.department-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.contact-card {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.contact-avatar {
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-avatar i {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.contact-info h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.contact-position {
    font-weight: 500;
    color: var(--text-dark);
}

.contact-department {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.contact-role {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    display: inline-block;
    margin-top: 0.5rem;
}

.contact-details {
    font-size: 0.875rem;
    color: var(--text-light);
}

.contact-details i {
    margin-right: 0.5rem;
    color: var(--secondary-color);
}

/* Quality Dashboard */
.quality-dashboard {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.dashboard-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.dashboard-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.chart-legend {
    display: flex;
    justify-content: space-around;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.current-value { color: var(--secondary-color); }
.target-value { color: var(--text-light); }

/* Risk Management */
.risk-management {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.risk-matrix {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.risk-item, .opportunity {
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.risk-item:hover, .opportunity:hover {
    transform: translateY(-5px);
}

.risk-item.high {
    background: rgba(231, 76, 60, 0.1);
    border: 2px solid var(--accent-color);
}

.risk-item.medium {
    background: rgba(243, 156, 18, 0.1);
    border: 2px solid var(--warning-color);
}

.opportunity {
    background: rgba(39, 174, 96, 0.1);
    border: 2px solid var(--success-color);
}

.risk-item i, .opportunity i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.risk-item.high i { color: var(--accent-color); }
.risk-item.medium i { color: var(--warning-color); }
.opportunity i { color: var(--success-color); }

/* Continuous Improvement */
.continuous-improvement {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

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

.tool-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.tool-card i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.tool-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.tool-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-action {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

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

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

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-action {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    padding: 0.5rem 1rem;
}

.btn-action:hover {
    background: var(--secondary-color);
    color: white;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Audit Section */
.audit-section {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.audit-table {
    width: 100%;
    margin-top: 1.5rem;
    border-collapse: collapse;
}

.audit-table th {
    background: var(--bg-light);
    padding: 1rem;
    text-align: left;
    font-weight: 500;
    color: var(--primary-color);
}

.audit-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge.internal {
    background: var(--info-color);
    color: white;
}

.badge.external {
    background: var(--warning-color);
    color: white;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status.planned {
    background: rgba(52, 152, 219, 0.2);
    color: var(--secondary-color);
}

.status.completed {
    background: rgba(39, 174, 96, 0.2);
    color: var(--success-color);
}

/* Documents Section */
.document-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.doc-category {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.doc-category.featured {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.doc-category.featured h3,
.doc-category.featured i {
    color: white;
}

.doc-category.featured .doc-link {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.doc-category.featured .doc-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.doc-category > i {
    font-size: 2.5rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    display: block;
}

.doc-category h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.doc-list {
    list-style: none;
}

.doc-list li {
    margin-bottom: 1rem;
}

.doc-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

.doc-link:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateX(5px);
}

.doc-link i {
    margin-right: 0.75rem;
}

.doc-size {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-hover);
    animation: slideIn 0.3s;
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 0.7;
}

/* Quality Form */
.quality-form {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

/* Footer */
.main-footer {
    background: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-iso {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-iso img {
    height: 50px;
}

.footer-info {
    text-align: center;
    flex: 1;
}

.footer-info a {
    color: var(--secondary-color);
    text-decoration: none;
}

.footer-info a:hover {
    text-decoration: underline;
}

.footer-contact {
    text-align: right;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .quality-bar {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .dashboard-grid,
    .indicator-cards {
        grid-template-columns: 1fr;
    }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .modal-content {
        margin: 10% auto;
        width: 95%;
    }

    .news-card.featured {
        grid-column: span 1;
    }

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

    .welcome-section h2 {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-contact {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: 1fr;
    }

    .department-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
    }

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

}

.main-header > .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 20px;
}
