/* SFCLB Timesheet — Frontend Styles */
.ts-wrap { max-width: 900px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; color: #333; }
.ts-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.ts-subtitle { color: #666; margin: 0 0 12px; }

/* Header */
.ts-header { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.ts-header-right { text-align: right; }
.ts-period-nav { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.ts-period-label { font-weight: 600; font-size: 15px; }
.ts-nav-btn { background: #f0f0f0; border: 1px solid #ccc; padding: 4px 12px; border-radius: 4px; text-decoration: none; color: #333; font-size: 13px; cursor: pointer; }
.ts-nav-btn:hover { background: #e0e0e0; }
.ts-nav-disabled { opacity: .4; cursor: default; pointer-events: none; }
.ts-status { font-size: 13px; margin-bottom: 4px; }
.ts-payday { font-size: 13px; }

/* Badges */
.ts-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.ts-badge-draft     { background: #e8e8e8; color: #555; }
.ts-badge-submitted { background: #fff3cd; color: #856404; }
.ts-badge-approved  { background: #d4edda; color: #155724; }
.ts-badge-rejected  { background: #f8d7da; color: #721c24; }
.ts-badge-processed { background: #cce5ff; color: #004085; }

/* Totals bar */
.ts-totals-bar { display: flex; gap: 24px; background: #f7f9fc; border: 1px solid #dde3ea; border-radius: 6px; padding: 12px 20px; margin-bottom: 16px; }
.ts-total-item { display: flex; flex-direction: column; }
.ts-total-label { font-size: 11px; text-transform: uppercase; color: #888; letter-spacing: .04em; }
.ts-total-value { font-size: 22px; font-weight: 700; color: #1a1a1a; }

/* Alert */
.ts-alert { padding: 12px 16px; border-radius: 5px; margin-bottom: 16px; font-size: 14px; }
.ts-alert-warning { background: #fff3cd; border-left: 4px solid #ffc107; color: #856404; }

/* Day blocks */
.ts-day { border: 1px solid #dde3ea; border-radius: 6px; margin-bottom: 10px; overflow: hidden; }
.ts-weekend { background: #fafafa; }
.ts-day-header { display: flex; justify-content: space-between; align-items: center; background: #f0f4f8; padding: 8px 14px; border-bottom: 1px solid #dde3ea; }
.ts-day-name { font-weight: 600; font-size: 13px; }
.ts-entries-container { padding: 8px 14px; }
.ts-no-entries { color: #aaa; font-size: 13px; font-style: italic; padding: 4px 0; }

/* Entry rows */
.ts-entry { background: #fff; border: 1px solid #e8edf2; border-radius: 4px; padding: 8px 12px; margin-bottom: 6px; }
.ts-entry:last-child { margin-bottom: 0; }
.ts-entry-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; }
.ts-entry-cat { background: #e8f0fe; color: #1a56bb; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.ts-entry-time { color: #555; }
.ts-entry-hours { font-weight: 700; margin-left: auto; }
.ts-entry-miles { color: #2e7d32; font-weight: 600; }
.ts-entry-notes { font-size: 12px; color: #777; margin-top: 4px; font-style: italic; }
.ts-entry-actions { margin-top: 6px; display: flex; gap: 6px; }

/* Buttons */
.ts-btn { display: inline-block; padding: 7px 16px; border-radius: 4px; font-size: 13px; cursor: pointer; border: 1px solid transparent; text-decoration: none; line-height: 1.4; }
.ts-btn-primary   { background: #0073aa; color: #fff; border-color: #005d8c; }
.ts-btn-primary:hover { background: #005d8c; }
.ts-btn-secondary { background: #f0f0f0; color: #333; border-color: #ccc; }
.ts-btn-success   { background: #28a745; color: #fff; border-color: #1e7e34; }
.ts-btn-success:hover { background: #1e7e34; }
.ts-btn-danger    { background: #dc3545; color: #fff; border-color: #b02a37; }
.ts-btn-danger:hover { background: #b02a37; }
.ts-btn-sm  { padding: 4px 10px; font-size: 12px; }
.ts-btn-xs  { padding: 2px 8px; font-size: 11px; }
.ts-btn-add { background: #e8f5e9; color: #2e7d32; border-color: #c8e6c9; }
.ts-btn-add:hover { background: #c8e6c9; }
.ts-btn-edit { background: #e3f2fd; color: #1565c0; border-color: #bbdefb; }

/* Submit section */
.ts-submit-section { margin-top: 20px; padding: 16px; background: #f7f9fc; border: 1px solid #dde3ea; border-radius: 6px; }
.ts-submit-note { font-size: 12px; color: #888; margin-top: 8px; }
.ts-info { color: #555; font-style: italic; }

/* Info boxes */
.ts-info-box { padding: 12px 16px; border-radius: 5px; margin-top: 20px; font-size: 14px; }
.ts-info-approved  { background: #d4edda; color: #155724; }
.ts-info-rejected  { background: #f8d7da; color: #721c24; }
.ts-info-processed { background: #cce5ff; color: #004085; }

/* Approval section (supervisor) */
.ts-approval-section { margin-top: 20px; padding: 20px; border: 2px solid #0073aa; border-radius: 8px; }
.ts-approval-section h3 { margin-top: 0; }
.ts-approval-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Table */
.ts-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 16px; }
.ts-table th { background: #0073aa; color: #fff; padding: 8px 10px; text-align: left; }
.ts-table td { padding: 7px 10px; border-bottom: 1px solid #dde3ea; }
.ts-table tr:nth-child(even) td { background: #f8f9fa; }
.ts-row-empty td { color: #ccc; }
.ts-tfoot-totals td { background: #f0f4f8 !important; font-weight: 700; border-top: 2px solid #0073aa; }

/* Modal */
.ts-modal { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.ts-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.ts-modal-box { position: relative; background: #fff; border-radius: 8px; padding: 28px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.ts-modal-box h3 { margin-top: 0; font-size: 18px; }

/* Form */
.ts-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ts-form-full { grid-column: 1 / -1; }
.ts-form-group { display: flex; flex-direction: column; gap: 4px; }
.ts-form-group label { font-size: 12px; font-weight: 600; color: #555; }
.ts-form-group input, .ts-form-group select, .ts-form-group textarea { padding: 7px 10px; border: 1px solid #ccc; border-radius: 4px; font-size: 14px; }
.ts-form-group input:focus, .ts-form-group select:focus, .ts-form-group textarea:focus { outline: none; border-color: #0073aa; box-shadow: 0 0 0 2px rgba(0,115,170,.15); }
.ts-form-value { font-size: 14px; padding: 7px 0; font-weight: 600; }
.ts-required { color: #dc3545; }

.ts-calculated-hours { background: #f0f4f8; border-radius: 4px; padding: 8px 12px; font-size: 13px; margin: 10px 0; }
.ts-modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.ts-modal-message { margin-top: 10px; font-size: 13px; padding: 6px 10px; border-radius: 4px; }
.ts-modal-message.success { background: #d4edda; color: #155724; }
.ts-modal-message.error   { background: #f8d7da; color: #721c24; }

.ts-notice { padding: 12px 16px; border: 1px solid #ddd; border-radius: 4px; background: #f9f9f9; }
.ts-notice.ts-error { background: #f8d7da; border-color: #f5c6cb; color: #721c24; }

@media (max-width: 600px) {
    .ts-form-grid { grid-template-columns: 1fr; }
    .ts-form-full { grid-column: auto; }
    .ts-header { flex-direction: column; }
    .ts-header-right { text-align: left; }
    .ts-totals-bar { flex-direction: column; gap: 12px; }
    .ts-entry-main { flex-direction: column; gap: 4px; }
    .ts-entry-hours { margin-left: 0; }
}
