:root {
    --ti-ink: #121a24;
    --ti-sidebar-bg: #ffffff;
    --ti-sidebar-ink: #45505c;
    --ti-sidebar-active: #13aff0;
    --ti-accent: #13aff0;
    --ti-accent-alt: #31f3e0;
    --ti-bg: #f4f6f5;
    --ti-panel: #ffffff;
    --ti-line: #e3e7e5;
}

body { background: var(--ti-bg); color: var(--ti-ink); font-family: 'Plus Jakarta Sans', -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

.ti-shell { display: flex; min-height: 100vh; }

.ti-sidebar {
    width: 250px; flex-shrink: 0; background: var(--ti-sidebar-bg); color: var(--ti-sidebar-ink);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
    border-right: 1px solid var(--ti-line);
}
.ti-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; border-bottom: 1px solid var(--ti-line); }
.ti-brand i { font-size: 1.6rem; color: var(--ti-accent); }
.ti-brand-logo { height: 28px; width: auto; }
.ti-brand-title { font-weight: 700; font-size: .95rem; color: var(--ti-ink); }
.ti-brand-sub { font-size: .72rem; color: #8391a0; }
.ti-nav { padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.ti-nav-heading { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #8391a0; margin: 14px 10px 4px; }
.ti-nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; color: var(--ti-sidebar-ink); text-decoration: none; font-size: .87rem; }
.ti-nav-link i { font-size: 1rem; width: 18px; text-align: center; }
.ti-nav-link:hover { background: #eef1ef; color: var(--ti-ink); }
.ti-nav-link.active { background: var(--ti-sidebar-active); color: #fff; }

.ti-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ti-topbar { display: flex; align-items: center; gap: 14px; padding: 14px 24px; background: var(--ti-panel); border-bottom: 1px solid var(--ti-line); position: sticky; top: 0; z-index: 10; }
.ti-page-title { font-size: 1.15rem; font-weight: 700; margin: 0; flex: 1; }
.ti-topbar-right { display: flex; align-items: center; gap: 12px; }
.ti-role-pill { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; background: var(--ti-bg); border: 1px solid var(--ti-line); padding: 4px 10px; border-radius: 100px; color: #52606d; }
.ti-user-btn { border: 1px solid var(--ti-line); background: #fff; }
.ti-sidebar-toggle { border: none; background: transparent; font-size: 1.4rem; }

.ti-content { padding: 24px; flex: 1; }

.ti-card { background: var(--ti-panel); border: 1px solid var(--ti-line); border-radius: 10px; padding: 20px; }
.ti-card + .ti-card { margin-top: 16px; }

.stat-tile { background: var(--ti-panel); border: 1px solid var(--ti-line); border-radius: 10px; padding: 18px 20px; }
.stat-tile .stat-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: #66727e; }
.stat-tile .stat-value { font-size: 1.9rem; font-weight: 700; margin-top: 4px; }
.stat-tile .stat-icon { font-size: 1.4rem; color: var(--ti-accent); }

.kanban-col { background: #f4f6f5; border-radius: 10px; padding: 12px; min-height: 200px; }
.kanban-col-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #52606d; margin-bottom: 10px; }
.kanban-card { background: #fff; border: 1px solid var(--ti-line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: .85rem; }
.kanban-card .kc-num { font-family: ui-monospace, monospace; font-size: .72rem; color: #7c8894; }

.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, #eef9fb, #f4f6f5); padding: 20px; }
.auth-card { background: #fff; border-radius: 12px; padding: 36px 34px; width: 100%; max-width: 400px; box-shadow: 0 12px 40px rgba(18,26,36,.10); border: 1px solid var(--ti-line); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand i { font-size: 1.8rem; color: var(--ti-accent); }
.auth-brand-logo { height: 34px; width: auto; }

.chat-bubble { border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; max-width: 80%; }
.chat-bubble.mine { background: var(--ti-accent); color: #fff; margin-left: auto; }
.chat-bubble.theirs { background: #eef1ef; }
.chat-bubble .chat-meta { font-size: .68rem; opacity: .75; margin-top: 4px; }

.ti-sidebar-backdrop {
    display: none; position: fixed; inset: 0; background: rgba(18,26,36,.45); z-index: 999;
    opacity: 0; transition: opacity .2s ease;
}
.ti-sidebar-backdrop.open { display: block; opacity: 1; }
body.ti-no-scroll { overflow: hidden; }

.table-responsive { width: 100%; }
.table-responsive > table,
table.dataTable,
.dataTables_wrapper,
.dataTables_wrapper table.dataTable { width: 100% !important; }
.ti-card .table:not(.dataTable) { width: 100%; }
.dataTables_wrapper .row:first-child,
.dataTables_wrapper .row:last-child { margin-left: 0; margin-right: 0; }

@media (max-width: 992px) {
    .ti-sidebar { position: fixed; left: -260px; top: 0; height: 100vh; z-index: 1000; transition: left .2s ease; }
    .ti-sidebar.open { left: 0; }
    .ti-content { padding: 16px; }
}

@media (max-width: 576px) {
    .ti-card { padding: 14px; }
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        text-align: left !important; float: none !important; width: 100%; margin-bottom: 8px;
    }
    .dataTables_wrapper .dataTables_filter input { width: 100%; margin-left: 0 !important; }
}
