@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --bg: #F3F0E8;
  --surface: #fff;
  --border: #E4E0D6;
  --ink: #232323;
  --muted: #8B8578;
  --topbar: #1F2A33;
  --accent: #E8A33D;
  --accent-ink: #3A2405;
  --danger: #A32D2D;
  --success: #3B6D11;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--ink); }

.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px; width: 320px; text-align: center; }
.login-logo { font-size: 30px; margin-bottom: 6px; }
.login-card h1 { font-family: 'Space Grotesk', sans-serif; font-size: 19px; margin: 0 0 4px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 0 0 18px; }
.login-error { background: #FCEBEB; color: #791F1F; font-size: 13px; padding: 8px 10px; border-radius: 8px; margin-bottom: 14px; }
.login-card label { display: block; text-align: left; font-size: 12.5px; font-weight: 600; color: #5B6670; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 12px; }
.login-card input { width: 100%; margin-top: 5px; padding: 10px 12px; border-radius: 9px; border: 1.5px solid #DAD6CC; font-size: 15px; }
.login-card button { width: 100%; padding: 12px; border-radius: 10px; border: none; background: var(--topbar); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; margin-top: 4px; }

.app-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: var(--topbar); color: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .subtitle { font-size: 12.5px; color: #B7C2CB; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: transparent; border: none; color: inherit; cursor: pointer; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 8px; flex-shrink: 0; }
.icon-btn:hover { background: rgba(255,255,255,0.08); }
.icon-btn.danger { color: var(--danger); }

.content { padding: 14px 16px; flex: 1; }

.input, select.input, textarea.input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 9px;
  border: 1.5px solid #DAD6CC; font-size: 15px; font-family: 'Inter', sans-serif; background: #fff; color: #232323;
}
textarea.input { min-height: 70px; resize: vertical; }
.field { display: block; margin-bottom: 14px; }
.field-label { font-size: 12.5px; font-weight: 600; color: #5B6670; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px; }

.btn-primary { width: 100%; padding: 12px; border-radius: 10px; border: none; background: var(--topbar); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; font-family: 'Space Grotesk', sans-serif; }
.btn-primary:disabled { background: #C9C4B6; cursor: not-allowed; }
.btn-secondary { width: 100%; padding: 11px; border-radius: 10px; border: 1.5px solid #DAD6CC; background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; color: #3A362E; font-family: 'Space Grotesk', sans-serif; }
.btn-dashed { width: 100%; padding: 12px; border-radius: 10px; border: 1.5px dashed #B7B1A1; background: #fff; color: #3A362E; font-weight: 600; font-size: 14.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; font-family: 'Space Grotesk', sans-serif; }

.card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.card.clickable { cursor: pointer; }
.card .name { font-weight: 600; font-size: 15px; color: #232323; }
.card .meta { font-size: 12.5px; color: var(--muted); }

.chip { border: 1.5px solid #DAD6CC; background: #fff; color: #5B6670; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; font-family: 'Inter', sans-serif; }
.chip.active { border-color: #2B6CB0; background: #EAF1FA; color: #2B6CB0; }
.chip-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; }

.avatar { width: 40px; height: 40px; border-radius: 50%; background: #EFE9DA; color: #8A6A2E; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; font-family: 'Space Grotesk', sans-serif; }

.empty { text-align: center; padding: 48px 24px; color: #8B8578; }
.empty .icon { font-size: 26px; margin-bottom: 8px; opacity: .6; }
.empty .title { font-weight: 600; color: #4A463C; margin-bottom: 4px; font-family: 'Space Grotesk', sans-serif; }
.empty .body { font-size: 13.5px; line-height: 1.5; }

.fab { position: sticky; bottom: 16px; margin-left: auto; margin-right: 16px; display: flex; align-items: center; gap: 8px; background: var(--accent); color: var(--accent-ink); border: none; border-radius: 999px; padding: 12px 18px; font-weight: 600; font-size: 14.5px; box-shadow: 0 4px 14px rgba(0,0,0,0.18); cursor: pointer; font-family: 'Space Grotesk', sans-serif; width: fit-content; }
.fab-row { display: flex; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid #DAD6CC; background: #fff; color: #3A362E; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stepper button.plus { background: var(--topbar); color: #fff; border-color: var(--topbar); }
.stepper input { width: 46px; text-align: center; border: 1.5px solid #DAD6CC; border-radius: 8px; padding: 6px 2px; font-family: 'IBM Plex Mono', monospace; font-size: 14.5px; }

.cat-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .3px; }

.foto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.foto-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #EDEAE0; }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.foto-thumb .del-foto { position: absolute; top: 4px; right: 4px; background: rgba(20,18,14,0.6); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 12px; line-height: 1; }

.resumen-box { margin-top: 12px; background: #232323; border-radius: 10px; padding: 14px; position: relative; }
.resumen-box pre { color: #EDEDED; font-size: 12.5px; white-space: pre-wrap; font-family: 'IBM Plex Mono', monospace; margin: 0; padding-right: 60px; }
.resumen-box .copy-btn { position: absolute; top: 10px; right: 10px; background: #3A3A3A; border: none; border-radius: 7px; padding: 5px 9px; color: #fff; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(20,18,14,0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-sheet { background: var(--bg); width: 100%; max-width: 480px; max-height: 85vh; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 14px 16px 10px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.modal-header .title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 15.5px; flex: 1; }
.modal-body { padding: 10px 16px; overflow-y: auto; }

.toast { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); background: #232323; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: 13px; z-index: 100; }
.toast.error { background: #A32D2D; }

.section-title { font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 14px; color: #4A463C; margin-bottom: 10px; }
.datos-box { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; color: #5B6670; }
.datos-box .row { display: flex; gap: 8px; margin-bottom: 4px; }

a { color: inherit; }
