/* ============================================================
   CIMA SYSTEM — Global Styles
   Versión: v9.2.0
============================================================ */

:root {
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --accent-color: #3b82f6;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --radius: 16px;
    --font-main: 'Segoe UI', system-ui, sans-serif;
}

[data-theme="dark"] {
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-color: #60a5fa;
}

* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body { font-family: var(--font-main); background: var(--bg-gradient); background-attachment: fixed; color: var(--text-primary); height: 100vh; overflow: hidden; transition: background 0.3s; }

.glass { background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); border-radius: var(--radius); }

/* Layout */
#app-shell { display: grid; grid-template-rows: 60px 1fr; grid-template-columns: 260px 1fr; height: 100vh; gap: 1rem; padding: 1rem; }
@media (max-width: 768px) {
    #app-shell { grid-template-columns: 1fr; grid-template-rows: 60px 1fr; }
    .sidebar { display: none; position: absolute; z-index: 50; height: calc(100% - 80px); width: 80%; }
    .sidebar.active { display: flex; }
}

/* Header */
header { display: flex; justify-content: space-between; align-items: center; padding: 0 1.5rem; z-index: 10; }
.brand { font-weight: 700; font-size: 1.5rem; letter-spacing: -0.5px; }
.brand span { color: var(--accent-color); }

/* Sidebar */
.sidebar { flex-direction: column; gap: 0.5rem; overflow-y: auto; padding: 1rem; }
.nav-item { padding: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; border-radius: 12px; color: var(--text-secondary); transition: 0.2s; }
.nav-item:hover, .nav-item.active { background: rgba(59, 130, 246, 0.1); color: var(--accent-color); }

/* Main */
main { overflow-y: auto; padding-right: 5px; padding-bottom: 20px; }

/* Forms & UI */
.form-group { margin-bottom: 1rem; }
label { display: block; margin-bottom: 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }
input, select, textarea { width: 100%; padding: 12px; background: rgba(255, 255, 255, 0.4); border: 1px solid var(--glass-border); border-radius: 8px; color: var(--text-primary); margin-bottom: 0.5rem; }
textarea { resize: vertical; min-height: 100px; }

/* Chips */
.chip-container { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 6px 12px; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.3); border-radius: 20px; font-size: 0.85rem; cursor: pointer; user-select: none; }
.chip:hover { background: rgba(59, 130, 246, 0.2); }
.chip.active { background: var(--accent-color); color: white; border-color: var(--accent-color); }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: 0.2s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent-color); color: white; }
.btn-secondary { background: rgba(255,255,255,0.3); color: var(--text-primary); }
.btn-danger { background: var(--danger-color); color: white; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 100; display: none; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-content { width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto; padding: 2rem; position: relative; }
.close-modal { position: absolute; top: 1rem; right: 1rem; cursor: pointer; font-size: 1.5rem; color: var(--text-secondary); }

/* Helpers */
.hidden { display: none !important; }
.w-full { width: 100%; }
.text-bold { font-weight: 700; }
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media(max-width: 600px) { .grid-2 { grid-template-columns: 1fr; } }
