/* Personal dashboard and time entry: one set of real data, responsive presentation. */
.responsive-dashboard,
.responsive-timesheets,
.employee-dashboard,
.employee-dashboard-summary {
    min-width: 0;
}

.responsive-dashboard .view-header > div,
.responsive-timesheets .view-header > div {
    min-width: 0;
}

.employee-dashboard .punch-card {
    justify-content: flex-start;
}

.time-clock-shortcut {
    display: none;
}

.responsive-time-modal .form-group,
.responsive-time-modal .form-control {
    min-width: 0;
}

:where(html[data-display-mode="mobile"]) .responsive-dashboard .dashboard-tabs {
    display: none;
}

:where(html[data-display-mode="mobile"]) .responsive-dashboard .view-header,
:where(html[data-display-mode="mobile"]) .responsive-timesheets .view-header {
    align-items: stretch;
    flex-direction: column;
    gap: .875rem;
}

:where(html[data-display-mode="mobile"]) .responsive-dashboard .view-header h1,
:where(html[data-display-mode="mobile"]) .responsive-timesheets .view-header h1 {
    font-size: 1.375rem !important;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

:where(html[data-display-mode="mobile"]) .responsive-dashboard .view-header p,
:where(html[data-display-mode="mobile"]) .responsive-dashboard .tenant-pill {
    overflow-wrap: anywhere;
    white-space: normal;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "metrics" "clock" "activity";
    gap: 1rem;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard-summary {
    display: contents;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .stats-grid {
    grid-area: metrics;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .625rem;
    margin-bottom: 0;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .stat-box {
    min-width: 0;
    padding: .875rem;
    gap: .35rem;
    overflow-wrap: anywhere;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .stat-value {
    font-size: clamp(1.125rem, 5vw, 1.5rem);
    font-variant-numeric: tabular-nums;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .punch-card {
    grid-area: clock;
    padding: 1rem;
    background: var(--primary-glow);
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .time-clock {
    font-size: 2rem;
    margin-top: .5rem;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .punch-status {
    margin-bottom: 1rem;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .punch-actions {
    gap: .375rem;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .form-control,
:where(html[data-display-mode="mobile"]) .responsive-timesheets .form-control {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px !important;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .employee-activity-card {
    grid-area: activity;
    padding: 1rem;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .punch-recovery-alert {
    flex-direction: column;
    align-items: stretch !important;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .punch-recovery-alert > div:last-child {
    flex-wrap: wrap;
}

:where(html[data-display-mode="mobile"]) .employee-dashboard .btn,
:where(html[data-display-mode="mobile"]) .responsive-timesheets .btn,
:where(html[data-display-mode="mobile"]) .responsive-time-modal .modal-close {
    min-height: 44px;
    min-width: 44px;
    white-space: normal;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .view-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: .5rem;
}

:where(html[data-display-mode="mobile"]) .time-clock-shortcut {
    display: inline-flex;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets #time-add-manual-btn {
    grid-column: 1 / -1;
    grid-row: 1;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .view-actions > :last-child {
    grid-column: 1 / -1;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .filter-bar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem !important;
    padding: 1rem;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .filter-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .375rem;
    min-width: 0;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .filter-group .form-control {
    width: 100% !important;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .timesheet-entries-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

:where(html[data-display-mode="mobile"]) .responsive-timesheets .timesheet-entries-card > .table-responsive,
:where(html[data-display-mode="mobile"]) .employee-activity-card > .table-responsive {
    overflow: visible;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table,
:where(html[data-display-mode="mobile"]) .mobile-time-table tbody {
    display: block;
    width: 100%;
    min-width: 0;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table {
    position: relative;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table thead {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem 1rem;
    margin-bottom: .75rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-secondary);
}

:where(html[data-display-mode="mobile"]) .mobile-time-table tbody td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: .875rem;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: .2rem;
    font-size: .7rem;
    color: var(--text-muted);
    font-weight: 500;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-date,
:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-project,
:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-description,
:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-actions,
:where(html[data-display-mode="mobile"]) .mobile-time-table td[colspan] {
    grid-column: 1 / -1;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-project {
    font-weight: 650;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table .badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-actions {
    display: flex;
    justify-content: flex-end;
    gap: .5rem;
}

:where(html[data-display-mode="mobile"]) .mobile-time-table td.mobile-time-actions::before,
:where(html[data-display-mode="mobile"]) .mobile-time-table .mobile-time-actions:empty {
    display: none;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal {
    width: calc(100% - 1rem);
    max-width: 540px;
    max-height: calc(100dvh - 1rem);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .modal-header {
    padding: .75rem 1rem;
    gap: .5rem;
    flex: 0 0 auto;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .modal-title {
    font-size: 1.1rem;
    min-width: 0;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal form {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .modal-body {
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1rem;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .form-control {
    min-height: 44px;
    font-size: 16px;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .modal-footer {
    flex: 0 0 auto;
    padding: .75rem 1rem max(.75rem, env(safe-area-inset-bottom));
    gap: .5rem;
}

:where(html[data-display-mode="mobile"]) .responsive-time-modal .modal-footer .btn {
    flex: 1;
}
