/* ===== App shell ===== */
.t-app {
    display: grid;
    grid-template-columns: 248px 1fr;
    min-height: 100vh;
    background: var(--t-bg-page);
}
.t-app__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.t-app__content {
    flex: 1;
    padding: var(--t-space-5) var(--t-space-7);
}
@media (max-width: 768px) {
    .t-app { grid-template-columns: 1fr; }
    .t-app__content { padding: var(--t-space-4); }
}

/* ===== Sidebar ===== */
.t-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--t-bg-panel);
    border-right: 1px solid var(--t-border-subtle);
    padding: var(--t-space-5) var(--t-space-3);
    gap: var(--t-space-4);
}
.t-sidebar__brand {
    display: flex; align-items: center; gap: var(--t-space-3);
    padding: 0 var(--t-space-3) var(--t-space-3);
    border-bottom: 1px solid var(--t-border-subtle);
}
.t-sidebar__brand-mark {
    width: 32px; height: 32px;
    border-radius: var(--t-radius-md);
    background: var(--t-accent);
    color: var(--t-text-on-accent);
    display: grid; place-items: center;
    font-weight: 590;
}
.t-sidebar__brand-text { display: flex; flex-direction: column; }
.t-sidebar__brand-title { font-weight: 590; color: var(--t-text-primary); }
.t-sidebar__brand-subtitle { font-size: 11px; color: var(--t-text-tertiary); text-transform: uppercase; letter-spacing: .6px; }

.t-sidebar__nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.t-sidebar__group { display: flex; flex-direction: column; }
.t-sidebar__link {
    display: flex; align-items: center;
    gap: var(--t-space-3);
    padding: 8px 12px;
    border-radius: var(--t-radius-md);
    color: var(--t-text-tertiary);
    font-size: 13px;
    font-weight: 510;
    text-decoration: none;
    background: transparent;
    border: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: background-color .12s ease, color .12s ease;
}
.t-sidebar__link:hover { background: var(--t-bg-surface-hover); color: var(--t-text-primary); }
.t-sidebar__link.is-active {
    background: var(--t-accent-soft);
    color: var(--t-accent);
}
.t-sidebar__link--child { padding-left: 36px; font-size: 13px; }
.t-sidebar__icon { width: 18px; text-align: center; opacity: .8; }
.t-sidebar__label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-sidebar__chevron { font-size: 16px; color: var(--t-text-quaternary); }
.t-sidebar__children { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.t-sidebar__footer { border-top: 1px solid var(--t-border-subtle); padding-top: var(--t-space-3); }

/* ===== Topbar ===== */
.t-topbar {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--t-space-7);
    border-bottom: 1px solid var(--t-border-subtle);
    background: var(--t-bg-page);
    position: sticky; top: 0; z-index: 10;
}
.t-topbar__title { margin: 0; font-size: 16px; font-weight: 590; letter-spacing: -0.2px; }
.t-topbar__right { display: flex; align-items: center; gap: var(--t-space-3); }
.t-topbar__user { font-size: 13px; color: var(--t-text-secondary); }
@media (max-width: 768px) {
    .t-topbar { padding: 0 var(--t-space-4); }
}

/* ===== Page wrapper ===== */
.t-page { max-width: 1200px; }
.t-page__title { font-size: 26px; letter-spacing: -0.5px; }
.t-page__lead { color: var(--t-text-secondary); font-size: 15px; margin-bottom: var(--t-space-6); }

/* ===== Grid helpers ===== */
.t-grid { display: grid; gap: var(--t-space-4); }
.t-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.t-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.t-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) {
    .t-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .t-grid--2, .t-grid--3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .t-grid--4 { grid-template-columns: 1fr; }
}

/* ===== Section ===== */
.t-section { display: flex; flex-direction: column; gap: var(--t-space-3); margin-bottom: var(--t-space-6); }
.t-section__head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: var(--t-space-3);
}
.t-section__title { margin: 0; font-size: 14px; font-weight: 510; color: var(--t-text-tertiary); text-transform: uppercase; letter-spacing: 0.6px; }
.t-section__more { font-size: 13px; color: var(--t-text-tertiary); text-decoration: none; }
.t-section__more:hover { color: var(--t-accent); }

/* ===== Page header ===== */
.t-page__header { margin-bottom: var(--t-space-6); }
.t-page__header--row {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: var(--t-space-4); flex-wrap: wrap;
}

/* ===== Login layout ===== */
.t-login-layout {
    min-height: 100vh;
    background: var(--t-bg-page);
    display: flex; align-items: center; justify-content: center;
    padding: var(--t-space-5);
}
.t-login-layout__content { width: 100%; max-width: 380px; }
.t-login { display: flex; flex-direction: column; gap: var(--t-space-5); }
.t-login__brand { display: flex; align-items: center; gap: var(--t-space-3); justify-content: center; }
.t-login__brand-mark {
    width: 36px; height: 36px;
    border-radius: var(--t-radius-md);
    background: var(--t-accent);
    color: var(--t-text-on-accent);
    display: grid; place-items: center;
    font-weight: 590;
}
.t-login__brand-text { font-size: 18px; font-weight: 590; letter-spacing: -0.3px; }
.t-login__aux {
    display: flex; justify-content: center;
    margin-top: var(--t-space-3);
}
.t-login__link {
    color: var(--t-text-tertiary);
    font-size: 13px;
    text-decoration: none;
}
.t-login__link:hover { color: var(--t-accent); }
