:root {
    --bg: #f5f6fa;
    --card: #ffffff;
    --border: #e2e4ea;
    --text: #1f2430;
    --muted: #6b7280;
    --primary: #12a594;
    --primary-dark: #0e8f80;
    --primary-tint: #e2f6f2;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    height: 56px;
}

.topbar .brand { font-weight: 700; font-size: 16px; color: var(--primary); }
.topbar nav { display: flex; gap: 16px; }
.topbar nav a { color: var(--muted); font-weight: 500; }
.topbar nav a.active { color: var(--text); }
.topbar .spacer { flex: 1; }

.container { max-width: 960px; margin: 24px auto; padding: 0 24px; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.card h2 { margin: 0 0 16px; font-size: 15px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > .grow { flex: 1; min-width: 160px; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

input, select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.danger { background: var(--danger); }
.btn.stop { background: var(--danger); }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.running-bar {
    display: flex; align-items: center; gap: 16px;
    background: var(--primary-tint); border: 1px solid #b8e6de; border-radius: var(--radius);
    padding: 16px 20px; margin-bottom: 20px;
}
.running-bar .time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.running-bar .desc { flex: 1; }

.total { font-size: 18px; font-weight: 700; }
.muted { color: var(--muted); }
.mt { margin-top: 12px; }
.pill { background: var(--bg); border-radius: 12px; padding: 2px 8px; font-size: 12px; }

.alert { background: #fef2f2; border: 1px solid #fecaca; color: var(--danger); padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }

/* ---- Auth (split brand + form), shared esoul look ---- */
.auth { display: flex; min-height: 100vh; }

.auth-brand {
    flex: 1; position: relative; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 40px; color: #fff;
    background: linear-gradient(150deg, #0e8f80 0%, #12a594 55%, #37cfa8 100%);
}
.auth-brand::before, .auth-brand::after {
    content: ""; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .06);
}
.auth-brand::before { width: 340px; height: 340px; top: -80px; left: -90px; }
.auth-brand::after { width: 460px; height: 460px; bottom: -140px; right: -120px; }
.auth-brand-inner { position: relative; z-index: 1; text-align: center; max-width: 420px; }
.auth-logo { height: 34px; width: auto; margin-bottom: 36px; filter: brightness(0) invert(1); }
.auth-illustration { margin: 0 auto 28px; max-width: 320px; }
.auth-illustration svg { width: 100%; height: auto; }
.auth-illustration img.auth-hero {
    width: 132px; height: auto; display: block; margin: 0 auto;
    background: #fff; border-radius: 30px; padding: 22px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
}
.auth-tagline { font-size: 26px; font-weight: 700; margin: 0 0 10px; }
.auth-sub { font-size: 15px; line-height: 1.6; opacity: .9; margin: 0; }
.auth-copyright {
    position: absolute; bottom: 22px; left: 0; right: 0; text-align: center;
    font-size: 13px; color: rgba(255, 255, 255, .75); z-index: 1;
}
.auth-copyright strong { font-weight: 700; }

.auth-form {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 40px; background: #f7f8fa;
}
.auth-form-inner { width: 100%; max-width: 340px; }
.auth-form h1 { font-size: 30px; margin: 0 0 6px; color: var(--text); }
.auth-hello { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
.auth-alt { color: var(--muted); margin: 20px 0 0; font-size: 13px; text-align: center; }

.auth-input {
    display: block; width: 100%; margin-bottom: 16px; padding: 14px 16px;
    border: 1px solid transparent; border-radius: 10px; background: #eef1fb;
    font-size: 15px; color: var(--text);
}
.auth-input::placeholder { color: #9aa2b1; }
.auth-input:focus { outline: none; border-color: #12a594; background: #fff; }
.auth-form .pw-wrap .auth-input { padding-right: 44px; }
.auth-form .pw-toggle { right: 14px; }
.auth-form .remember {
    display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin: 4px 0 20px;
}
.auth-form .remember input[type="checkbox"] {
    width: auto; flex: none; margin: 0; accent-color: #12a594;
}
.auth-submit {
    width: 100%; padding: 14px; border: none; border-radius: 10px;
    background: #12a594; color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.auth-submit:hover { background: #0e8f80; }
.auth-form .alert { margin-bottom: 16px; }

.pw-wrap { position: relative; display: block; }
.pw-toggle {
    position: absolute; top: 50%; right: 8px; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 2px; line-height: 0;
    color: var(--muted); display: inline-flex;
}
.pw-toggle:hover { color: var(--text); }
.pw-toggle .eye-off { display: none; }
.pw-toggle.on .eye { display: none; }
.pw-toggle.on .eye-off { display: inline; }

@media (max-width: 820px) {
    .auth { flex-direction: column; }
    .auth-brand { flex: none; padding: 32px 24px 48px; }
    .auth-illustration { max-width: 210px; margin-bottom: 20px; }
    .auth-logo { margin-bottom: 24px; }
    .auth-copyright { position: static; margin-top: 26px; }
    .auth-form { flex: none; }
}

.bars { margin-top: 16px; }
.bar-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-line .label { width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-line .track { flex: 1; background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-line .fill { height: 100%; background: var(--primary); }
.bar-line .val { width: 70px; text-align: right; font-variant-numeric: tabular-nums; }

/* =========================================================================
   Toggl-like app shell (sidebar + main) and page styles
   ========================================================================= */
.tt-app { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.tt-sidebar {
    width: 232px; flex: none; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.tt-ws {
    display: flex; align-items: center; gap: 10px; padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}
.tt-ws img { height: 28px; width: auto; border-radius: 7px; }
.tt-ws .tt-ws-name { font-weight: 700; font-size: 14px; color: var(--text); }

.tt-nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.tt-nav-sec {
    font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: #9aa2b1; padding: 14px 10px 6px;
}
.tt-nav-item {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 8px;
    color: #4b5563; font-weight: 500; font-size: 14px; margin-bottom: 2px;
}
.tt-nav-item:hover { background: #f4f5f8; text-decoration: none; color: var(--text); }
.tt-nav-item.active { background: var(--primary-tint); color: var(--primary-dark); }
.tt-nav-item i { width: 18px; text-align: center; font-size: 15px; color: #9aa2b1; }
.tt-nav-item.active i { color: var(--primary); }
.tt-nav-item .tt-nav-time {
    margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px;
}
.tt-nav-item.is-running { background: var(--primary-tint); color: var(--primary-dark); }
.tt-nav-item.is-running i { color: var(--primary); }

.tt-side-foot { border-top: 1px solid var(--border); padding: 12px; }
.tt-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 6px 8px; margin-left: -8px; margin-right: -8px; border-radius: 8px; color: inherit; text-decoration: none; }
.tt-user:hover { background: var(--primary-tint); }
.tt-user.active { background: var(--primary-tint); }
.tt-user .tt-avatar {
    flex: none; width: 30px; height: 30px; border-radius: 8px; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.tt-user .tt-uname { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-side-foot .btn.ghost { width: 100%; }

/* ---- Main column ---- */
.tt-main { flex: 1; min-width: 0; background: var(--bg); }
.tt-page { max-width: 1180px; margin: 0 auto; padding: 22px 28px 60px; }
.tt-page-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; margin-bottom: 18px;
}
.tt-page-head h1 { font-size: 22px; margin: 0; }
.tt-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.tt-toolbar .grow { flex: 1; min-width: 120px; }

/* ---- Timer bar (Track) ---- */
.tt-timerbar {
    display: flex; align-items: center; gap: 10px; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 18px;
}
.tt-timerbar.is-running { border-color: #b8e6de; box-shadow: 0 0 0 3px var(--primary-tint); }
.tt-timerbar .tt-desc { flex: 1; min-width: 0; border: none; font-size: 15px; padding: 8px 6px; }
.tt-timerbar .tt-desc:focus { outline: none; }
.tt-timerbar select { width: auto; min-width: 140px; border-color: var(--border); }
.tt-timerbar .tt-elapsed {
    font-variant-numeric: tabular-nums; font-weight: 700; font-size: 17px; min-width: 78px; text-align: right;
}
.tt-play, .tt-stop {
    flex: none; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px; color: #fff;
}
.tt-play { background: var(--primary); }
.tt-play:hover { background: var(--primary-dark); }
.tt-stop { background: var(--danger); }
.tt-stop:hover { background: #b91c1c; }

.tt-totals { display: flex; gap: 26px; align-items: center; margin: 4px 2px 14px; }
.tt-totals .tt-total-lbl { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.tt-totals .tt-total-val { font-weight: 700; font-variant-numeric: tabular-nums; margin-left: 8px; }

/* ---- Day groups + entries ---- */
.tt-day { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.tt-day-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: #fafbfc; border-bottom: 1px solid var(--border);
}
.tt-day-head .tt-day-name { font-weight: 700; font-size: 14px; }
.tt-day-head .tt-day-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-entry {
    display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.tt-entry:hover { background: #fafbfc; }
.tt-entry:last-child { border-bottom: none; }
.tt-entry .tt-entry-desc { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-entry .tt-entry-proj { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; min-width: 130px; }
.tt-entry .tt-entry-range { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tt-entry .tt-entry-dur { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 66px; text-align: right; }
.tt-entry .tt-entry-del { background: none; border: none; color: #c3c8d0; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 4px; }
.tt-entry .tt-entry-del:hover { background: #fef2f2; color: var(--danger); }
.tt-empty { text-align: center; color: var(--muted); padding: 48px 20px; background: #fff; border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---- Reveal (manual entry / new project / new client) ---- */
details.tt-reveal { margin-bottom: 16px; }
details.tt-reveal > summary {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--primary-dark);
    font-weight: 600; font-size: 14px; list-style: none;
}
details.tt-reveal > summary::-webkit-details-marker { display: none; }
details.tt-reveal[open] > summary { margin-bottom: 12px; }
details.tt-reveal .card { margin-bottom: 0; }

/* ---- Data tables (Projects / Members) ---- */
.tt-table { width: 100%; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.tt-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fafbfc; }
.tt-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.tt-table tr:last-child td { border-bottom: none; }
.tt-table tr:hover td { background: #fafbfc; }
.tt-proj-name { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.tt-num { text-align: right; font-variant-numeric: tabular-nums; }
.tt-tag { display: inline-block; background: var(--primary-tint); color: var(--primary-dark); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.tt-tag.muted-tag { background: #f1f3f7; color: var(--muted); }

/* ---- Clients (grouped list) ---- */
.tt-clist { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tt-client { border-bottom: 1px solid var(--border); }
.tt-client:last-child { border-bottom: none; }
.tt-client > summary {
    display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer;
    font-weight: 600; list-style: none;
}
.tt-client > summary::-webkit-details-marker { display: none; }
.tt-client > summary .tt-chev { color: #9aa2b1; transition: transform .15s; }
.tt-client[open] > summary .tt-chev { transform: rotate(90deg); }
.tt-client > summary .tt-count { color: var(--muted); font-weight: 400; font-size: 13px; }
.tt-client-projects { padding: 4px 16px 14px 42px; }
.tt-client-projects .tt-cp { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.tt-client-empty { color: var(--muted); font-size: 13px; padding: 6px 0; }

/* ---- Members ---- */
.tt-member-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.tt-member-actions form { margin: 0; }

/* ---- Invite box (Members) ---- */
.invite-box { display: flex; align-items: center; gap: 16px; justify-content: space-between; background: var(--primary-tint); border: 1px solid #b8e6de; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.invite-box .invite-url { margin-top: 6px; }
.invite-box code { display: inline-block; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; font-size: 13px; word-break: break-all; }
.invite-box .btn { flex: none; }

/* ---- Avatars ---- */
.tt-avatar {
    flex: none; width: 28px; height: 28px; border-radius: 8px; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; line-height: 1; text-transform: uppercase;
}
.tt-avatar.av-0 { background: #2563eb; } .tt-avatar.av-1 { background: #16a34a; }
.tt-avatar.av-2 { background: #d97706; } .tt-avatar.av-3 { background: #db2777; }
.tt-avatar.av-4 { background: #7c3aed; } .tt-avatar.av-5 { background: #0891b2; }

@media (max-width: 820px) {
    .tt-app { flex-direction: column; }
    .tt-sidebar { width: 100%; height: auto; position: static; flex-direction: column; }
    .tt-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .tt-nav-sec { width: 100%; padding: 8px 10px 2px; }
    .tt-page { padding: 18px 16px 48px; }
}

/* ---- Bulk selection ---- */
.tt-check { display: inline-flex; align-items: center; margin: 0; padding: 0; }
.tt-check input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--primary); }

.tt-bulkbar {
    display: flex; align-items: center; gap: 10px; background: #fff;
    border: 1px solid #b8e6de; box-shadow: 0 0 0 3px var(--primary-tint);
    border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px;
    position: sticky; top: 10px; z-index: 20;
}
.tt-bulkbar[hidden] { display: none; }
.tt-bulk-all { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.tt-bulk-all input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.tt-bulkbar .spacer { flex: 1; }
.tt-bulkbar .btn { padding: 6px 12px; }

/* ---- Tags + billable on entries ---- */
.tt-chip {
    display: inline-flex; align-items: center; gap: 4px; background: var(--primary-tint); color: var(--primary-dark);
    border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: middle;
}
.tt-chip i { font-size: 9px; }
.tt-entry-bill { color: #d1d5db; font-size: 12px; width: 16px; text-align: center; }
.tt-entry-bill.is-on { color: var(--primary); }

/* ---- Modal ---- */
.tt-modal-backdrop {
    position: fixed; inset: 0; background: rgba(20, 24, 32, .5);
    display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px; z-index: 60;
}
.tt-modal-backdrop[hidden] { display: none; }
.tt-modal { background: #fff; border-radius: 12px; width: 440px; max-width: 100%; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); overflow: hidden; }
.tt-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 8px; font-weight: 700; font-size: 16px; }
.tt-modal-x { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; }
.tt-modal-x:hover { color: var(--text); }
.tt-modal-body { padding: 8px 20px 22px; }
.tt-modal-body select[multiple] { padding: 6px; height: auto; }
.tt-modal-body small { display: block; margin: -8px 0 14px; }
.tt-modal-check { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; font-size: 14px; color: var(--text); }
.tt-modal-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.tt-modal-body .auth-submit { margin-top: 6px; }

/* ---- Searchable project picker (bulk edit) ---- */
.pp { margin-bottom: 16px; }
.pp-btn { display: flex; align-items: center; justify-content: space-between; width: 100%; cursor: pointer; text-align: left; background: #fff; border: 1px solid var(--border); margin-bottom: 0; }
.pp-btn i { color: var(--muted); font-size: 11px; }
.pp-pop { margin-top: 6px; border: 1px solid var(--border); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 8px; }
.pp-pop[hidden] { display: none; }
.pp-search { width: 100%; padding: 9px 10px; border: 1px solid var(--primary); border-radius: 8px; outline: none; margin-bottom: 6px; font-size: 14px; }
.pp-list { max-height: 240px; overflow-y: auto; }
.pp-group { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 8px 4px; }
.pp-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.pp-item:hover { background: var(--primary-tint); }
.pp-item[hidden] { display: none; }

/* ---- Tag chip picker (bulk edit) ---- */
.tagpick { margin-bottom: 12px; }
.tagpick-search { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; margin-bottom: 8px; }
.tagpick-search:focus { border-color: var(--primary); }
.tagpick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; }
.tagpick-chip { display: inline-flex; margin: 0; }
.tagpick-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.tagpick-chip span { border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; color: var(--text); user-select: none; }
.tagpick-chip span:hover { border-color: #c9cfd8; }
.tagpick-chip input:checked + span { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.tagpick-chip[hidden] { display: none; }
.tagpick-empty { color: var(--muted); font-size: 13px; margin: 0 0 12px; }

/* ---- Toggle switch ---- */
.tt-switch-row {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px;
    font-size: 15px; color: var(--text);
}
.tt-switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.tt-switch input { opacity: 0; width: 0; height: 0; }
.tt-slider { position: absolute; inset: 0; background: #cbd2dc; border-radius: 999px; transition: background .15s; }
.tt-slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s; }
.tt-switch input:checked + .tt-slider { background: var(--primary); }
.tt-switch input:checked + .tt-slider::before { transform: translateX(18px); }

/* ---- Tags page inline rename ---- */
.tt-inline-edit { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.tt-inline-edit .tt-rename { width: auto; }
.tt-inline-edit .btn { padding: 5px 10px; }

/* ---- Entry edit ---- */
.tt-entry-edit { background: none; border: none; color: #c3c8d0; cursor: pointer; font-size: 13px; padding: 4px 6px; border-radius: 4px; }
.tt-entry-edit:hover { background: var(--primary-tint); color: var(--primary); }
.tt-field-lbl { display: block; font-size: 12px; color: var(--muted); margin: 2px 0 5px; }

/* =========================================================================
   Reports
   ========================================================================= */
.rep-actions { display: flex; gap: 10px; }

.rep-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.rep-tab { padding: 10px 16px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.rep-tab:hover { color: var(--text); text-decoration: none; }
.rep-tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

.rep-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.rep-filters > div { display: flex; flex-direction: column; }
.rep-filters label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.rep-filters input, .rep-filters select { width: auto; min-width: 120px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
/* Filter buttons + popovers */
.fbtn-wrap { position: relative; }
.fbtn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); }
.fbtn:hover { border-color: #c9cfd8; }
.fbtn.active { background: var(--primary-tint); border-color: #b8e6de; color: var(--primary-dark); }
.fbtn strong { color: var(--primary); }
.fpop { position: absolute; top: 100%; left: 0; margin-top: 6px; z-index: 50; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18); padding: 16px; min-width: 260px; }
.fpop[hidden] { display: none !important; }
.fpop-title { font-weight: 700; margin-bottom: 8px; }
.fpop-lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 10px 0 5px; }
.fpop-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: #fff; min-width: 0; }
.fpop-input:disabled { background: #f1f3f7; color: #9aa2b1; }
.fpop-add { width: 100%; margin-top: 14px; }

/* Date range */
.daterange { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.dr-nav { background: none; border: none; padding: 8px 11px; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; }
.dr-nav:hover { background: #f4f5f8; color: var(--text); }
.dr-main { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; border-left: 1px solid var(--border); border-right: 1px solid var(--border); padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.dr-main:hover { background: #f4f5f8; }
.fpop-wide { display: flex; padding: 0; min-width: auto; }
.dr-shortcuts { display: flex; flex-direction: column; gap: 2px; padding: 16px; border-right: 1px solid var(--border); min-width: 190px; }
.dr-shortcuts button { text-align: left; background: none; border: none; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--text); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dr-shortcuts button:hover { background: #f4f5f8; }
.sc-def { background: #eceef1; color: var(--muted); font-size: 11px; border-radius: 6px; padding: 1px 8px; font-weight: 600; }
.dr-cals { padding: 16px; }
.dr-cal-nav { display: flex; align-items: center; margin-bottom: 8px; }
.dr-cal-nav button { background: none; border: 1px solid var(--border); border-radius: 6px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); }
.dr-cal-nav button:hover { border-color: var(--primary); color: var(--text); }
.dr-cal-nav .spacer { flex: 1; }
.dr-cal-pair { display: flex; gap: 24px; }
.dr-cal-title { font-weight: 700; text-align: center; margin-bottom: 8px; }
.dr-cal-grid { display: grid; grid-template-columns: auto repeat(7, 32px); gap: 2px; align-items: center; }
.dr-wk { font-size: 11px; color: var(--muted); text-align: center; padding-right: 6px; }
.dr-dow { font-size: 11px; color: var(--muted); text-align: center; }
.dr-day { height: 32px; border: none; background: none; cursor: pointer; border-radius: 6px; font-size: 13px; color: var(--text); }
.dr-day:hover { background: #f4f5f8; }
.dr-day.empty { visibility: hidden; }
.dr-day.range { background: var(--primary-tint); border-radius: 0; }
.dr-day.end { background: var(--primary); color: #fff; border-radius: 6px; }

.report { max-width: 1000px; }
.report-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.report-title { font-size: 20px; margin: 0; }
.report-range { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.report-logo { height: 26px; width: auto; flex: none; }
.report-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.report-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: #fff; }
.chip-x { color: var(--muted); text-decoration: none; font-size: 16px; line-height: 1; }
.chip-x:hover { color: var(--danger); text-decoration: none; }
.report-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 18px 20px; margin-bottom: 16px; }
.report-card-title { font-weight: 700; margin-bottom: 14px; }
.report-summary { display: flex; gap: 40px; flex-wrap: wrap; }
.rs-lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.rs-val { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.report-foot { display: none; color: var(--muted); font-size: 12px; }

/* Bar chart */
.rep-bars { display: flex; align-items: stretch; gap: 6px; height: 300px; padding-top: 10px; }
.rep-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.rep-bar-val { font-size: 10px; color: var(--muted); height: 16px; white-space: nowrap; }
.rep-bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.rep-bar { width: 60%; max-width: 26px; background: var(--primary); border-radius: 3px 3px 0 0; }
.rep-bar-stack { width: 60%; max-width: 26px; display: flex; flex-direction: column; border-radius: 3px 3px 0 0; overflow: hidden; }
.rep-seg.bill { background: var(--primary); }
.rep-seg.nonbill { background: #cbd2dc; }
.rep-bar-x { font-size: 10px; color: var(--muted); margin-top: 8px; transform: rotate(-45deg); white-space: nowrap; }
.rep-legend { display: flex; align-items: center; gap: 18px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 18px; }
.rep-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.rep-legend-dot { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

/* Donut */
.rep-dist { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.rep-donut { width: 220px; height: 220px; flex: none; }
.rep-donut-total { font-size: 22px; font-weight: 700; fill: var(--text); }
.rep-donut-sub { font-size: 10px; fill: var(--muted); letter-spacing: .1em; }
.rep-dist-legend { flex: 1; min-width: 260px; }
.rep-dist-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.rep-dist-row:last-child { border-bottom: none; }
.rep-dist-name { flex: 1; }
.rep-dist-pct { width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.rep-dist-dur { width: 84px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Report tables */
.rep-table { width: 100%; border-collapse: collapse; }
.rep-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.rep-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.rep-group td { background: #fafbfc; }
.rep-item td:first-child { padding-left: 28px; }
.rep-total td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }
.rep-detailed .rep-d-desc { max-width: 260px; }
.rep-detailed .rep-d-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rep-bill { color: #d1d5db; font-weight: 700; margin-right: 4px; }
.rep-bill.is-on { color: var(--primary); }

/* Print (A4) */
@media print {
    /* Real per-page margins. The browser's URL/date/title band is its own
       "Headers and footers" option — untick it once in the print dialog. */
    @page { size: A4; margin: 14mm; }
    .tt-sidebar, .no-print { display: none !important; }
    .tt-main { background: #fff !important; }
    .tt-page { max-width: none !important; padding: 0 !important; }
    .report { max-width: none !important; }
    .report-card { break-inside: avoid; box-shadow: none; }
    .rep-table tr { break-inside: avoid; }
    .report-foot { display: block; position: fixed; bottom: 4mm; left: 0; }
    body { background: #fff; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
