@font-face {
    font-family: "Space Grotesk";
    src: local("Space Grotesk"), local("SpaceGrotesk-Regular");
    font-weight: 400;
    font-style: normal;
}

:root {
    --bg: #f8f4f0;
    --ink: #1f1d1b;
    --muted: #615a52;
    --accent: #0f5b7a;
    --accent-2: #e1863a;
    --card: #ffffff;
    --line: #e7ded5;
    --success: #1f7a4c;
    --danger: #a3322d;
    --shadow: 0 18px 35px rgba(31, 29, 27, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
}

.bg {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 10% 10%, rgba(15, 91, 122, 0.18), transparent 45%),
        radial-gradient(circle at 90% 20%, rgba(225, 134, 58, 0.15), transparent 40%),
        linear-gradient(135deg, #f5efe8 0%, #fbf8f5 55%, #f7efe6 100%);
    z-index: -1;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
}

.brand {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
}

.nav a {
    color: var(--ink);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.nav a:hover {
    background: rgba(15, 91, 122, 0.12);
}

.nav-user {
    color: var(--muted);
    font-size: 13px;
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.container {
    max-width: 1100px;
    margin: 28px auto 60px;
    padding: 0 20px;
}

.card {
    background: var(--card);
    border-radius: 20px;
    padding: 28px;
    box-shadow: var(--shadow);
    max-width: 520px;
    margin: 60px auto;
}

.card h1 {
    margin-top: 0;
}

.muted {
    color: var(--muted);
}

.form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 6px;
    font-size: 14px;
}

input,
select,
textarea {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font-size: 14px;
    font-family: inherit;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

.btn-secondary {
    background: var(--accent-2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table th,
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.table th {
    background: #faf7f2;
    font-weight: 600;
}

.table tr:last-child td {
    border-bottom: none;
}

.chip {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.chip-pendiente {
    background: rgba(225, 134, 58, 0.18);
    color: #8a4e1c;
}

.chip-completada {
    background: rgba(31, 122, 76, 0.2);
    color: var(--success);
}

.chip-cancelada {
    background: rgba(163, 50, 45, 0.15);
    color: var(--danger);
}

.alert {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-info {
    background: rgba(15, 91, 122, 0.12);
}

.alert-error {
    background: rgba(163, 50, 45, 0.15);
    color: var(--danger);
}

.btn-view-detail {
    display: inline-block;
    padding: 4px 10px;
    background: #e0e0e0;
    color: #333;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-view-detail:hover {
    background: #5a5a5a;
    color: #fff;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.grid-2 > div {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.section {
    margin: 26px 0 20px;
}

.section h2 {
    margin: 0 0 10px;
}

.summary {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.summary-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    min-width: 180px;
}

.summary-card strong {
    display: block;
    font-size: 20px;
    margin-top: 6px;
}

.receipt-preview {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    background: #fff;
}

.receipt-preview img,
.receipt-preview iframe {
    width: 100%;
    height: 1100px;
    max-height: 1100px;
    border: none;
    border-radius: 10px;
}

@media (max-width: 760px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card {
        margin: 30px auto;
    }
}
