:root { --primary: #0056b3; --success: #16a34a; --danger: #dc2626; --warning: #d97706; --bg: #f1f5f9; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); margin: 0; padding: 15px; color: #1e293b; }

/* -- PANTALLA LOGIN -- */
.login-body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; background: #0f172a; padding: 0; }
.login-box { background: #1e293b; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.3); width: 100%; max-width: 340px; text-align: center; color: white; }
.logo-bg { background: white; padding: 10px 15px; border-radius: 8px; display: inline-block; margin-bottom: 20px; }
.logo-login { max-width: 200px; height: auto; display: block; }
.login-box h2 { margin-top: 0; margin-bottom: 20px; font-size: 1.2em; color: #cbd5e1; font-weight: 500; }
.login-box input { width: 100%; padding: 12px; margin: 8px 0 16px; border: 1px solid #334155; background: #0f172a; color: white; border-radius: 6px; font-size: 16px; }
.login-box input:focus { outline: none; border-color: #3b82f6; }
.login-box button { width: 100%; padding: 12px; background: #2563eb; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 16px; transition: 0.2s; }
.login-box button:hover { background: #1d4ed8; }
.error { color: #f87171; font-size: 0.9em; margin-bottom: 15px; }

/* -- ESTRUCTURA PRINCIPAL -- */
.container { max-width: 1200px; margin: auto; background: white; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.06); overflow: hidden; }
.header { background: #0056b3; padding: 15px 25px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 15px; color: white; }
.header-brand { display: flex; align-items: center; gap: 15px; }
.logo-wrapper { background: #ffffff; padding: 6px 12px; border-radius: 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,0.15); }
.logo-header { max-width: 160px; height: auto; display: block; object-fit: contain; }
h1 { font-size: 1.3em; margin: 0; font-weight: 600; opacity: 0.95; }
.user-tag { background: rgba(255,255,255,0.2); padding: 4px 10px; border-radius: 12px; font-size: 0.85em; margin-left: 10px; font-weight: normal; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.main-content { padding: 25px; }

/* -- BOTONES Y CONTROLES -- */
.btn-backup { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); text-decoration: none; padding: 8px 12px; border-radius: 6px; font-size: 0.9em; font-weight: bold; transition: 0.2s; white-space: nowrap; }
.btn-backup:hover { background: rgba(255,255,255,0.25); }
.btn { padding: 8px 14px; border-radius: 6px; text-decoration: none; font-size: 0.9em; font-weight: bold; cursor: pointer; border: none; display: inline-block; text-align: center; }
.btn-logout { background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.4); }
.btn-submit { background: var(--primary); color: white; padding: 12px; font-size: 1em; width: 100%; }
.btn-cancel { background: #64748b; color: white; }
.btn-edit { background: #fef3c7; color: #92400e; padding: 6px 10px; }
.btn-delete { background: #fee2e2; color: #991b1b; padding: 6px 10px; }
.btn-move { background: #f1f5f9; color: #334155; padding: 4px 8px; border: 1px solid #cbd5e1; text-decoration: none; border-radius: 4px; }
.btn-search { background: var(--primary); color: white; padding: 8px 14px; border-radius: 6px; border: none; cursor: pointer; }
.btn-clear-search { background: #e2e8f0; color: #334155; padding: 8px 12px; border-radius: 6px; text-decoration: none; font-weight: bold; }

/* -- NAVEGACIÓN Y TABS -- */
.tabs-bar { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 2px solid #e2e8f0; overflow-x: auto; scrollbar-width: none; }
.tabs-bar::-webkit-scrollbar { display: none; }
.tab-btn { padding: 10px 18px; border: none; background: none; font-size: 0.95em; font-weight: bold; cursor: pointer; color: #64748b; border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.controls-bar { background: #f8fafc; padding: 15px; border-radius: 8px; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 15px; align-items: center; justify-content: space-between; border: 1px solid #e2e8f0; }
.controls-left, .search-form { display: flex; flex-wrap: wrap; gap: 15px; align-items: center; }
.controls-bar select, .search-input { padding: 8px 12px; border-radius: 6px; border: 1px solid #cbd5e1; font-size: 0.95em; background: white; }
.search-input { width: 220px; margin: 0; color: #1e293b; }

/* -- FORMULARIOS -- */
form.main-form { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 30px; background: #f8fafc; padding: 20px; border-radius: 8px; border: 1px solid #e2e8f0; }
.full-width { grid-column: 1 / -1; }
label { display: block; font-weight: 600; margin-bottom: 5px; font-size: 0.85em; color: #475569; }
input:not(.login-box input), textarea, select { width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-family: inherit; font-size: 15px; background: white; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; }

/* -- TABLAS Y BADGES -- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 700px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
th { background: #f8fafc; font-size: 0.8em; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover { background: #f8fafc; }
tr.done td { opacity: 0.55; }
tr.done td.estado-col, tr.done td.acc-col { opacity: 1; }
.acciones { display: flex; gap: 6px; flex-wrap: nowrap; }
.hora-text { font-family: monospace; font-size: 1em; font-weight: bold; color: #334155; background: #e2e8f0; padding: 2px 6px; border-radius: 4px; }
.badge { padding: 6px 12px; border-radius: 20px; font-size: 0.85em; text-decoration: none; color: white; font-weight: bold; display: inline-block; white-space: nowrap; }
.badge.pendiente { background: var(--danger); }
.badge.realizada { background: var(--success); }
.badge.aviso { background: var(--warning); color: white; }
.badge-user { background: #e2e8f0; color: #475569; padding: 3px 8px; border-radius: 4px; font-size: 0.75em; font-weight: bold; }

/* -- CALENDARIO -- */
.fc-responsive-wrapper { margin-top: 10px; background: white; border-radius: 8px; border: 1px solid #e2e8f0; width: 100%; overflow-x: auto; }
#calendar { min-height: 600px; padding: 10px; }
.vacaciones-box { background: #fffbebfb; border: 1px solid #fef3c7; border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.vacaciones-box h3 { margin-top: 0; font-size: 1.05em; color: #b45309; margin-bottom: 12px; }

/* -- NOTAS / POST-ITS -- */
.form-nota-rapida { display: flex; gap: 15px; margin-bottom: 25px; align-items: stretch; flex-wrap: wrap; }
.form-nota-rapida textarea { flex-grow: 1; min-height: 80px; resize: vertical; border-radius: 8px; min-width: 250px; }
.form-nota-rapida-opciones { display: flex; flex-direction: column; gap: 10px; min-width: 200px; justify-content: space-between; }
.notas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.post-it { color: #334155; padding: 15px 20px 10px 20px; border-radius: 2px 15px 15px 15px; box-shadow: 2px 4px 10px rgba(0,0,0,0.08); position: relative; min-height: 160px; display: flex; flex-direction: column; justify-content: space-between; transition: transform 0.2s, box-shadow 0.2s; }
.post-it:hover { transform: scale(1.03) !important; box-shadow: 4px 8px 15px rgba(0,0,0,0.12); z-index: 10; }
.post-it.is-importante { border: 2px solid #ef4444; box-shadow: 0 0 15px rgba(239, 68, 68, 0.3); }
.pin-importante { position: absolute; top: -12px; right: -12px; font-size: 1.4em; background: white; border-radius: 50%; box-shadow: 0 3px 6px rgba(0,0,0,0.2); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; border: 1px solid #cbd5e1; z-index: 5; }
.post-it:nth-child(even) { transform: rotate(1.5deg); }
.post-it:nth-child(3n) { transform: rotate(-1.5deg); }
.post-it:nth-child(4n) { transform: rotate(0.5deg); }
.post-it-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 1px dashed rgba(0,0,0,0.2); padding-bottom: 5px; font-size: 0.8em; font-weight: bold; color: rgba(0,0,0,0.6); }
.post-it-text { white-space: pre-wrap; font-size: 1.05em; line-height: 1.4; margin-bottom: 15px; flex-grow: 1; }
.post-it-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(0,0,0,0.1); padding-top: 10px; flex-wrap: wrap; gap: 5px; }
.color-picker { display: flex; gap: 6px; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; cursor: pointer; border: 1px solid rgba(0,0,0,0.15); transition: transform 0.2s; }
.color-dot:hover { transform: scale(1.2); }
.btn-borrar-nota { background: none; border: none; color: #ef4444; cursor: pointer; padding: 5px; opacity: 0.8; font-weight: bold; text-decoration: none; font-size: 0.85em; }

/* -- ESTADÍSTICAS -- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 30px; }
.stat-card { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.stat-card h3 { margin: 0; color: #64748b; font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .numero { font-size: 2.5em; font-weight: bold; margin: 10px 0 0 0; color: #1e293b; }
.stat-card.c-blue .numero { color: #2563eb; }
.stat-card.c-red .numero { color: #dc2626; }
.stat-card.c-green .numero { color: #16a34a; }
.chart-container { background: white; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; margin-top: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }

/* -- RESPONSIVE -- */
@media (max-width: 768px) {
    body { padding: 0; }
    .container { border-radius: 0; }
    .main-content { padding: 15px; }
    .header { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px; }
    .header-actions { width: 100%; justify-content: space-between; }
    .form-actions { flex-direction: column; }
    .controls-bar, .controls-left { flex-direction: column; align-items: stretch; gap: 10px; }
    .search-form, .search-input { width: 100%; }
    .form-nota-rapida { flex-direction: column; }
    .form-nota-rapida-opciones { width: 100%; }
    #calendar { min-width: 550px; padding: 5px !important; }
    .fc .fc-toolbar { flex-direction: column !important; gap: 10px; align-items: center; }
}