:root {
  --primary: #0ea5e9;
  --primary-dark: #0369a1;
  --secondary: #06b6d4;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --gray: #64748b;
  --light: #f1f5f9;
  --white: #ffffff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.2);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f8fafc; color: var(--dark); }
.hidden { display: none !important; }

/* LOGIN */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0c4a6e 0%, #0ea5e9 50%, #06b6d4 100%); }
.login-card { background: white; padding: 40px; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; }
.login-header { text-align: center; margin-bottom: 30px; }
.logo-fish { font-size: 48px; display: block; margin-bottom: 10px; }
.login-header h1 { color: var(--primary-dark); font-size: 28px; }
.login-header p { color: var(--gray); }
.login-card label { display: block; margin-top: 15px; margin-bottom: 5px; font-weight: 600; color: var(--dark-2); font-size: 14px; }
.login-card input { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px; font-size: 15px; transition: border 0.2s; }
.login-card input:focus { outline: none; border-color: var(--primary); }
.btn-primary { width: 100%; padding: 13px; background: var(--primary); color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; margin-top: 20px; transition: background 0.2s; }
.btn-primary:hover { background: var(--primary-dark); }
.error-msg { color: var(--danger); margin-top: 10px; font-size: 14px; text-align: center; }
.login-hint { margin-top: 20px; padding: 10px; background: var(--light); border-radius: 6px; font-size: 12px; text-align: center; color: var(--gray); }

/* APP */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: var(--dark); color: white; display: flex; flex-direction: column; position: fixed; height: 100vh; }
.sidebar-header { padding: 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--dark-3); }
.sidebar-header h2 { font-size: 18px; }
.sidebar-header small { color: #94a3b8; }
#navMenu { flex: 1; padding: 15px 0; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; color: #cbd5e1; text-decoration: none; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.nav-item:hover { background: var(--dark-2); color: white; }
.nav-item.active { background: var(--primary); color: white; border-left: 3px solid var(--secondary); }
.nav-item span { font-size: 18px; }
.sidebar-footer { padding: 15px; border-top: 1px solid var(--dark-3); }
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: bold; }
.user-info small { color: #94a3b8; }
.btn-logout { width: 100%; padding: 8px; background: var(--danger); color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { background: #dc2626; }

.main-content { flex: 1; margin-left: 240px; }
.topbar { background: white; padding: 20px 30px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; }
.topbar h1 { color: var(--dark); font-size: 24px; }
.topbar-right { color: var(--gray); font-size: 14px; }
.view-content { padding: 30px; }

/* DASHBOARD */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 30px; }
.stat-card { background: white; padding: 20px; border-radius: 12px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; }
.stat-info small { color: var(--gray); font-size: 13px; }
.stat-info h2 { font-size: 28px; margin-top: 5px; color: var(--dark); }
.stat-icon { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.bg-blue { background: #dbeafe; color: #1e40af; }
.bg-green { background: #d1fae5; color: #065f46; }
.bg-purple { background: #ede9fe; color: #5b21b6; }
.bg-yellow { background: #fef3c7; color: #92400e; }
.bg-pink { background: #fce7f3; color: #9d174d; }
.bg-cyan { background: #cffafe; color: #155e75; }
.bg-orange { background: #ffedd5; color: #9a3412; }
.bg-red { background: #fee2e2; color: #991b1b; }

.dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dashboard-row { grid-template-columns: 1fr; } }
.dash-card { background: white; padding: 20px; border-radius: 12px; box-shadow: var(--shadow); }
.dash-card h3 { margin-bottom: 15px; color: var(--dark-2); }
.dash-list { list-style: none; }
.dash-list li { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.dash-list li:last-child { border-bottom: none; }

/* BOTONES Y FILTROS */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.btn-add { background: var(--primary); color: white; border: none; padding: 10px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-add:hover { background: var(--primary-dark); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.filters select, .filters input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }

/* TABLA */
.table-card { background: white; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { background: var(--light); text-align: left; padding: 12px 15px; font-size: 13px; color: var(--dark-2); font-weight: 600; text-transform: uppercase; }
td { padding: 12px 15px; border-top: 1px solid var(--border); font-size: 14px; }
tr:hover { background: #f8fafc; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #e2e8f0; color: #475569; }
.actions { display: flex; gap: 6px; }
.btn-sm { padding: 6px 10px; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; }
.btn-edit { background: var(--warning); color: white; }
.btn-del { background: var(--danger); color: white; }
.btn-view { background: var(--primary); color: white; }
.empty { text-align: center; padding: 40px; color: var(--gray); }

/* MODAL */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.modal-card { position: relative; background: white; border-radius: 12px; max-width: 600px; width: 100%; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 25px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-close { background: none; border: none; font-size: 28px; cursor: pointer; color: var(--gray); }
.modal-body { padding: 25px; overflow-y: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--dark-2); }
.form-group label .optional-hint { font-weight: 400; color: var(--gray); font-size: 12px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; font-family: inherit; }
.form-group textarea { min-height: 70px; resize: vertical; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-cancel { padding: 10px 18px; background: var(--light); color: var(--dark); border: none; border-radius: 6px; cursor: pointer; }
.btn-save { padding: 10px 18px; background: var(--primary); color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.btn-save:hover { background: var(--primary-dark); }
.bar { height: 8px; background: var(--light); border-radius: 4px; overflow: hidden; margin-top: 4px; }
.bar-fill { height: 100%; background: var(--primary); transition: width 0.3s; }
.bar-fill.warn { background: var(--warning); }
.bar-fill.danger { background: var(--danger); }

@media (max-width: 768px) { .sidebar { width: 70px; } .sidebar-header h2, .sidebar-header small, .user-info div, .nav-item { font-size: 0; } .nav-item span { font-size: 22px; } .main-content { margin-left: 70px; } .form-row { grid-template-columns: 1fr; } }
