/* ============================================
   GESTIÓN TAREAS · Notion Design System
   ============================================ */

/* --- Notion Color Palette --- */
:root {
  --bg:    #FFFFFF;
  --bg2:   #F7F8FA;
  --bg3:   #EBECEE;
  --tx:    #37352F;
  --tx2:   #9B9A97;
  --tx3:   #B4B2AE;
  --ac:    #2383E2;
  --ac2:   #0B6BCB;
  --gr:    #4AAF57;
  --rd:    #E03E3E;
  --or:    #D9730D;
  --yl:    #DFAB01;
  --br:    #E9E9E7;
  --sh:    0 1px 3px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.03);
  --sh2:   0 2px 8px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
  /* Legacy mapping */
  --cream: var(--bg2);
  --ink:   var(--tx);
  --gold:  var(--ac);
  --gold-light: var(--ac);
  --gold-pale:  var(--bg2);
  --terracotta: var(--rd);
  --sage:  var(--gr);
  --slate: var(--tx2);
  --white: var(--bg);
  --border: var(--br);
  --shadow: var(--sh);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--tx);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--ac); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =============================================
   LOGIN / REGISTER (index.php, register.php)
   ============================================= */
body.login-page,
body.register-page {
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container { width: 100%; max-width: 400px; }

.login-card,
.register-card {
  background: var(--bg);
  border-radius: 8px;
  padding: 40px 32px 32px;
  box-shadow: var(--sh2);
}

.register-container { width: 100%; max-width: 480px; }

.logo-section { text-align: center; margin-bottom: 28px; }
.logo-icon { display: none; }
.logo-title { font-size: 22px; font-weight: 700; color: var(--tx); letter-spacing: -0.3px; }
.logo-subtitle { font-size: 13px; color: var(--tx2); margin-top: 4px; }

/* Messages */
.message-box,
.error-message,
.success-message {
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.4;
}
.message-box.success,
.success-message {
  background: rgba(74,175,87,0.06);
  border: 1px solid rgba(74,175,87,0.15);
  color: var(--gr);
}
.message-box.error,
.error-message {
  background: rgba(224,62,62,0.06);
  border: 1px solid rgba(224,62,62,0.15);
  color: var(--rd);
}
.msg-icon, .error-icon, .success-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.msg-text, .error-text, .success-text { font-size: 14px; line-height: 1.4; }
.msg-text a { color: var(--ac); font-weight: 500; text-decoration: none; }
.msg-text a:hover { text-decoration: underline; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--tx); margin-bottom: 4px; }
.form-group label .required { color: var(--rd); }
.form-group label .optional { color: var(--tx3); font-weight: 400; font-size: 12px; }

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 15px;
  color: var(--tx);
  background: var(--bg);
  border: 1px solid var(--br);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 2px rgba(35,131,226,0.15);
}
.form-control::placeholder { color: var(--tx3); }
.form-control.error { border-color: var(--rd); }
textarea.form-control { resize: vertical; min-height: 80px; }

.btn-submit {
  width: 100%;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: white;
  background: var(--tx);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-submit:hover { background: #2B2A26; }
.btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.form-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--br);
}
.form-footer p { font-size: 13px; color: var(--tx2); }
.form-footer a { color: var(--ac); text-decoration: none; font-weight: 500; }
.form-footer a:hover { text-decoration: underline; }

.info-box {
  background: var(--bg2);
  border: 1px solid var(--br);
  border-radius: 4px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.info-box p { font-size: 13px; color: var(--tx2); }

/* =============================================
   PROFILE PAGES (profile.php, mi-perfil.php)
   ============================================= */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 45px;
  background: var(--bg);
  border-bottom: 1px solid var(--br);
}

.profile-wrap {
  max-width: 600px;
  margin: 40px auto;
  padding: 0 20px;
  width: 100%;
}
.profile-card {
  background: var(--bg);
  border: 1px solid var(--br);
  border-radius: 8px;
  padding: 32px;
  box-shadow: var(--sh);
}
.profile-avatar-wrap {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-header { text-align: center; margin-bottom: 28px; }
.avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  color: white;
  margin: 0 auto 12px;
  background: var(--ac);
}
.profile-header h1 { font-size: 20px; font-weight: 600; color: var(--tx); letter-spacing: -0.2px; }
.profile-header p { font-size: 14px; color: var(--tx2); margin-top: 4px; }

.avatar-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.avatar-opt {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.avatar-opt:hover { border-color: var(--ac); box-shadow: 0 0 0 2px rgba(35,131,226,0.2); }
.avatar-opt.active { border-color: var(--ac); box-shadow: 0 0 0 2px rgba(35,131,226,0.2); }

/* =============================================
   ADMIN PANEL (admin/index.php)
   ============================================= */
.admin-wrap {
  max-width: 1100px;
  margin: 32px auto;
  padding: 0 24px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg);
  border: 1px solid var(--br);
  border-radius: 6px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: white;
}
.stat-icon.org { background: var(--ac); }
.stat-icon.users { background: var(--gr); }
.stat-icon.active { background: #2383E2; }
.stat-icon.pending { background: var(--or); }
.stat-icon.banned { background: var(--rd); }
.stat-number { font-size: 24px; font-weight: 600; color: var(--tx); line-height: 1; letter-spacing: -0.3px; }
.stat-label { font-size: 12px; color: var(--tx2); margin-top: 2px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg);
  border: 1px solid var(--br);
  border-radius: 6px;
  overflow: hidden;
}
.admin-table th {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--tx2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  text-align: left;
  border-bottom: 1px solid var(--br);
  background: var(--bg2);
}
.admin-table td {
  padding: 10px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--br);
}
.admin-table tr:last-child td { border-bottom: none; }

/* =============================================
   ORG PANEL (org/index.php)
   ============================================= */
.org-wrap {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 24px;
}
.org-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.org-header h1 { font-size: 20px; font-weight: 600; color: var(--tx); letter-spacing: -0.2px; }
.org-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.org-card {
  background: var(--bg);
  border: 1px solid var(--br);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--sh);
}
.org-card h2 { font-size: 16px; font-weight: 600; color: var(--tx); margin-bottom: 16px; }

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--br);
  background: transparent;
  color: var(--tx);
  transition: all 0.1s;
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn:hover { background: var(--bg2); }
.btn-primary { background: var(--tx); color: white; border: none; }
.btn-primary:hover { background: #2B2A26; }
.btn-danger { color: var(--rd); border-color: rgba(224,62,62,0.2); }
.btn-danger:hover { background: rgba(224,62,62,0.06); }
.btn-small { padding: 4px 8px; font-size: 12px; }

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  font-size: 14px;
  color: var(--ac);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

.badge {
  display: inline-block;
  background: var(--bg2);
  color: var(--tx2);
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 3px;
  line-height: 1.5;
}
.badge.active { background: rgba(74,175,87,0.1); color: var(--gr); }
.badge.inactive { background: rgba(224,62,62,0.1); color: var(--rd); }
.badge.pending { background: rgba(217,115,13,0.1); color: var(--or); }

/* =============================================
   RESPONSIVE (general)
   ============================================= */
@media (max-width: 640px) {
  .login-card, .register-card { padding: 28px 20px 24px; }
  .profile-card { padding: 20px; }
  .org-grid { grid-template-columns: 1fr; }
  .admin-wrap { padding: 0 12px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
