:root {
    --bg: #0a0d10;
    --surface: #12161b;
    --surface-2: #1a1f26;
    --border: #262d36;
    --text: #eef2f5;
    --text-muted: #8a96a3;
    --cyan: #00a9fa;
    --cyan-dim: #0077b3;
    --danger: #f87171;
    --ok: #34d399;
    --warn: #fbbf24;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
}

.brand {
    text-decoration: none;
    color: var(--text);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 0.5px;
}
.brand span {
    color: var(--cyan);
    font-weight: 600;
    margin-left: 6px;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid transparent;
    cursor: pointer;
}

.btn-primary {
    background: var(--cyan);
    color: #04222a;
}
.btn-primary:hover { background: #4ddfff; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--cyan); color: var(--cyan); }

.banner {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}
.banner-ok {
    background: rgba(52, 211, 153, 0.12);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: var(--ok);
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    color: var(--text-muted);
}
.empty-state p { margin-bottom: 20px; font-size: 16px; }

.table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 14px 16px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.row-vendido { opacity: 0.5; }

.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}
.tag-disponible { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.tag-reservado { background: rgba(251, 191, 36, 0.15); color: var(--warn); }
.tag-vendido { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }

.actions {
    white-space: nowrap;
    text-align: right;
}

.link-action {
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-left: 14px;
}
.link-action:first-child { margin-left: 0; }
.link-danger { color: var(--danger); }

.vehicle-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
}

.full-width { width: 100%; margin-bottom: 24px; }

input, select, textarea {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cyan);
}

textarea { resize: vertical; }

.form-actions {
    display: flex;
    gap: 12px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
}
.filter-bar input {
    flex: 1 1 160px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.vehicle-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.15s;
}
.vehicle-card:hover { border-color: var(--cyan); }

.vehicle-card h3 { margin: 0 0 6px; font-size: 17px; }
.vehicle-version { color: var(--text-muted); font-size: 14px; margin: 0 0 12px; }
.vehicle-price { color: var(--cyan); font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.vehicle-meta { color: var(--text-muted); font-size: 13px; margin: 0; }

.link-back {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    margin-bottom: 20px;
}
.link-back:hover { color: var(--cyan); }

.detail-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 560px;
}
.detail-card h1 { font-size: 24px; margin-bottom: 4px; }
.vehicle-price-big { color: var(--cyan); font-size: 30px; font-weight: 800; margin: 16px 0 24px; }

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
    padding: 16px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.detail-grid > div { display: flex; flex-direction: column; gap: 4px; }
.detail-label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.detail-obs { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }

.btn-wide { width: 100%; text-align: center; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-nav { display: flex; gap: 20px; }
.topbar-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}
.topbar-nav a:hover { color: var(--cyan); }

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 36px;
    width: 100%;
    max-width: 380px;
}
.brand-logo {
    height: 42px;
    width: 42px;
    border-radius: 50%;
    display: block;
}

.brand-logo-auth {
    height: 88px;
    width: 88px;
    border-radius: 50%;
    display: block;
    margin: 0 auto 20px;
}

.auth-card { text-align: center; }
.auth-card form { text-align: left; }

.brand-auth {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 24px;
    text-align: center;
}
.brand-auth span { color: var(--cyan); font-weight: 600; margin-left: 6px; }
.auth-card h2 { font-size: 18px; margin: 0 0 8px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.banner-error {
    background: rgba(248, 113, 113, 0.12);
    border: 1px solid rgba(248, 113, 113, 0.35);
    color: var(--danger);
}

.field-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 8px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 8px;
}
.photo-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(10, 13, 16, 0.8);
    color: var(--danger);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}

.thumb-mini {
    width: 56px;
    height: 42px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.thumb-empty { background: var(--surface-2); border: 1px dashed var(--border); }

.vehicle-card { padding: 0; overflow: hidden; }
.vehicle-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--surface-2);
}
.vehicle-card-img-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
}
.vehicle-card-body { padding: 16px 20px 20px; }

.detail-gallery { margin: -32px -32px 24px; }
.detail-photo-main {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0;
}
.detail-thumbs {
    display: flex;
    gap: 8px;
    padding: 12px 16px 0;
    overflow-x: auto;
}
.detail-thumb {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* ---------- Landing pública ---------- */

.landing-bg-logo {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-repeat: no-repeat;
    background-position: center 30%;
    background-size: 600px;
    opacity: 0.05;
    pointer-events: none;
}

.hero {
    text-align: center;
    padding: 90px 24px 70px;
    max-width: 720px;
    margin: 0 auto;
}
.hero-location {
    color: var(--text-muted);
    font-size: 14px;
    margin: 0 0 16px;
    letter-spacing: 0.5px;
}
.hero h1 {
    font-size: 42px;
    margin: 0 0 16px;
    line-height: 1.15;
}
.hero-sub {
    color: var(--text-muted);
    font-size: 17px;
    margin: 0 0 32px;
}
.hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.stats-bar {
    display: flex;
    justify-content: center;
    gap: 64px;
    padding: 32px 24px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(18, 22, 27, 0.6);
    flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-num {
    display: block;
    font-size: 30px;
    font-weight: 800;
    color: var(--cyan);
}
.stat-label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.section-destacados { padding-top: 56px; }
.section-contacto, .section-ubicacion { padding: 56px 24px; text-align: center; }
.section-contacto h2, .section-ubicacion h2 { font-size: 26px; margin-bottom: 8px; }

.ubicacion-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    text-align: left;
    margin-top: 24px;
    align-items: stretch;
}
.ubicacion-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}
.ubicacion-mapa {
    width: 100%;
    min-height: 260px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.footer {
    text-align: center;
    padding: 28px 24px 40px;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 640px) {
    .hero { padding: 56px 20px 48px; }
    .hero h1 { font-size: 30px; }
    .stats-bar { gap: 32px; }
    .ubicacion-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .container { padding: 20px 16px 48px; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    td { border-bottom: none; padding: 6px 16px; }
    tr { border-bottom: 1px solid var(--border); padding: 12px 0; }
    .actions { text-align: left; margin-top: 8px; }
}

.section-vender {
    padding: 40px 24px;
}
.vender-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.vender-card h2 { margin: 0 0 6px; font-size: 20px; }
.vender-card .subtitle { margin: 0; }
.btn-wide-sm { white-space: nowrap; }

.form-section-title {
    font-size: 15px;
    color: var(--cyan);
    margin: 24px 0 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-section-title:first-child { margin-top: 0; }

.gracias-card { text-align: center; max-width: 480px; margin: 0 auto; }
.gracias-nota { color: var(--text-muted); font-size: 13px; margin-top: 14px; }

.consultas-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.consulta-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    grid-template-columns: 140px 1fr auto;
    gap: 18px;
    align-items: center;
}
.consulta-fotos {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    height: 90px;
    border-radius: 8px;
    overflow: hidden;
}
.consulta-fotos img { width: 100%; height: 100%; object-fit: cover; }
.consulta-info h3 { margin: 0 0 4px; font-size: 16px; }
.consulta-contacto { font-weight: 600; margin: 8px 0 2px; }
.consulta-fecha { color: var(--text-muted); font-size: 12px; margin: 0; }
.consulta-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

@media (max-width: 640px) {
    .consulta-card { grid-template-columns: 1fr; }
    .consulta-fotos { height: 140px; }
    .consulta-actions { flex-direction: row; align-items: center; }
    .vender-card { flex-direction: column; align-items: stretch; text-align: center; }
}

.input-with-select {
    display: flex;
    gap: 8px;
}
.input-with-select input { flex: 1; min-width: 0; }
.input-with-select select {
    width: 90px;
    flex-shrink: 0;
}

.landing-bg-foto {
    background-size: cover;
    background-position: center;
    opacity: 0.22;
}
