.attendance-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.attendance-card .content-card__header {
    margin-bottom: 14px;
}

.attendance-mode-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

.attendance-mode-btn {
    border: 1px solid var(--color-border, #dbe2ea);
    background: #fff;
    color: #1f2937;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}

.attendance-mode-btn.active {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
}

.attendance-camera-wrap {
    border: 1px solid var(--color-border, #dbe2ea);
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}

.attendance-camera-wrap video,
.attendance-photo-preview img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: cover;
}

.attendance-photo-preview {
    width: 100%;
}

.attendance-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.attendance-gps-status {
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 14px;
    line-height: 1.5;
}

.attendance-form-stack {
    display: grid;
    gap: 12px;
}

.attendance-help-text {
    margin-top: 12px;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .attendance-layout {
        grid-template-columns: 1fr;
    }

    .attendance-camera-wrap {
        min-height: 220px;
    }
}

/* =========================================================
   Attendance responsive polish
   ========================================================= */

.employee-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.attendance-manage-table {
    min-width: 920px;
}

.employee-table th,
.employee-table td {
    vertical-align: top;
    line-height: 1.45;
}

.employee-table img {
    display: block;
    max-width: 100%;
}

.attendance-layout {
    align-items: start;
}

.attendance-card {
    position: sticky;
    top: 16px;
}

.attendance-camera-wrap {
    position: relative;
}

.attendance-camera-wrap video,
.attendance-photo-preview img {
    border-radius: 0;
}

.attendance-actions .btn,
.employee-detail-actions .btn {
    min-height: 42px;
}

.attendance-form-stack .employee-form-group input {
    min-height: 42px;
}

.attendance-gps-status {
    padding: 10px 12px;
    border: 1px solid var(--color-border, #dbe2ea);
    border-radius: 10px;
    background: #f8fafc;
}

.attendance-help-text {
    padding: 10px 12px;
    border-radius: 10px;
    background: #f8fafc;
}

/* Desktop sedang / laptop kecil */
@media (max-width: 1280px) {
    .attendance-layout {
        grid-template-columns: 1fr;
    }

    .attendance-card {
        position: static;
    }

    .attendance-camera-wrap {
        min-height: 260px;
    }

    .attendance-manage-table {
        min-width: 860px;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .attendance-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .attendance-card {
        position: static;
    }

    .attendance-camera-wrap {
        min-height: 220px;
        margin-bottom: 12px;
    }

    .attendance-actions {
        gap: 8px;
    }

    .attendance-actions .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .attendance-manage-table {
        min-width: 760px;
    }

    .employee-table th,
    .employee-table td {
        padding: 10px 10px;
        font-size: 0.92rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .attendance-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .attendance-card,
    .content-card {
        border-radius: 14px;
    }

    .attendance-mode-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .attendance-mode-btn {
        width: 100%;
        min-height: 42px;
        padding: 10px 12px;
        font-size: 0.92rem;
    }

    .attendance-camera-wrap {
        min-height: 200px;
        border-radius: 12px;
    }

    .attendance-camera-wrap video,
    .attendance-photo-preview img {
        max-height: 280px;
    }

    .attendance-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .attendance-actions .btn,
    .employee-detail-actions .btn {
        width: 100%;
    }

    .attendance-form-stack {
        gap: 10px;
    }

    .attendance-gps-status,
    .attendance-help-text {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .attendance-manage-table {
        min-width: 680px;
    }

    .employee-table th,
    .employee-table td {
        padding: 9px 9px;
        font-size: 0.88rem;
    }
}

/* Mobile kecil */
@media (max-width: 480px) {
    .attendance-camera-wrap {
        min-height: 180px;
    }

    .attendance-camera-wrap video,
    .attendance-photo-preview img {
        max-height: 240px;
    }

    .attendance-mode-btn,
    .attendance-actions .btn,
    .employee-detail-actions .btn {
        min-height: 40px;
        font-size: 0.88rem;
    }

    .attendance-gps-status,
    .attendance-help-text {
        padding: 9px 10px;
        font-size: 0.8rem;
    }

    .attendance-manage-table {
        min-width: 620px;
    }

    .employee-table th,
    .employee-table td {
        padding: 8px 8px;
        font-size: 0.84rem;
    }
}

/* Halaman absensi karyawan: jangan biarkan tabel kecil melebar */
.attendance-layout .employee-table {
    min-width: 0 !important;
    width: 100%;
    table-layout: fixed;
}

.attendance-layout .employee-table th,
.attendance-layout .employee-table td {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Summary cards halaman absensi */
@media (max-width: 768px) {
    .employee-summary-cards {
        grid-template-columns: 1fr !important;
    }
}