:root {
    --navy: #16324f;
    --navy-deep: #0e2338;
    --red: #b71c2b;
    --gold: #c79a45;
    --cream: #f7f4ee;
    --line: #dfe4ea;
    --text: #223247;
    --muted: #66788c;
}

.tp-app--lbs,
.tp-app--auth,
.tp-app--lbs *,
.tp-app--auth * {
    box-sizing: border-box;
}

.tp-app--lbs,
.tp-app--auth {
    margin: 0;
    color: var(--text);
    font-family: "Montserrat", Arial, sans-serif;
    background: var(--cream);
}

.tp-app--auth {
    background: var(--navy-deep);
}

.wm-dots {
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(22, 50, 79, .045) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.wm-ring {
    position: fixed;
    right: -140px;
    bottom: -140px;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    border: 36px solid rgba(22, 50, 79, .035);
    pointer-events: none;
    z-index: 0;
}

#screen-login {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--navy-deep);
    background-image:
        linear-gradient(180deg, rgba(14, 35, 56, .38) 0%, rgba(14, 35, 56, .62) 100%),
        var(--login-bg-image, none);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

#screen-login .ring-dash {
    position: absolute;
    right: -160px;
    top: -160px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1.4px dashed rgba(199, 154, 69, .45);
}

#screen-login .ring-dash2 {
    position: absolute;
    left: -140px;
    bottom: -140px;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, .06);
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(420px, calc(100% - 32px));
    padding: 38px 40px 32px;
    border: 1px solid var(--gold);
    border-radius: 10px;
    background: #132c46;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .4);
}

.login-card img {
    height: 46px;
    display: block;
    margin: 0 auto 22px;
}

.login-kicker {
    margin-bottom: 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gold);
    text-align: center;
}

.login-title {
    margin-bottom: 26px;
    font-size: 19px;
    font-weight: 800;
    color: #fff;
    text-align: center;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #9fb2c6;
}

.field-input {
    width: 100%;
    margin-bottom: 20px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
}

.field-input::placeholder { color: #7c8ea3; }
.field-input:disabled { background: #f2f4f6; color: var(--muted); }

.btn-primary {
    width: 100%;
    padding: 13px;
    border: none;
    border-radius: 6px;
    background: var(--red);
    color: #fff;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: .5px;
    cursor: pointer;
}

.btn-primary:hover { background: #9c1723; }

.btn-ghost {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: none;
    background: transparent;
    color: #9fb2c6;
    font-family: "Montserrat", sans-serif;
    font-size: 11.5px;
    cursor: pointer;
    text-decoration: underline;
}

.code-boxes { display: flex; gap: 8px; margin-bottom: 8px; }
.code-boxes input,
.tp-otp__cell {
    width: 100%;
    padding: 10px 0;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    color: #fff;
    font-family: "Montserrat", sans-serif;
}

.tp-otp { display: flex; gap: 8px; }
.tp-otp__native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.code-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: #8296ac; margin: 8px 0 22px; }
.login-note { font-size: 10.5px; color: #7c8ea3; text-align: center; margin-top: 16px; line-height: 1.5; }
.login-error { color: #f0a6ac; font-size: 12px; margin: -8px 0 14px; }
.tp-devcode { color: var(--gold); font-size: 12px; text-align: center; margin-bottom: 16px; }
.tp-devcode strong { display: block; margin-top: 4px; font-size: 18px; letter-spacing: .2em; }

#lbs-app {
    position: relative;
    z-index: 1;
    min-width: 0;
    font-family: "Montserrat", Arial, sans-serif;
}

body.tp-app--lbs.lbs-app-shell {
    background: #f1f3f5;
}

body.tp-app--lbs.lbs-app-shell .admin-layout-main {
    padding: 0;
}

body.tp-app--lbs .pd-page button.pd-alert-chip,
body.tp-app--lbs .pd-page button.pd-card-action {
    border: 0;
    cursor: pointer;
    font-family: inherit;
}

body.tp-app--lbs .pd-page button.pd-alert-chip {
    background: #fff7ed;
}

body.tp-app--lbs .pd-alerts {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    width: 100%;
    flex-wrap: nowrap;
}

body.tp-app--lbs .pd-alerts .pd-alert-chip {
    flex: 0 0 auto;
}

body.tp-app--lbs .pd-alerts .pd-alert-chip + .pd-alert-chip {
    margin-left: auto;
}

body.tp-app--lbs .pd-page > .pd-card,
body.tp-app--lbs .pd-page > .pd-charts-row,
body.tp-app--lbs .pd-page > .pd-bottom-grid {
    margin-bottom: 1.25rem;
}

body.tp-app--lbs .pd-charts-row {
    align-items: stretch;
}

body.tp-app--lbs .pd-charts-row .pd-card {
    min-width: 0;
}

body.tp-app--lbs .td-chart-tabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: #eef2f6;
}

body.tp-app--lbs .td-chart-tabs .tab {
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.32rem 0.75rem;
    border-radius: 999px;
    cursor: pointer;
}

body.tp-app--lbs .td-chart-tabs .tab[aria-selected="true"] {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body.tp-app--lbs .td-chart-stats {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.35rem;
}

body.tp-app--lbs .td-chart-stats {
    gap: 0;
}

body.tp-app--lbs .td-chart-stats .text-2xl {
    font-size: 1.25rem;
}

body.tp-app--lbs .td-chart-wrap {
    position: relative;
    height: 188px;
}

body.tp-app--lbs .td-chart-wrap .chart-dots {
    position: absolute;
    inset: 0 0 30px 0;
    background-image: radial-gradient(#e4e7eb 1px, transparent 1.2px);
    background-size: 10px 10px;
    pointer-events: none;
}

body.tp-app--lbs .td-chart-wrap #chart {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: pan-y;
}

body.tp-app--lbs .td-chart-tip {
    position: absolute;
    top: 12px;
    width: 196px;
    pointer-events: none;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 0.75rem;
    box-shadow: 0 8px 24px rgba(16, 24, 40, 0.1);
    opacity: 0;
    visibility: hidden;
}

body.tp-app--lbs .td-chart-tip.is-on {
    opacity: 1;
    visibility: visible;
}

body.tp-app--lbs .td-chart-tip #tip-date {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
}

body.tp-app--lbs .td-chart-tip #tip-rows {
    margin-top: 0.5rem;
}

body.tp-app--lbs .td-chart-tip #tip-note {
    margin: 0.65rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px dashed #e2e8f0;
    font-size: 11px;
    line-height: 1.4;
    color: #64748b;
}

body.tp-app--lbs.lbs-app-shell #sidebar .side-menu > li > a.active,
body.tp-app--lbs.lbs-app-shell #sidebar .side-menu > li > a.active:hover {
    background: #1e3a5f;
    color: #fff;
}

body.tp-app--lbs #sidebar .side-menu {
    margin-top: 20px;
}

body.tp-app--lbs #sidebar .side-menu > li > a {
    padding: 12px 14px 12px 0;
    border-radius: 12px;
}

body.tp-app--lbs #sidebar .side-menu > li > a:hover {
    background: #1f1f1f;
    color: #fff;
}

body.tp-app--lbs #sidebar .draft-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    margin-left: 8px;
    border-radius: 999px;
    background: #f59e0b;
    color: #1f2937;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

body.tp-app--lbs #admin-top-navbar.admin-shell-top-navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: unset;
    gap: 0.55rem 0.75rem;
    padding: 0.55rem 1.1rem;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: none;
    border-bottom: 1px solid #e4e8ee;
    min-height: 64px;
    overflow: visible;
}

#admin-top-navbar .navbar-left,
#admin-top-navbar .navbar-center,
#admin-top-navbar .navbar-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

#admin-top-navbar .navbar-left {
    gap: 12px;
    flex: 0 0 auto;
}

#admin-top-navbar .navbar-center {
    justify-content: center;
    flex: 1 1 160px;
    width: auto;
    min-width: 0;
}

#admin-top-navbar .navbar-right {
    gap: 8px;
    flex: 0 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    margin-left: auto;
}

#admin-top-navbar .toggle-sidebar {
    cursor: pointer;
    font-size: 1.5rem;
    color: #6c757d;
    flex: 0 0 auto;
}

#admin-top-navbar .toggle-sidebar:hover {
    color: #1775f1;
}

#admin-top-navbar .search-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    min-width: 0;
}

#admin-top-navbar .search-form .form-group {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
}

#admin-top-navbar .search-form input {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 8px 42px 8px 16px;
    border: 1px solid #d9e0e8;
    border-radius: 12px;
    font-size: 14px;
    background: #f7f8fa;
}

#admin-top-navbar .search-form input:focus {
    outline: none;
    border-color: #8aa0b5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

#admin-top-navbar .search-form .icon {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #7a8b9c;
    display: flex;
    align-items: center;
    justify-content: center;
}

#admin-top-navbar .divider {
    display: inline-block;
    width: 1px;
    height: 1.25rem;
    background: #dee2e6;
}

#admin-top-navbar .academic-year {
    flex: 0 0 auto;
}

#admin-top-navbar .year-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #eef3f7;
    color: #35506b;
    padding: 6px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

#admin-top-navbar .year-text { font-size: 13px; font-weight: 650; }
#admin-top-navbar .year-status {
    background: #d9e6d8;
    color: #2f6a3a;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    text-transform: none;
}

#admin-top-navbar .admin-name {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #5b6b7a;
    max-width: min(260px, 32vw);
    min-width: 0;
    overflow: hidden;
}

#admin-top-navbar .admin-name-label {
    flex: 0 0 auto;
    white-space: nowrap;
}

#admin-top-navbar .admin-fullname {
    font-weight: 700;
    color: var(--red);
    background: none;
    padding: 0;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#admin-top-navbar .profile {
    flex: 0 0 auto;
}

#admin-top-navbar .profile { position: relative; }
#admin-top-navbar .profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

#admin-top-navbar .profile-avatar::after {
    content: '▼';
    position: absolute;
    bottom: -2px;
    right: -2px;
    background: #667eea;
    color: #fff;
    font-size: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

#admin-top-navbar .initials {
    color: #fff;
    font-weight: 600;
    font-size: 14px;
}

#admin-top-navbar .profile-link {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1200;
    display: none;
    padding: 8px 0;
    margin: 0;
    list-style: none;
}

#admin-top-navbar .profile-link.show { display: block; }
#admin-top-navbar .profile-link a,
#admin-top-navbar .logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 16px;
    border: 0;
    background: none;
    color: #495057;
    font-size: 14px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

#admin-top-navbar .logout-btn { color: #dc3545; }
#admin-top-navbar .profile-link a:hover,
#admin-top-navbar .logout-btn:hover { background: #f8f9fa; }

.lbs-main { flex: 1; position: relative; z-index: 1; min-height: 0; padding: 0; min-width: 0; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; position: relative; z-index: 2; }
.topbar h1 { font-size: clamp(1.6rem, 2.2vw, 2rem); font-weight: 650; color: var(--navy); margin: 0; letter-spacing: -0.025em; line-height: 1.2; }
.topbar .sub { font-size: 15px; color: #6b7c8d; margin-top: 8px; line-height: 1.55; font-weight: 400; max-width: 42rem; }

.score-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px 8px 8px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 30, 50, .06);
    cursor: pointer;
    font: inherit;
}
.score-ring {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex: none;
    background: conic-gradient(var(--gold) calc(var(--pct) * 1%), var(--line) 0);
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-ring span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    color: var(--navy);
}
.score-pill .lbl { font-size: 11px; font-weight: 700; color: var(--navy); line-height: 1.3; }
.score-pill .lbl small { display: block; font-weight: 500; color: var(--muted); font-size: 9.5px; }

.view { display: none; position: relative; z-index: 2; }
.view.active { display: block; }

#lbs-app .card {
    display: block;
    background: #fff;
    border: 1px solid rgba(22, 50, 79, 0.06);
    border-radius: 18px;
    padding: 26px 28px;
    box-shadow: 0 10px 28px rgba(22, 50, 79, 0.04);
}
.card-title { font-size: 16px; font-weight: 650; color: var(--navy); margin-bottom: 6px; }
.card-sub { font-size: 13.5px; color: #6b7c8d; margin-bottom: 18px; line-height: 1.5; }
.row-grid { display: grid; gap: 20px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: 1.3fr 1fr; }
.te-gap { margin-top: 28px; }
.te-gap-top { margin-top: 8px; }
.te-form { margin-top: 8px; max-width: 760px; }
.te-form-grid { grid-template-columns: 1fr 1fr; }
.te-save { margin-top: 22px; }
.te-empty {
    margin: 0;
    padding: 28px;
    border-radius: 18px;
    background: #fff;
    color: #6b7c8d;
    font-size: 15px;
    line-height: 1.55;
}

.stat-card { display: flex; flex-direction: row; align-items: center; gap: 16px; }
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex: none;
    color: #fff;
}
.stat-num { font-size: 22px; font-weight: 650; color: var(--navy); line-height: 1; }
.stat-lbl { font-size: 13px; color: #6b7c8d; margin-top: 6px; }

.next-course { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid #eef1f4; }
.next-course:last-child { border-bottom: none; }
.next-course .when { width: 70px; flex: none; font-size: 12px; font-weight: 700; color: var(--navy); }
.next-course .info { flex: 1; min-width: 0; }
.next-course .info .mod { font-size: 14.5px; font-weight: 600; color: var(--text); }
.next-course .info .meta { font-size: 12.5px; color: #6b7c8d; margin-top: 3px; }
.badge-room { font-size: 12px; font-weight: 600; color: #35506b; background: #eef3f7; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }

.piece-row { display: flex; align-items: center; gap: 16px; padding: 18px 0; border-bottom: 1px solid #eef1f4; }
.piece-row:last-child { border-bottom: none; }
.piece-check { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; font-weight: 800; color: #fff; }
.piece-check.done { background: var(--navy); }
.piece-check.missing { background: #e7ecf1; color: var(--muted); }
.piece-name { font-size: 15px; font-weight: 600; color: var(--text); }
.piece-desc { font-size: 13px; color: #6b7c8d; margin-top: 3px; line-height: 1.45; }
.piece-actions { margin-left: auto; display: flex; gap: 8px; }
.btn-sm { font-size: 13.5px; font-weight: 600; padding: 10px 16px; border-radius: 12px; border: 1px solid #d9e0e8; background: #fff; color: var(--navy); cursor: pointer; font-family: inherit; }
.btn-sm.primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.next-hint { background: #f7f1e4; border: 0; border-radius: 14px; padding: 14px 18px; font-size: 14px; color: var(--navy); margin: 0 0 20px; line-height: 1.5; }
.next-hint b { color: var(--red); }

.syll-search { display: flex; gap: 10px; margin: 0 0 22px; }
.syll-list { display: grid; gap: 14px; }
.syll-card {
    border: 1px solid rgba(22, 50, 79, 0.06);
    border-radius: 18px;
    padding: 20px 24px;
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(22, 50, 79, 0.04);
}
.syll-card:last-child { margin-bottom: 0; }
.syll-card .code { font-size: 12px; font-weight: 650; color: var(--red); letter-spacing: 0.04em; }
.syll-card .name { font-size: 16px; font-weight: 650; color: var(--navy); margin-top: 4px; }
.syll-card .meta { font-size: 13px; color: #6b7c8d; margin-top: 4px; }
.syll-status { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.syll-status.ok { background: #e8f3ec; color: #1f7a45; }
.syll-status.draft { background: #fbeee0; color: #b5691a; }

.form-input, .form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d9e0e8;
    border-radius: 12px;
    font-family: "Montserrat", sans-serif;
    font-size: 14.5px;
    color: var(--text);
    background: #fbfcfd;
}
body.tp-app--lbs #lbs-app .field-label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: #5b6b7a;
    margin-bottom: 6px;
}

.day-pill { display: inline-block; font-size: 13px; font-weight: 600; color: #35506b; background: #eef3f7; padding: 6px 12px; border-radius: 999px; margin-bottom: 14px; }
.day-pill.is-soft { margin-top: 22px; }
.sched-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid #eef1f4; font-size: 14.5px; }
.sched-row:last-child { border-bottom: none; }
.sched-time { width: 100px; font-weight: 700; color: var(--navy); }
.sched-mod { flex: 1; }
.sched-mod b { color: var(--text); }
.sched-mod span { display: block; font-size: 13px; color: #6b7c8d; margin-top: 3px; }

.tp-app--lbs .td-dash {
    margin-top: 8px;
    padding: 8px 0 4px;
}

body.tp-app--lbs .pd-page-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.tp-app--lbs .pd-page-header h1 {
    justify-content: center;
}

body.tp-app--lbs .pd-lead {
    max-width: none;
    white-space: nowrap;
    font-size: 0.8rem;
    line-height: 1.4;
}

body.tp-app--lbs .pd-page-header-actions {
    justify-content: center;
}

body.tp-app--lbs .pd-headline-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.55rem;
}

body.tp-app--lbs .pd-headline-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0.6rem 0.45rem;
}

body.tp-app--lbs .pd-headline-value {
    font-size: 1.28rem;
}

body.tp-app--lbs .pd-headline-label {
    font-size: 0.62rem;
    letter-spacing: 0.03em;
}

body.tp-app--lbs .td-headline-card--hint {
    justify-content: center;
}

body.tp-app--lbs .td-headline-hint {
    max-width: 100%;
    overflow-wrap: anywhere;
}

body.tp-app--lbs .pd-charts-row {
    overflow: visible;
}

body.tp-app--lbs .td-cal-card,
body.tp-app--lbs .td-cal-body {
    overflow: visible;
}

body.tp-app--lbs .td-cal-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

body.tp-app--lbs .td-cal {
    min-height: 260px;
}

body.tp-app--lbs .td-cal-week {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    min-height: 260px;
}

body.tp-app--lbs .td-cal-col {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    padding: 6px;
    border: 1px solid #eef2f6;
    border-radius: 10px;
    background: #fbfcfd;
}

body.tp-app--lbs .td-cal-col.is-today {
    border-color: #c7d2fe;
    background: #eef2ff;
}

body.tp-app--lbs .td-cal-col-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 6px;
}

body.tp-app--lbs .td-cal-col-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #64748b;
}

body.tp-app--lbs .td-cal-col-num {
    font-size: 0.85rem;
    font-weight: 800;
    color: #0f172a;
}

body.tp-app--lbs .td-cal-col-events {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

body.tp-app--lbs .td-cal-empty {
    margin: 0;
    font-size: 0.72rem;
    color: #94a3b8;
}

body.tp-app--lbs .td-cal-event {
    display: block;
    width: 100%;
    padding: 6px 7px;
    border: 0;
    border-radius: 7px;
    background: var(--event-color, #007bff);
    color: #000;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transform-origin: left top;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}

body.tp-app--lbs .td-cal-event-time,
body.tp-app--lbs .td-cal-event-title {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.tp-app--lbs .td-cal-event-time {
    font-size: 0.64rem;
    font-weight: 800;
}

body.tp-app--lbs .td-cal-event-title {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.25;
}

body.tp-app--lbs .td-cal-event-details {
    display: none;
    margin-top: 5px;
    font-size: 0.68rem;
    line-height: 1.35;
    font-weight: 600;
    white-space: normal;
}

body.tp-app--lbs .td-cal-event:hover,
body.tp-app--lbs .td-cal-event:focus-visible {
    position: absolute;
    left: 6px;
    width: 220px;
    z-index: 20;
    transform: scale(1.08);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
    padding: 9px 10px;
}

body.tp-app--lbs .td-cal-event:hover .td-cal-event-title,
body.tp-app--lbs .td-cal-event:focus-visible .td-cal-event-title {
    white-space: normal;
}

body.tp-app--lbs .td-cal-event:hover .td-cal-event-details,
body.tp-app--lbs .td-cal-event:focus-visible .td-cal-event-details {
    display: block;
}

body.tp-app--lbs .td-att-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

body.tp-app--lbs .td-att-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.65rem 1rem;
}

body.tp-app--lbs .td-att-week {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

body.tp-app--lbs .td-att-week input {
    min-width: 11rem;
    min-height: 2.2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.25rem 0.55rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    background: #fff;
}

body.tp-app--lbs .td-att-exports {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

body.tp-app--lbs .td-att-summary {
    margin: 0;
    font-size: 0.75rem;
    color: #64748b;
}

body.tp-app--lbs .td-att-list {
    max-height: 220px;
    overflow: auto;
}

body.tp-app--lbs .td-att-status {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    vertical-align: middle;
}

body.tp-app--lbs .td-att-status.is-complete {
    color: #0f766e;
    background: #ccfbf1;
}

body.tp-app--lbs .td-att-status.is-incomplete {
    color: #b45309;
    background: #ffedd5;
}

body.tp-app--lbs .td-att-status.is-missing {
    color: #b91c1c;
    background: #fee2e2;
}

body.tp-app--lbs .td-att-status.is-upcoming {
    color: #334155;
    background: #e2e8f0;
}

body.tp-app--lbs .td-headline-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.62rem;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    color: #64748b;
}

body.tp-app--lbs .admin-layout-main,
body.tp-app--lbs .admin-page-root,
body.tp-app--lbs #lbs-app,
body.tp-app--lbs .pd-page,
body.tp-app--lbs .pd-card,
body.tp-app--lbs .pd-card-head,
body.tp-app--lbs .pd-card-body {
    min-width: 0;
}

body.tp-app--lbs #lbs-app.te-space {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 1199px) {
    body.tp-app--lbs .pd-lead {
        white-space: normal;
    }

    body.tp-app--lbs .pd-headline-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    body.tp-app--lbs .td-cal {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    body.tp-app--lbs .td-cal-week {
        grid-template-columns: repeat(6, minmax(112px, 1fr));
        min-width: 700px;
    }
}

@media (max-width: 1199px) {
    body.tp-app--lbs #admin-top-navbar.admin-shell-top-navbar {
        gap: 0.45rem 0.6rem;
        padding: 0.5rem 0.85rem;
    }
    #admin-top-navbar .navbar-center {
        flex: 1 1 140px;
    }
    #admin-top-navbar .admin-name {
        max-width: min(220px, 30vw);
        font-size: 0.8rem;
    }
    #admin-top-navbar .search-form input {
        height: 38px;
        font-size: 13px;
    }
    #admin-top-navbar .year-badge {
        padding: 5px 8px;
        gap: 5px;
        font-size: 11px;
    }
}

@media (max-width: 991px) {
    body.tp-app--lbs #admin-top-navbar.admin-shell-top-navbar {
        flex-wrap: wrap;
        padding: 0.5rem 0.8rem;
    }
    #admin-top-navbar .navbar-center {
        flex: 1 1 160px;
        min-width: 0;
    }
    #admin-top-navbar .navbar-right {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.tp-app--lbs .admin-page-root,
    body.tp-app--lbs #lbs-app {
        overflow-x: clip;
    }

    body.tp-app--lbs .pd-charts-row,
    body.tp-app--lbs .pd-bottom-grid {
        grid-template-columns: 1fr;
    }

    body.tp-app--lbs .pd-card-head {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    body.tp-app--lbs .td-cal-card,
    body.tp-app--lbs .td-cal-body {
        overflow: hidden;
    }

    body.tp-app--lbs .td-cal {
        overflow: visible;
        min-height: 0;
    }

    body.tp-app--lbs .td-cal-week {
        display: flex;
        flex-direction: column;
        gap: 8px;
        min-width: 0;
        min-height: 0;
        grid-template-columns: none;
    }

    body.tp-app--lbs .td-cal-col {
        flex-direction: row;
        align-items: flex-start;
        min-height: 0;
        gap: 10px;
        padding: 8px 10px;
    }

    body.tp-app--lbs .td-cal-col-head {
        flex: 0 0 52px;
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 0;
        gap: 0;
    }

    body.tp-app--lbs .td-cal-col-events {
        flex-direction: row;
        flex-wrap: wrap;
        flex: 1;
        min-width: 0;
    }

    body.tp-app--lbs .td-cal-event {
        width: auto;
        min-width: min(100%, 168px);
        flex: 1 1 168px;
        max-width: 100%;
    }

    body.tp-app--lbs .td-cal-event:hover,
    body.tp-app--lbs .td-cal-event:focus-visible {
        position: relative;
        left: auto;
        width: auto;
        max-width: 100%;
        transform: none;
        box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
    }

    body.tp-app--lbs .td-cal-event:hover .td-cal-event-details,
    body.tp-app--lbs .td-cal-event:focus-visible .td-cal-event-details {
        display: block;
    }
}

@media (max-width: 980px) {
    .g3, .g2, .te-form-grid { grid-template-columns: 1fr; }
    body.tp-app--lbs.lbs-app-shell .admin-layout-main {
        padding: 0;
    }
}

@media (max-width: 768px) {
    body.tp-app--lbs #lbs-app.te-space {
        padding-top: 1rem !important;
        padding-bottom: 1.25rem !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    body.tp-app--lbs .pd-page-header {
        margin-bottom: 1rem;
        padding-bottom: 1rem;
        gap: 0.75rem;
    }

    body.tp-app--lbs .pd-page-header h1 {
        font-size: 1.2rem;
    }

    body.tp-app--lbs .pd-lead {
        font-size: 0.75rem;
    }

    body.tp-app--lbs .pd-page-header-actions {
        width: 100%;
        justify-content: center;
    }

    body.tp-app--lbs .pd-headline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.55rem;
    }

    body.tp-app--lbs .pd-headline-card {
        padding: 0.7rem 0.65rem;
    }

    body.tp-app--lbs .pd-headline-value {
        font-size: 1.25rem;
    }

    body.tp-app--lbs .td-headline-hint {
        font-size: 0.58rem;
    }

    body.tp-app--lbs .td-att-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    body.tp-app--lbs .td-att-week input,
    body.tp-app--lbs .td-att-exports {
        width: 100%;
    }

    body.tp-app--lbs .td-att-exports {
        justify-content: flex-start;
    }

    body.tp-app--lbs .td-chart-wrap {
        height: 160px;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-bottom: 18px;
    }

    .topbar h1 {
        font-size: 1.35rem;
    }

    #lbs-app .card {
        padding: 18px 16px;
        border-radius: 14px;
    }

    .piece-row,
    .syll-card,
    .sched-row {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .piece-actions {
        margin-left: 0;
        width: 100%;
    }

    .sched-time {
        width: auto;
    }

    body.tp-app--lbs #admin-top-navbar.admin-shell-top-navbar {
        min-height: 56px;
        padding: 0.45rem 0.75rem;
        flex-wrap: wrap;
    }
    #admin-top-navbar .navbar-left {
        order: 1;
    }
    #admin-top-navbar .navbar-center {
        order: 2;
        flex: 1 1 140px;
    }
    #admin-top-navbar .navbar-right {
        order: 3;
        flex: 1 1 100%;
        justify-content: flex-end;
        margin-left: 0;
    }
    #admin-top-navbar .year-badge { padding: 5px 8px; }
    #admin-top-navbar .year-text { font-size: 12px; }
    #admin-top-navbar .admin-name {
        max-width: min(220px, 52vw);
        font-size: 0.8rem;
    }
    #admin-top-navbar .profile-avatar {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    body.tp-app--lbs #admin-top-navbar.admin-shell-top-navbar {
        padding: 0.4rem 0.6rem;
        gap: 0.4rem 0.5rem;
    }
    #admin-top-navbar .navbar-left { order: 1; }
    #admin-top-navbar .navbar-right {
        order: 2;
        flex: 1 1 0;
        margin-left: 0;
    }
    #admin-top-navbar .navbar-center {
        order: 3;
        flex: 1 1 100%;
    }
    #admin-top-navbar .search-container { max-width: none; }
    #admin-top-navbar .admin-name { max-width: min(170px, 48vw); }
    #admin-top-navbar .year-status { padding: 1px 6px; }

    body.tp-app--lbs .pd-headline-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.tp-app--lbs .pd-page-header-actions .btn {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.78rem;
        padding: 0.4rem 0.55rem;
    }

    body.tp-app--lbs .td-att-status {
        display: inline-block;
        margin: 0.2rem 0 0;
    }
}

body.tp-app--lbs.tp-profile-modal-open {
    overflow: hidden;
}

body.tp-app--lbs .tp-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: block;
}

body.tp-app--lbs .tp-profile-modal[hidden] {
    display: none;
}

body.tp-app--lbs .tp-profile-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(14, 35, 56, 0.46);
    opacity: 0;
    transition: opacity 0.32s ease;
}

body.tp-app--lbs .tp-profile-modal.is-open .tp-profile-modal__backdrop {
    opacity: 1;
}

body.tp-app--lbs .tp-profile-modal__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    height: 100vh;
    background: #fff;
    box-shadow: 18px 0 48px rgba(14, 35, 56, 0.22);
    transform: translateX(-108%);
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

body.tp-app--lbs .tp-profile-modal.is-open .tp-profile-modal__panel {
    transform: translateX(0);
}

@media (min-width: 769px) {
    body.tp-app--lbs #sidebar:not(.hide) ~ #content .tp-profile-modal__panel {
        margin-left: 260px;
        width: min(540px, calc(100vw - 280px));
        height: 100vh;
    }

    body.tp-app--lbs #sidebar.hide ~ #content .tp-profile-modal__panel {
        margin-left: 60px;
        width: min(540px, calc(100vw - 80px));
    }
}

body.tp-app--lbs .tp-profile-modal__hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.35rem 1.15rem;
    background:
        linear-gradient(180deg, rgba(199, 154, 69, 0.16), transparent 68%),
        var(--navy);
    color: #fff;
}

body.tp-app--lbs .tp-profile-modal__identity {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    min-width: 0;
}

body.tp-app--lbs .tp-profile-modal__avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--gold), #e8c97a);
    color: var(--navy-deep);
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

body.tp-app--lbs .tp-profile-modal__kicker {
    margin: 0 0 0.15rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.72);
}

body.tp-app--lbs .tp-profile-modal__hero h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

body.tp-app--lbs .tp-profile-modal__name {
    margin: 0.2rem 0 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: #f3e6c4;
}

body.tp-app--lbs .tp-profile-modal__meta {
    margin: 0.15rem 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
}

body.tp-app--lbs .tp-profile-modal__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}

body.tp-app--lbs .tp-profile-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.tp-app--lbs .tp-profile-modal__form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 1.15rem 1.35rem 1.25rem;
}

body.tp-app--lbs .tp-profile-modal__lead {
    margin: 0 0 1rem;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--muted);
}

body.tp-app--lbs .tp-profile-modal__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem 0.9rem;
    overflow: auto;
    min-height: 0;
    padding-right: 0.15rem;
}

body.tp-app--lbs .tp-profile-modal__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

body.tp-app--lbs .tp-profile-modal__field span {
    font-size: 0.78rem;
    font-weight: 650;
    color: #3d5166;
}

body.tp-app--lbs .tp-profile-modal__field .form-input {
    width: 100%;
    height: 42px;
    padding: 0.45rem 0.75rem;
    border: 1px solid #d5dde6;
    border-radius: 10px;
    background: #f7f8fa;
    color: var(--text);
    font-size: 0.9rem;
}

body.tp-app--lbs .tp-profile-modal__field .form-input:focus {
    outline: none;
    border-color: #8aa0b5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 50, 79, 0.08);
}

body.tp-app--lbs .tp-profile-modal__field .form-input:disabled {
    color: #7a8b9c;
    cursor: not-allowed;
}

body.tp-app--lbs .tp-profile-modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: auto;
    padding-top: 1.1rem;
}

body.tp-app--lbs .tp-profile-modal__ghost,
body.tp-app--lbs .tp-profile-modal__save {
    height: 42px;
    padding: 0 1.1rem;
    border-radius: 11px;
    font-size: 0.88rem;
    font-weight: 650;
    cursor: pointer;
}

body.tp-app--lbs .tp-profile-modal__ghost {
    border: 1px solid #d5dde6;
    background: #fff;
    color: #3d5166;
}

body.tp-app--lbs .tp-profile-modal__save {
    border: 0;
    background: var(--navy);
    color: #fff;
}

body.tp-app--lbs .tp-profile-modal__save:hover {
    background: var(--navy-deep);
}

body.tp-app--lbs #sidebar a[data-te-profile-modal].is-open {
    background: var(--grey, #f6f6f6);
    color: var(--navy);
}

@media (max-width: 768px) {
    body.tp-app--lbs .tp-profile-modal__panel {
        width: 100%;
        margin-left: 0;
    }

    body.tp-app--lbs .tp-profile-modal__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.tp-app--lbs .tp-profile-modal__backdrop,
    body.tp-app--lbs .tp-profile-modal__panel {
        transition: none;
    }
}
