:root {
  --ly-bg: #0f172a;
  --ly-surface: #1e293b;
  --ly-border: #334155;
  --ly-text: #f1f5f9;
  --ly-muted: #94a3b8;
  --ly-accent: #ea580c;
  --ly-accent-dark: #c2410c;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: var(--ly-bg); color: var(--ly-text); }
a { color: #38bdf8; }
code { background: #0b1220; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }

.ly-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.ly-login-card { width: min(100%, 400px); background: var(--ly-surface); border: 1px solid var(--ly-border); border-radius: 16px; padding: 28px; }
.ly-brand, .ly-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--ly-accent); display: grid; place-items: center; font-weight: 800; color: #fff; margin-bottom: 12px; }
.ly-muted, .ly-hint { color: var(--ly-muted); font-size: 0.9rem; }
.ly-form label { display: block; margin-bottom: 14px; font-size: 0.9rem; }
.ly-form input { width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--ly-border); background: #0b1220; color: var(--ly-text); }
.ly-btn { border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; font-weight: 600; }
.ly-btn-primary { background: var(--ly-accent); color: #fff; width: 100%; }
.ly-btn-primary:hover { background: var(--ly-accent-dark); }
.ly-alert { padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.ly-alert-error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); }
.ly-alert-success { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #bbf7d0; }
.ly-alert-info { background: rgba(59,130,246,.12); border: 1px solid rgba(59,130,246,.35); color: #dbeafe; }

.ly-admin-body { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.ly-sidebar { background: #111827; border-right: 1px solid var(--ly-border); padding: 20px 16px; display: flex; flex-direction: column; gap: 20px; }
.ly-sidebar-brand { display: flex; gap: 12px; align-items: center; }
.ly-sidebar-brand small { display: block; color: var(--ly-muted); }
.ly-nav { display: flex; flex-direction: column; gap: 6px; }
.ly-nav a { color: var(--ly-muted); text-decoration: none; padding: 10px 12px; border-radius: 8px; }
.ly-nav a.active, .ly-nav a:hover { background: rgba(234,88,12,.15); color: var(--ly-text); }
.ly-sidebar-foot { margin-top: auto; font-size: 0.85rem; color: var(--ly-muted); }
.ly-user { color: var(--ly-text); margin-bottom: 6px; }
.ly-main { padding: 24px; }
.ly-page h1 { margin: 0 0 8px; }
.ly-lead { color: var(--ly-muted); margin: 0 0 20px; max-width: 720px; }
.ly-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.ly-stat-card, .ly-card { background: var(--ly-surface); border: 1px solid var(--ly-border); border-radius: 12px; padding: 16px; }
.ly-stat-label { color: var(--ly-muted); font-size: 0.85rem; }
.ly-stat-value { display: block; font-size: 1.8rem; margin-top: 6px; }
.ly-list { margin: 0; padding-left: 20px; line-height: 1.6; }
.ly-table-wrap { overflow: auto; border: 1px solid var(--ly-border); border-radius: 12px; }
.ly-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ly-table th, .ly-table td { padding: 10px 12px; border-bottom: 1px solid var(--ly-border); text-align: left; }
.ly-table th { background: #111827; color: var(--ly-muted); }

/* Generador APK */
.ly-page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.ly-page-heading h1 { font-size: clamp(1.65rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.ly-eyebrow { display: block; color: #fb923c; font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; margin-bottom: 5px; }
.ly-btn-secondary { display: inline-flex; align-items: center; justify-content: center; color: var(--ly-text); background: #273449; border: 1px solid #3d4d63; text-decoration: none; white-space: nowrap; }
.ly-btn-secondary:hover { background: #334155; }
.ly-btn:disabled { opacity: .55; cursor: not-allowed; }
.ly-builder-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 22px; align-items: start; }
.ly-builder-controls { display: grid; gap: 16px; min-width: 0; }
.ly-form-section { padding: 21px; }
.ly-section-title { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 20px; }
.ly-section-title h2 { font-size: 1.05rem; margin: 1px 0 4px; }
.ly-section-title p { color: var(--ly-muted); font-size: .85rem; margin: 0; }
.ly-section-title-compact { margin-bottom: 15px; }
.ly-step { display: grid; place-items: center; flex: 0 0 34px; height: 34px; border-radius: 10px; background: rgba(234,88,12,.16); border: 1px solid rgba(251,146,60,.28); color: #fb923c; font-size: .72rem; font-weight: 800; }
.ly-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.ly-field-wide { grid-column: 1 / -1; }
.ly-field > span { display: block; color: #cbd5e1; font-size: .78rem; font-weight: 700; margin: 0 0 7px; }
.ly-field input, .ly-color-field input[type="text"] { width: 100%; color: var(--ly-text); background: #0b1220; border: 1px solid #3b4a60; border-radius: 10px; padding: 11px 12px; outline: none; transition: border-color .2s, box-shadow .2s; }
.ly-field input:focus, .ly-color-field input[type="text"]:focus { border-color: #fb923c; box-shadow: 0 0 0 3px rgba(251,146,60,.12); }
.ly-upload { display: flex; gap: 13px; align-items: center; margin-top: 15px; border: 1px dashed #475569; border-radius: 12px; background: rgba(15,23,42,.45); padding: 15px; cursor: pointer; transition: border-color .2s, background .2s; }
.ly-upload:hover { border-color: #fb923c; background: rgba(234,88,12,.07); }
.ly-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ly-upload-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: rgba(234,88,12,.15); color: #fb923c; font-size: 1.3rem; }
.ly-upload strong, .ly-upload small { display: block; }
.ly-upload small { color: var(--ly-muted); margin-top: 3px; }
.ly-color-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 11px; }
.ly-color-field { display: flex; align-items: center; gap: 10px; background: #111827; border: 1px solid #334155; border-radius: 11px; padding: 10px; }
.ly-color-field > input[type="color"] { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.ly-color-field > span { min-width: 0; flex: 1; }
.ly-color-field strong { display: block; font-size: .76rem; margin-bottom: 4px; }
.ly-color-field input[type="text"] { padding: 4px 0; border: 0; border-radius: 0; background: transparent; color: var(--ly-muted); font-family: ui-monospace, monospace; font-size: .72rem; box-shadow: none; }
.ly-build-note { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; background: rgba(14,165,233,.08); border: 1px solid rgba(56,189,248,.18); border-radius: 10px; padding: 11px 12px; }
.ly-build-note span { color: #38bdf8; font-weight: 800; }
.ly-build-note p { color: #bae6fd; font-size: .78rem; line-height: 1.5; margin: 0; }
.ly-builder-actions { display: grid; grid-template-columns: .8fr 1.2fr; gap: 10px; }
.ly-builder-actions .ly-btn { width: 100%; min-height: 44px; }
.ly-preview-sticky { position: sticky; top: 24px; }
.ly-preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ly-preview-header h2 { margin: 0; font-size: .96rem; }
.ly-live-dot { color: #86efac; background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.25); border-radius: 99px; padding: 5px 8px; font-size: .62rem; font-weight: 900; letter-spacing: .1em; }
.ly-phone { --preview-primary:#FF5722; --preview-bg:#121212; --preview-surface:#1E1E1E; --preview-text:#E4E2E1; width: min(100%, 342px); margin: 0 auto; border-radius: 38px; border: 7px solid #020617; padding: 5px; background: #334155; box-shadow: 0 25px 55px rgba(0,0,0,.38), inset 0 0 0 1px #64748b; }
.ly-phone-speaker { width: 92px; height: 21px; margin: -5px auto -16px; position: relative; z-index: 2; border-radius: 0 0 13px 13px; background: #020617; }
.ly-phone-screen { position: relative; overflow: hidden; min-height: 615px; border-radius: 29px; color: var(--preview-text); background: var(--preview-bg); font-size: 12px; }
.ly-phone-status { display: flex; justify-content: space-between; padding: 13px 18px 8px; font-size: 9px; font-weight: 700; }
.ly-preview-brand { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.ly-preview-brand-stack { flex-direction: column; align-items: flex-start; gap: 8px; }
.ly-preview-wordmark strong { display: flex; align-items: baseline; gap: 4px; font-size: 18px; line-height: 1.1; }
.ly-word-hi { color: var(--preview-primary); }
.ly-word-rest { color: var(--preview-text); font-weight: 800; }
.ly-preview-logo-ly { background: var(--preview-bg); border: 1px solid color-mix(in srgb, var(--preview-primary) 35%, transparent); }
.ly-ly-mark { font-size: 11px; font-weight: 900; letter-spacing: -.04em; color: var(--preview-text); }
.ly-ly-mark::first-letter { color: var(--preview-primary); }
.ly-preview-brand > div:last-child { min-width: 0; }
.ly-preview-brand strong, .ly-preview-brand small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-preview-brand strong { font-size: 16px; }
.ly-preview-brand small { color: color-mix(in srgb, var(--preview-text) 60%, transparent); margin-top: 2px; font-size: 9px; }
.ly-preview-logo { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border-radius: 13px; overflow: hidden; background: var(--preview-primary); color: #fff; font-weight: 900; }
.ly-preview-logo img { width: 100%; height: 100%; object-fit: cover; }
.ly-preview-map { height: 180px; position: relative; overflow: hidden; margin: 0 12px; border-radius: 17px; background: linear-gradient(135deg,#34483d,#1d3b40); }
.ly-map-road { position: absolute; width: 120%; height: 18px; background: #788078; border: 5px solid #a6aca3; transform: rotate(-24deg); left: -10%; top: 55%; }
.ly-map-road.road-b { transform: rotate(39deg); top: 32%; }
.ly-map-pin { position: absolute; left: 55%; top: 31%; display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--preview-primary); color: #fff; box-shadow: 0 5px 12px #0008; }
.ly-map-pin::first-letter { transform: rotate(45deg); }
.ly-map-copy { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; border-radius: 12px; padding: 10px; background: rgba(2,6,23,.8); backdrop-filter: blur(8px); }
.ly-map-copy strong, .ly-map-copy small { display: block; }
.ly-map-copy small { color: #cbd5e1; margin-top: 2px; }
.ly-preview-chips { display: flex; gap: 7px; padding: 12px; overflow: hidden; }
.ly-preview-chips span { border: 1px solid color-mix(in srgb, var(--preview-primary) 45%, transparent); border-radius: 99px; padding: 6px 10px; background: color-mix(in srgb, var(--preview-primary) 12%, transparent); white-space: nowrap; }
.ly-preview-card { margin: 0 12px; border: 1px solid color-mix(in srgb, var(--preview-text) 12%, transparent); border-radius: 15px; padding: 14px; background: var(--preview-surface); }
.ly-preview-card > small { color: var(--preview-primary); font-size: 7px; font-weight: 900; letter-spacing: .13em; }
.ly-preview-card strong { display: block; font-size: 15px; margin-top: 3px; }
.ly-preview-card p { min-height: 29px; margin: 5px 0 10px; color: color-mix(in srgb, var(--preview-text) 62%, transparent); font-size: 9px; line-height: 1.5; }
.ly-preview-card button { width: 100%; border: 0; border-radius: 9px; padding: 9px; color: #fff; background: var(--preview-primary); font-weight: 800; font-size: 9px; }
.ly-preview-nav { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 9px 5px 12px; border-top: 1px solid color-mix(in srgb, var(--preview-text) 10%, transparent); background: var(--preview-surface); }
.ly-preview-nav span { display: grid; place-items: center; gap: 2px; color: color-mix(in srgb, var(--preview-text) 55%, transparent); font-size: 16px; }
.ly-preview-nav span:first-child { color: var(--preview-primary); }
.ly-preview-nav small { font-size: 7px; }
.ly-preview-help { color: var(--ly-muted); max-width: 342px; margin: 12px auto 0; font-size: .72rem; line-height: 1.5; text-align: center; }
.ly-build-history { margin-top: 22px; }
.ly-status { display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 8px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.ly-status-queued { color: #fde68a; background: rgba(234,179,8,.13); }
.ly-status-building { color: #7dd3fc; background: rgba(14,165,233,.13); }
.ly-status-success { color: #86efac; background: rgba(34,197,94,.13); }
.ly-status-failed { color: #fca5a5; background: rgba(239,68,68,.13); }

/* Categorías app */
.ly-categories-page .ly-stat-card-inline { min-width: 120px; padding: 14px 16px; }
.ly-categories-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.ly-category-create-form { display: grid; gap: 12px; }
.ly-table-categories td { vertical-align: middle; }
.ly-row-muted { opacity: .62; }
.ly-cat-icon { margin-left: 6px; }
.ly-order-actions { display: flex; gap: 4px; }
.ly-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.ly-btn-icon { width: 30px; height: 30px; border: 1px solid #475569; border-radius: 8px; background: #1e293b; color: #e2e8f0; cursor: pointer; }
.ly-btn-icon:hover { border-color: #fb923c; color: #fb923c; }
.ly-btn-small { width: auto; min-height: 34px; padding: 6px 10px; font-size: .78rem; }
.ly-btn-danger { background: rgba(239,68,68,.18); border: 1px solid rgba(239,68,68,.35); color: #fecaca; }
.ly-btn-danger:hover { background: rgba(239,68,68,.28); }
.ly-preview-chips-static { display: flex; flex-wrap: wrap; gap: 8px; }
.ly-preview-chips-static span { border: 1px solid rgba(251,146,60,.35); border-radius: 999px; padding: 6px 12px; background: rgba(234,88,12,.12); font-size: .82rem; }
.ly-preview-chips-card h2 { margin: 0 0 12px; font-size: .95rem; }

@media (max-width: 900px) {
  .ly-admin-body { grid-template-columns: 1fr; }
  .ly-sidebar { border-right: 0; border-bottom: 1px solid var(--ly-border); }
  .ly-builder-layout { grid-template-columns: 1fr; }
  .ly-preview-sticky { position: static; }
}

@media (max-width: 560px) {
  .ly-main { padding: 17px; }
  .ly-page-heading { display: block; }
  .ly-page-heading .ly-btn { width: 100%; margin-top: 12px; }
  .ly-form-grid, .ly-color-grid, .ly-builder-actions { grid-template-columns: 1fr; }
  .ly-field-wide { grid-column: auto; }
  .ly-form-section { padding: 16px; }
  .ly-categories-layout { grid-template-columns: 1fr; }
}
