/* Treelife timesheet billing. Frosted glass over a green and lime glow. */
:root {
  --forest: #0d3b26; --mid: #1a5c3a; --bright: #2e8b57; --spark: #c8f04d;
  --ink: #1c2b3a; --steel: #3d5166; --cloud: #e8eef4; --warm: #f7f6f2;
  --gold: #d4a843; --terra: #c05e3c; --risk: #c0392b;
  --glass: rgba(255, 255, 255, 0.68); --glass-strong: rgba(255, 255, 255, 0.86);
  --edge: 1px solid rgba(255, 255, 255, 0.95); --line: rgba(13, 59, 38, 0.1);
  --shadow: 0 10px 34px rgba(13, 59, 38, 0.1), 0 1px 2px rgba(13, 59, 38, 0.06);
  --radius: 18px; --rail: 72px; --side: 236px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 400 15px/1.5 'IBM Plex Sans', system-ui, sans-serif; color: var(--ink);
  font-variant-numeric: tabular-nums; background: var(--warm);
  background-image:
    radial-gradient(900px 600px at 8% -5%, rgba(46, 139, 87, 0.26), transparent 60%),
    radial-gradient(700px 520px at 92% 8%, rgba(200, 240, 77, 0.34), transparent 60%),
    radial-gradient(900px 700px at 70% 105%, rgba(26, 92, 58, 0.18), transparent 60%);
  background-attachment: fixed;
}
h1, h2, h3 { margin: 0; color: var(--forest); font-weight: 600; }
h1 { font-size: 28px; line-height: 34px; }
h2 { font-size: 20px; line-height: 26px; }
h3 { font-size: 16px; line-height: 22px; }
a { color: var(--mid); }
.caption { font-size: 13px; line-height: 1.4; color: var(--steel); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--steel); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--bright); outline-offset: 2px; border-radius: 6px; }

.glass { background: var(--glass); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); border: var(--edge); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 20px 22px; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; gap: 0; transition: grid-template-columns .2s; }
.shell.rail { grid-template-columns: var(--rail) 1fr; }
.side { position: sticky; top: 14px; margin: 14px 0 14px 14px; height: calc(100vh - 28px); display: flex; flex-direction: column; padding: 18px 12px; }
.brand { height: 44px; margin: 2px 8px 22px; display: flex; align-items: center; gap: 10px; }
.logo { flex: none; display: block; background: var(--forest); -webkit-mask: url(logo.png) center / 230px no-repeat; mask: url(logo.png) center / 230px no-repeat; width: 190px; height: 52px; }
.logo.small { width: 24px; height: 44px; -webkit-mask-size: 220px; mask-size: 220px; -webkit-mask-position: 10.1% 50%; mask-position: 10.1% 50%; }
.brand-sub { font-size: 13px; color: var(--steel); margin: -16px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a:hover { background: rgba(46, 139, 87, 0.08); }
.nav a[aria-current="page"] { background: var(--forest); color: #fff; }
.nav svg, .icon { width: 20px; height: 20px; flex: none; }
.usercard { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.6); }
.usercard .who { min-width: 0; flex: 1; }
.usercard .who b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shell.rail .label, .shell.rail .brand-sub, .shell.rail .usercard .who { display: none; }
.shell.rail .nav a { justify-content: center; padding: 10px 0; }
.shell.rail .usercard { flex-direction: column; padding: 8px 0; background: none; }
.shell.rail .brand { margin: 2px 0 22px; justify-content: center; }

.main { padding: 22px 28px 48px 24px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; min-height: 44px; }
.topbar .grow { flex: 1; min-width: 0; }

/* Buttons and inputs */
button, .btn { font: inherit; font-weight: 500; font-size: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-strong); color: var(--ink); padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 20px; white-space: nowrap; }
button:hover:not(:disabled), .btn:hover { border-color: var(--bright); }
.primary { background: var(--forest); color: #fff; border-color: var(--forest); }
.primary:hover:not(:disabled) { background: var(--mid); }
.danger { color: var(--risk); border-color: rgba(192, 57, 43, 0.35); }
.ghost { background: transparent; border-color: transparent; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn[aria-disabled="true"] { pointer-events: none; }
.iconbtn { padding: 8px; border-radius: 12px; position: relative; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--ink); border: 1px solid rgba(61, 81, 102, 0.28); border-radius: 10px; padding: 8px 10px; background: rgba(255, 255, 255, 0.9); min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--bright); outline: 3px solid rgba(46, 139, 87, 0.25); outline-offset: 0; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--steel); font-weight: 500; }

/* Tags and chips */
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px; line-height: 20px; white-space: nowrap; }
.tag::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .7; }
.tag.draft { background: var(--cloud); color: var(--ink); }
.tag.review { background: var(--gold); color: var(--ink); }
.tag.final { background: var(--mid); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; padding: 1px 9px; border-radius: 999px; background: rgba(26, 92, 58, 0.09); color: var(--forest); border: 1px solid rgba(26, 92, 58, 0.16); white-space: nowrap; }
.chip button { padding: 0 2px; border: 0; background: none; color: var(--steel); font-size: 14px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.billing { display: inline-flex; font-size: 12px; font-weight: 600; padding: 0 8px; border-radius: 6px; background: var(--cloud); color: var(--ink); border: 1px solid rgba(61, 81, 102, 0.2); white-space: nowrap; line-height: 20px; }
.billing.hourly { background: #fff; color: var(--forest); border-color: rgba(26, 92, 58, 0.35); }
.flag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; padding: 1px 8px; border-radius: 8px; background: rgba(192, 94, 60, 0.12); color: #8a3a1f; border: 1px solid rgba(192, 94, 60, 0.4); white-space: nowrap; }
.role { font-size: 12.5px; font-weight: 600; padding: 1px 9px; border-radius: 999px; }
.role.admin { background: var(--forest); color: #fff; }
.role.manager { background: var(--cloud); color: var(--ink); }

/* Avatars */
.avatars { display: flex; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 600; background: #fff; color: var(--forest); border: 2px solid rgba(26, 92, 58, 0.25); position: relative; margin-right: -2px; flex: none; }
.avatar.ok { border-color: var(--mid); }
.avatar .tick { position: absolute; right: -4px; bottom: -4px; width: 15px; height: 15px; border-radius: 50%; background: var(--mid); color: #fff; display: grid; place-items: center; font-size: 10px; border: 2px solid #fff; }
.avatar.unassigned { border: 2px dashed var(--terra); color: #8a3a1f; background: rgba(192, 94, 60, 0.06); }
.avatar.big { width: 40px; height: 40px; font-size: 14px; margin: 0; }

/* Tiles */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.tile { display: flex; align-items: center; gap: 16px; padding: 18px; }
.tile .k { font-size: 13px; color: var(--steel); font-weight: 500; }
.tile .v { font-size: 24px; font-weight: 600; color: var(--forest); line-height: 1.2; white-space: nowrap; }
.tile .s { font-size: 13px; color: var(--steel); }
.ring { flex: none; }
.legend { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* Filters and tabs */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 16px; margin-bottom: 14px; }
.filters { flex-wrap: wrap; }
.filters .search { flex: 1 1 160px; }
.filters label.field { flex: 0 1 auto; min-width: 0; }
.filters input, .filters select { width: 100%; }
.filters select { max-width: 170px; }
.filters input[type="date"] { width: 138px; }
.filters #f-status, .filters #f-billing { width: 110px; }
@media (max-width: 1360px) { .filters { flex-wrap: wrap; } }
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, 0.55); border: var(--edge); }
.tabs button { border: 0; background: none; border-radius: 10px; }
.tabs button[aria-selected="true"] { background: var(--forest); color: #fff; }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }

/* Tables */
.tablewrap { overflow: auto; padding: 4px 0; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12.5px; font-weight: 600; color: var(--steel); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: rgba(247, 250, 248, 0.95); z-index: 1; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th.num, td.num { text-align: right; }
.sortbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; font: inherit; color: inherit; }
.sortbtn:focus-visible { outline: 3px solid var(--bright); border-radius: 4px; }
.sortbtn .arrow { font-size: 10px; opacity: .45; }
th[aria-sort="ascending"] .arrow, th[aria-sort="descending"] .arrow { opacity: 1; color: var(--forest); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: rgba(46, 139, 87, 0.06); }
tfoot td { font-weight: 600; border-bottom: 0; border-top: 2px solid rgba(13, 59, 38, 0.18); }
.nowrap { white-space: nowrap; }
td .client { font-weight: 600; color: var(--forest); text-decoration: none; }
td .client:hover { text-decoration: underline; }
.subflags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* Rows table on the client sheet */
.rows td { vertical-align: middle; }
.tasks { max-width: 460px; }
.tasks button { all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tasks button:focus-visible { outline: 3px solid var(--bright); }
.tasks.open button { -webkit-line-clamp: unset; display: block; }
tr.locked td { background: repeating-linear-gradient(135deg, rgba(61, 81, 102, 0.05) 0 6px, rgba(61, 81, 102, 0.1) 6px 12px); color: #4a5a6c; }
tr.excluded td:not(.hourscol) { color: #6b7a89; }
tr.excluded .orig, tr.excluded .tasks { text-decoration: line-through; }
.hourscol { width: 150px; }
.hours { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 92px; padding: 5px 10px; border-radius: 10px; font-weight: 600; border: 0; background: none; }
button.hours { background: #fff; border: 1.5px solid var(--bright); cursor: text; }
button.hours:hover { box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15); }
button.hours.edited { background: color-mix(in srgb, var(--spark) 55%, #fff); }
span.hours.locked { color: #4a5a6c; font-weight: 500; }
.hours.zero { color: #6b7a89; text-decoration: line-through; }
.pencil, .lock { width: 14px; height: 14px; }
.was { color: #6b7a89; text-decoration: line-through; font-size: 13px; margin-right: 6px; }
.marker { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--forest); background: color-mix(in srgb, var(--spark) 60%, #fff); padding: 1px 8px; border-radius: 999px; border: 0; cursor: help; }
.marker.excl { background: var(--cloud); color: var(--ink); }
.tip { position: relative; }
.tip .tiptext { visibility: hidden; opacity: 0; position: absolute; z-index: 30; right: 0; bottom: calc(100% + 8px); width: 280px; padding: 10px 12px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal; transition: opacity .12s; pointer-events: none; }
.tip:hover .tiptext, .tip:focus .tiptext, .tip:focus-within .tiptext { visibility: visible; opacity: 1; }

/* Popover */
.popover { position: absolute; z-index: 50; width: 340px; padding: 16px; background: var(--glass-strong); }
.popover h3 { margin-bottom: 8px; }
.popover .pair { display: flex; gap: 18px; font-size: 13px; margin-bottom: 10px; }
.popover .pair b { display: block; font-size: 16px; color: var(--ink); }
.popover .row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.popover input[type="text"] { width: 110px; font-weight: 600; text-align: right; }
.popover textarea { width: 100%; min-height: 64px; resize: vertical; }
.popover .conv { font-size: 13px; color: var(--steel); }
.popover .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.note { font-size: 13px; padding: 8px 10px; border-radius: 10px; margin: 8px 0; }
.note.warn { background: rgba(212, 168, 67, 0.2); color: var(--ink); border: 1px solid rgba(212, 168, 67, 0.6); }
.note.info { background: var(--cloud); color: var(--ink); }
.note.err { background: rgba(192, 57, 43, 0.1); color: #8e2a1f; border: 1px solid rgba(192, 57, 43, 0.35); }

/* Banners */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; margin-bottom: 12px; border: 1px solid; font-size: 14px; }
.banner .icon { margin-top: 1px; }
.banner ul { margin: 4px 0 0; padding-left: 18px; }
.banner.b-warn { background: rgba(192, 94, 60, 0.09); border-color: rgba(192, 94, 60, 0.45); }
.banner.b-lock { background: rgba(26, 92, 58, 0.08); border-color: rgba(26, 92, 58, 0.3); }
.banner.b-info { background: rgba(255, 255, 255, 0.66); border-color: rgba(61, 81, 102, 0.2); }
.banner.b-review { background: rgba(212, 168, 67, 0.16); border-color: rgba(212, 168, 67, 0.6); }
.banner.b-error { background: rgba(192, 57, 43, 0.08); border-color: rgba(192, 57, 43, 0.4); color: #7c2318; }
.banner .grow { flex: 1; }

/* Client sheet */
.crumbs { font-size: 13px; color: var(--steel); display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--steel); }
.sheethead { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: start; margin-bottom: 14px; }
.sheethead .title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.summary { display: flex; gap: 22px; margin-top: 10px; font-size: 14px; color: var(--steel); flex-wrap: wrap; }
.summary b { color: var(--ink); font-size: 16px; }
.ratebox { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.ratebox .rate { display: flex; align-items: center; gap: 6px; }
.ratebox input { width: 120px; text-align: right; font-weight: 600; }
.ratebox input.missing { border: 2px solid var(--terra); background: rgba(192, 94, 60, 0.05); }
.ratebox .ro { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 16px; }
.actions-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin-top: 12px; }
.why { font-size: 12.5px; color: #8a3a1f; text-align: right; }
.reviewers { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.revcard { display: flex; gap: 10px; align-items: center; padding: 10px 14px; min-width: 210px; }
.revcard.unassigned { border: 2px dashed var(--terra); background: rgba(255, 255, 255, 0.5); box-shadow: none; }
.revcard .meta { font-size: 13px; color: var(--steel); }
.revcard .state { font-size: 13px; font-weight: 600; }
.sheetbody { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.sheetbody.withdrawer { grid-template-columns: minmax(0, 1fr) 360px; }
.excelfoot { display: grid; grid-template-columns: auto auto; gap: 4px 28px; justify-content: end; padding: 14px 18px; font-size: 15px; }
.excelfoot span { color: var(--steel); }
.excelfoot b { text-align: right; }
.drawer { position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; padding: 16px; }
.drawer header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.logitem { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.logitem .who { font-weight: 600; }
.logitem .when { color: var(--steel); font-size: 12.5px; }
.logitem .rowlabel { color: var(--steel); margin: 2px 0; }
.old { text-decoration: line-through; color: #6b7a89; }
.new { font-weight: 600; }
.remark { margin-top: 2px; font-style: normal; }
@media (max-width: 1359px) {
  .sheetbody.withdrawer { grid-template-columns: 1fr; }
  .sheetbody.withdrawer .drawer { position: fixed; right: 14px; top: 14px; bottom: 14px; width: 380px; max-height: none; z-index: 60; background: var(--glass-strong); }
}

/* Dropdown (bell) */
.bellwrap { position: relative; }
.badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--risk); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-height: 440px; overflow: auto; z-index: 70; padding: 8px; background: var(--glass-strong); }
.dropdown header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 8px; }
.notif { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 10px; border-radius: 10px; white-space: normal; font-weight: 400; }
.notif:hover { background: rgba(46, 139, 87, 0.07); }
.notif.unread { font-weight: 600; }
.notif.unread::before { content: 'New'; font-size: 11px; font-weight: 700; color: #fff; background: var(--mid); border-radius: 6px; padding: 0 5px; margin-right: 6px; }
.notif .when { display: block; font-size: 12px; color: var(--steel); font-weight: 400; }

/* Month selector */
.monthsel { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 14px; }
.monthsel select { border: 0; background: transparent; font-weight: 600; font-size: 15px; }

/* Upload */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 46px 20px; border: 2px dashed rgba(26, 92, 58, 0.35); border-radius: var(--radius); text-align: center; cursor: pointer; background: rgba(255, 255, 255, 0.5); }
.drop.over { border-color: var(--bright); background: rgba(200, 240, 77, 0.12); }
.filechip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.okt { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.okt .glass { padding: 14px 16px; border-color: rgba(46, 139, 87, 0.4); background: rgba(232, 246, 236, 0.75); }
.okt .v { font-size: 22px; font-weight: 600; color: var(--forest); }
.failpanel { border: 1px solid rgba(192, 57, 43, 0.45); background: rgba(253, 240, 238, 0.85); border-radius: var(--radius); padding: 16px 18px; }
.failpanel h2 { color: #8e2a1f; }
.dup { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Users */
.addvert { display: flex; gap: 6px; margin-top: 6px; }
.addvert select { padding: 4px 8px; font-size: 13px; }
.inline-confirm { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.formgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; }

/* Sign in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.signin form { width: 380px; max-width: 100%; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.signin .logo { margin: 0 auto 6px; width: 220px; height: 60px; -webkit-mask-size: 268px; mask-size: 268px; }
.signin input { padding: 10px 12px; font-size: 15px; }
.signin button { justify-content: center; padding: 11px; font-size: 15px; }

/* Skeletons and toast */
.sk { border-radius: 10px; background: linear-gradient(90deg, rgba(255,255,255,.5), rgba(232,238,244,.9), rgba(255,255,255,.5)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } * { transition: none !important; } }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--forest); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 100; box-shadow: var(--shadow); font-size: 14px; }
.empty { text-align: center; padding: 56px 20px; }
.empty p { color: var(--steel); }
.spacer { height: 14px; }

/* 1280 to 1359: narrower sidebar and cells so the clients table fits. */
@media (max-width: 1359px) {
  :root { --side: 204px; }
  .main { padding: 18px 18px 40px 18px; }
  th, td { padding: 9px 8px; }
  .brand .logo:not(.small) { width: 160px; -webkit-mask-size: 194px; mask-size: 194px; }
  .tile { padding: 14px; gap: 12px; }
  .tile .v { font-size: 21px; }
}
