:root {
    --sidebar: #15171b;
    --sidebar-2: #202329;
    --bg: #f3f5f7;
    --surface: #ffffff;
    --text: #17191d;
    --muted: #667085;
    --line: #e4e7ec;
    --primary: #17191d;
    --success: #067647;
    --success-bg: #ecfdf3;
    --danger: #b42318;
    --danger-bg: #fef3f2;
    --warning: #b54708;
    --warning-bg: #fffaeb;
    --radius: 15px;
    --shadow: 0 14px 38px rgba(16, 24, 40, .07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

.admin-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: var(--sidebar);
    color: white;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    font-weight: 850;
}

.brand__mark {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: white;
    color: var(--sidebar);
    font-size: .82rem;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
    margin-top: 30px;
}

.sidebar-nav a {
    padding: 11px 12px;
    border-radius: 9px;
    color: #d0d5dd;
    text-decoration: none;
    font-weight: 650;
}

.sidebar-nav a:hover {
    background: var(--sidebar-2);
    color: white;
}

.sidebar-user {
    display: grid;
    gap: 5px;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #30343b;
}

.sidebar-user span {
    color: #98a2b3;
    font-size: .88rem;
    text-transform: capitalize;
}

.sidebar-user form {
    margin-top: 11px;
}

.admin-main {
    min-width: 0;
}

.admin-header {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 30px;
    background: white;
    border-bottom: 1px solid var(--line);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -.025em;
}

.menu-button {
    display: none;
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    cursor: pointer;
}

.admin-content {
    width: min(1220px, calc(100% - 48px));
    margin: 30px auto 60px;
}

.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-actions h2 {
    margin: 0;
    font-size: 1.65rem;
    letter-spacing: -.035em;
}

.page-actions__buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--primary);
    color: white;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
}

.button:hover {
    opacity: .88;
}

.button--secondary {
    border-color: var(--line);
    background: white;
    color: var(--text);
}

.button--danger {
    background: #b42318;
}

.button--success {
    background: #067647;
}

.button--ghost {
    border-color: #41464f;
    background: transparent;
}

.button--small {
    min-height: 35px;
    padding: 6px 10px;
    font-size: .88rem;
}

.button--full {
    width: 100%;
}

.grid-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
}

.stat {
    padding: 21px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.stat__label {
    color: var(--muted);
    font-size: .9rem;
    font-weight: 700;
}

.stat__value {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
    font-weight: 880;
    letter-spacing: -.045em;
}

.panel {
    padding: 24px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.panel + .panel {
    margin-top: 20px;
}

.panel h2,
.panel h3 {
    margin-top: 0;
}

.table-wrap {
    overflow-x: auto;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 15px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    background: #f8fafc;
    color: #475467;
    font-size: .8rem;
    letter-spacing: .025em;
    text-transform: uppercase;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.table-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

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

.status {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f2f4f7;
    color: #344054;
    font-size: .78rem;
    font-weight: 800;
    white-space: nowrap;
}

.status--success {
    background: var(--success-bg);
    color: var(--success);
}

.status--danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.status--warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.alert {
    margin-bottom: 20px;
    padding: 13px 15px;
    border-radius: 10px;
    border: 1px solid transparent;
}

.alert ul {
    margin: 0;
    padding-left: 20px;
}

.alert--success {
    background: var(--success-bg);
    border-color: #abefc6;
    color: var(--success);
}

.alert--error {
    background: var(--danger-bg);
    border-color: #fecdca;
    color: var(--danger);
}

.form-card {
    max-width: 900px;
    padding: 27px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.field {
    margin-bottom: 17px;
}

.field--full {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 750;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cfd4dc;
    border-radius: 9px;
    background: white;
}

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

.field small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.preview-banner {
    width: min(500px, 100%);
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.preview-banner img {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    display: block;
}

.filters {
    display: flex;
    gap: 10px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding: 17px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.filters .field {
    min-width: 190px;
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.detail-card {
    padding: 16px;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 11px;
}

.detail-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .85rem;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(102, 112, 133, .18), transparent 35%),
        #f4f6f8;
}

.login-card {
    width: min(430px, 100%);
    padding: 34px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 22px 70px rgba(16, 24, 40, .12);
}

.login-card .brand {
    margin-bottom: 27px;
}

.login-card .brand__mark {
    background: var(--primary);
    color: white;
}

.login-card h1 {
    margin: 0 0 8px;
    letter-spacing: -.04em;
}

.login-card p {
    margin: 0 0 24px;
    color: var(--muted);
}

.empty {
    padding: 40px 20px;
    color: var(--muted);
    text-align: center;
}

.checkin-shell {
    min-height: 100vh;
    padding: 20px;
    background: #101215;
    color: white;
}

.checkin-container {
    width: min(780px, 100%);
    margin-inline: auto;
}

.checkin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px;
}

.scanner {
    overflow: hidden;
    background: #20242a;
    border: 1px solid #343a43;
    border-radius: 18px;
}

.scanner video {
    width: 100%;
    max-height: 500px;
    display: block;
    background: black;
}

.scanner__controls {
    padding: 17px;
}

.checkin-result {
    margin-top: 18px;
    padding: 24px;
    border-radius: 16px;
    background: #20242a;
    border: 1px solid #343a43;
}

.checkin-result--success {
    background: #063e2b;
    border-color: #0b6b4a;
}

.checkin-result--error {
    background: #531b1b;
    border-color: #8c2f2f;
}

@media (max-width: 1000px) {
    .grid-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 760px) {
    .admin-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 40;
        width: min(290px, 88vw);
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: 20px 0 50px rgba(0, 0, 0, .2);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .menu-button {
        display: block;
    }

    .admin-header {
        padding-inline: 18px;
    }

    .admin-content {
        width: min(100% - 24px, 1220px);
        margin-top: 20px;
    }

    .page-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .field--full {
        grid-column: auto;
    }
}

@media (max-width: 520px) {
    .grid-stats {
        grid-template-columns: 1fr;
    }

    .form-card,
    .panel {
        padding: 19px;
    }
}


/* Feedback visual do check-in */
.checkin-feedback {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    color: #fff;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.03);
    transition:
        opacity .14s ease,
        transform .14s ease,
        visibility 0s linear .14s;
}

.checkin-feedback.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition-delay: 0s;
}

.checkin-feedback--success {
    background: rgba(5, 122, 78, .96);
}

.checkin-feedback--error {
    background: rgba(181, 35, 35, .96);
}

.checkin-feedback__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.checkin-feedback__icon {
    width: clamp(130px, 38vw, 190px);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin-bottom: 20px;
    border: 9px solid currentColor;
    border-radius: 50%;
    font-size: clamp(6rem, 25vw, 9rem);
    font-weight: 800;
    line-height: 1;
}

.checkin-feedback__title {
    font-size: clamp(2.1rem, 10vw, 4.5rem);
    letter-spacing: .06em;
}

.checkin-feedback__message {
    max-width: 620px;
    margin-top: 10px;
    font-size: clamp(1rem, 4vw, 1.35rem);
    font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
    .checkin-feedback {
        transition: none;
    }
}
