/* Fichas Profes MAYC — Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #7c3aed;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 1rem; }

/* Header */
.header {
  background: var(--primary);
  color: white;
  padding: 1rem 0;
  box-shadow: var(--shadow);
}
.header .container { display: flex; align-items: center; gap: 1rem; }
.header h1 { font-size: 1.25rem; font-weight: 700; }
.header .subtitle { font-size: 0.85rem; opacity: 0.85; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; color: var(--primary); }
.card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.5rem; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  color: var(--text);
}
.form-group .hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
textarea { resize: vertical; min-height: 100px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #15803d; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* Availability Grid */
.grid-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.avail-grid {
  display: grid;
  grid-template-columns: 70px repeat(5, 1fr);
  gap: 2px;
  min-width: 420px;
  font-size: 0.78rem;
}
.grid-header {
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 0.4rem 0.2rem;
  font-weight: 600;
  border-radius: 4px;
}
.time-label {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.3rem 0.4rem;
  text-align: right;
  color: var(--text-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-radius: 4px;
}
.slot {
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.slot.available { background: #dcfce7; border-color: #86efac; }
.slot.available:hover { background: #bbf7d0; }
.slot.unavailable { background: #fee2e2; border-color: #fca5a5; }
.slot.unavailable:hover { background: #fecaca; }

.legend { display: flex; gap: 1rem; margin-top: 0.75rem; font-size: 0.8rem; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 0.35rem; }
.legend-swatch { width: 16px; height: 16px; border-radius: 3px; border: 2px solid; }
.legend-swatch.available { background: #dcfce7; border-color: #86efac; }
.legend-swatch.unavailable { background: #fee2e2; border-color: #fca5a5; }

/* Photo upload */
.foto-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.foto-area:hover { border-color: var(--primary); }
.foto-preview { max-width: 150px; max-height: 180px; border-radius: var(--radius); margin: 0.5rem auto; display: block; }

/* Profile preview */
.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
}
.preview-foto {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--border);
  flex-shrink: 0;
}
.preview-foto-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.preview-info h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.preview-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin: 0.5rem 0; }
.preview-tag {
  background: var(--primary);
  color: white;
  font-size: 0.75rem;
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
}
.preview-bio { font-size: 0.875rem; color: var(--text-muted); }

/* Admin table */
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th { background: var(--bg); padding: 0.6rem 0.75rem; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); }
.admin-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: #f8fafc; }
.admin-table .link-cell { font-family: monospace; font-size: 0.75rem; word-break: break-all; }

/* Login form */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-lg); width: 100%; max-width: 380px; }
.login-box h1 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.login-box .subtitle { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.5rem; }

/* Responsive */
@media (max-width: 640px) {
  .card { padding: 1rem; }
  .preview-card { flex-direction: column; align-items: center; text-align: center; }
}

/* Main page spacing */
main { padding: 1.5rem 0 3rem; }

/* Instruments tags input */
.tag-input-wrap { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem 0.5rem; min-height: 40px; cursor: text; }
.tag-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.tag-chip { background: var(--primary); color: white; border-radius: 9999px; padding: 0.15rem 0.6rem; font-size: 0.8rem; display: flex; align-items: center; gap: 0.25rem; }
.tag-chip button { background: none; border: none; color: white; cursor: pointer; padding: 0; line-height: 1; font-size: 0.85rem; opacity: 0.8; }
.tag-chip button:hover { opacity: 1; }
.tag-input-inner { border: none; outline: none; font-size: 0.875rem; min-width: 120px; flex: 1; padding: 0; background: transparent; }

/* Steps indicator */
.steps { display: flex; gap: 0.5rem; margin-bottom: 1.5rem; }
.step { flex: 1; text-align: center; font-size: 0.75rem; padding: 0.4rem; border-radius: var(--radius); background: var(--border); color: var(--text-muted); font-weight: 500; }
.step.active { background: var(--primary); color: white; }
.step.done { background: var(--success); color: white; }

/* Copy button */
.copy-btn { font-size: 0.75rem; padding: 0.2rem 0.5rem; cursor: pointer; }
