/* ================================================================
   Intranet Grupo Innova - sistema visual
   HTML en /inc/views, estilos aquí.
   ================================================================ */
.io-section,
.io-panel,
.io-card,
.io-project-card {
    box-sizing: border-box;
}

.io-section { width: 100%; }
.io-panel,
.io-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin: 0 0 20px;
    background: #fff;
}

.io-panel--form { margin-bottom: 20px; }
.io-panel--danger { border-color: #e0b4b4; }
.io-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.io-section-header h3 { margin: 0; }
.io-muted,
.io-note { color: #666; font-size: 13px; }
.io-empty { margin: 0; color: #666; }

.io-alert {
    padding: 12px 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin: 0 0 16px;
    background: #f5f5f5;
}
.io-alert--success { background: #ecfdf3; border-color: #22c55e; }
.io-alert--warning { background: #fff7ed; border-color: #f59e0b; }
.io-alert--error { background: #fef2f2; border-color: #ef4444; }
.io-alert--info { background: #f5f5f5; border-color: #ccc; }

.io-form { width: 100%; }
.io-form--stack { display: flex; flex-direction: column; gap: 14px; }
.io-form-grid {
    display: grid;
    gap: 16px;
}
.io-form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.io-form label,
.io-fieldset { display: flex; flex-direction: column; gap: 6px; }
.io-form input,
.io-form select,
.io-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.io-form textarea { resize: vertical; }
.io-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}
.io-filter-form > label { min-width: 180px; flex: 1 1 180px; }
.io-field-grow { flex: 1 1 280px !important; }
.io-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.io-actions--end { justify-content: flex-end; }
.io-actions--wrap { flex-wrap: wrap; }
.io-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid #2271b1;
    border-radius: 6px;
    background: #2271b1;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}
.io-button:hover { color: #fff; opacity: .92; }
.io-button--secondary { background: #fff; color: #2271b1; }
.io-button--secondary:hover { color: #2271b1; }
.io-button--danger { background: #b00020; border-color: #b00020; color: #fff; }
.io-link-danger { color: #b00020; }

.io-fieldset {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
}
.io-fieldset legend { padding: 0 6px; font-weight: 600; }
.io-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 16px;
}
.io-check { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 7px; }
.io-check input { width: auto; }

.io-table-wrap { width: 100%; overflow-x: auto; }
.io-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}
.io-table th,
.io-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    vertical-align: top;
}
.io-table th { background: #f7f7f7; }
.io-table-detail-row td { padding: 0; }

.io-project-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.io-project-card { border: 1px solid #ddd; border-radius: 8px; padding: 14px; background: #fff; }
.io-project-admin-card { margin-bottom: 16px; }

.io-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f0f0f0;
    font-size: 12px;
    line-height: 1.2;
}

.io-gallery { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.io-gallery a { display: block; }
.io-gallery img {
    display: block;
    width: 150px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #ddd;
}
.io-gallery--small img { width: 60px; height: 60px; }

.io-details summary { cursor: pointer; padding: 10px 0; }
.io-detail-content { padding: 12px; background: #fafafa; border-radius: 6px; }
.io-details--danger summary { color: #a00; }
.io-danger-box { margin-top: 10px; padding: 14px; border: 1px solid #e0b4b4; background: #fff7f7; border-radius: 8px; }
.io-activity-item { border-bottom: 1px solid #ddd; padding: 8px 0; }
.io-activity-item:last-child { border-bottom: 0; }
.io-activity-item p { margin: 4px 0; }

.io-storage-status {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.io-progress {
    width: 100%;
    height: 22px;
    background: #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    margin: 15px 0;
}
.io-progress__fill {
    display: block;
    height: 100%;
    width: 0;
    background: #2271b1;
    border-radius: 12px;
    transition: width .25s ease;
}
.io-storage-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.io-storage-grid > section {
    min-width: 0;
    padding-right: 20px;
    border-right: 1px solid #e5e5e5;
}
.io-storage-grid > section:nth-child(3n) { border-right: 0; padding-right: 0; }
.io-storage-grid h4 { margin: 0 0 8px; }
.io-storage-span-2 { grid-column: span 2; }
.io-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.io-stat-grid > div { padding: 14px; border: 1px solid #ddd; border-radius: 8px; }
.io-stat-grid span,
.io-stat-grid strong { display: block; }
.io-stat-grid strong { margin-top: 4px; font-size: 20px; }

@media (max-width: 900px) {
    .io-storage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .io-storage-grid > section { border-right: 0; padding-right: 0; }
    .io-storage-span-2 { grid-column: span 2; }
    .io-project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .io-panel,
    .io-card { padding: 15px; border-radius: 8px; }
    .io-form-grid--2,
    .io-check-grid,
    .io-stat-grid,
    .io-project-list { grid-template-columns: 1fr; }
    .io-storage-grid { grid-template-columns: 1fr; gap: 15px; }
    .io-storage-span-2 { grid-column: auto; }
    .io-storage-grid > section { border-right: 0; padding-right: 0; }
    .io-section-header { align-items: flex-start; flex-direction: column; }
    .io-filter-form { align-items: stretch; flex-direction: column; }
    .io-filter-form > label { width: 100%; min-width: 0; }
    .io-actions--end { justify-content: flex-start; }
    .io-button { width: 100%; }
    .io-actions .io-button { flex: 1 1 100%; }

    .io-table { min-width: 0; border: 0; }
    .io-table thead { display: none; }
    .io-table,
    .io-table tbody,
    .io-table tr,
    .io-table td { display: block; width: 100%; box-sizing: border-box; }
    .io-table tr { border: 1px solid #ddd; border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
    .io-table td { border: 0; border-bottom: 1px solid #eee; padding: 10px; }
    .io-table td:last-child { border-bottom: 0; }
    .io-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 600;
        color: #666;
        margin-bottom: 3px;
    }
    .io-table .io-table-detail-row { border: 0; margin: 0; }
    .io-table .io-table-detail-row td { padding: 0; }
}

/* ================================================================
   Modales globales de la intranet
   ================================================================ */
.io-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.io-modal.is-open { display: flex; }
.io-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .52);
}
.io-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    max-height: min(90vh, 760px);
    overflow: auto;
    padding: 24px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    box-sizing: border-box;
}
.io-modal__dialog--danger { border-top: 4px solid #b00020; }
.io-modal__dialog--success { border-top: 4px solid #22c55e; }
.io-modal__dialog--warning { border-top: 4px solid #f59e0b; }
.io-modal__dialog--error { border-top: 4px solid #ef4444; }
.io-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #555;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.io-modal__close:hover { background: #f1f1f1; }
.io-modal__dialog h3 { margin: 0 42px 12px 0; }
.io-modal__message { line-height: 1.55; }
.io-modal__form { margin-top: 18px; }
.io-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}
.io-modal__icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #f0f0f0;
    font-weight: 700;
}
.io-modal__dialog--success .io-modal__icon { background: #ecfdf3; color: #15803d; }
.io-modal__dialog--warning .io-modal__icon { background: #fff7ed; color: #b45309; }
.io-modal__dialog--error .io-modal__icon,
.io-modal__dialog--danger .io-modal__icon { background: #fef2f2; color: #b00020; }
.io-button--small { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.io-form--compact { gap: 8px; }
.io-check-grid--compact { margin-bottom: 8px; }
.io-note--warning { padding: 10px 12px; border: 1px solid #f59e0b; border-radius: 8px; background: #fff7ed; margin-bottom: 16px; }
body.io-modal-open { overflow: hidden; }

@media (max-width: 700px) {
    .io-modal { padding: 10px; align-items: flex-end; }
    .io-modal__dialog { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; padding: 20px 16px; }
    .io-modal__footer { flex-direction: column-reverse; }
    .io-modal__footer .io-button { width: 100%; }
}
