/* ============================================================================
   DOC PANEL - ESTILO iOS
   ============================================================================ */

:root {
    --accent: #0075FF;
    --success: #34C759;
    --error: #FF3B30;
    --warning: #FF9500;
    --bg: #F8F9FA;
    --surface: #FFFFFF;
    --border: #E8E8E8;
    --text: #000000;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --sidebar-bg: #FFFFFF;
    --sidebar-border: #F0F0F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ============================================================================
   HEADER
   ============================================================================ */

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

.header-content p {
    font-size: 13px;
    color: var(--text-secondary);
}

.header-stats {
    display: flex;
    gap: 30px;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--accent);
}

.stat-label {
    font-size: 11px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ============================================================================
   MAIN LAYOUT
   ============================================================================ */

.main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

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

.btn-primary:hover {
    background: #0066E0;
}

.btn-primary:active {
    background: #0055C0;
}

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

.btn-secondary:hover {
    background: var(--border);
}

.btn-large {
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 15px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    padding: 12px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.15s;
}

.nav-item:hover {
    background: var(--bg);
    color: var(--text);
}

.nav-item.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--sidebar-border);
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

/* ============================================================================
   CONTENT
   ============================================================================ */

.content {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    background: var(--bg);
}

.content::-webkit-scrollbar {
    width: 8px;
}

.content::-webkit-scrollbar-track {
    background: transparent;
}

.content::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.2s;
}

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

.view h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

.view h3 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

.view h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 16px;
    margin-bottom: 8px;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(0, 117, 255, 0.1);
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.progress-bar {
    background: var(--border);
    border-radius: 4px;
    height: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    background: var(--success);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

.summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 8px 0;
}

.summary-item span {
    color: var(--text-secondary);
}

.summary-item strong {
    color: var(--text);
    font-weight: 600;
}

/* ============================================================================
   PROYECTO CARDS
   ============================================================================ */

.proyecto-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.proyecto-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(0, 117, 255, 0.15);
}

.proyecto-card h4 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.proyecto-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.4;
}

.proyecto-progress {
    margin-bottom: 12px;
}

.proyecto-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-tertiary);
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge.completado {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success);
}

.badge.pendiente {
    background: rgba(255, 149, 0, 0.1);
    color: var(--warning);
}

/* ============================================================================
   MODALS
   ============================================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
    max-width: 800px;
}

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

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-tertiary);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

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

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 117, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ============================================================================
   LISTAS
   ============================================================================ */

.tareas-list,
.usuarios-list,
.auditoria-list,
.proyectos-list,
.documentos-list,
.proyectos-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proyecto-item {
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.proyecto-item:hover {
    border-color: var(--accent);
}

/* ============================================================================
   ICONS STYLE iOS
   ============================================================================ */

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

.icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }

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

    .content {
        padding: 20px;
    }

    .header {
        padding: 16px 20px;
    }

    .header-stats {
        gap: 20px;
    }
}
