:root {
  --action-btn-success-bg: #34C759;
  --action-btn-warning-bg: #FF9500;
  --action-btn-danger-bg: #EC221F;
}

.ts-wrapper { 
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0 1rem;
  flex-direction: row;
}
.ts-topbar {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 0.7rem;
}
.ts-toggle {
  border: 1px solid #cfcfcf;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.ts-dropdown {
  position: absolute;
  top: 34px;
  left: 0;
  width: 720px;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,.12);
  z-index: 9999;
}

.ts-dropdown .ts-item {
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 4px;
  border-bottom:1px solid #f0f0f0;
}
.ts-dropdown .ts-item .ts-item-action {
  display:flex; 
  gap:4px; 
  flex-shrink:0;
}
.ts-dropdown .ts-item .ts-item-action button[data-ts-action="pause"] {
  border:none;
  background:var(--action-btn-warning-bg);
  color:#fff;
  border-radius:3px;
  padding:3px 7px;
  font-size:11px;
  cursor:pointer;
}
.ts-dropdown .ts-item .ts-item-action button[data-ts-action="resume"] {
  border:none;
  background:var(--action-btn-success-bg);
  color:#fff;
  border-radius:3px;
  padding:3px 7px;
  font-size:11px;
  cursor:pointer;
}
.ts-dropdown .ts-item .ts-item-action button[data-ts-action="finish"] {
  border:none;
  background:var(--action-btn-danger-bg);
  color:#fff;
  border-radius:3px;
  padding:3px 7px;
  font-size:11px;
  cursor:pointer;
}
.ts-dropdown .ts-item .ts-item-time-detail {
  min-width:62px;
  font-size:11px;
  font-weight:bold;
  color:#333;
  text-align:center;
  border:1px solid #ddd;
  border-radius:3px;
  padding:2px 4px;
}
.ts-dropdown .ts-item .ts-item-record-detail {
  min-width:0; flex:1;
}
.ts-dropdown .ts-item .ts-item-record-detail div {
  font-size:12px;
  color:#333;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.ts-dropdown .ts-item .ts-item-record-detail div a {
  color: #000;
}

.ts-hidden { display: none; }

.ts-activebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
  gap: 10px;
}

.ts-activebar-left { display: flex; align-items: center; gap: 8px; }
.ts-activebar-right { flex: 1; text-align: right; }
.ts-active-title { 
  font-weight: 600;
  max-width: 30ch;
      /* width: clamp(100px, 20vw, 600px); */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}

.ts-list { padding: 6px; }

.ts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 6px;
  border-radius: 6px;
}

.ts-row:hover { background: #f6f6f6; }

.ts-row-left { display: flex; align-items: center; gap: 8px; }
.ts-row-right { flex: 1; padding-left: 10px; }

.ts-title { font-weight: 600; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.ts-time {
  font-family: monospace;
  background: #f2f2f2;
  border: 1px solid #e1e1e1;
  padding: 2px 6px;
  border-radius: 14px;
}
.ts-active {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}
.ts-btn {
  border: none;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: #fff;
  font-weight: 600;
}
.ts-active-title, .ts-active-title > a, .ts-active-time { color: #fff!important; }
.ts-btn-success { 
  /* background: #2fbf63;  */
  background: linear-gradient(180deg, color-mix(in srgb, #2fbf63 88%, #000), #2fbf63);
  border-color: color-mix(in srgb, var(#2fbf63) 72%, #000);
}
.ts-btn-warn    { 
  /* background: #f0ad4e;  */
  background: linear-gradient(180deg, color-mix(in srgb, #f0ad4e 88%, #000), #f0ad4e);
  border-color: color-mix(in srgb, #f0ad4e 72%, #000);
}
.ts-btn-danger  { 
  /* background: #d9534f;  */
  background: linear-gradient(180deg, color-mix(in srgb, #d9534f 88%, #000), #d9534f);
  border-color: color-mix(in srgb, var(#d9534f) 72%, #000);
}

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

.ts-empty { padding: 12px; color: #666; }

.action-timesheet-btn { margin: 0 1rem; display: inline-flex; }
.action-timesheet-btn__btn {
  color: #fff;
  padding: 0.3rem 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  user-select: none;
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.12), 0 1px 5px 0 rgba(0, 0, 0, 0.2);
  border: 0.5px solid rgba(5, 51, 69, 0.45);
}
.action-timesheet-btn__btn.action-timesheet-btn__btn--start, .action-timesheet-btn__btn.action-timesheet-btn__btn--resume {
  background: linear-gradient(180deg, color-mix(in srgb, var(--action-btn-success-bg) 88%, #000), var(--action-btn-success-bg));
  border-color: color-mix(in srgb, var(--action-btn-success-bg) 72%, #000);
}
.action-timesheet-btn__btn.action-timesheet-btn__btn--pause {
  background: linear-gradient(180deg, color-mix(in srgb, var(--action-btn-warning-bg) 88%, #000), var(--action-btn-warning-bg));
  border-color: color-mix(in srgb, var(--action-btn-warning-bg) 72%, #000);
}
.action-timesheet-btn__btn.action-timesheet-btn__btn--finish {
  background: linear-gradient(180deg, color-mix(in srgb, var(--action-btn-danger-bg) 88%, #000), var(--action-btn-danger-bg));
  border-color: color-mix(in srgb, var(--action-btn-danger-bg) 72%, #000);
}
.action-timesheet-btn__btn i { margin: 0; }
.action-timesheet-btn__btn:hover { filter: brightness(0.95); }
.action-timesheet-btn__btn:active { transform: translateY(1px); }


.main-content.timesheet-container {
  padding: 24px;
}

.main-content.timesheet-container .timesheet-page {
  background: #f5f6f8;
  min-height: 100vh;
  box-sizing: border-box;
}

.main-content.timesheet-container .timesheet-page__header {
  margin-bottom: 20px;
}

.main-content.timesheet-container .timesheet-page__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #222;
}

.main-content.timesheet-container .timesheet-page__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: #666;
}

.main-content.timesheet-container .timesheet-filter-card,
.main-content.timesheet-container .timesheet-list-card {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.main-content.timesheet-container .timesheet-filter-card {
  margin-bottom: 20px;
}

.main-content.timesheet-container .timesheet-filter-card__header,
.main-content.timesheet-container .timesheet-list-card__header {
  margin-bottom: 16px;
}

.main-content.timesheet-container .timesheet-filter-card__header h2,
.main-content.timesheet-container .timesheet-list-card__header h2 {
  margin: 0;
  font-size: 18px;
  color: #222;
}

.main-content.timesheet-container .timesheet-result-count {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: #666;
}

.main-content.timesheet-container .timesheet-filter-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.main-content.timesheet-container .form-group {
  display: flex;
  flex-direction: column;
}

.main-content.timesheet-container .form-group label {
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
#timesheet-new-modal .ts-new-form-block {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1rem;
}
#timesheet-new-modal .ts-new-form-block-time {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 1rem;
}

.main-content.timesheet-container .form-group input, #timesheet-new-modal .form-group select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #cfd5dc;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.main-content.timesheet-container .form-group input:focus, #timesheet-new-modal .form-group select:focus {
  border-color: #3b82f6;
}

.main-content.timesheet-container .form-group .select2-container ul {
  min-height: 40px!important;
  border-radius: 8px!important;
}

.main-content.timesheet-container .form-group .select2-container ul li {
  line-height: 20px;
}
.main-content.timesheet-container .form-group .select2-container ul li.select2-search-field {
  line-height: 2.5;
}

.main-content.timesheet-container .timesheet-filter-form__actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: space-between;
}

.main-content.timesheet-container .btn, #timesheet-new-modal .timesheet-filter-form__actions .btn {
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}
#timesheet-new-modal .timesheet-filter-form__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.main-content.timesheet-container .timesheet-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main-content.timesheet-container .timesheet-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  background: #fafafa;
}

.main-content.timesheet-container .timesheet-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.main-content.timesheet-container .timesheet-item__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

.main-content.timesheet-container .timesheet-item__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: #666;
}

.main-content.timesheet-container .timesheet-item__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.main-content.timesheet-container .timesheet-item__status--running {
  background: #dcfce7;
  color: #166534;
}

.main-content.timesheet-container .timesheet-item__status--paused {
  background: #fef3c7;
  color: #92400e;
}

.main-content.timesheet-container .timesheet-item__status--finished {
  background: #fee2e2;
  color: #991b1b;
}

.main-content.timesheet-container .timesheet-item__details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.main-content.timesheet-container .timesheet-item__detail {
  background: #fff;
  border: 1px solid #eceff3;
  border-radius: 8px;
  padding: 12px;
}

.main-content.timesheet-container .timesheet-item__detail-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}

.main-content.timesheet-container .timesheet-item__detail-value {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

.main-content.timesheet-container .timesheet-empty-state {
  padding: 32px 16px;
  text-align: center;
  color: #666;
  border: 1px dashed #d1d5db;
  border-radius: 10px;
  background: #fafafa;
}

@media (max-width: 768px) {
  .main-content.timesheet-container .timesheet-page {
    padding: 16px;
  }

  .main-content.timesheet-container .timesheet-item__top {
    flex-direction: column;
    align-items: flex-start;
  }
}


.main-content.timesheet-container .timesheet-table-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.main-content.timesheet-container .timesheet-table-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 14px;
  color: #4b5563;
  font-weight: 600;
}

.main-content.timesheet-container .timesheet-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.main-content.timesheet-container .timesheet-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.main-content.timesheet-container .timesheet-table thead th {
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  color: #111827;
  padding: 14px 16px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.main-content.timesheet-container .timesheet-table tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid #f0f2f5;
  font-size: 14px;
  color: #1f2937;
  vertical-align: middle;
}

.main-content.timesheet-container .timesheet-table tbody tr:hover {
  background: #fafafa;
}
.main-content.timesheet-container .timesheet-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  box-sizing: border-box;
}

.main-content.timesheet-container .timesheet-badge--running {
  background: #dcfce7;
  color: #166534;
}

.main-content.timesheet-container .timesheet-badge--paused {
  background: #fef3c7;
  color: #92400e;
}

.main-content.timesheet-container .timesheet-badge--finished {
  background: #fee2e2;
  color: #991b1b;
}

.main-content.timesheet-container .timesheet-time {
  font-weight: 700;
  color: #111827;
}

.main-content.timesheet-container .timesheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-content.timesheet-container .timesheet-action-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
}

.main-content.timesheet-container .timesheet-action-btn:hover {
  background: #f3f4f6;
}

.main-content.timesheet-container .timesheet-action-btn--play {
  color: #16a34a;
}

.main-content.timesheet-container .timesheet-action-btn--edit {
  color: #374151;
}

.main-content.timesheet-container .timesheet-action-btn--reopen {
  color: #0d6efd;
}

.main-content.timesheet-container .timesheet-action-btn--delete {
  color: #dc2626;
}

.main-content.timesheet-container .timesheet-empty-state {
  display: none;
  padding: 32px 20px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.main-content.timesheet-container .timesheet-pagination {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 6px;
  margin: 14px 0;
  padding: 10px 16px;
  flex-wrap: wrap;
}

.main-content.timesheet-container .ts-page-btn {
  min-width: 34px;
  height: 34px;
  border: 1px solid #d0d5dd;
  background-color: #ffffff;
  color: #344054;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.main-content.timesheet-container .ts-page-btn:hover {
  background-color: #f2f4f7;
}

.main-content.timesheet-container .ts-page-btn.active {
  background-color: #e8f7ed;
  border-color: var(--action-btn-success-bg);
  color: #1f7a3d;
}

.main-content.timesheet-container #timesheet-table-body .timesheet-table-body__link {
  color: #000;
  font-weight: bold;
}

/* ===== Dark theme (.theme-5) — timesheet-menu ===== */
.theme-5 .ts-toggle {
  background: #1a2333 !important;
  border-color: #2d3142 !important;
  color: #e5e7eb !important;
}
.theme-5 .ts-dropdown {
  background: #1a2333 !important;
  border-color: #2d3142 !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.4) !important;
}
.theme-5 .ts-dropdown .ts-item {
  border-bottom-color: #2d3142 !important;
}
.theme-5 .ts-dropdown .ts-item .ts-item-time-detail {
  color: #e5e7eb !important;
  border-color: #2d3142 !important;
  background: #0b0f19 !important;
}
.theme-5 .ts-dropdown .ts-item .ts-item-record-detail div {
  color: #e5e7eb !important;
}
.theme-5 .ts-activebar {
  background: #0b0f19 !important;
  border-bottom-color: #2d3142 !important;
}
.theme-5 .ts-row:hover {
  background: #151e2d !important;
}
.theme-5 .ts-title {
  color: #e5e7eb !important;
}
.theme-5 .ts-time {
  background: #0b0f19 !important;
  border-color: #2d3142 !important;
  color: #e5e7eb !important;
}
.theme-5 .ts-empty {
  color: #9ca3af !important;
}

/* ===== Dark theme (.theme-5) — timesheet page ===== */
.theme-5 .main-content.timesheet-container .timesheet-page {
  background: #070a0f !important;
}
.theme-5 .main-content.timesheet-container .timesheet-page__title {
  color: #e5e7eb !important;
}
.theme-5 .main-content.timesheet-container .timesheet-page__subtitle,
.theme-5 .main-content.timesheet-container .timesheet-result-count {
  color: #9ca3af !important;
}
.theme-5 .main-content.timesheet-container .timesheet-filter-card,
.theme-5 .main-content.timesheet-container .timesheet-list-card,
.theme-5 .main-content.timesheet-container .timesheet-table-card,
.theme-5 .main-content.timesheet-container .timesheet-pagination {
  background: #1a2333 !important;
  border-color: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .timesheet-filter-card__header h2,
.theme-5 .main-content.timesheet-container .timesheet-list-card__header h2 {
  color: #e5e7eb !important;
}
.theme-5 .main-content.timesheet-container .form-group label {
  color: #d1d5db !important;
}
.theme-5 .main-content.timesheet-container .form-group input,
.theme-5 #timesheet-new-modal .form-group select {
  background: #0b0f19 !important;
  border-color: #2d3142 !important;
  color: #e5e7eb !important;
}
.theme-5 .main-content.timesheet-container .timesheet-item {
  background: #151e2d !important;
  border-color: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .timesheet-item__title {
  color: #e5e7eb !important;
}
.theme-5 .main-content.timesheet-container .timesheet-item__subtitle {
  color: #9ca3af !important;
}
.theme-5 .main-content.timesheet-container .timesheet-item__detail {
  background: #1a2333 !important;
  border-color: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .timesheet-item__detail-label {
  color: #9ca3af !important;
}
.theme-5 .main-content.timesheet-container .timesheet-item__detail-value {
  color: #e5e7eb !important;
}
.theme-5 .main-content.timesheet-container .timesheet-empty-state {
  color: #9ca3af !important;
  border-color: #2d3142 !important;
  background: #151e2d !important;
}
.theme-5 .main-content.timesheet-container .timesheet-table-card__header {
  color: #9ca3af !important;
  border-bottom-color: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .timesheet-table thead th {
  color: #c1ff73 !important;
  background: #0b0f19 !important;
  border-bottom-color: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .timesheet-table tbody td {
  color: #e5e7eb !important;
  border-bottom-color: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .timesheet-table tbody tr:hover {
  background: #151e2d !important;
}
.theme-5 .main-content.timesheet-container .timesheet-time {
  color: #e5e7eb !important;
}
.theme-5 .main-content.timesheet-container .timesheet-action-btn:hover {
  background: #2d3142 !important;
}
.theme-5 .main-content.timesheet-container .ts-page-btn {
  background-color: #0b0f19 !important;
  border-color: #2d3142 !important;
  color: #d1d5db !important;
}
.theme-5 .main-content.timesheet-container .ts-page-btn:hover {
  background-color: #1a2333 !important;
}
.theme-5 .main-content.timesheet-container .ts-page-btn.active {
  background-color: #0f2a1a !important;
  border-color: #1d6b3a !important;
  color: #86efac !important;
}

.theme-5 .action-timesheet-btn__btn.action-timesheet-btn__btn--start, .theme-5 .action-timesheet-btn__btn.action-timesheet-btn__btn--resume {
  background: linear-gradient(180deg, color-mix(in srgb, var(--action-btn-success-bg) 70%, #000), color-mix(in srgb, var(--action-btn-success-bg) 85%, #000));
  border-color: color-mix(in srgb, var(--action-btn-success-bg) 72%, #000);
}
.theme-5 .action-timesheet-btn__btn.action-timesheet-btn__btn--pause {
  background: linear-gradient(180deg, color-mix(in srgb, var(--action-btn-warning-bg) 70%, #000), color-mix(in srgb, var(--action-btn-warning-bg) 85%, #000));
  border-color: color-mix(in srgb, var(--action-btn-warning-bg) 72%, #000);
}
.theme-5 .action-timesheet-btn__btn.action-timesheet-btn__btn--finish {
  background: linear-gradient(180deg, color-mix(in srgb, var(--action-btn-danger-bg) 70%, #000), color-mix(in srgb, var(--action-btn-danger-bg) 85%, #000));
  border-color: color-mix(in srgb, var(--action-btn-danger-bg) 72%, #000);
}
.theme-5 .ts-dropdown .ts-item .ts-item-record-detail div a,
.theme-5 .main-content.timesheet-container .timesheet-action-btn--edit,
.theme-5 .main-content.timesheet-container #timesheet-table-body .timesheet-table-body__link {
  color: #fff;
}
.theme-5 .main-content.timesheet-container #clear-filters-btn {
  color: #000;
}