:root {
    --bg: #f6f7f4;
    --surface: #ffffff;
    --surface-soft: #eef2ef;
    --surface-strong: #dfe8e2;
    --text: #17201b;
    --muted: #637069;
    --line: #d8e0dc;
    --brand: #0f8b6f;
    --brand-strong: #0a6d5a;
    --accent: #2563eb;
    --danger: #dc2626;
    --warning: #b45309;
    --success: #15803d;
    --shadow: 0 18px 45px rgba(23, 32, 27, 0.10);
    --radius: 8px;
}

body.dark-mode {
    --bg: #101411;
    --surface: #171d19;
    --surface-soft: #202822;
    --surface-strong: #2b352e;
    --text: #eef6f1;
    --muted: #a8b5ad;
    --line: #344139;
    --brand: #2dd4bf;
    --brand-strong: #14b8a6;
    --accent: #60a5fa;
    --danger: #fb7185;
    --warning: #fbbf24;
    --success: #4ade80;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg) !important;
    color: var(--text) !important;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

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

header,
footer,
#sidebar {
    background: var(--surface) !important;
    border-color: var(--line) !important;
    box-shadow: none !important;
}

main {
    background: var(--bg);
}

#mobileMenuOverlay {
    display: none;
}

body.sidebar-open #mobileMenuOverlay {
    display: block;
}

#sidebar {
    z-index: 140;
}

@media (max-width: 768px) {
    #sidebar {
        transform: translateX(-100%);
        position: fixed;
        height: 100vh;
        overflow-y: auto;
    }

    body.sidebar-open #sidebar {
        transform: translateX(0);
    }
}

.subtle-glow,
.neon-glow {
    box-shadow: var(--shadow);
}

.subtle-glow:hover,
.neon-glow:hover {
    transform: none;
}

.tk-shell {
    max-width: 1280px;
    margin: 0 auto;
}

.tk-page-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.tk-eyebrow {
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tk-title {
    color: var(--text);
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 850;
    line-height: 1.08;
    margin: 0.2rem 0 0.5rem;
}

.tk-subtitle {
    color: var(--muted);
    max-width: 760px;
    line-height: 1.65;
}

.tk-grid {
    display: grid;
    gap: 1rem;
}

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

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

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

.tk-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tk-card-pad {
    padding: 1.25rem;
}

.tk-stat {
    min-height: 128px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tk-stat-value {
    color: var(--text);
    font-size: 2.2rem;
    font-weight: 850;
    line-height: 1;
}

.tk-stat-label {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 0.4rem;
}

.tk-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tk-section-title h2,
.tk-section-title h3 {
    color: var(--text);
    font-size: 1.1rem;
    font-weight: 800;
    margin: 0;
}

.tk-list {
    display: grid;
    gap: 0.75rem;
}

.tk-project,
.tk-task {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--brand);
    border-radius: var(--radius);
    padding: 1rem;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.tk-project:hover,
.tk-task:hover {
    border-color: var(--brand);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.tk-project-title,
.tk-task-title {
    color: var(--text);
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.tk-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-top: 0.55rem;
}

.tk-progress {
    background: var(--surface-strong);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.tk-progress span {
    background: linear-gradient(90deg, var(--brand), var(--accent));
    display: block;
    height: 100%;
}

.tk-badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    gap: 0.35rem;
    padding: 0.32rem 0.65rem;
    white-space: nowrap;
}

.tk-badge-success {
    background: rgba(21, 128, 61, 0.12);
    color: var(--success);
}

.tk-badge-warning {
    background: rgba(180, 83, 9, 0.13);
    color: var(--warning);
}

.tk-badge-info {
    background: rgba(37, 99, 235, 0.12);
    color: var(--accent);
}

.tk-badge-danger {
    background: rgba(220, 38, 38, 0.12);
    color: var(--danger);
}

.tk-badge-muted {
    background: var(--surface-soft);
    color: var(--muted);
}

.tk-priority-normal {
    border-left-color: var(--brand);
}

.tk-priority-medium {
    border-left-color: var(--warning);
}

.tk-priority-high,
.tk-priority-critical {
    border-left-color: var(--danger);
}

.tk-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tk-btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 40px;
    padding: 0.62rem 0.95rem;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tk-btn-primary {
    background: var(--brand);
    color: #ffffff;
}

.tk-btn-primary:hover {
    background: var(--brand-strong);
}

.tk-btn-secondary {
    background: var(--surface-soft);
    border-color: var(--line);
    color: var(--text);
}

.tk-btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand-strong);
}

.tk-btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.tk-empty {
    color: var(--muted);
    padding: 2rem;
    text-align: center;
}

.tk-form-row {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 1rem;
}

.tk-input {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    min-height: 42px;
    padding: 0.65rem 0.75rem;
    width: 100%;
}

.tk-input:focus {
    border-color: var(--brand);
    outline: 2px solid rgba(15, 139, 111, 0.18);
}

.tk-modal {
    align-items: center;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    inset: 0;
    justify-content: center;
    padding: 1rem;
    position: fixed;
    z-index: 9999;
}

.tk-modal.hidden {
    display: none;
}

.tk-modal-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 92vh;
    max-width: 560px;
    overflow-y: auto;
    width: min(100%, 560px);
}

.tk-modal-head {
    border-bottom: 1px solid var(--line);
    padding: 1.1rem 1.25rem;
}

.tk-modal-head h3 {
    font-size: 1.1rem;
    font-weight: 850;
    margin: 0;
}

.tk-modal-body {
    padding: 1.25rem;
}

.tk-table-wrap {
    overflow-x: auto;
}

.tk-table {
    border-collapse: collapse;
    width: 100%;
}

.tk-table th,
.tk-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.85rem;
    text-align: left;
}

.tk-table th {
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

@media (max-width: 1024px) {
    .tk-grid-4,
    .tk-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .tk-page-head {
        flex-direction: column;
    }

    .tk-grid-4,
    .tk-grid-3,
    .tk-grid-2 {
        grid-template-columns: 1fr;
    }

    .tk-card-pad {
        padding: 1rem;
    }
}

