:root {
    color-scheme: light;
    --blue: #4f46e5;
    --blue-active: #4338ca;
    --indigo: #312e81;
    --canvas: #f8fafc;
    --surface: #ffffff;
    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --hairline: #e2e8f0;
    --sky: #38bdf8;
    --purple: #c084fc;
    --pink: #f472b6;
    --orange: #f97316;
    --teal: #0d9488;
    --green: #10b981;
    --brown: #78350f;
    --shadow-soft:
        0 1px 3px rgba(15, 23, 42, .03),
        0 4px 12px rgba(15, 23, 42, .04),
        0 12px 24px rgba(15, 23, 42, .03);
    --shadow-pop:
        0 4px 14px rgba(15, 23, 42, .05),
        0 18px 36px rgba(15, 23, 42, .07);
    --theme-gradient-1: rgba(99, 102, 241, .16);
    --theme-gradient-2: rgba(6, 182, 212, .12);
}

:root.dark {
    color-scheme: dark;
    --canvas: #191817;
    --surface: #22211f;
    --ink: #ffffff;
    --ink-2: #f0eeeb;
    --muted: #c6c1bb;
    --faint: #8c8781;
    --hairline: #35322f;
    --shadow-soft:
        0 .175px 1.041px rgba(0, 0, 0, .08),
        0 .8px 2.925px rgba(0, 0, 0, .1),
        0 2.025px 7.847px rgba(0, 0, 0, .12),
        0 4px 18px rgba(0, 0, 0, .16);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

.boot-screen,
.auth-screen {
    min-height: 100vh;
}

.boot-screen {
    display: grid;
    place-items: center;
}

.loading-card {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
}

.auth-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .7fr);
    gap: 32px;
    align-items: center;
    width: min(1120px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 40px 0;
}

.auth-hero {
    padding: 36px 0;
}

.auth-hero h1 {
    max-width: 780px;
    margin: 18px 0 18px;
    font-size: clamp(42px, 8vw, 64px);
    line-height: 1;
}

.auth-hero p {
    max-width: 620px;
    color: var(--ink-2);
    font-size: 18px;
}

.auth-card {
    box-shadow: var(--shadow-pop);
}

.auth-brand {
    margin-bottom: 20px;
    padding: 0;
}

.auth-stickers {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}

.auth-stickers span {
    width: 42px;
    height: 42px;
    background: var(--dot);
    border: 2px solid var(--surface);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    transform: rotate(-4deg);
}

.auth-stickers span:nth-child(even) {
    transform: rotate(5deg);
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 18% 8%, var(--theme-gradient-1), transparent 180px),
        radial-gradient(circle at 86% 18%, var(--theme-gradient-2), transparent 210px),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-feature-settings: "lnum" 1, "locl" 1;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 16px;
    background: rgba(255, 255, 255, .74);
    border-right: 1px solid var(--hairline);
    backdrop-filter: blur(18px);
    overflow-y: auto;
}

:root.dark .sidebar {
    background: rgba(34, 33, 31, .78);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
    padding: 8px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--blue) 0%, #06b6d4 100%);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.5px;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 15px;
    font-weight: 750;
}

.brand small,
.eyebrow,
.metric span,
.muted {
    color: var(--muted);
}

.badge-pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    color: var(--blue);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 650;
}

.portal-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding: 4px;
    margin-bottom: 18px;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 999px;
}

.portal-toggle button,
.nav-list button,
.icon-button,
.primary-action,
.ghost-action,
.chip,
.segmented button {
    border: 0;
}

.portal-toggle button {
    min-height: 34px;
    color: var(--muted);
    background: transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
}

.portal-toggle button.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.nav-list {
    display: grid;
    gap: 3px;
}

.user-card {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
    padding: 12px;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

.user-card small {
    color: var(--muted);
}

.nav-list button {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px 8px 16px;
    background: transparent;
    color: var(--muted);
    border-radius: 8px;
    text-align: left;
    font-size: 14.5px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-list button::before {
    content: "";
    position: absolute;
    left: 4px;
    width: 3px;
    height: 18px;
    border-radius: 999px;
    background: transparent;
    transition: background-color 0.15s ease;
}

.nav-list button:hover {
    background: var(--surface);
    color: var(--ink);
}

.nav-list button.is-active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--blue);
    font-weight: 650;
}

:root.dark .nav-list button.is-active {
    background: rgba(79, 70, 229, 0.18);
}

.nav-list button.is-active::before {
    background: var(--blue);
}

.nav-list small {
    color: var(--faint);
    font-size: 12px;
}

.workspace {
    min-width: 0;
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    padding: 18px 32px;
    background: rgba(246, 245, 244, .82);
    border-bottom: 1px solid var(--hairline);
    backdrop-filter: blur(18px);
}

:root.dark .topbar {
    background: rgba(25, 24, 23, .82);
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.33;
    letter-spacing: 0;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(30px, 4vw, 40px);
    font-weight: 760;
    line-height: 1.1;
    letter-spacing: 0;
}

h2 {
    font-size: 26px;
    font-weight: 750;
    line-height: 1.23;
    letter-spacing: 0;
}

h3 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: 0;
}

p {
    line-height: 1.5;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(380px, 34vw);
    min-height: 38px;
    padding: 0 10px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .01);
}

.search:focus-within {
    border-color: rgba(0, 117, 222, .34);
    box-shadow: var(--shadow-soft);
}

.search span {
    color: var(--faint);
    font-size: 12px;
    font-weight: 650;
}

.search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.icon-button,
.primary-action,
.ghost-action {
    min-height: 40px;
    padding: 0 16px;
    font-weight: 650;
    transition: transform .12s ease, background-color .12s ease;
}

.full {
    width: 100%;
}

.tiny {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.icon-button:active,
.primary-action:active,
.ghost-action:active {
    transform: scale(.97);
}

.icon-button {
    width: 40px;
    padding: 0;
    background: rgba(0, 0, 0, .05);
    color: var(--ink);
    border-radius: 999px;
}

:root.dark .icon-button {
    background: rgba(255, 255, 255, .08);
}

.primary-action {
    background: var(--blue);
    color: #fff;
    border-radius: 999px;
}

.primary-action:hover {
    background: var(--blue-active);
}

.ghost-action {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 8px;
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px 56px;
}

.command-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 16px;
    padding: 18px 20px;
}

.command-strip p {
    margin: 3px 0 0;
}

.split-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: 16px;
    align-items: start;
}

.task-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.sticky-panel {
    position: sticky;
    top: 96px;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.kpis {
    grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.grid.two {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .8fr);
}

.grid.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

.card::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 14px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--purple);
    opacity: .9;
}

.card:nth-child(4n + 2)::after {
    background: var(--sky);
}

.card:nth-child(4n + 3)::after {
    background: var(--orange);
}

.card:nth-child(4n + 4)::after {
    background: var(--teal);
}

.panel {
    padding: 24px;
}

.metric {
    padding: 20px;
}

.metric strong {
    display: block;
    margin: 8px 0 4px;
    font-size: 34px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: 0;
}

.metric span {
    font-size: 12px;
    font-weight: 650;
    line-height: 1.33;
}

.metric small {
    color: var(--blue);
    font-weight: 650;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.section-header h2 {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--hairline);
    border-radius: 8px;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: var(--surface);
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--hairline);
    text-align: left;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    background: var(--canvas);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0;
}

tbody tr:hover {
    background: rgba(0, 0, 0, .025);
}

:root.dark tbody tr:hover {
    background: rgba(255, 255, 255, .04);
}

.status,
.chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--canvas);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.status::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: 6px;
    border-radius: 999px;
    background: var(--faint);
}

.status.completed::before,
.status.approved::before,
.status.active::before,
.status.paid::before {
    background: var(--green);
}

.status.pending::before,
.status.pending_review::before,
.status.generated::before,
.status.in_progress::before {
    background: var(--orange);
}

.status.urgent::before,
.status.rejected::before,
.status.returned_for_revision::before {
    background: var(--pink);
}

.status.high::before {
    background: var(--orange);
}

.status.normal::before,
.status.not_started::before,
.status.draft::before {
    background: var(--sky);
}

.chips,
.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip {
    border-radius: 4px;
}

hr {
    border: 0;
    border-top: 1px solid var(--hairline);
    margin: 16px 0;
}

.timeline {
    display: grid;
    gap: 12px;
}

.timeline-item {
    padding: 12px 0 12px 18px;
    border-left: 2px solid var(--hairline);
}

.timeline-item:nth-child(3n + 1) {
    border-left-color: var(--blue);
}

.timeline-item:nth-child(3n + 2) {
    border-left-color: var(--purple);
}

.timeline-item:nth-child(3n + 3) {
    border-left-color: var(--teal);
}

.timeline-item p {
    margin-bottom: 4px;
}

.progress-row {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-weight: 650;
}

.bar {
    height: 8px;
    overflow: hidden;
    background: var(--canvas);
    border-radius: 999px;
}

.bar span {
    display: block;
    height: 100%;
    background: var(--blue);
}

.bar.warn span {
    background: var(--orange);
}

.bar.danger span {
    background: var(--pink);
}

.kanban {
    display: grid;
    grid-template-columns: repeat(5, minmax(230px, 1fr));
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 4px;
    cursor: grab;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.kanban::-webkit-scrollbar {
    display: none;
}
.kanban:active {
    cursor: grabbing;
}

.kanban-column {
    min-height: 360px;
    padding: 12px;
    background: rgba(255, 255, 255, .58);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

:root.dark .kanban-column {
    background: rgba(255, 255, 255, .03);
}

.kanban-column h3 {
    font-size: 15px;
}

.task-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    margin-top: 12px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
}

.client-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.client-card {
    padding: 24px;
}

.client-card h3 {
    margin-bottom: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-stack {
    display: grid;
    gap: 12px;
}

.field {
    display: grid;
    gap: 6px;
}

.field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.field input:not([type="radio"]):not([type="checkbox"]),
.field select,
.field textarea {
    width: 100%;
    min-height: 40px;
    padding: 6px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preset-btn {
    border-radius: 99px !important;
    padding: 6px 14px !important;
    background: var(--surface) !important;
    color: var(--ink) !important;
    transition: all 0.2s ease;
    border: 1px solid var(--hairline) !important;
    user-select: none;
    -webkit-user-select: none;
}

.preset-btn:hover {
    background: var(--sky) !important;
    border-color: var(--blue) !important;
    color: var(--blue) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: 0;
    border-color: rgba(0, 117, 222, .44);
    box-shadow: var(--shadow-soft);
}

.field textarea {
    min-height: 110px;
    resize: vertical;
}

/* Password field with eye toggle */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    width: 100%;
    padding-right: 42px !important;
}

.eye-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.eye-toggle:hover {
    color: var(--accent);
    background: rgba(0, 117, 222, 0.08);
}

.eye-toggle svg {
    width: 18px;
    height: 18px;
    display: block;
}

.segmented {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
}

.segmented button {
    min-height: 32px;
    padding: 0 12px;
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    font-weight: 650;
}

.segmented button.is-active {
    background: var(--blue);
    color: #fff;
}

.empty {
    padding: 48px 20px;
    color: var(--muted);
    text-align: center;
}

.empty-state {
    display: grid;
    gap: 6px;
    justify-items: center;
    padding: 36px 18px;
    color: var(--muted);
    text-align: center;
}

.empty-state strong {
    color: var(--ink);
}

.empty-state p {
    margin: 0;
}

.approval-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--hairline);
}

.approval-row:last-child {
    border-bottom: 0;
}

.toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 30;
    max-width: 360px;
    padding: 12px 16px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: var(--shadow-pop);
}

.loading-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 16px;
}

.skeleton span,
.skeleton strong,
.skeleton small {
    display: block;
    min-height: 14px;
    color: transparent;
    background: linear-gradient(90deg, var(--canvas), var(--surface), var(--canvas));
    background-size: 220% 100%;
    border-radius: 999px;
    animation: pulse 1.4s infinite;
}

.skeleton strong {
    width: 60%;
    min-height: 34px;
}

@keyframes pulse {
    to {
        background-position: -220% 0;
    }
}

@media (min-width: 1101px) {
    .grid.two > .card:nth-child(2),
    .grid.three > .card,
    .metric:hover,
    .client-card:hover,
    .task-card:hover {
        box-shadow: var(--shadow-soft);
    }
}

@media (max-width: 1100px) {
    .auth-layout,
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--hairline);
    }

    .nav-list {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    .split-page,
    .task-layout,
    .grid.kpis,
    .grid.two,
    .grid.three,
    .loading-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .topbar,
    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar,
    .content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .search {
        width: 100%;
    }

    .auth-layout {
        width: min(100% - 28px, 560px);
    }

    .auth-hero h1 {
        font-size: 42px;
    }

    .command-strip,
    .approval-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .split-page,
    .task-layout,
    .grid.kpis,
    .grid.two,
    .grid.three,
    .form-grid,
    .loading-grid {
        grid-template-columns: 1fr;
    }
}

/* Custom enhancements for NCP Virtual Solutions */

:root.theme-indigo, html.theme-indigo, .theme-indigo,
:root.theme-classic, html.theme-classic, .theme-classic {
    --blue: #4f46e5;
    --blue-active: #4338ca;
    --indigo: #312e81;
    --theme-gradient-1: rgba(99, 102, 241, .20);
    --theme-gradient-2: rgba(6, 182, 212, .15);
}

:root.theme-rose, html.theme-rose, .theme-rose {
    --blue: #e11d48;
    --blue-active: #be123c;
    --indigo: #881337;
    --theme-gradient-1: rgba(225, 29, 72, .20);
    --theme-gradient-2: rgba(244, 63, 94, .14);
}

:root.theme-mint, html.theme-mint, .theme-mint,
:root.theme-emerald, html.theme-emerald, .theme-emerald {
    --blue: #0d9488;
    --blue-active: #0f766e;
    --indigo: #115e59;
    --theme-gradient-1: rgba(13, 148, 136, .22);
    --theme-gradient-2: rgba(16, 185, 129, .15);
}

:root.theme-peach, html.theme-peach, .theme-peach,
:root.theme-amber, html.theme-amber, .theme-amber {
    --blue: #ea580c;
    --blue-active: #c2410c;
    --indigo: #7c2d12;
    --theme-gradient-1: rgba(234, 88, 12, .20);
    --theme-gradient-2: rgba(245, 158, 11, .14);
}

:root.theme-ocean, html.theme-ocean, .theme-ocean {
    --blue: #2563eb;
    --blue-active: #1d4ed8;
    --indigo: #1e3a8a;
    --theme-gradient-1: rgba(37, 99, 235, .20);
    --theme-gradient-2: rgba(59, 130, 246, .14);
}

.app-shell {
    transition: grid-template-columns 0.25s ease;
}

.sidebar {
    transition: transform 0.25s ease, width 0.25s ease, padding 0.25s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 0px minmax(0, 1fr) !important;
}

.app-shell.sidebar-collapsed .sidebar {
    transform: translateX(-100%) !important;
    pointer-events: none;
    padding: 0 !important;
    border-right: 0 !important;
    width: 0 !important;
    overflow: hidden;
}

.sidebar-toggle-btn {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.12s ease;
}

.sidebar-toggle-btn:hover {
    background-color: var(--canvas);
}

.sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.sidebar-close-btn:hover {
    background-color: var(--hairline);
    color: var(--ink);
}

.task-status-select {
    font-size: 12px;
    padding: 4px 8px;
    border: 1px solid var(--hairline);
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-weight: 600;
}

.brand-logo-img {
    max-height: 36px;
    max-width: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.auth-stickers span {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.2s ease;
}

.auth-stickers span:hover {
    transform: scale(1.18) rotate(8deg);
    filter: brightness(1.15);
}

.auth-stickers span:active {
    transform: scale(0.95);
}

.theme-selector {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.theme-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid var(--hairline);
    cursor: pointer;
    transition: transform 0.12s ease;
}

.theme-dot:hover {
    transform: scale(1.1);
}

.theme-dot.is-active {
    border-color: var(--ink);
    transform: scale(1.1);
}

.sop-screenshot-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
    padding: 8px;
    border: 1px dashed var(--hairline);
    border-radius: 6px;
    background: var(--canvas);
}

.sop-screenshot-preview img {
    height: 48px;
    width: 48px;
    object-fit: cover;
    border-radius: 4px;
}

.sop-screenshot-preview span {
    font-size: 12px;
    color: var(--muted);
}

.logo-uploader-card {
    padding: 16px;
    border: 1px dashed var(--hairline);
    border-radius: 8px;
    background: var(--canvas);
    margin-bottom: 16px;
}

/* Modals & Search Overlay Enhancements */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 16px;
    box-shadow: var(--shadow-pop);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-normal {
    width: min(680px, calc(100% - 32px));
}

.modal-card.modal-medium {
    width: min(840px, calc(100% - 32px));
}

.modal-card.modal-large {
    width: min(1120px, calc(100% - 32px));
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--hairline);
}

.modal-body {
    padding: 24px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.search-container {
    position: relative;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    box-shadow: var(--shadow-pop);
    margin-top: 8px;
    z-index: 100;
    max-height: 280px;
    overflow-y: auto;
    display: none;
}

.search-results-dropdown.is-active {
    display: block;
}

.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    text-align: left;
}

.search-result-item:last-child {
    border-bottom: 0;
}

.search-result-item:hover {
    background: var(--canvas);
}

.search-result-item strong {
    color: var(--ink);
}

.search-result-item small {
    color: var(--muted);
}

.sop-inline-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px 0;
    border-radius: 12px;
    border: 1px solid var(--hairline);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sop-inline-img:hover {
    transform: scale(1.015);
    box-shadow: var(--shadow-pop);
}

/* Checkbox Pills & Toggle Switch Styles */
.checkbox-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
    user-select: none;
}

.checkbox-pill:hover {
    background-color: var(--canvas);
    border-color: var(--faint);
}

.checkbox-pill input[type="checkbox"] {
    width: 14px !important;
    min-height: 14px !important;
    height: 14px !important;
    margin: 0 !important;
    cursor: pointer;
}

.checkbox-pill:has(input[type="checkbox"]:checked) {
    border-color: var(--blue);
    background-color: rgba(0, 117, 222, 0.05);
    color: var(--blue);
}

.switch-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.switch-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: calc(25% - 6px);
    min-width: 145px;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
    user-select: none;
}

.switch-pill:hover {
    background-color: var(--canvas);
}

.switch-pill input[type="checkbox"] {
    display: none !important;
}

.switch-pill .switch-slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 20px;
    background-color: #cbd5e1;
    border-radius: 999px;
    transition: background-color 0.2s;
}

.switch-pill .switch-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background-color: white;
    transition: transform 0.2s;
}

.switch-pill input[type="checkbox"]:checked + .switch-slider {
    background-color: var(--blue);
}

.switch-pill input[type="checkbox"]:checked + .switch-slider::before {
    transform: translateX(14px);
}

.switch-pill:has(input[type="checkbox"]:checked) {
    border-color: rgba(0, 117, 222, 0.3);
    background-color: rgba(0, 117, 222, 0.02);
}

@media (max-width: 720px) {
    .switch-pill {
        width: calc(50% - 4px);
    }
}


button.is-loading { position: relative; pointer-events: none; opacity: 0.8; color: transparent !important; }
button.is-loading::after { content: ''; position: absolute; top: 50%; left: 50%; width: 16px; height: 16px; margin-top: -8px; margin-left: -8px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
button.ghost-action.is-loading::after { border: 2px solid rgba(0, 0, 0, 0.2); border-top-color: var(--text-main); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Custom Select Dropdowns */
.cs-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    min-width: 120px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.cs-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    font-size: 13.5px;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
    height: 40px;
    min-height: 40px;
    transition: all 0.15s ease;
    box-sizing: border-box;
    font-weight: 500;
}

.cs-trigger:hover {
    border-color: var(--blue, #0075de);
}

.cs-wrapper.open {
    z-index: 10000;
}

.cs-wrapper.open .cs-trigger {
    border-color: var(--blue, #0075de);
    box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.15);
}

.cs-arrow {
    font-size: 9px;
    color: var(--muted);
    margin-left: 8px;
    transition: transform 0.2s;
}

.cs-wrapper.open .cs-arrow {
    transform: rotate(180deg);
}

.cs-options {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.12), 0 8px 10px -6px rgba(0,0,0,0.08);
    z-index: 99999 !important;
    display: none;
    max-height: 250px;
    overflow-y: auto;
    padding: 5px;
    box-sizing: border-box;
}

.cs-wrapper.open .cs-options {
    display: block;
    animation: cs-fadein 0.15s ease-out;
}

.cs-option {
    padding: 8px 12px;
    font-size: 13.5px;
    color: var(--ink);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.1s;
    white-space: nowrap;
}

.cs-option:hover {
    background: rgba(0, 117, 222, 0.08);
    color: var(--blue, #0075de);
}

.cs-option.selected {
    background: rgba(0, 117, 222, 0.12);
    color: var(--blue, #0075de);
    font-weight: 600;
}
@keyframes cs-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Time Tracker & Projects (TimeCamp-style)
   ========================================================================== */

/* ==========================================================================
   Time Tracker & Projects (Modernized UI & Premium Theme)
   ========================================================================== */

/* Flatpickr and date/time input styling to look modern and native */
input.flatpickr-input,
.flatpickr-input.form-control,
.form-control.input,
input[type="date"],
input[type="time"] {
    background: var(--canvas) !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13.5px !important;
    color: var(--ink) !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    outline: none !important;
    transition: all 0.15s ease !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
    height: 40px !important;
    box-sizing: border-box !important;
}

.tt-input-group input.flatpickr-input,
.tt-input-group .flatpickr-input.form-control,
.tt-input-group .form-control.input,
.tt-input-group input[type="date"] {
    padding-left: 36px !important;
}

input.flatpickr-input:focus,
.flatpickr-input.form-control:focus,
.form-control.input:focus,
input[type="date"]:focus,
input[type="time"]:focus {
    border-color: var(--blue) !important;
    background: var(--surface) !important;
    box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.15) !important;
}

/* Flatpickr Popup Theme */
.flatpickr-calendar {
    background: var(--surface) !important;
    border: 1px solid var(--hairline) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08) !important;
    color: var(--ink) !important;
    font-family: inherit !important;
}

.flatpickr-calendar .flatpickr-months {
    background: var(--canvas) !important;
    border-top-left-radius: 12px !important;
    border-top-right-radius: 12px !important;
}

.flatpickr-calendar .flatpickr-current-month,
.flatpickr-calendar .flatpickr-monthDropdown-months,
.flatpickr-calendar .cur-year {
    color: var(--ink) !important;
    font-weight: 600 !important;
}

.flatpickr-day {
    color: var(--ink) !important;
    border-radius: 6px !important;
}

.flatpickr-day.today {
    border-color: var(--blue) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--blue) !important;
    border-color: var(--blue) !important;
    color: #fff !important;
}

.flatpickr-day:hover {
    background: rgba(0, 117, 222, 0.1) !important;
}

.tt-tracker-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 4px 16px -2px rgba(0, 0, 0, 0.05), 0 2px 6px -1px rgba(0, 0, 0, 0.03);
    margin-bottom: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tt-tracker-card:focus-within {
    border-color: rgba(0, 117, 222, 0.35);
    box-shadow: 0 6px 20px -2px rgba(0, 117, 222, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

/* Clean Field Pill Architecture (Zero Overlaps) */
.tt-field-pill {
    display: inline-flex;
    align-items: center;
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    height: 40px;
    padding: 0 12px;
    gap: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tt-field-pill:focus-within {
    border-color: var(--blue);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.15);
}

.tt-field-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    white-space: nowrap;
    user-select: none;
    flex-shrink: 0;
}

.tt-field-icon {
    font-size: 13.5px;
    line-height: 1;
    color: var(--muted);
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

.tt-clean-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 13.5px !important;
    color: var(--ink) !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    outline: none !important;
    box-shadow: none !important;
    height: 100% !important;
    min-width: 0;
}

.tt-clean-input::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

.tt-clean-select {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 13.5px !important;
    color: var(--ink) !important;
    font-family: inherit !important;
    font-weight: 500 !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    height: 100% !important;
    width: 100%;
}

.tt-clean-select option {
    background: var(--surface);
    color: var(--ink);
}

/* Type & Dropdown Searchable Combobox */
.tt-combobox-container {
    position: relative;
    cursor: text;
}

.tt-combobox-arrow {
    background: transparent;
    border: none;
    padding: 0 4px;
    margin: 0;
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, color 0.15s;
    flex-shrink: 0;
}

.tt-combobox-arrow:hover {
    color: var(--ink);
}

.tt-combobox-container.is-open .tt-combobox-arrow {
    transform: rotate(180deg);
}

.tt-combobox-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 250px;
    max-height: 250px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-combobox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}

.tt-combobox-item:hover,
.tt-combobox-item.is-highlighted {
    background: var(--canvas);
    color: var(--blue);
}

.tt-combobox-item.is-selected {
    background: rgba(0, 117, 222, 0.08);
    color: var(--blue);
    font-weight: 600;
}

.tt-combobox-item-new {
    border-top: 1px dashed var(--hairline);
    margin-top: 4px;
    padding-top: 8px;
    color: var(--blue);
    font-weight: 600;
}

.tt-combobox-item-new:hover {
    background: rgba(0, 117, 222, 0.08);
}

.tt-combobox-empty {
    padding: 10px;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

/* Flatpickr and input inside field pill */
.tt-field-pill .flatpickr-input,
.tt-field-pill .form-control.input,
.tt-field-pill input[type="date"],
.tt-field-pill input[type="time"] {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    height: 100% !important;
    font-size: 13.5px !important;
    color: var(--ink) !important;
    font-weight: 500 !important;
    cursor: pointer;
    width: 100% !important;
    outline: none !important;
}

.tt-field-pill input[type="time"] {
    min-width: 95px !important;
}

.tt-modern-input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    background: var(--canvas);
    color: var(--ink);
    outline: none;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.tt-modern-input:focus {
    border-color: var(--blue);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.15);
}

.tt-modern-select {
    height: 40px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13.5px;
    background: var(--canvas);
    color: var(--ink);
    outline: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.15s ease;
    box-sizing: border-box;
    max-width: 240px;
}

.tt-modern-select:focus {
    border-color: var(--blue);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(0, 117, 222, 0.15);
}

/* Timer Display & Actions */
.tt-timer-section {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-left: auto;
}

.tt-clock-display {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: var(--ink);
    min-width: 100px;
    text-align: center;
    background: var(--canvas);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--hairline);
}

.tt-clock-display.is-active-clock {
    color: #10b981;
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.25);
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.25);
}

.tt-btn-start {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35);
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

.tt-btn-start:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
}

.tt-btn-start:active {
    transform: scale(0.98);
}

.tt-btn-stop {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    animation: pulse-red-border 2s infinite;
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

.tt-btn-stop:hover {
    filter: brightness(1.06);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
}

.tt-btn-stop:active {
    transform: scale(0.98);
}

.tt-btn-log {
    background: var(--blue, #0075de);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    box-shadow: 0 2px 6px rgba(0, 117, 222, 0.3);
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}

.tt-btn-log:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(0, 117, 222, 0.4);
}

.tt-btn-log:active {
    transform: scale(0.98);
}

/* Manual Mode Structured 2-row Layout */
.tt-manual-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tt-manual-row-top {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.tt-manual-row-bottom {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed var(--hairline);
}

.tt-time-interval-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tt-duration-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(0, 117, 222, 0.08);
    border: 1px solid rgba(0, 117, 222, 0.22);
    border-radius: 8px;
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
    color: var(--blue, #0075de);
    font-weight: 650;
    user-select: none;
    box-sizing: border-box;
}

.tt-duration-pill .tt-duration-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    letter-spacing: 0.2px;
}

/* Mode Switcher Segmented Control & Header Navigation */
.tt-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 16px;
    width: 100%;
    box-sizing: border-box;
}

.tt-subtabs-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.tt-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.tt-mode-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--canvas);
    border-radius: 9px;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--hairline);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    flex-shrink: 0;
    white-space: nowrap;
}

.tt-mode-btn {
    border: none;
    background: transparent;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 7px;
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.tt-mode-btn:hover {
    color: var(--ink);
}

.tt-mode-btn.is-active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tt-tracker-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
}

.topbar-timer-widget {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.35);
    font-size: 12.5px;
    font-weight: 600;
    color: #059669;
    cursor: pointer;
    margin-right: 12px;
    text-decoration: none;
    transition: background 0.15s;
}

:root.dark .topbar-timer-widget {
    background: rgba(16, 185, 129, 0.18);
    color: #34d399;
}

.topbar-timer-widget:hover {
    background: rgba(16, 185, 129, 0.2);
}

.topbar-timer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-dot 1.5s infinite;
}

.topbar-timer-stop {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-size: 10px;
    margin-left: 4px;
    transition: transform 0.1s;
}

.topbar-timer-stop:hover {
    transform: scale(1.15);
}

@keyframes pulse-dot {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

@keyframes pulse-red-border {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Timesheet Daily Groups */
.tt-day-group {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
    position: relative;
}

.tt-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
}

.tt-day-header .day-date {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
}

.tt-day-header .day-date-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(0, 117, 222, 0.08);
    font-size: 13px;
    flex-shrink: 0;
}

.tt-day-header .day-date-relative {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
}

.tt-day-header .day-totals {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.tt-day-header .day-total-badge {
    font-family: ui-monospace, monospace;
    font-weight: 700;
    font-size: 13px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--hairline);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tt-entry-row {
    display: grid;
    grid-template-columns: minmax(200px, 1.4fr) minmax(180px, 1fr) auto auto auto;
    gap: 14px;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--hairline);
    transition: background 0.12s;
    font-size: 13.5px;
}

.tt-entry-row:last-child {
    border-bottom: none;
}

.tt-entry-row:hover {
    background: rgba(0, 0, 0, 0.015);
}

:root.dark .tt-entry-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.tt-entry-row.is-running {
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid #10b981;
}

.tt-project-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    max-width: 240px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-project-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.tt-time-range {
    font-family: ui-monospace, monospace;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.tt-duration-badge {
    font-family: ui-monospace, monospace;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ink);
    min-width: 65px;
    text-align: right;
}

.tt-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.tt-action-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--hairline);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s;
}

.tt-action-btn:hover {
    background: var(--canvas);
    color: var(--ink);
    border-color: var(--muted);
}

.tt-action-btn.btn-continue:hover {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-color: #10b981;
}

.tt-action-btn.btn-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border-color: #ef4444;
}

/* Projects grid and cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.project-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: box-shadow 0.15s, transform 0.1s;
    position: relative;
    overflow: hidden;
}

.project-card:hover {
    box-shadow: var(--shadow-pop);
}

.project-card-stripe {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.progress-track {
    width: 100%;
    height: 7px;
    background: var(--hairline);
    border-radius: 999px;
    overflow: hidden;
    margin: 8px 0 4px;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.color-swatch-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    padding: 4px 0;
}

.color-swatch-opt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border: 2px solid transparent;
}

.color-swatch-opt:hover {
    transform: scale(1.18);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.18);
}

.color-swatch-opt.is-selected {
    transform: scale(1.18);
    box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 4.5px var(--ink);
}

.color-swatch-opt.is-selected::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* Sub-tasks list in project detail */
.project-task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--surface);
    transition: background 0.12s;
}

.project-task-item:hover {
    background: var(--canvas);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tt-entry-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .tt-tracker-row {
        flex-direction: column;
        align-items: stretch;
    }
    .tt-clock-display {
        text-align: left;
    }
    .emp-modal-tabs {
        flex-wrap: wrap;
    }
}

/* Employee Modal Tabbed & Multi-column System (Anti-Doomscrolling) */
.emp-modal-tabs {
    display: flex;
    gap: 6px;
    background: var(--canvas);
    padding: 5px;
    border-radius: 10px;
    border: 1px solid var(--hairline);
    margin-bottom: 22px;
}

.emp-tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 12px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 7px;
    cursor: pointer;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    transition: all 0.15s ease;
    user-select: none;
}

.emp-tab-btn:hover {
    color: var(--ink);
    background: rgba(0, 0, 0, 0.03);
}

:root.dark .emp-tab-btn:hover {
    background: rgba(255, 255, 255, 0.04);
}

.emp-tab-btn.is-active {
    background: var(--surface);
    color: var(--blue, #0075de);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.emp-tab-panel {
    display: none;
    animation: fadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.emp-tab-panel.is-active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 250px;
}

.emp-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    margin-top: 20px;
    border-top: 1px solid var(--hairline);
}

/* Payroll Template Styling */
.tpl-container {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 768px) {
    .tpl-container {
        grid-template-columns: 1fr;
    }
}

.tpl-calc-card {
    background: var(--canvas);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 18px 20px;
    position: sticky;
    top: 10px;
}

.tpl-calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13px;
    color: var(--ink-2);
    border-bottom: 1px dashed var(--hairline);
}

.tpl-calc-row:last-child {
    border-bottom: none;
}

.tpl-calc-row.is-total {
    border-top: 2px solid var(--hairline);
    border-bottom: none;
    margin-top: 8px;
    padding-top: 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ink);
}

.tpl-calc-val {
    font-family: ui-monospace, monospace;
    font-weight: 600;
}

.tpl-quick-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tpl-quick-pill {
    background: var(--surface);
    border: 1px solid var(--hairline);
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.tpl-quick-pill:hover {
    background: var(--blue-soft, rgba(0, 117, 222, 0.08));
    color: var(--blue, #0075de);
    border-color: var(--blue, #0075de);
}


