/* Timesheet-specific controls; the original invoice styles remain shared. */
.timesheet-payment-toggle{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;margin:7px 0 2px;font-size:.78rem;color:#536174}
.timesheet-payment-toggle button{border:1px solid #d7dfe5;background:#fff;color:#34485a;border-radius:6px;padding:4px 9px;font-size:.75rem}
.timesheet-payment-toggle button:hover{background:#f3f6fa}
@media(max-width:767px){.timesheet-payment-toggle{justify-content:flex-start}}
@media print{.timesheet-payment-toggle{display:none!important}}

.invoice-logo-area{position:relative}
.timesheet-remove-logo{position:absolute;right:4px;top:4px;width:25px;height:25px;line-height:20px;border:1px solid #d5dbe2;border-radius:50%;color:#424c57;background:#fff;font-size:17px;font-weight:700;cursor:pointer;z-index:2}
.timesheet-remove-logo:hover{color:#ad2737;border-color:#dfb2ba}
.timesheet-remove-logo[hidden]{display:none!important}
.invoice-pdf-host .timesheet-remove-logo{display:none!important}


/* Timesheet status picker: opening it always shows every status, even when an
   existing value is present. Custom statuses remain editable in the text field. */
.timesheet-method-row.is-open{position:relative;z-index:50}
.timesheet-method-combobox{position:relative;min-width:0;width:100%}
.invoice-paper .timesheet-method-combobox input[data-field="timesheetStatus"]{width:100%;padding-right:32px}
.timesheet-method-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    height: 100%;
    max-height: 35px;
    width: 29px;
    border: 0;
    background: transparent;
    color: #59677a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 17px;
    line-height: 1;
}
.timesheet-method-toggle span {
    display: block;
    line-height: 1;
}
.timesheet-method-toggle:focus-visible{outline:2px solid #b48b44;outline-offset:-2px;border-radius:4px}
.timesheet-method-toggle[aria-expanded="true"] span{transform:rotate(180deg)}
.timesheet-method-options{position:absolute;right:0;top:calc(100% + 4px);min-width:100%;width:max(100%,205px);max-width:min(285px,calc(100vw - 48px));max-height:320px;overflow-y:auto;overscroll-behavior:contain;background:#fff;color:#182536;border:1px solid #d8dfe8;border-radius:7px;box-shadow:0 8px 22px rgba(16,32,56,.16);z-index:60;padding:4px 0}
.timesheet-method-options[hidden]{display:none!important}
.timesheet-method-options button[role="option"]{display:block;width:100%;min-height:34px;padding:8px 12px;border:0;background:#fff;color:#182536;text-align:left;font-size:.82rem;line-height:1.4;cursor:pointer;white-space:normal}
.timesheet-method-options button[role="option"]:hover,.timesheet-method-options button[role="option"].is-active{background:#f0f4fa;color:#172d53}
.timesheet-method-options button[role="option"][aria-selected="true"]{font-weight:700}
.timesheet-method-options button[role="option"][hidden]{display:none!important}
@media print{.timesheet-method-options,.timesheet-method-toggle{display:none!important}}
.invoice-pdf-host .timesheet-method-options,.invoice-pdf-host .timesheet-method-toggle{display:none!important}

/* Optional deposit schedule: leave the remaining-balance row out until a deposit is entered. */
.invoice-total-row[hidden],.invoice-pdf-host .invoice-total-row[hidden]{display:none!important}
/* Free-text timesheet dates with an optional native calendar shortcut. The text
   fields have no required/date-format restriction and can be completely blank. */
.invoice-paper .timesheet-date-field{position:relative;min-width:0;width:100%}
.invoice-paper .timesheet-date-field>input[data-field]{box-sizing:border-box;min-width:0;width:100%;padding-right:36px}
.timesheet-date-picker-toggle{position:absolute;right:3px;top:50%;transform:translateY(-50%);width:29px;height:29px;display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;opacity:.78;cursor:pointer;z-index:1}
.timesheet-date-picker-toggle:hover{opacity:1}
.timesheet-date-picker-toggle:focus-visible{opacity:1;outline:2px solid #b48b44;outline-offset:0;border-radius:4px}
/* Keep the native control rendered so showPicker works in supported browsers;
   it isn't a persisted field and never appears in the generated PDF. */
.invoice-paper .timesheet-date-native-picker{position:absolute!important;right:2px!important;top:calc(100% - 1px)!important;width:1px!important;min-width:0!important;height:1px!important;padding:0!important;border:0!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}
@media print{.timesheet-date-picker-toggle,.timesheet-date-native-picker{display:none!important}}
.invoice-pdf-host .timesheet-date-picker-toggle,.invoice-pdf-host .timesheet-date-native-picker{display:none!important}
.timesheet-method-options[hidden]{display:none!important}

/* The PDF uses wrapping text instead of a single-line input for custom dates.
   This keeps long phrases fully visible rather than clipping their last words. */
.invoice-pdf-host .timesheet-pdf-date-value{box-sizing:border-box;min-width:0;width:100%;margin:0;padding:0;text-align:inherit;font:inherit;color:inherit;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}

/* Work entries are part of the actual document and stay readable in every theme. */
.invoice-paper .timesheet-work-cell{min-width:0;vertical-align:top;text-align:left}
.invoice-paper .timesheet-entry-date-label{display:flex;align-items:center;gap:9px;font-size:.7rem;font-weight:650;letter-spacing:.01em;opacity:.86;margin:0 0 6px;color:inherit}
.invoice-paper .timesheet-entry-date-label input{flex:1;min-width:0;width:100%;max-width:175px;border:1px solid var(--invoice-line,#e0e4ea);border-radius:5px;padding:4px 5px;background:transparent;color:inherit;font-size:.73rem;min-height:28px}
.invoice-paper .timesheet-work-cell .invoice-item-description{box-sizing:border-box;width:100%;min-width:0;min-height:48px;margin:0 0 6px;resize:vertical;font-size:.83rem;line-height:1.4}
.invoice-paper .timesheet-entry-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:4px 0 5px}
.invoice-paper .timesheet-entry-controls .timesheet-entry-control{display:flex;flex-direction:column;gap:3px;min-width:0;margin:0;font-size:.65rem;line-height:1.3;color:inherit;opacity:.92}
.invoice-paper .timesheet-entry-controls input{width:100%;min-width:0;min-height:29px;padding:4px 3px;box-sizing:border-box;border:1px solid var(--invoice-line,#e0e4ea);border-radius:5px;background:transparent;color:inherit;font-size:.7rem}
.invoice-paper .timesheet-entry-options{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;font-size:.68rem;line-height:1.3;color:inherit}
.invoice-paper .timesheet-entry-options .timesheet-billable,.invoice-paper .timesheet-entry-options .timesheet-rate-multiplier{display:inline-flex;align-items:center;gap:4px;margin:0;font-size:inherit;cursor:pointer}
.invoice-paper .timesheet-entry-options input[type=checkbox]{width:14px;height:14px;accent-color:var(--invoice-accent,#2a5da0)}
.invoice-paper .timesheet-entry-options select{min-height:24px;width:60px;padding:0 3px;background:transparent;border:1px solid var(--invoice-line,#e0e4ea);border-radius:4px;color:inherit;font-size:.68rem}
.invoice-paper .timesheet-hours-cell{vertical-align:top;text-align:center}
.invoice-paper .timesheet-hours-cell .invoice-qty-input{width:100%;min-width:0;max-width:87px;box-sizing:border-box;text-align:center}
.invoice-paper .timesheet-hours-cell .invoice-qty-input[readonly]{cursor:default;background:rgba(128,128,128,.04)}
.invoice-paper .timesheet-row-error{display:block;margin:5px 0 0;padding:5px;border-radius:4px;background:#fff1f0;color:#8f2424;font-size:.67rem}
.invoice-paper .timesheet-row-error[hidden]{display:none!important}
.invoice-paper .timesheet-hours-summary{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin:16px 0;padding:10px 13px;border:1px solid var(--invoice-line,#e0e4ea);border-radius:7px;color:inherit}
.invoice-paper .timesheet-hours-summary>div{display:flex;align-items:center;gap:12px;min-width:142px;justify-content:space-between;font-size:.79rem}
.invoice-paper .timesheet-hours-summary strong{font-weight:700;white-space:nowrap}
.invoice-paper .invoice-items-table tr[data-row]{break-inside:avoid;page-break-inside:avoid}
@media(max-width:767px){
 .invoice-paper .timesheet-entry-controls{grid-template-columns:repeat(2,minmax(0,1fr))}
 .invoice-paper .timesheet-hours-summary{justify-content:stretch}
 .invoice-paper .timesheet-hours-summary>div{flex:1;min-width:125px}
}
@media print{
 .invoice-paper .timesheet-entry-controls input,.invoice-paper .timesheet-entry-date-label input{border:0!important}
}
.invoice-pdf-host .timesheet-entry-controls,.invoice-pdf-host .timesheet-entry-options,.invoice-pdf-host .timesheet-entry-date-label,.invoice-pdf-host .timesheet-row-error{display:none!important}
.invoice-pdf-host .timesheet-hours-summary{break-inside:avoid;page-break-inside:avoid}
.invoice-pdf-host .timesheet-work-cell{min-width:0!important}

.invoice-paper .timesheet-entry-help{font-size:.68rem;line-height:1.5;color:#68758b;margin:3px 0 6px;max-width:96%}
.invoice-pdf-host .timesheet-entry-help{display:none!important}
@media print{.timesheet-entry-help{display:none!important}}

/* Timesheet captions are directly editable, just like the original Quote
   Generator's document labels. Keep them visible in all ten themes. */
.invoice-paper .timesheet-editable-label,
.invoice-paper .timesheet-hours-summary [data-label-key],
.invoice-paper .invoice-balance-row [data-label-key]{cursor:text;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;outline-offset:2px}
.invoice-paper .timesheet-editable-label:focus,
.invoice-paper .timesheet-hours-summary [data-label-key]:focus,
.invoice-paper .invoice-balance-row [data-label-key]:focus{outline:1px dashed var(--invoice-accent,#2a5da0);border-radius:2px}
.invoice-paper .timesheet-entry-date-label .timesheet-editable-label{flex:0 1 auto}
.invoice-paper .timesheet-entry-controls .timesheet-editable-label{display:inline-block}
.invoice-paper .timesheet-entry-options .timesheet-editable-label{display:inline-block;max-width:100%}
.invoice-paper .timesheet-hours-summary [data-label-key]{flex:1}
@media print{.invoice-paper [data-label-key]:focus{outline:none!important}}
.invoice-pdf-host [data-label-key]:focus{outline:none!important}
