:root {
    --bg: #fff8f6;
    --panel: #ffffff;
    --ink: #2c2027;
    --muted: #74656d;
    --brand: #8f5b76;
    --brand-dark: #503247;
    --accent: #e8b8a5;
    --soft: #f6e7e2;
    --ok: #197b52;
    --warn: #b66a00;
    --bad: #b43636;
    --line: #eadbd6;
    --shadow: 0 12px 30px rgba(80, 50, 71, .12);
    --radius: 20px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.site-header, .admin-header {
    position: sticky; top: 0; z-index: 10; background: rgba(255, 248, 246, .94);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--brand); color: white; box-shadow: var(--shadow); }
.top-nav { display: flex; gap: 8px; font-size: 14px; }
.top-nav a, .logout-link { color: var(--brand-dark); padding: 8px 10px; border-radius: 999px; background: var(--soft); font-weight: 700; }
.main { width: min(1120px, 100%); margin: 0 auto; padding: 20px 16px 60px; }
.hero { padding: 18px; border-radius: 28px; background: linear-gradient(135deg, #fff, #f7e2dc); box-shadow: var(--shadow); margin-bottom: 18px; }
.hero-kicker { color: var(--brand); font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; }
h1 { font-size: clamp(30px, 8vw, 54px); line-height: .98; margin: 10px 0; letter-spacing: -.05em; }
h2 { font-size: clamp(24px, 5vw, 36px); line-height: 1.05; margin: 22px 0 12px; letter-spacing: -.03em; }
h3 { margin: 0 0 8px; font-size: 20px; }
p { color: var(--muted); line-height: 1.55; }
.hero-actions { display: grid; gap: 10px; margin-top: 18px; }
.btn { border: 0; display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 12px 16px; border-radius: 16px; background: var(--brand); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 10px 24px rgba(143, 91, 118, .22); }
.btn:hover { filter: brightness(.98); }
.btn-secondary { background: #fff; color: var(--brand-dark); border: 1px solid var(--line); box-shadow: none; }
.btn-danger { background: var(--bad); }
.btn-warning { background: var(--warn); }
.btn-ok { background: var(--ok); }
.btn-small { min-height: 38px; padding: 8px 12px; font-size: 13px; border-radius: 12px; }
.grid { display: grid; gap: 14px; }
.service-grid { grid-template-columns: 1fr; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.service-card { display: grid; gap: 12px; }
.service-top { display: flex; gap: 12px; align-items: flex-start; }
.service-icon { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; background: var(--soft); font-size: 28px; flex: 0 0 auto; }
.meta-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; background: var(--soft); color: var(--brand-dark); font-size: 13px; font-weight: 800; }
.price { font-size: 18px; font-weight: 900; color: var(--brand-dark); }
.actions { display: grid; gap: 8px; }
.detail-card { display: grid; gap: 14px; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-size: 14px; color: var(--brand-dark); font-weight: 800; }
input, select, textarea { width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); padding: 12px; font: inherit; background: #fff; color: var(--ink); outline: none; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(143, 91, 118, .12); }
.help { font-size: 13px; color: var(--muted); margin: 0; }
.alert { padding: 12px 14px; border-radius: 16px; margin: 0 0 14px; font-weight: 700; }
.alert-success { background: #e4f6ed; color: #176844; }
.alert-error { background: #ffe7e7; color: #8d2323; }
.alert-info { background: #ece8ff; color: #42316e; }
.alert-warning { background: #fff2db; color: #7a4b00; }
.table-wrap { width: 100%; overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
th { color: var(--brand-dark); background: var(--soft); }
.status { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 12px; font-weight: 900; }
.status-pendiente, .status-pendiente-pago, .status-sin_constancia { background: #fff2db; color: #7a4b00; }
.status-confirmada, .status-validado, .status-atendida { background: #e4f6ed; color: #176844; }
.status-cancelada, .status-rechazado { background: #ffe7e7; color: #8d2323; }
.admin-body { background: #fbf7fb; }
.admin-header { background: rgba(251,247,251,.95); }
.admin-nav { position: sticky; top: 63px; z-index: 9; display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; border-bottom: 1px solid var(--line); background: rgba(251,247,251,.95); }
.admin-nav a { white-space: nowrap; padding: 9px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 800; color: var(--brand-dark); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); }
.stat strong { display: block; font-size: 28px; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 800; }
.appointment-card { display: grid; gap: 10px; }
.payment-box { border: 1px dashed var(--brand); background: #fff; padding: 14px; border-radius: 18px; }
.empty { border: 1px dashed var(--line); padding: 20px; border-radius: 18px; text-align: center; background: #fff; }
.site-footer { text-align: center; padding: 28px 16px; border-top: 1px solid var(--line); }
.site-footer p { margin: 0; font-size: 13px; }
.filters { display: grid; gap: 10px; margin-bottom: 14px; }
.inline-form { display: inline; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.badge-note { background: var(--brand-dark); color: #fff; padding: 12px 14px; border-radius: 18px; }
@media (min-width: 720px) {
    .main { padding: 30px 24px 70px; }
    .hero { padding: 34px; }
    .hero-actions, .actions { display: flex; flex-wrap: wrap; }
    .service-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: repeat(2, 1fr); }
    .filters { grid-template-columns: repeat(4, 1fr); align-items: end; }
    .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1040px) {
    .service-grid { grid-template-columns: repeat(3, 1fr); }
}
