/* ============================================================
   ADS styles - Time: timesheet module, attendance register, entry modal, workflow setup
   Split out of the former monolithic style.css WITHOUT code changes.
   Files are linked in numeric order (see Core/templates/_styles.html) so
   the cascade is identical to the old single file.
   ============================================================ */

/* ========== TIMESHEET MODULE ========== */
.timesheet-week-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ts-week-nav {
    background: var(--white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ts-week-nav:hover { background: var(--gray-lite, #f3f4f6); }

.ts-week-label {
    font-weight: 600;
    font-size: 15px;
    min-width: 180px;
}

.ts-week-status { font-size: 13px; color: var(--gray-dark, #6b7280); }

.ts-btn {
    border: none;
    border-radius: 8px;
    padding: 9px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ts-btn-primary { background: var(--green); color: var(--white); }
.ts-btn-primary:hover { background: var(--green-dark); }
.ts-btn-primary:disabled { background: var(--gray-mid, #d1d5db); cursor: not-allowed; }
.ts-btn-secondary { background: var(--white); border: 1px solid var(--border-color, #e5e7eb); }
.ts-btn-secondary:hover { background: var(--gray-lite, #f3f4f6); }
.ts-btn-danger { background: #dc2626; color: var(--white); }
.ts-btn-danger:hover { background: #b91c1c; }

.ts-badge { display:inline-block; padding:2px 9px; border-radius:10px; font-size:11px; font-weight:600; }
.ts-badge-active { background:#dcfce7; color:#166534; }
.ts-badge-inactive { background:#f3f4f6; color:#6b7280; }

.ts-global-timer-badge {
    position: fixed;
    /* Default dock: below the header's Logout icon, top-right. This is
       only the STARTING position now  ADSV2-47 makes the badge
       user-draggable (see _tsInitGlobalTimerDrag in script.js), which
       overrides top/right with an explicit left/top inline style once
       the user has moved it, and remembers that spot via localStorage. */
    top: calc(var(--header-h) + 12px);
    right: 20px;
    z-index: 3000;
    display: flex;
    align-items: center;
    /* ADSV2-48: kept as compact as possible  small gap, tight padding,
       no fixed/large widths. Only the ticket id shows (full repo +
       description is a hover tooltip  see the label's title attribute
       set in _tsRenderGlobalTimerBadge). */
    gap: 6px;
    /* ADSV2-47: glass effect  translucent tinted panel + blur instead of
       a flat fill, with a hairline border and soft glow to keep it
       legible over any page content behind it. Falls back gracefully to
       the old flat green (see @supports below) if backdrop-filter isn't
       supported. */
    background: linear-gradient(135deg, rgba(22,101,52,0.55), rgba(6,78,59,0.45));
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255,255,255,0.28);
    color: var(--white);
    padding: 6px 8px 6px 10px;
    border-radius: 999px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.25);
    cursor: grab;
    font-size: 11.5px;
    font-weight: 600;
    width: max-content;
    max-width: min(220px, calc(100vw - 24px));
    user-select: none;
    touch-action: none;
    transition: box-shadow 0.15s ease, transform 0.1s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .ts-global-timer-badge { background: var(--green-dark, #166534); }
}
.ts-global-timer-badge:hover {
    box-shadow: 0 10px 32px rgba(0,0,0,0.32), inset 0 1px 0 rgba(255,255,255,0.3);
}
.ts-global-timer-badge.ts-timer-dragging {
    cursor: grabbing;
    transition: none;
    box-shadow: 0 14px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
    transform: scale(1.02);
}
.ts-global-timer-badge i.fa-stopwatch { color: #bbf7d0; font-size: 11px; }
.ts-global-timer-badge #ts-global-timer-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 60px;
}
.ts-global-timer-badge .ts-timer-live {
    background: rgba(255,255,255,0.18);
    color: var(--white);
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    letter-spacing: -0.2px;
}
.ts-global-timer-popout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--white);
    font-size: 9px;
    cursor: pointer;
    flex-shrink: 0;
}
.ts-global-timer-popout-btn:hover { background: rgba(255,255,255,0.3); }
.ts-global-timer-stop-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 50%;
    /* Own glass tint on the Stop button too, so it doesn't look like a
       flat cutout pasted onto the blurred panel. */
    background: rgba(220,38,38,0.85);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--white);
    font-size: 9.5px;
    cursor: pointer;
    flex-shrink: 0;
}
.ts-global-timer-stop-btn:hover { background: rgba(185,28,28,0.9); }
@media (max-width: 640px) {
    .ts-global-timer-badge { left: auto; right: 12px; top: calc(var(--header-h) + 8px); max-width: min(220px, calc(100vw - 24px)); }
    /* Dragging is desktop-pointer-friendly by design (see script.js) but
       still works via touch; once moved, the badge switches to an exact
       left/top position on mobile too, so left/right:12px no longer
       apply  that's intentional. */
}

.ts-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.ts-my-tickets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}
.ts-subsection-title {
    font-size: 16px !important;
    margin: 0 !important;
}
.ts-timer-live {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: var(--green-dark, #166534);
    background: var(--green-lite, #dcfce7);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
}
.ts-mytickets-today { font-weight: 600; }
.ts-today-total { font-size: 13px; color: var(--gray-dark, #4b5563); }
.ts-today-total strong { color: var(--green-dark, #166534); font-size: 14px; }

.ts-config-form {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
    background: var(--white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 16px 18px;
    margin-top: 6px;
}
.ts-config-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
}
.ts-config-form input {
    padding: 7px 10px;
    border: 1.5px solid var(--gray-200, #e5e7eb);
    border-radius: 7px;
    font-size: 13px;
}

.vt-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
    max-height: 420px;
    overflow-y: auto;
}
.vt-comment {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--gray-50, #f9fafb);
}
.vt-comment-meta {
    font-size: 11.5px;
    color: var(--gray-500, #6b7280);
    margin-bottom: 4px;
}
.vt-comment-body {
    font-size: 13px;
    color: var(--gray-800, #1f2937);
    white-space: pre-wrap;
    word-break: break-word;
}

.timesheet-table-wrap {
    background: var(--white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    overflow-x: auto;
}

.timesheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
/* This Week's Entries table mixes a colspan="5" day-group row with normal
   9-cell rows; with auto layout the browser sizes columns differently for
   each, so header/data columns drift out of alignment. Pin the column
   widths via colgroup so both row types share identical boundaries. */
#ts-week-table {
    table-layout: fixed;
}
.timesheet-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--gray-lite, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    font-weight: 600;
    color: var(--gray-dark, #6b7280);
}
.timesheet-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color, #f0f0f0);
    vertical-align: middle;
}
.timesheet-table tfoot td { border-bottom: none; padding-top: 12px; }

/* ---- Attendance Register: professional data-grid redesign.
   Sticky header + sticky first column so the date grid can scroll
   horizontally/vertically without losing track of which user/date a
   cell belongs to; icon-badge title block; collapsible legend;
   refined toolbar; muted zebra + tabular-number cells. */
.ar-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 4px;
}
.ar-title-block {
    display: flex;
    align-items: center;
    gap: 14px;
}
.ar-title-icon {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(150deg, #16a34a, #15803d);
    box-shadow: 0 6px 16px -4px rgba(22, 163, 74, 0.45), inset 0 1px 0 rgba(255,255,255,0.25);
    flex-shrink: 0;
}
.ar-title-text {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    color: var(--gray-900, #111827);
    letter-spacing: -0.2px;
}
.ar-title-sub {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--gray-500, #6b7280);
}

.ar-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.6);
    padding: 7px 10px 7px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 4px 14px -8px rgba(15, 23, 42, 0.15);
}
.ar-date-range {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 6px;
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.ar-date-icon {
    font-size: 12px;
    color: var(--gray-400, #9ca3af);
}
.ar-date-input {
    border: none !important;
    background: transparent !important;
    padding: 4px 2px !important;
    font-size: 12.5px !important;
    box-shadow: none !important;
    width: 128px;
}
.ar-date-sep {
    color: var(--gray-400, #9ca3af);
    font-size: 11px;
}

/* -- Collapsible legend, professional pill-strip look -- */
.ar-legend {
    margin: 14px 0 16px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
.ar-legend-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-600, #4b5563);
    padding: 2px 2px 2px 0;
}
.ar-legend-toggle:hover { color: var(--gray-800, #1f2937); }
.ar-legend-chevron {
    font-size: 10px;
    transition: transform 0.15s ease;
}
.ar-legend-chips {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}
.ar-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--gray-700, #374151);
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 999px;
    padding: 4px 10px 4px 6px;
    white-space: nowrap;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.ar-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px -3px rgba(15, 23, 42, 0.18);
}
.ar-chip-muted {
    color: var(--gray-500, #6b7280);
    background: rgba(255, 255, 255, 0.4);
}
.ar-chip-muted i { font-size: 10px; }
.ar-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

/* -- Table shell -- */
.ar-table-wrap {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 32px -14px rgba(15, 23, 42, 0.2);
}
#page-attendance-register .timesheet-table-wrap {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    backdrop-filter: blur(16px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.6);
}
/* Slim, unobtrusive scrollbar so a wide/tall grid doesn't feel clunky */
#page-attendance-register .timesheet-table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
#page-attendance-register .timesheet-table-wrap::-webkit-scrollbar-track { background: transparent; }
#page-attendance-register .timesheet-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 8px;
}
#page-attendance-register .timesheet-table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.32); }

#ar-table {
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    width: 100%;
}
#ar-table th, #ar-table td {
    border-right: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.045) !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Header: bold day-number over a small-caps weekday, on a frosted strip */
#ar-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(249, 250, 251, 0.94);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-weight: 700;
    font-size: 12px;
    color: var(--gray-700, #374151);
    padding-top: 9px !important;
    padding-bottom: 9px !important;
    line-height: 1.5;
}
#ar-table thead th span {
    display: block;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 9px !important;
    color: var(--gray-400, #9ca3af) !important;
}

/* Sticky "User" column - clean divider, avatar-style initial chip */
#ar-table th:first-child, #ar-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 2px 0 8px rgba(15, 23, 42, 0.07);
    width: 148px;
    white-space: normal;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--gray-800, #1f2937);
    padding-left: 14px !important;
}
#ar-table thead th:first-child {
    z-index: 4;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500, #6b7280);
}

#ar-table th:not(:first-child), #ar-table td:not(:first-child) {
    /* No fixed px width here on purpose - table-layout:fixed + width:100%
       makes the browser split whatever's left after the first column
       evenly across however many date columns exist, so the whole
       register always fits the screen width instead of overflowing. */
    text-align: center;
    padding: 9px 2px;
    font-size: 11.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
/* Flat register look: cells are full-bleed colour blocks flush against
   each other (like a spreadsheet's conditional formatting), not floating
   pills - no per-cell radius, no hover pop/scale/shadow. Row hover reads
   as a single thin highlight line, not a bouncing key. */
#ar-table tbody tr:nth-child(even) td { background: rgba(15, 23, 42, 0.018); }
#ar-table tbody tr:nth-child(even) td:first-child { background: rgba(255, 255, 255, 0.88); }
#ar-table tbody tr:hover td:first-child {
    background: rgba(22, 163, 74, 0.08);
    color: var(--gray-900, #111827);
}
#ar-table tbody tr:hover td:not(:first-child) {
    box-shadow: inset 0 -2px 0 rgba(22, 163, 74, 0.35);
}

@media (max-width: 900px) {
    .ar-page-header { flex-direction: column; align-items: flex-start; }
    .ar-toolbar { width: 100%; }
}


.ts-empty {
    text-align: center;
    color: var(--gray-dark, #9ca3af);
    padding: 24px !important;
}

.ts-repo-select, .ts-ticket-select {
    width: 100%;
    min-width: 140px;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 13px;
}
.ts-hours-input {
    width: 70px;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 13px;
}
.ts-desc-input {
    width: 100%;
    min-width: 160px;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 13px;
}

.ts-status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}
.ts-status-draft     { background: #f3f4f6; color: #4b5563; }
.ts-status-submitted { background: #fef3c7; color: #92400e; }
.ts-status-approved  { background: var(--green-lite, #dcfce7); color: var(--green-dark, #166534); }
.ts-status-rejected  { background: #fee2e2; color: #991b1b; }

.ts-reject-reason {
    font-size: 11px;
    color: #b91c1c;
    margin-top: 3px;
    max-width: 220px;
    white-space: normal;
}

.ts-icon-btn {
    background: none;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    margin-right: 4px;
    color: var(--gray-dark, #4b5563);
}
.ts-icon-btn:hover { background: var(--gray-lite, #f3f4f6); }
.ts-icon-btn.ts-icon-danger { color: #dc2626; }
.ts-icon-btn.ts-icon-danger:hover { background: #fee2e2; }
.ts-icon-btn.ts-icon-approve { color: var(--green-dark, #166534); }
.ts-icon-btn.ts-icon-approve:hover { background: var(--green-lite, #dcfce7); }

/* BUGFIX: this button used to share .ts-icon-btn (fixed 30x30px, meant for
   icon-only buttons), which clipped/wrapped its "Export to Excel" label.
   Give it its own auto-sized style instead. */
.vt-export-excel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}
.vt-export-excel-btn:hover { filter: brightness(0.94); }

/* ============================================================
   TIMESHEET v2  entry modal, task-status badges, workflow setup
   ============================================================ */

.ts-task-cell {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts-taskstatus-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
}
.ts-taskstatus-In-Progress { background: #dbeafe; color: #1e40af; }
.ts-taskstatus-Completed   { background: var(--green-lite, #dcfce7); color: var(--green-dark, #166534); }
.ts-taskstatus-Hold        { background: #fee2e2; color: #991b1b; }

/* ---- Entry modal ---- */
.ts-entry-modal-content {
    width: 640px;
    max-width: 92vw;
}
.ts-entry-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.ts-entry-grid label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-dark, #4b5563);
}
.ts-entry-grid label.ts-entry-span2 { grid-column: 1 / -1; }
.ts-entry-grid input,
.ts-entry-grid select {
    font-weight: 400;
    font-size: 13px;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    color: var(--text, #111827);
}
.ts-entry-grid input:read-only {
    background: var(--gray-lite, #f9fafb);
    color: var(--gray-dark, #6b7280);
}
.ts-entry-grid input:disabled,
.ts-entry-grid select:disabled {
    background: var(--gray-lite, #f3f4f6);
    color: var(--gray-dark, #9ca3af);
}
.ts-autofill-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 9999px;
    background: var(--green-lite, #dcfce7);
    color: var(--green-dark, #166534);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ---- Workflow Setup page ---- */
.ts-workflow-hint {
    font-size: 13px;
    line-height: 1.6;
    color: var(--gray-dark, #4b5563);
    background: var(--gray-lite, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    max-width: 900px;
}
.ts-approver-select {
    width: 100%;
    min-width: 200px;
    padding: 6px 8px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 13px;
}
.ts-chain-cell {
    font-size: 12px;
    color: var(--gray-dark, #4b5563);
    white-space: nowrap;
    overflow-x: auto;
    max-width: 260px;
}

@media (max-width: 768px) {
    .ts-entry-grid { grid-template-columns: 1fr; }
    .ts-entry-modal-content { width: 94vw; }
}

/* ---- Daily submit/approve group rows ---- */
.ts-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}
.ts-day-group-row {
    background: var(--gray-lite, #f9fafb);
}
.ts-day-group-row td {
    border-top: 2px solid var(--border-color, #e5e7eb);
    padding-top: 10px;
    padding-bottom: 10px;
}
.ts-subrow-date { color: transparent; } /* keeps column alignment without repeating the date */

/* ---- Team Dashboard expandable per-user entry detail ---- */
.ts-dash-subtable {
    margin: 8px 0 8px 24px;
    width: calc(100% - 24px);
    box-shadow: none;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}
.ts-dash-subtable th {
    background: var(--gray-lite, #f9fafb);
    font-size: 11px;
}
.ts-dash-subtable td, .ts-dash-subtable th {
    padding: 8px 10px;
    font-size: 12.5px;
}
.ts-dash-group-row td { font-weight: 500; }
.ts-dash-group-row:hover { background: var(--gray-lite, #f9fafb); }



/* ============================================================
   This Week's Entries - no scrollbar.
   The wrapper used overflow-x:auto (which also makes overflow-y auto), so the
   9 fixed-width columns produced an inner scrollbar. On desktop/tablet the table
   now fits the available width: the wrapper no longer scrolls, long text
   (project / module / task) is cut with "..." (full text stays in the tooltip),
   and the Submit Day / action buttons get enough room. Phones keep their
   existing stacked/scroll layout (max-width: 768px rules in
   03-core-loader-and-mobile.css).
   ============================================================ */
@media (min-width: 769px) {
    .ts-week-wrap {
        overflow: visible;
    }
    #ts-week-table {
        width: 100%;
        min-width: 0;
    }
    #ts-week-table th,
    #ts-week-table td {
        padding-left: 10px;
        padding-right: 10px;
    }
    #ts-week-table tbody td {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    /* Day header row (colspan cells) and the approval/reason cell may wrap. */
    #ts-week-table tr.ts-day-group-row td,
    #ts-week-table tbody td:nth-child(8) {
        white-space: normal;
        overflow: visible;
    }
    #ts-week-table tr.ts-day-group-row td:last-child {
        text-align: right;
        white-space: nowrap;
    }
    #ts-week-table .ts-icon-btn {
        flex: none;
    }
    #ts-week-table tbody td:last-child {
        white-space: nowrap;
        overflow: visible;
    }
}

/* Narrow desktop / tablet band (769-1180px): tighten further so all nine
   columns still fit without a scrollbar. */
@media (min-width: 769px) and (max-width: 1180px) {
    #ts-week-table { font-size: 12px; }
    #ts-week-table th,
    #ts-week-table td { padding-left: 6px; padding-right: 6px; }
    #ts-week-table col:nth-child(1) { width: 40px !important; }
    #ts-week-table col:nth-child(2) { width: 9% !important; }
    #ts-week-table col:nth-child(3) { width: 58px !important; }
    #ts-week-table col:nth-child(4) { width: 9% !important; }
    #ts-week-table col:nth-child(6) { width: 52px !important; }
    #ts-week-table col:nth-child(7) { width: 80px !important; }
    #ts-week-table col:nth-child(8) { width: 92px !important; }
    #ts-week-table col:nth-child(9) { width: 108px !important; }
}

/* Week total ("0.00 hrs") stays on one line instead of wrapping under the Hours header. */
@media (min-width: 769px) {
    #ts-week-table tfoot td { white-space: nowrap; }
}

/* ---- PM review of rejected entries, approval trail, permissions (additive) ---- */
body.ts-no-create [onclick*="StartTimer"], body.ts-no-create #ts-misc-start-btn,
body.ts-no-create #ts-misc-start-select { display: none !important; }
.apv-row-escalated { background: rgba(245, 158, 11, 0.08); }
.apv-esc-row td { font-size: 12px; color: #92400e; background: rgba(245, 158, 11, 0.12); padding: 6px 12px; }
.apv-edited-tag { background: #dbeafe; color: #1d4ed8; border-radius: 8px; padding: 1px 7px; font-size: 11px; margin-left: 4px; }
.ts-edit-subtitle { font-weight: 600; margin: 14px 0 6px; }
.ts-trail-summary { margin-bottom: 12px; font-size: 13px; }
.ts-trail-list { list-style: none; margin: 0; padding: 0; border-left: 2px solid #cbd5e1; margin-left: 12px; }
.ts-trail-item { position: relative; padding: 0 0 16px 26px; }
.ts-trail-dot { position: absolute; left: -13px; top: 0; width: 24px; height: 24px; border-radius: 50%; background: #64748b; color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 11px; }
.ts-trail-approved .ts-trail-dot { background: #16a34a; }
.ts-trail-rejected .ts-trail-dot { background: #dc2626; }
.ts-trail-edited .ts-trail-dot { background: #2563eb; }
.ts-trail-submitted .ts-trail-dot, .ts-trail-auto_submitted .ts-trail-dot { background: #0d9488; }
.ts-trail-role { background: #e2e8f0; border-radius: 8px; padding: 1px 7px; font-size: 11px; }
.ts-trail-when { font-size: 12px; color: #64748b; }
.ts-trail-note, .ts-trail-reason { font-size: 13px; margin-top: 3px; }
.ts-trail-reason { color: #b91c1c; }
.ts-trail-changes { border-collapse: collapse; margin-top: 6px; font-size: 12px; }
.ts-trail-changes th, .ts-trail-changes td { border: 1px solid #e2e8f0; padding: 3px 8px; text-align: left; }
.att-month-picker { margin-left: auto; font-size: 12px; border: 1px solid #cbd5e1; border-radius: 6px; padding: 1px 4px; background: transparent; }
.att-rejections { margin-top: 10px; border-top: 1px dashed #cbd5e1; padding-top: 8px; font-size: 12px; }
.att-rejections-title { font-weight: 600; color: #b91c1c; margin-bottom: 4px; }
.att-rejected-count { background: #fee2e2; color: #b91c1c; border-radius: 10px; padding: 0 7px; margin-left: 4px; }
.att-rejections-list { list-style: none; margin: 0; padding: 0; max-height: 150px; overflow-y: auto; }
.att-rej-item { display: flex; flex-wrap: wrap; gap: 2px 8px; padding: 4px 0; border-bottom: 1px solid #f1f5f9; }
.att-rej-date { font-weight: 600; }
.att-rej-state { color: #92400e; }
.att-rej-approved .att-rej-state { color: #15803d; }
.att-rej-returned .att-rej-state { color: #b91c1c; }
.att-rej-meta, .att-rej-reason { color: #64748b; width: 100%; }
