/* =========================================================================
   TERMINAL VER2 — THEME VARIABLES
   Status accents are the same in both modes.
   Only surfaces, text, and status fills/text-on-fill shift.
   ========================================================================= */
.t-root {
    --t-bg: #f5f5f4;
    --t-card: #ffffff;
    --t-surface-2: #f4f4f5;
    --t-border: rgba(0, 0, 0, 0.08);
    --t-border-strong: rgba(0, 0, 0, 0.14);

    --t-text: #18181b;
    --t-text-mute: #71717a;
    --t-text-faint: #a1a1aa;

    --t-onsite:   #639922;
    --t-internal: #378ADD;
    --t-external: #1D9E75;
    --t-mount:    #D85A30;
    --t-sick:     #E24B4A;
    --t-leave:    #BA7517;
    --t-out:      #888780;

    --t-onsite-bg:   #EAF3DE;
    --t-internal-bg: #E6F1FB;
    --t-external-bg: #E1F5EE;
    --t-mount-bg:    #FAECE7;
    --t-sick-bg:     #FCEBEB;
    --t-leave-bg:    #FAEEDA;
    --t-out-bg:      #f4f4f5;

    --t-onsite-text:   #3B6D11;
    --t-internal-text: #0C447C;
    --t-external-text: #0F6E56;
    --t-mount-text:    #993C1D;
    --t-sick-text:     #A32D2D;
    --t-leave-text:    #854F0B;
    --t-out-text:      #5F5E5A;
}

.t-root.t-dark {
    --t-bg: #0c0c0e;
    --t-card: #18181b;
    --t-surface-2: rgba(255, 255, 255, 0.04);
    --t-border: rgba(255, 255, 255, 0.07);
    --t-border-strong: rgba(255, 255, 255, 0.12);

    --t-text: #fafafa;
    --t-text-mute: #a1a1aa;
    --t-text-faint: #71717a;

    --t-onsite-bg:   rgba(99, 153, 34, 0.15);
    --t-internal-bg: rgba(55, 138, 221, 0.15);
    --t-external-bg: rgba(29, 158, 117, 0.15);
    --t-mount-bg:    rgba(216, 90, 48, 0.15);
    --t-sick-bg:     rgba(226, 75, 74, 0.15);
    --t-leave-bg:    rgba(186, 117, 23, 0.15);
    --t-out-bg:      rgba(255, 255, 255, 0.05);

    --t-onsite-text:   #97C459;
    --t-internal-text: #85B7EB;
    --t-external-text: #5DCAA5;
    --t-mount-text:    #F0997B;
    --t-sick-text:     #F09595;
    --t-leave-text:    #EF9F27;
    --t-out-text:      #a1a1aa;
}

/* =========================================================================
   ROOT
   ========================================================================= */
.t-root {
    font-family: 'DM Sans', 'Funnel Sans', system-ui, -apple-system, sans-serif;
    background: var(--t-bg);
    color: var(--t-text);
    min-height: 100vh;
    padding: 16px;
    position: relative;
}
.t-root *,
.t-root *::before,
.t-root *::after { box-sizing: border-box; }

/* =========================================================================
   THEME TOGGLE
   ========================================================================= */
.t-theme-toggle {
    position: absolute;
    top: 16px; right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    color: var(--t-text-mute);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    z-index: 10;
    transition: background 0.15s, color 0.15s;
}
.t-theme-toggle:hover {
    background: var(--t-surface-2);
    color: var(--t-text);
}
.t-theme-toggle .material-symbols-outlined { font-size: 20px; }

/* =========================================================================
   HEADER
   ========================================================================= */
.t-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 12px;
    padding: 16px 22px;
    margin-bottom: 12px;
}
.t-brand { display: flex; align-items: center; gap: 12px; }
.t-logo {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: #a81b27;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 500; font-size: 16px;
    letter-spacing: 0.5px;
}
.t-brand-name { font-size: 14px; font-weight: 500; line-height: 1.2; }
.t-brand-sub { font-size: 11px; color: var(--t-text-mute); margin-top: 2px; }

.t-clock-block { text-align: center; }
.t-clock {
    font-size: 40px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
    line-height: 1;
    color: var(--t-text);
}
.t-clock-sec { color: var(--t-text-faint); font-size: 28px; }
.t-date {
    font-size: 12px;
    color: var(--t-text-mute);
    margin-top: 6px;
    letter-spacing: 0.3px;
}

/* Nav buttons */
.t-nav-btn {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--t-surface-2);
    border: 0.5px solid var(--t-border);
    color: var(--t-text-mute);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.t-nav-btn:hover {
    background: var(--t-card);
    color: var(--t-text);
    border-color: var(--t-border-strong);
}

.t-weather { display: flex; align-items: center; gap: 12px; }
.t-weather-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--t-surface-2);
    display: flex; align-items: center; justify-content: center;
    color: var(--t-text-mute);
}
.t-weather-icon .material-symbols-outlined { font-size: 22px; }
.t-temp {
    font-size: 22px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.t-temp-unit {
    font-size: 13px;
    color: var(--t-text-faint);
    margin-left: 2px;
}
.t-weather-meta {
    font-size: 11px;
    color: var(--t-text-mute);
    margin-top: 4px;
    line-height: 1.4;
}

/* =========================================================================
   GROUP PANELS (Instamplad / Ustamplad summary with chips)
   ========================================================================= */
.t-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}
.t-group {
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 8px;
    padding: 12px 16px;
    position: relative;
    overflow: hidden;
}
.t-group::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
}
.t-group--in::before  { background: var(--t-onsite); }
.t-group--out::before { background: var(--t-out); }

.t-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}
.t-group-title {
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--t-text-mute);
}
.t-group-count {
    font-size: 22px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.t-group--in  .t-group-count { color: var(--t-onsite-text); }
.t-group--out .t-group-count { color: var(--t-out-text); }

.t-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.t-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    background: var(--t-surface-2);
    color: var(--t-text);
}
.t-chip-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.t-chip-lbl { color: var(--t-text-mute); font-weight: 400; }

/* =========================================================================
   SECTION HEADERS
   ========================================================================= */
.t-sec-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 6px;
    margin-top: 4px;
}
.t-sec-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px; font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--t-text-mute);
}
.t-sec-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
}
.t-sec-meta {
    font-size: 12px;
    color: var(--t-text-faint);
    font-variant-numeric: tabular-nums;
}

/* =========================================================================
   MAIN GRID
   ========================================================================= */
.t-main {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 12px;
}
.t-card-sections {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.t-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 10px;
}

/* =========================================================================
   COWORKER CARDS
   ========================================================================= */
.t-card {
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 10px;
    padding: 18px 18px 18px 21px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    min-height: 96px;
}
.t-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--t-border);
}
.t-card--onsite::before   { background: var(--t-onsite); }
.t-card--internal::before { background: var(--t-internal); }
.t-card--external::before { background: var(--t-external); }
.t-card--mount::before    { background: var(--t-mount); }
.t-card--sick::before     { background: var(--t-sick); }
.t-card--leave::before    { background: var(--t-leave); }
.t-card--out              { opacity: 0.55; }

.t-avatar {
    width: 54px; height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.t-avatar img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.t-avatar--onsite   { background: var(--t-onsite-bg);   color: var(--t-onsite-text); }
.t-avatar--internal { background: var(--t-internal-bg); color: var(--t-internal-text); }
.t-avatar--external { background: var(--t-external-bg); color: var(--t-external-text); }
.t-avatar--mount    { background: var(--t-mount-bg);    color: var(--t-mount-text); }
.t-avatar--sick     { background: var(--t-sick-bg);     color: var(--t-sick-text); }
.t-avatar--leave    { background: var(--t-leave-bg);    color: var(--t-leave-text); }
.t-avatar--out      { background: var(--t-out-bg);      color: var(--t-out-text); }

.t-pulse {
    position: absolute;
    bottom: -1px; right: -1px;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid var(--t-card);
    animation: t-pulse 2s ease-in-out infinite;
}
.t-pulse--onsite   { background: var(--t-onsite); }
.t-pulse--internal { background: var(--t-internal); }
.t-pulse--external { background: var(--t-external); }
.t-pulse--mount    { background: var(--t-mount); }

@keyframes t-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.65; transform: scale(0.9); }
}

.t-info { min-width: 0; flex: 1; }
.t-name {
    font-size: 15px; font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.t-status {
    font-size: 13px; font-weight: 500;
    margin-top: 3px;
    line-height: 1.3;
}
.t-status--onsite   { color: var(--t-onsite-text); }
.t-status--internal { color: var(--t-internal-text); }
.t-status--external { color: var(--t-external-text); }
.t-status--mount    { color: var(--t-mount-text); }
.t-status--sick     { color: var(--t-sick-text); }
.t-status--leave    { color: var(--t-leave-text); }
.t-status--out      { color: var(--t-out-text); }

.t-task {
    font-size: 12px;
    color: var(--t-text-mute);
    margin-top: 2px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Break indicator */
.t-break-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--t-text-faint);
    margin-top: 2px;
}
.t-break-badge .material-symbols-outlined {
    font-size: 13px;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.t-side { display: flex; flex-direction: column; gap: 10px; }
.t-panel {
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 8px;
    padding: 14px 16px;
}
.t-panel-title {
    font-size: 11px; font-weight: 500;
    color: var(--t-text-mute);
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.t-feed-item {
    padding: 10px 0;
    border-bottom: 0.5px solid var(--t-border);
}
.t-feed-item:last-child  { border-bottom: none; padding-bottom: 0; }
.t-feed-item:first-child { padding-top: 0; }
.t-feed-source {
    font-size: 10px;
    color: var(--t-text-faint);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.t-feed-text {
    font-size: 13px;
    color: var(--t-text);
    line-height: 1.4;
}

.t-abs-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}
.t-abs-avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px; font-weight: 500;
    flex-shrink: 0;
}
.t-abs-body { font-size: 12px; min-width: 0; flex: 1; }
.t-abs-name { font-weight: 500; line-height: 1.2; }
.t-abs-meta {
    color: var(--t-text-mute);
    margin-top: 2px;
    font-size: 11px;
}

/* =========================================================================
   LOADING
   ========================================================================= */
.t-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    font-size: 16px;
    color: var(--t-text-mute);
}

/* =========================================================================
   PERSONAL PAGE (.tp-*)
   ========================================================================= */
.tp-root {
    font-family: 'DM Sans', 'Funnel Sans', system-ui, -apple-system, sans-serif;
    background: var(--t-bg);
    color: var(--t-text);
    min-height: 100vh;
    height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 12px;
    position: relative;
    overflow: hidden;
}
.tp-root *, .tp-root *::before, .tp-root *::after { box-sizing: border-box; }

/* Page header */
.tp-ph {
    display: grid;
    grid-template-columns: auto auto 1fr auto;
    align-items: center;
    gap: 20px;
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 10px;
    padding: 12px 16px;
    height: 72px;
}
.tp-ph-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px;
    border: 0.5px solid var(--t-border);
    border-radius: 999px;
    background: var(--t-card);
    font-size: 13px; font-weight: 500;
    color: var(--t-text-mute);
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.tp-ph-back:hover { background: var(--t-surface-2); color: var(--t-text); }
.tp-ph-back .material-symbols-outlined { font-size: 18px; }

.tp-ph-who { display: flex; align-items: center; gap: 12px; }
.tp-ph-av {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 500; font-size: 14px;
    position: relative; flex-shrink: 0;
    overflow: hidden;
}
.tp-ph-av img { width: 100%; height: 100%; object-fit: cover; }
.tp-ph-pulse {
    position: absolute;
    bottom: -1px; right: -1px;
    width: 12px; height: 12px;
    border-radius: 50%;
    border: 2px solid var(--t-card);
    animation: t-pulse 2s ease-in-out infinite;
}
.tp-ph-name { font-size: 15px; font-weight: 500; line-height: 1.2; }
.tp-ph-role { font-size: 12px; color: var(--t-text-mute); margin-top: 3px; }

.tp-ph-actions { display: flex; gap: 4px; align-items: center; }
.tp-ph-act {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--t-text);
    position: relative;
    min-width: 84px;
    background: transparent;
    border: none;
    transition: background 0.12s;
}
.tp-ph-act:hover { background: var(--t-surface-2); }
.tp-ph-act .material-symbols-outlined { font-size: 24px; color: var(--t-text-mute); }
.tp-ph-act-lbl { font-size: 11px; color: var(--t-text-mute); letter-spacing: 0.2px; }
.tp-ph-badge {
    position: absolute;
    top: 4px; right: 18px;
    background: var(--t-sick);
    color: #fff;
    font-size: 10px; font-weight: 500;
    min-width: 18px; height: 18px;
    border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
    border: 1.5px solid var(--t-card);
}

/* Hero strip */
.tp-hero {
    display: grid;
    grid-template-columns: 1.2fr auto auto auto;
    gap: 24px;
    align-items: center;
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 10px;
    padding: 14px 22px;
    height: 116px;
    position: relative;
    overflow: hidden;
}
.tp-hero::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
}
.tp-hero.hero--onsite::before   { background: var(--t-onsite); }
.tp-hero.hero--internal::before { background: var(--t-internal); }
.tp-hero.hero--external::before { background: var(--t-external); }
.tp-hero.hero--mount::before    { background: var(--t-mount); }
.tp-hero.hero--out::before      { background: var(--t-out); }

.tp-hero-left { padding-left: 6px; min-width: 0; }
.tp-hero-tag {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.6px; text-transform: uppercase;
    margin-bottom: 6px;
}
.tp-hero-tag .ldot {
    width: 8px; height: 8px;
    border-radius: 50%;
    animation: t-pulse 2s ease-in-out infinite;
}
.tp-hero-task {
    font-size: 20px; line-height: 1.2;
    color: var(--t-text); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tp-hero-task.idle {
    color: var(--t-text-faint);
    font-style: italic; font-weight: 400;
}
.tp-hero-since { font-size: 12px; color: var(--t-text-mute); margin-top: 4px; }

.tp-hero-elapsed {
    text-align: center;
    padding: 0 22px;
    border-left: 0.5px solid var(--t-border);
    border-right: 0.5px solid var(--t-border);
}
.tp-hero-num {
    font-size: 32px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px; line-height: 1;
    color: var(--t-text);
}
.tp-hero-num-lbl {
    font-size: 10px; color: var(--t-text-mute);
    margin-top: 6px; letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tp-hero-totals { display: flex; gap: 28px; padding-left: 8px; }
.tp-hero-stat-num {
    font-size: 20px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1; color: var(--t-text);
}
.tp-hero-stat-lbl {
    font-size: 10px; color: var(--t-text-mute);
    margin-top: 5px; letter-spacing: 0.5px;
    text-transform: uppercase;
}

.tp-hero-actions { display: flex; gap: 10px; }
.tp-hero-btn {
    display: inline-flex; align-items: center; gap: 9px;
    padding: 13px 20px;
    border-radius: 8px;
    border: 0.5px solid;
    font-weight: 500; font-size: 14px;
    cursor: pointer;
    transition: transform 0.08s;
}
.tp-hero-btn:active { transform: scale(0.97); }
.tp-hero-btn .material-symbols-outlined { font-size: 20px; }
.tp-hero-btn.lunch {
    background: var(--t-leave-bg);
    border-color: var(--t-leave);
    color: var(--t-leave-text);
}
.tp-hero-btn.out {
    background: var(--t-sick-bg);
    border-color: var(--t-sick);
    color: var(--t-sick-text);
}
.tp-hero-btn.stamp-in {
    background: var(--t-onsite-bg);
    border-color: var(--t-onsite);
    color: var(--t-onsite-text);
}

/* Body 3-column */
.tp-body {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 10px;
    min-height: 0;
}
.tp-col {
    display: flex; flex-direction: column; gap: 10px;
    min-height: 0;
}

.tp-panel {
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 10px;
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 0;
}
.tp-panel.flex { flex: 1; }

.tp-panel-head {
    padding: 11px 16px;
    border-bottom: 0.5px solid var(--t-border);
    display: flex; align-items: baseline; justify-content: space-between;
}
.tp-panel-title {
    font-size: 11px; font-weight: 500;
    letter-spacing: 0.7px; text-transform: uppercase;
    color: var(--t-text-mute);
}
.tp-panel-meta {
    font-size: 12px; color: var(--t-text-faint);
    font-variant-numeric: tabular-nums;
}
.tp-panel-meta strong { color: var(--t-text); font-weight: 500; }

.tp-panel-foot {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px;
    background: var(--t-surface-2);
    border-top: 0.5px solid var(--t-border);
    font-size: 12px;
}
.tp-panel-foot .lbl { color: var(--t-text-mute); }
.tp-panel-foot .total {
    font-size: 14px; font-weight: 500;
    font-variant-numeric: tabular-nums; color: var(--t-text);
}

/* Left: register work buttons */
.tp-reg-btn {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 16px;
    border-bottom: 0.5px solid var(--t-border);
    cursor: pointer;
    background: transparent;
    border-left: none; border-right: none; border-top: none;
    text-align: left; width: 100%;
    transition: background 0.12s;
}
.tp-reg-btn:last-child { border-bottom: none; }
.tp-reg-btn:hover { background: var(--t-surface-2); }
.tp-reg-icon {
    width: 46px; height: 46px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tp-reg-icon.add { background: var(--t-internal-bg); color: var(--t-internal-text); }
.tp-reg-icon.int { background: var(--t-external-bg); color: var(--t-external-text); }
.tp-reg-icon .material-symbols-outlined { font-size: 22px; }
.tp-reg-title { font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--t-text); }
.tp-reg-sub { font-size: 12px; color: var(--t-text-mute); margin-top: 3px; line-height: 1.3; }

/* Left: quick info */
.tp-info { padding: 12px 16px; }
.tp-info-row {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 7px 0;
    border-bottom: 0.5px solid var(--t-border);
}
.tp-info-row:last-child { border-bottom: none; }
.tp-info-row .lbl { font-size: 12px; color: var(--t-text-mute); }
.tp-info-row .val {
    font-size: 13px; font-weight: 500;
    font-variant-numeric: tabular-nums; color: var(--t-text);
}
.tp-info-row .val.empty { color: var(--t-text-faint); }

/* Center: task rows */
.tp-tasks-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.tp-task-row {
    display: grid;
    grid-template-columns: 96px 1fr 110px 130px 40px;
    gap: 14px; align-items: center;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--t-border);
}
.tp-task-row:last-child { border-bottom: none; }

.tp-task-id {
    font-size: 12px; font-variant-numeric: tabular-nums;
    color: var(--t-text-faint); letter-spacing: 0.3px;
}
.tp-task-name {
    font-size: 14px; font-weight: 500; line-height: 1.2;
    color: var(--t-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tp-task-sub {
    font-size: 12px; color: var(--t-text-mute);
    margin-top: 3px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.tp-time {
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--t-surface-2);
    border-radius: 6px;
    padding: 4px;
}
.tp-time input {
    width: 32px; text-align: center;
    background: var(--t-card);
    border: 0.5px solid var(--t-border);
    border-radius: 4px;
    padding: 5px 2px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
    color: var(--t-text);
}
.tp-time .sep { color: var(--t-text-faint); font-size: 12px; font-weight: 500; }
.tp-time-lbl { font-size: 10px; color: var(--t-text-faint); margin-left: 4px; }

.tp-dist { display: inline-flex; align-items: center; gap: 8px; }
.tp-dist-bar {
    flex: 1; height: 6px;
    background: var(--t-surface-2);
    border-radius: 3px;
    position: relative; overflow: hidden;
    min-width: 60px;
}
.tp-dist-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: var(--t-onsite); border-radius: 3px;
}
.tp-dist-pct {
    font-size: 12px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--t-text-mute);
    width: 32px; text-align: right;
}

.tp-check {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1.5px solid var(--t-border-strong);
    background: var(--t-card);
    cursor: pointer;
    position: relative;
}
.tp-check.done {
    background: var(--t-onsite);
    border-color: var(--t-onsite);
}
.tp-check.done::after {
    content: '';
    position: absolute;
    left: 7px; top: 4px;
    width: 7px; height: 12px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
}

.tp-empty {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    color: var(--t-text-faint);
    font-size: 13px; font-style: italic;
    padding: 24px;
}

/* Right: today stats */
.tp-stat {
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--t-border);
}
.tp-stat:last-child { border-bottom: none; }
.tp-stat-lbl {
    font-size: 11px; color: var(--t-text-mute);
    letter-spacing: 0.5px; text-transform: uppercase;
    margin-bottom: 6px;
}
.tp-stat-val {
    font-size: 26px; font-weight: 500;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.3px; line-height: 1;
    color: var(--t-text);
}
.tp-stat-sub { font-size: 12px; color: var(--t-text-mute); margin-top: 6px; }
.tp-progress {
    margin-top: 8px; height: 5px;
    background: var(--t-surface-2);
    border-radius: 3px; overflow: hidden;
}
.tp-progress-fill { height: 100%; background: var(--t-onsite); border-radius: 3px; }

/* Right: week chart */
.tp-week { padding: 14px 16px; }
.tp-week-bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px; align-items: end;
    height: 70px; margin: 8px 0;
}
.tp-week-bar {
    background: #C0DD97;
    border-radius: 3px 3px 0 0;
    min-height: 4px;
}
.tp-week-bar.today { background: var(--t-onsite); }
.tp-week-bar.future { background: var(--t-surface-2); }
.t-dark .tp-week-bar { background: rgba(99, 153, 34, 0.4); }
.t-dark .tp-week-bar.today { background: var(--t-onsite); }
.t-dark .tp-week-bar.future { background: rgba(255, 255, 255, 0.06); }

.tp-week-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    font-size: 10px; color: var(--t-text-faint);
    text-align: center; letter-spacing: 0.3px;
}
.tp-week-total {
    display: flex; justify-content: space-between;
    font-size: 12px;
    margin-top: 10px; padding-top: 10px;
    border-top: 0.5px solid var(--t-border);
}
.tp-week-total .lbl { color: var(--t-text-mute); }
.tp-week-total .v {
    font-weight: 500; font-variant-numeric: tabular-nums;
    color: var(--t-text);
}

/* Stamp-in buttons grid */
.tp-stamp-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 16px;
}
.tp-stamp-btn {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 24px 16px;
    border-radius: 10px;
    border: 0.5px solid var(--t-border);
    background: var(--t-card);
    cursor: pointer;
    transition: transform 0.08s, background 0.12s;
    font-size: 14px; font-weight: 500;
    color: var(--t-text);
}
.tp-stamp-btn:hover { background: var(--t-surface-2); }
.tp-stamp-btn:active { transform: scale(0.97); }
.tp-stamp-btn .material-symbols-outlined { font-size: 32px; }

/* =========================================================================
   TIME TRACKING PROJECT FORM (.ttp-*)
   ========================================================================= */
.ttp-wrap {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}
.ttp-wrap.ttp-disabled { opacity: 0.5; pointer-events: none; }

.ttp-actions {
    display: flex;
    gap: 10px;
}
.ttp-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 20px;
    border-radius: 8px;
    border: 0.5px solid;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.08s, opacity 0.12s;
    font-family: inherit;
}
.ttp-btn:active { transform: scale(0.97); }
.ttp-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.ttp-btn .material-symbols-outlined { font-size: 20px; }

.ttp-btn--project {
    background: var(--t-internal-bg, #E6F1FB);
    border-color: var(--t-internal, #378ADD);
    color: var(--t-internal-text, #0C447C);
}
.ttp-btn--internal {
    background: var(--t-external-bg, #E1F5EE);
    border-color: var(--t-external, #1D9E75);
    color: var(--t-external-text, #0F6E56);
}
.ttp-btn--waiting {
    background: var(--t-mount-bg, #FAECE7);
    border-color: var(--t-mount, #D85A30);
    color: var(--t-mount-text, #993C1D);
    margin-left: auto;
}

.ttp-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.ttp-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 8px 2px;
}
.ttp-section-title {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--t-text-mute, #71717a);
}
.ttp-section-meta {
    font-size: 12px;
    color: var(--t-text-faint, #a1a1aa);
    font-variant-numeric: tabular-nums;
}

.ttp-calc-btn {
    font-size: 11px;
    color: var(--t-info, #185FA5);
    border: 0.5px solid var(--t-border, rgba(0,0,0,0.08));
    border-radius: 999px;
    padding: 4px 12px;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    font-family: inherit;
}
.ttp-calc-btn:hover { background: var(--t-surface-2, #f4f4f5); }

/* =========================================================================
   RESPONSIVE — DASHBOARD (Terminal)
   ========================================================================= */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
    .t-root { padding: 10px; }

    .t-header {
        grid-template-columns: auto 1fr auto auto;
        gap: 12px;
        padding: 12px 14px;
    }
    .t-clock { font-size: 28px; }
    .t-clock-sec { font-size: 18px; }

    .t-groups { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }

    .t-main {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .t-side { order: -1; }

    .t-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 8px;
    }
    .t-card {
        padding: 12px 12px 12px 15px;
        min-height: 72px;
    }
    .t-avatar { width: 42px; height: 42px; font-size: 13px; }
}

/* Mobile: <= 640px */
@media (max-width: 640px) {
    .t-root { padding: 8px; }

    .t-header {
        grid-template-columns: 1fr auto;
        gap: 8px;
        padding: 10px 12px;
    }
    .t-brand { display: none; }
    .t-weather { display: none; }
    .t-clock { font-size: 22px; }
    .t-clock-sec { font-size: 14px; }
    .t-date { font-size: 11px; }

    .t-nav-btn { width: 36px; height: 36px; }

    .t-theme-toggle {
        top: 10px; right: 10px;
        width: 34px; height: 34px;
    }

    .t-groups {
        grid-template-columns: 1fr;
        gap: 6px;
        margin-bottom: 10px;
    }
    .t-group { padding: 10px 12px; }
    .t-group-count { font-size: 18px; }
    .t-chips { gap: 4px; }
    .t-chip { font-size: 11px; padding: 3px 8px; }

    .t-main { grid-template-columns: 1fr; }
    .t-side { order: 2; }

    .t-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .t-card {
        padding: 10px 10px 10px 13px;
        min-height: 64px;
        gap: 10px;
        border-radius: 8px;
    }
    .t-avatar { width: 38px; height: 38px; font-size: 12px; }
    .t-name { font-size: 13px; }
    .t-status { font-size: 11px; }
    .t-task { font-size: 11px; }
    .t-pulse { width: 10px; height: 10px; }

    .t-sec-head { padding: 6px 4px; }
    .t-sec-title { font-size: 11px; }

    .t-panel { padding: 10px 12px; }
    .t-panel-title { font-size: 10px; }
    .t-feed-text { font-size: 12px; }

    .t-abs-avatar { width: 22px; height: 22px; font-size: 9px; }
    .t-abs-body { font-size: 11px; }
}

/* =========================================================================
   RESPONSIVE — PERSONAL PAGE (TerminalPersonal)
   ========================================================================= */

/* Tablet: <= 1024px */
@media (max-width: 1024px) {
    .tp-root {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        grid-template-rows: auto 1fr;
    }

    .tp-body {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
    .tp-body > .tp-col:first-child {
        grid-column: 1 / -1;
        flex-direction: row;
        gap: 10px;
    }
    .tp-body > .tp-col:first-child > .tp-panel {
        flex: 1;
    }

    .tp-ph { height: auto; gap: 12px; padding: 10px 14px; }
    .tp-ph-av { width: 60px; height: 60px; font-size: 18px; }

    .tp-hero { height: auto; padding: 12px 16px; gap: 16px; }
    .tp-hero-task { font-size: 16px; }
    .tp-hero-num { font-size: 24px; }

    .ttp-actions { flex-wrap: wrap; }
}

/* Mobile: <= 640px */
@media (max-width: 640px) {
    .tp-root {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        padding: 8px;
        grid-template-rows: auto 1fr;
    }

    .tp-body {
        grid-template-columns: 1fr;
    }
    .tp-body > .tp-col:first-child {
        flex-direction: column;
    }

    .tp-ph {
        grid-template-columns: 1fr;
        height: auto;
        gap: 10px;
        padding: 12px;
    }
    .tp-ph-who { justify-content: center; }
    .tp-ph-av { width: 64px; height: 64px; font-size: 20px; }
    .tp-ph-name { font-size: 16px; }
    .tp-ph-actions {
        flex-wrap: wrap;
        justify-content: center;
        gap: 2px;
    }
    .tp-ph-act { min-width: 70px; padding: 6px 10px; }
    .tp-ph-act .material-symbols-outlined { font-size: 20px; }
    .tp-ph-act-lbl { font-size: 10px; }

    .tp-hero {
        grid-template-columns: 1fr;
        height: auto;
        gap: 12px;
        padding: 12px;
    }
    .tp-hero-elapsed {
        border: none;
        padding: 0;
        text-align: left;
    }
    .tp-hero-totals {
        gap: 16px;
        padding-left: 0;
    }
    .tp-hero-actions {
        flex-direction: column;
    }
    .tp-hero-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }
    .tp-hero-task { font-size: 16px; }
    .tp-hero-num { font-size: 26px; }
    .tp-hero-stat-num { font-size: 16px; }

    .tp-reg-btn { padding: 14px 12px; gap: 10px; }
    .tp-reg-icon { width: 36px; height: 36px; }
    .tp-reg-title { font-size: 13px; }
    .tp-reg-sub { font-size: 11px; }

    .tp-info-row .lbl { font-size: 11px; }
    .tp-info-row .val { font-size: 12px; }

    .tp-stat-val { font-size: 22px; }

    .tp-week-bars { height: 50px; }

    .ttp-actions {
        flex-direction: column;
    }
    .ttp-btn {
        width: 100%;
        justify-content: center;
        padding: 11px 16px;
        font-size: 13px;
    }
    .ttp-btn--waiting { margin-left: 0; }
}

/* =========================================================================
   TERMINAL DIALOGS (.td-*)
   ========================================================================= */

/* Radzen dialog wrapper override */
.td-dialog .rz-dialog-titlebar {
    background: var(--t-card, #fff);
    border-bottom: 0.5px solid var(--t-border, rgba(0,0,0,0.08));
    padding: 14px 20px;
}
.td-dialog .rz-dialog-titlebar .rz-dialog-title {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--t-text, #18181b);
    letter-spacing: 0.2px;
}
.td-dialog .rz-dialog-content {
    background: var(--t-card, #fff);
    padding: 0 !important;
}
.td-dialog {
    border-radius: 12px !important;
    border: 0.5px solid var(--t-border, rgba(0,0,0,0.08)) !important;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08) !important;
}

/* Dialog body */
.td-body {
    padding: 24px 28px;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--t-text, #18181b);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Icon circle */
.td-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.td-icon .material-symbols-outlined { font-size: 28px; }
.td-icon--warn {
    background: var(--t-leave-bg, #FAEEDA);
    color: var(--t-leave-text, #854F0B);
}
.td-icon--error {
    background: var(--t-sick-bg, #FCEBEB);
    color: var(--t-sick-text, #A32D2D);
}
.td-icon--info {
    background: var(--t-internal-bg, #E6F1FB);
    color: var(--t-internal-text, #0C447C);
}

/* Message */
.td-msg {
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    color: var(--t-text, #18181b);
}
.td-msg strong { font-weight: 600; }
.td-msg--detail {
    font-size: 13px;
    line-height: 1.6;
    text-align: left;
    color: var(--t-text-mute, #71717a);
    white-space: pre-line;
    width: 100%;
    padding: 12px 16px;
    background: var(--t-surface-2, #f4f4f5);
    border-radius: 8px;
}

/* Button row */
.td-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 4px;
}
.td-actions > * { flex: 1; }

/* Dialog button base */
.td-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 8px;
    border: 0.5px solid;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.08s, opacity 0.12s;
}
.td-btn:active { transform: scale(0.97); }
.td-btn .material-symbols-outlined { font-size: 18px; }

.td-btn--confirm {
    background: var(--t-onsite-bg, #EAF3DE);
    border-color: var(--t-onsite, #639922);
    color: var(--t-onsite-text, #3B6D11);
}
.td-btn--danger {
    background: var(--t-sick-bg, #FCEBEB);
    border-color: var(--t-sick, #E24B4A);
    color: var(--t-sick-text, #A32D2D);
}
.td-btn--neutral {
    background: var(--t-surface-2, #f4f4f5);
    border-color: var(--t-border-strong, rgba(0,0,0,0.14));
    color: var(--t-text-mute, #71717a);
}
.td-btn--primary {
    background: var(--t-internal-bg, #E6F1FB);
    border-color: var(--t-internal, #378ADD);
    color: var(--t-internal-text, #0C447C);
}

/* Form elements inside dialogs */
.td-form {
    padding: 20px 24px;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--t-text, #18181b);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.td-form-row {
    display: flex;
    gap: 12px;
}
.td-form-row > * { flex: 1; }
.td-form-field {
    width: 100%;
}
.td-form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--t-text);
}
.td-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
    border-top: 0.5px solid var(--t-border, rgba(0,0,0,0.08));
    margin-top: 4px;
}
.td-alert {
    font-size: 13px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--t-leave-bg, #FAEEDA);
    color: var(--t-leave-text, #854F0B);
    border-left: 3px solid var(--t-leave, #BA7517);
}

/* Inactivity countdown */
.td-countdown {
    font-size: 48px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--t-sick, #E24B4A);
}
.td-countdown-ring {
    width: 96px;
    height: 96px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.td-countdown-ring svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.td-countdown-ring circle {
    fill: none;
    stroke-width: 4;
    cx: 48;
    cy: 48;
    r: 44;
}
.td-countdown-ring .td-ring-bg {
    stroke: var(--t-surface-2, #f4f4f5);
}
.td-countdown-ring .td-ring-fg {
    stroke: var(--t-sick, #E24B4A);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

/* Picker dialog (project/work activities) */
.td-picker {
    padding: 20px 24px;
    font-family: 'DM Sans', system-ui, sans-serif;
    color: var(--t-text, #18181b);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.td-picker-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.td-picker-toolbar .td-separator {
    font-size: 13px;
    color: var(--t-text-faint, #a1a1aa);
}
.td-picker-search {
    flex: 1;
    min-width: 200px;
    padding: 10px 14px;
    border: 0.5px solid var(--t-border-strong, rgba(0,0,0,0.14));
    border-radius: 8px;
    background: var(--t-card, #fff);
    font-family: inherit;
    font-size: 14px;
    color: var(--t-text, #18181b);
    outline: none;
    transition: border-color 0.15s;
}
.td-picker-search:focus {
    border-color: var(--t-internal, #378ADD);
}
.td-picker-search::placeholder {
    color: var(--t-text-faint, #a1a1aa);
}
.td-picker-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.td-picker-heading h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--t-text-mute, #71717a);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin: 0;
}
.td-picker-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 0.5px solid var(--t-border, rgba(0,0,0,0.08));
}
.td-selected-row {
    background-color: var(--t-internal-bg, #E6F1FB) !important;
}
