.attendance-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.42);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 18px;
    position: fixed;
    z-index: 10020;
}

.attendance-modal.is-open {
    display: flex;
}

.attendance-modal__backdrop {
    inset: 0;
    position: absolute;
}

.attendance-panel {
    background: #fff;
    border: 1px solid rgba(255, 119, 78, 0.18);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
    max-height: min(760px, calc(100vh - 34px));
    max-width: 560px;
    overflow: auto;
    padding: 24px;
    position: relative;
    width: min(100%, 560px);
}

.attendance-panel__header {
    align-items: flex-start;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.attendance-panel__eyebrow {
    color: #10b981;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

.attendance-panel__header h2 {
    color: #111827;
    font-size: 1.7rem;
    line-height: 1.1;
    margin: 0;
}

.attendance-panel__close,
.attendance-history__reload {
    align-items: center;
    background: #f3f4f6;
    border: 0;
    border-radius: 50%;
    color: #4b5563;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.attendance-alert {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    color: #9a3412;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.attendance-alert.hidden {
    display: none;
}

.attendance-alert.is-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

.attendance-alert.is-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.attendance-store-card {
    align-items: center;
    background: linear-gradient(135deg, #fff7ed 0%, #ecfdf5 100%);
    border: 1px solid rgba(16, 185, 129, 0.16);
    border-radius: 20px;
    display: flex;
    gap: 14px;
    padding: 16px;
}

.attendance-store-card__icon {
    align-items: center;
    background: #10b981;
    border-radius: 18px;
    color: #fff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.25rem;
    height: 52px;
    justify-content: center;
    width: 52px;
}

.attendance-store-card__label {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 700;
    margin: 0 0 2px;
}

.attendance-store-card h3 {
    color: #111827;
    font-size: 1.08rem;
    margin: 0;
}

.attendance-store-card p:last-child {
    color: #6b7280;
    font-size: 0.92rem;
    line-height: 1.35;
    margin: 4px 0 0;
}

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

.attendance-metric {
    background: #f9fafb;
    border: 1px solid #eef2f7;
    border-radius: 16px;
    padding: 12px;
}

.attendance-metric span {
    color: #6b7280;
    display: block;
    font-size: 0.76rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.attendance-metric strong {
    color: #111827;
    display: block;
    font-size: 1rem;
}

.attendance-status-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 14px;
}

.attendance-status-pill {
    background: #e5e7eb;
    border-radius: 999px;
    color: #374151;
    display: inline-flex;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 6px 10px;
}

.attendance-status-pill.is-open {
    background: #dcfce7;
    color: #166534;
}

.attendance-status-pill.is-review {
    background: #fef3c7;
    color: #92400e;
}

.attendance-status-card p {
    color: #4b5563;
    line-height: 1.45;
    margin: 10px 0 0;
}

.attendance-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 16px 0 20px;
}

.attendance-btn {
    align-items: center;
    border: 0;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    gap: 8px;
    justify-content: center;
    min-height: 46px;
    padding: 12px 14px;
}

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

.attendance-btn.hidden {
    display: none;
}

.attendance-btn--ghost {
    background: #f3f4f6;
    color: #374151;
}

.attendance-btn--primary {
    background: linear-gradient(135deg, #ff5a2e 0%, #10b981 100%);
    color: #fff;
}

.attendance-btn--secondary {
    background: #111827;
    color: #fff;
}

.attendance-history {
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
}

.attendance-history__header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.attendance-history__header h3 {
    color: #111827;
    font-size: 1rem;
    margin: 0;
}

.attendance-history__reload {
    height: 34px;
    width: 34px;
}

.attendance-history__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attendance-record {
    align-items: center;
    background: #ffffff;
    border: 1px solid #edf2f7;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    padding: 12px;
}

.attendance-record strong {
    color: #111827;
    display: block;
    font-size: 0.94rem;
}

.attendance-record span {
    color: #6b7280;
    display: block;
    font-size: 0.82rem;
    margin-top: 2px;
}

.attendance-record__status {
    border-radius: 999px;
    color: #fff;
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 6px 9px;
}

.attendance-record__status.is-completed {
    background: #10b981;
}

.attendance-record__status.is-open {
    background: #3b82f6;
}

.attendance-record__status.is-review {
    background: #f59e0b;
}

.attendance-empty {
    color: #6b7280;
    font-weight: 700;
    margin: 0;
    padding: 12px 0;
    text-align: center;
}

@media (max-width: 560px) {
    .attendance-modal {
        align-items: flex-end;
        padding: 0;
    }

    .attendance-panel {
        border-radius: 24px 24px 0 0;
        max-height: calc(100vh - 16px);
        padding: 20px 16px 24px;
        width: 100%;
    }

    .attendance-metrics {
        grid-template-columns: 1fr;
    }

    .attendance-actions {
        grid-template-columns: 1fr;
    }
}
