/**
 * Hotel HR Suite - Attendance PWA / Native-like mobile styles
 * Scoped to .hotel-hr-attendance-dashboard for installable attendance experience.
 */

/* Design tokens and base (mobile-first) */
.hotel-hr-attendance-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    -webkit-font-smoothing: antialiased;
    box-sizing: border-box;
}

.hotel-hr-attendance-dashboard *,
.hotel-hr-attendance-dashboard *::before,
.hotel-hr-attendance-dashboard *::after {
    box-sizing: border-box;
}

/* Safe areas for notched devices and home indicator */
@supports (padding: env(safe-area-inset-top)) {
    .hotel-hr-attendance-dashboard {
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* Extra top padding when running as standalone PWA (status bar) */
@media all and (display-mode: standalone) {
    .hotel-hr-attendance-dashboard {
        padding-top: calc(24px + env(safe-area-inset-top, 0px));
    }
}

/* Container: full-bleed app feel on small viewports */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard {
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 24px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* Header: large title style */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-header {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-header h2 {
        font-size: 24px;
        font-weight: 700;
        line-height: 1.2;
        margin: 0;
        color: #1a1a1a;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-status {
        font-size: 14px;
        font-weight: 500;
    }
}

/* Location notice on mobile: prominent and touch-friendly */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-location-notice {
        padding: 14px 44px 14px 16px;
        margin-bottom: 16px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-location-notice #hotel-hr-allow-location {
        min-height: 48px;
        padding: 12px 20px;
    }
}

/* Primary actions: full-width, 48px min height, large radius */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-actions {
        width: 100%;
        margin-bottom: 24px;
        gap: 12px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-clock-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-clock-buttons .hotel-hr-btn,
    .hotel-hr-attendance-dashboard .hotel-hr-manual-clock .hotel-hr-btn {
        width: 100%;
        min-height: 48px;
        padding: 14px 20px;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 600;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-manual-clock {
        width: 100%;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-manual-clock .hotel-hr-btn {
        width: 100%;
        min-height: 48px;
        border-radius: 14px;
    }
}

/* Today card: native-like card */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-today {
        margin-top: 24px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-today h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 12px;
        color: #1a1a1a;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-card {
        border-radius: 14px;
        padding: 20px;
        background: #fff;
        border: 1px solid #e8e8ed;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-row .label {
        font-size: 12px;
        color: #6c757d;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-row .value {
        font-size: 18px;
        font-weight: 600;
        color: #1a1a1a;
    }
}

@media screen and (max-width: 480px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-card {
        grid-template-columns: 1fr;
    }
}

/* History: list-style rows on narrow viewports (table as list) */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-history {
        margin-top: 28px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-attendance-history h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 12px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table-scroll-wrapper {
        border-radius: 14px;
        border: 1px solid #e8e8ed;
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table {
        min-width: 0;
        display: block;
        border: none;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table thead {
        display: none;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody {
        display: block;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid #edf0f7;
        gap: 8px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody tr:last-child {
        border-bottom: none;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody td {
        display: block;
        padding: 0;
        border: none;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody td:first-child {
        font-weight: 600;
        color: #1a1a1a;
        width: 100%;
        font-size: 14px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody td:nth-child(2),
    .hotel-hr-attendance-dashboard .hotel-hr-table tbody td:nth-child(3),
    .hotel-hr-attendance-dashboard .hotel-hr-table tbody td:nth-child(4) {
        font-size: 13px;
        color: #4b5675;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table tbody td:nth-child(5) {
        margin-left: auto;
        font-size: 12px;
        font-weight: 500;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-table .hotel-hr-empty {
        padding: 24px 16px;
        text-align: center;
    }
}

/* Timesheet summary: single column cards */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-timesheet-summary {
        margin-top: 28px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-timesheet-summary h3 {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 12px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-timesheet-card {
        border-radius: 14px;
        padding: 18px;
        border: 1px solid #e8e8ed;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    }

    .hotel-hr-attendance-dashboard .hotel-hr-timesheet-card .stat {
        font-size: 24px;
    }
}

/* Camera: full-width, safe areas, large touch targets */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-camera {
        border-radius: 14px;
        padding: 16px;
        margin-left: calc(-1 * max(0px, env(safe-area-inset-left)));
        margin-right: calc(-1 * max(0px, env(safe-area-inset-right)));
        max-width: 100vw;
        width: 100%;
        box-sizing: border-box;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-camera-controls {
        flex-direction: column;
        gap: 10px;
        margin-top: 14px;
    }

    .hotel-hr-attendance-dashboard .hotel-hr-camera-controls .hotel-hr-btn {
        width: 100%;
        min-height: 48px;
        border-radius: 14px;
        font-size: 16px;
    }
}

/* Alerts: full-width, sufficient padding */
@media screen and (max-width: 767px) {
    .hotel-hr-attendance-dashboard .hotel-hr-attendance-alert .hotel-hr-notice {
        padding: 14px 16px;
        border-radius: 12px;
    }
}
