/* ================================
   CHECK-IN SIBA
   css/checkin.css
================================ */

:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --text: #1f2937;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success-bg: #dcfce7;
    --success-text: #166534;
    --error-bg: #fee2e2;
    --error-text: #991b1b;
    --border: #e5e7eb;
    --shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.page {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px;
}

/* ================================
   TOPO
================================ */

.topbar {
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #ffffff;
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: var(--shadow);
}

.topbar h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.2;
}

.topbar p {
    margin: 0;
    font-size: 15px;
    opacity: 0.9;
}

.top-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.top-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #1e3a8a;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 11px 16px;
    border-radius: 999px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.top-actions a:hover {
    background: #dbeafe;
}

/* ================================
   ALERTAS
================================ */

.alert {
    padding: 15px 18px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 14px;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #86efac;
}

.alert.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fca5a5;
}

/* ================================
   CARTÃO PRINCIPAL
================================ */

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* ================================
   FORMULÁRIO
================================ */

.form-section {
    margin-bottom: 32px;
    padding-bottom: 26px;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 18px;
}

.form-section h2 {
    margin: 0 0 20px;
    font-size: 19px;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h2::before {
    content: "";
    display: block;
    width: 8px;
    height: 24px;
    background: var(--primary);
    border-radius: 999px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.field {
    display: flex;
    flex-direction: column;
}

.field label {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #374151;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 15px;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

.field input:focus,
.field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.field small {
    display: block;
    margin-top: 7px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.field input::placeholder {
    color: #9ca3af;
}

/* ================================
   BOTÕES
================================ */

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    flex-wrap: wrap;
}

button,
.secondary-button {
    min-height: 48px;
    border: none;
    border-radius: 999px;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

button {
    background: var(--primary);
    color: #ffffff;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-button {
    background: #eef2ff;
    color: #1e3a8a;
}

.secondary-button:hover {
    background: #dbeafe;
}

/* ================================
   RESPONSIVO
================================ */

@media (max-width: 900px) {
    .page {
        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .topbar h1 {
        font-size: 24px;
    }

    .card {
        padding: 24px;
    }
}

@media (max-width: 700px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .form-section {
        margin-bottom: 26px;
        padding-bottom: 22px;
    }

    .form-section h2 {
        font-size: 17px;
    }

    .field input,
    .field select {
        font-size: 16px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    button,
    .secondary-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .page {
        padding: 12px;
    }

    .topbar {
        border-radius: 14px;
        padding: 20px;
    }

    .topbar h1 {
        font-size: 22px;
    }

    .topbar p {
        font-size: 14px;
    }

    .top-actions {
        width: 100%;
    }

    .top-actions a {
        width: 100%;
    }

    .card {
        padding: 18px;
        border-radius: 14px;
    }

    .alert {
        font-size: 13px;
        padding: 13px 15px;
    }
}

/* ================================
   LISTA DE CHECK-INS
================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow);
}

.stat-card span {
    display: block;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-card strong {
    display: block;
    font-size: 34px;
    line-height: 1;
    color: #111827;
}

.stat-card.warning {
    border-left: 6px solid #f59e0b;
}

.stat-card.success {
    border-left: 6px solid #22c55e;
}

.filters {
    display: grid;
    grid-template-columns: 220px 1fr auto;
    gap: 16px;
    align-items: end;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.filter-actions {
    display: flex;
    gap: 10px;
}

.generate-box {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.generate-box strong {
    display: block;
    font-size: 17px;
    color: #1e3a8a;
    margin-bottom: 4px;
}

.generate-box p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.generate-button {
    background: #2563eb;
    color: #ffffff;
    text-decoration: none;
    padding: 13px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.generate-button:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.checkins-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.checkins-table th {
    text-align: left;
    font-size: 13px;
    color: #6b7280;
    background: #f9fafb;
    padding: 14px 12px;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.checkins-table td {
    padding: 15px 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    vertical-align: middle;
}

.checkins-table td strong {
    display: block;
    color: #111827;
    margin-bottom: 3px;
}

.checkins-table td span {
    color: #6b7280;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.badge.sent {
    background: #dcfce7;
    color: #166534;
}

.doc-type {
    display: inline-flex;
    margin-right: 6px;
    background: #eef2ff;
    color: #3730a3 !important;
    padding: 4px 7px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
}

.file-name {
    font-size: 12px;
    color: #1e3a8a !important;
    font-weight: 700;
}

.muted {
    color: #9ca3af !important;
    font-size: 13px;
}

.empty-state {
    text-align: center;
    padding: 50px 20px;
}

.empty-state h2 {
    margin: 0 0 10px;
    font-size: 22px;
    color: #111827;
}

.empty-state p {
    margin: 0 0 20px;
    color: #6b7280;
}

/* ================================
   RESPONSIVO LISTA
================================ */

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        flex-direction: column;
    }

    .filter-actions button,
    .filter-actions .secondary-button {
        width: 100%;
    }

    .generate-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .generate-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 720px) {
    .table-wrap {
        overflow: visible;
    }

    .checkins-table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 14px;
    }

    .checkins-table thead {
        display: none;
    }

    .checkins-table,
    .checkins-table tbody,
    .checkins-table tr,
    .checkins-table td {
        display: block;
        width: 100%;
    }

    .checkins-table tr {
        background: #ffffff;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        padding: 12px;
        box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    }

    .checkins-table td {
        border-bottom: 1px solid #f1f5f9;
        padding: 11px 8px;
        display: flex;
        justify-content: space-between;
        gap: 16px;
        text-align: right;
    }

    .checkins-table td:last-child {
        border-bottom: none;
    }

    .checkins-table td::before {
        content: attr(data-label);
        font-weight: 800;
        color: #374151;
        text-align: left;
    }

    .checkins-table td strong,
    .checkins-table td span {
        text-align: right;
    }
}

