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

:root {
  --bg: #f5f5f5;
  --surface: #fff;
  --primary: #4b5563;
  --primary-hover: #374151;
  --primary-light: #f3f4f6;
  --danger: #b91c1c;
  --danger-hover: #991b1b;
  --success: #4b5563;
  --success-hover: #374151;
  --warning: #92400e;
  --text: #111827;
  --text-secondary: #6b7280;
  --border: #d1d5db;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,.06);
}

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

/* ── Navbar ── */
.navbar {
  background: #1f2937;
  color: #fff;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.navbar .brand { font-size: 1.15rem; font-weight: 700; color: #fff; text-decoration: none; display: flex; align-items: center; letter-spacing: -.01em; }
.navbar .nav-links { display: flex; align-items: center; gap: .5rem; }
.navbar .nav-links a { color: #94a3b8; text-decoration: none; font-size: .85rem; padding: .4rem .75rem; border-radius: 6px; transition: .15s; }
.navbar .nav-links a:hover { background: #1e293b; color: #e2e8f0; }
.navbar .user-info { display: flex; align-items: center; gap: .75rem; font-size: .85rem; }
.navbar .user-info .rol { font-size: .7rem; background: var(--primary); padding: 2px 8px; border-radius: 4px; text-transform: uppercase; font-weight: 600; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border: none; border-radius: var(--radius); font-size: .85rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .15s; letter-spacing: .01em; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-hover); }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.5rem; font-size: 1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Container ── */
.container { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ── Cards ── */
.card { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.card-header h1, .card-header h2 { font-size: 1.4rem; font-weight: 700; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: .35rem; color: var(--text); }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: .6rem .8rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .9rem; outline: none; transition: border .15s; background: #fff;
}
.form-group input:focus, .form-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(75,85,99,.1); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.form-inline { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th { text-align: left; padding: .85rem 1rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary); background: #f8fafc; border-bottom: 2px solid var(--border); }
td { padding: .75rem 1rem; font-size: .875rem; border-bottom: 1px solid var(--border); }
tr:hover td { background: #f8fafc; }

/* ── Badges ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-pendiente { background: #fef3c7; color: #92400e; }
.badge-confirmada { background: #e5e7eb; color: #374151; }
.badge-en_progreso { background: #d1d5db; color: #1f2937; }
.badge-completada { background: #d1d5db; color: #1f2937; }
.badge-cancelada { background: #fee2e2; color: #991b1b; }
.badge-admin { background: var(--primary); color: #fff; }
.badge-cliente { background: #e5e7eb; color: #374151; }
.badge-activo { background: #d1d5db; color: #1f2937; }
.badge-inactivo { background: #fee2e2; color: #991b1b; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }

/* ── Hero ── */
.hero { background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #1f2937 100%); color: #fff; text-align: center; padding: 5rem 1.5rem; }
.hero h1 { font-size: 2.8rem; font-weight: 800; margin-bottom: 1rem; letter-spacing: -.02em; }
.hero p { font-size: 1.1rem; color: #9ca3af; max-width: 600px; margin: 0 auto 2rem; line-height: 1.6; }
.hero .hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .hero-btns .btn { padding: .8rem 2rem; font-size: 1rem; }

/* ── Features ── */
.features { padding: 4rem 1.5rem; max-width: 1000px; margin: 0 auto; }
.features h2 { text-align: center; font-size: 1.8rem; margin-bottom: 2.5rem; font-weight: 700; color: var(--text); }
.features .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; }
.feature-card { background: var(--surface); border-radius: var(--radius); padding: 2rem; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border); }
.feature-card .icon { font-size: 2.5rem; margin-bottom: 1rem; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: .5rem; font-weight: 600; }
.feature-card p { font-size: .875rem; color: var(--text-secondary); line-height: 1.5; }

/* ── Auth pages ── */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 60px); padding: 2rem; }
.auth-card { background: var(--surface); padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; }
.auth-card h2 { text-align: center; margin-bottom: 1.5rem; font-size: 1.5rem; }

/* ── Alerts ── */
.alert { padding: .75rem 1rem; border-radius: var(--radius); font-size: .875rem; margin-bottom: 1rem; display: none; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; }

/* ── Pagination ── */
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 1.5rem; }
.pagination button { padding: .4rem .85rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: .85rem; }
.pagination button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 2rem; width: 90%; max-width: 500px; box-shadow: var(--shadow-lg); }

/* ── Filters bar ── */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filters button { padding: .4rem 1rem; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: .8rem; font-weight: 500; transition: .15s; }
.filters button:hover { background: var(--bg); }
.filters button.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Empty state ── */
.empty { text-align: center; padding: 3rem; color: var(--text-secondary); }
.empty p { font-size: 1.1rem; margin-bottom: 1rem; }

/* ── Disponibilidad ── */
.slots { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.slots button { padding: .4rem .75rem; border: 1px solid var(--border); border-radius: 6px; font-size: .8rem; cursor: pointer; transition: .15s; }
.slots button.free { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.slots button.free:hover { background: #e5e7eb; }
.slots button.busy { background: #fef2f2; color: #b91c1c; border-color: #fecaca; cursor: not-allowed; }
.slots button.selected { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Admin quick links ── */
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.quick-link { background: var(--surface); border-radius: var(--radius); padding: 1.25rem; text-decoration: none; color: var(--text); box-shadow: var(--shadow); border-left: 4px solid var(--primary); transition: .15s; border: 1px solid var(--border); border-left: 4px solid var(--primary); }
.quick-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.quick-link h3 { font-size: 1rem; margin-bottom: .25rem; }
.quick-link p { font-size: .8rem; color: var(--text-secondary); }

/* ── Misc ── */
.text-sm { font-size: .85rem; }
.text-xs { font-size: .75rem; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mr-1 { margin-right: .5rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.mono { font-family: 'SF Mono', Consolas, monospace; }
.link { color: var(--primary); text-decoration: none; font-size: .875rem; }
.link:hover { text-decoration: underline; }
