:root {
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --bg-card-soft: #f9fafb;
    --accent: #2563eb;
    --accent-dark: #1d4ed8;
    --accent-soft: #dbeafe;
    --text-main: #111827;
    --text-muted: #4b5563;
    --border: #e5e7eb;
    --radius-lg: 18px;
    --radius-md: 10px;
    --shadow-soft: 0 14px 40px rgba(15, 23, 42, 0.12);
    --max-width: 880px;
}

/* RESET */

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

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #e5e7eb 0, #f3f4f6 40%, #e5e7eb 100%);
    color: var(--text-main);
    line-height: 1.6;
}

/* LAYOUT */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.section {
    padding: 2.5rem 0 2.75rem;
}

.main {
    min-height: calc(100vh - 120px);
}

/* HEADER */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: linear-gradient(135deg, #111827, #1f2937);
    color: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-weight: 600;
    font-size: 0.98rem;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* INTRO / ACCIONES */

.intro-card {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 1.75rem 1.5rem 1.8rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border);
}

.intro-card h1 {
    margin: 0 0 0.5rem;
    font-size: 1.7rem;
    font-weight: 650;
}

.intro-subtitle {
    margin: 0 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.8rem;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card-soft);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease, border-color 0.15s;
}

.action-card:hover {
    background: #eff6ff;
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.18);
    transform: translateY(-1px);
}

.action-card:active {
    transform: translateY(0);
    box-shadow: none;
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.action-card h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.action-card p {
    margin: 0.1rem 0 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* INFO */

.info-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 1.3rem 0 1rem;
}

.info-pill {
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    background: #f9fafb;
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.direct-contact {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.btn-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.btn-link:hover {
    text-decoration: underline;
}

.sep {
    margin: 0 0.35rem;
}

/* MODAL */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 50;
}

.modal-backdrop.open {
    display: flex;
}

.modal {
    background: #ffffff;
    border-radius: 24px;
    max-width: 420px;
    width: 100%;
    padding: 1.5rem 1.4rem 1.4rem;
    box-shadow: var(--shadow-soft);
    position: relative;
    border: 1px solid var(--border);
}

.modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    cursor: pointer;
}

.modal h2 {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
}

.modal-description {
    margin: 0 0 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* FORM */

.field {
    margin-bottom: 0.8rem;
}

.field label {
    display: block;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.field input,
.field textarea {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 0.55rem 0.6rem;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

textarea {
    resize: vertical;
}

.btn-primary {
    width: 100%;
    border-radius: 999px;
    border: none;
    background: var(--accent);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: background 0.15s ease, transform 0.08s ease, box-shadow 0.15s;
}

.btn-primary:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* FEEDBACK */

.feedback {
    min-height: 1.2em;
    font-size: 0.85rem;
    margin: 0 0 0.6rem;
}

.feedback.error {
    color: #b91c1c;
}

.feedback.success {
    color: #047857;
}

/* FOOTER */

.site-footer {
    border-top: 1px solid var(--border);
    background: #f9fafb;
    padding: 0.9rem 0 1.3rem;
}

.footer-inner {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ADMIN */

.admin-wrapper {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

.admin-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 1.5rem 1.4rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.admin-card h1 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.admin-login-form {
    max-width: 320px;
}

.admin-login-form .field {
    margin-bottom: 0.9rem;
}

.admin-login-form button {
    width: 100%;
}

.admin-error {
    color: #b91c1c;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.4rem 0.35rem;
    text-align: left;
    vertical-align: top;
}

.admin-table th {
    font-weight: 600;
}

.badge-type {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    color: #ffffff;
}

.badge-comprar { background: #16a34a; }
.badge-cambiar_pila { background: #f97316; }
.badge-reparar { background: #0ea5e9; }

/* RESPONSIVE */

@media (min-width: 720px) {
    .intro-card {
        padding: 2rem 2rem 2.1rem;
    }

    .intro-card h1 {
        font-size: 1.9rem;
    }

    .actions-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
