:root {
    --tc-blue: #1d4ed8;
    --tc-blue-dark: #12388f;
    --tc-green: #16a34a;
    --tc-teal: #0f766e;
    --tc-ink: #172033;
    --tc-muted: #64748b;
    --tc-soft: #eef8f5;
    --tc-line: #dbe7ef;
    --tc-card: #ffffff;
}

body {
    color: var(--tc-ink);
    background: #fff;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a { color: var(--tc-blue); text-decoration: none; }
a:hover { color: var(--tc-blue-dark); }

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--tc-blue);
    color: #fff;
    font-weight: 800;
    font-size: .9rem;
}

.navbar .btn { border-radius: 8px; }
.btn { border-radius: 8px; font-weight: 700; }
.btn-primary { background: var(--tc-blue); border-color: var(--tc-blue); }
.btn-primary:hover { background: var(--tc-blue-dark); border-color: var(--tc-blue-dark); }
.btn-success { background: var(--tc-green); border-color: var(--tc-green); }

.home-hero {
    padding: 72px 0 42px;
    background: linear-gradient(180deg, #f5fbff 0%, #ffffff 100%);
}

.home-hero h1,
.page-hero h1 {
    font-size: clamp(2.25rem, 4vw, 4.4rem);
    line-height: 1.03;
    max-width: 820px;
    font-weight: 850;
    letter-spacing: 0;
}

.home-hero .lead { max-width: 680px; color: var(--tc-muted); font-size: 1.2rem; }
.hero-img { width: 100%; border-radius: 18px; box-shadow: 0 24px 70px rgba(23,32,51,.14); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.eyebrow {
    color: var(--tc-teal);
    text-transform: uppercase;
    font-weight: 800;
    font-size: .78rem;
    letter-spacing: .08em;
    margin-bottom: .5rem;
}

.search-panel {
    background: #fff;
    border: 1px solid var(--tc-line);
    box-shadow: 0 18px 46px rgba(29,78,216,.10);
    padding: 18px;
    border-radius: 14px;
    margin: 24px 0 8px;
}

.form-label,
label { font-weight: 700; color: #263448; }
.form-control,
.form-select { border-radius: 8px; border-color: #cbd9e4; min-height: 44px; }

.section-head { margin-bottom: 22px; }
.section-head h2,
.readable h1,
.panel h2,
.filter-box h2 { font-weight: 820; letter-spacing: 0; }

.category-grid,
.location-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.category-card,
.location-grid a,
.admin-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--tc-line);
    border-radius: 8px;
    color: var(--tc-ink);
    box-shadow: 0 10px 26px rgba(23,32,51,.05);
}

.category-card:hover,
.location-grid a:hover,
.admin-tile:hover { transform: translateY(-2px); border-color: #9fc6ed; }
.location-grid a { flex-direction: column; align-items: flex-start; gap: 2px; }
.location-grid span { color: var(--tc-muted); font-size: .95rem; }

.soft-band { background: var(--tc-soft); }

.tutor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.tutor-card,
.panel,
.filter-box,
.profile-main,
.booking-panel,
.auth-card,
.info-panel,
.quote-card,
.blog-card {
    background: var(--tc-card);
    border: 1px solid var(--tc-line);
    border-radius: 8px;
    box-shadow: 0 12px 34px rgba(23,32,51,.06);
}

.tutor-card { padding: 18px; }
.tutor-card-top { display: flex; gap: 14px; align-items: center; }
.tutor-card img,
.profile-main img {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3px solid #d7efe9;
    object-fit: cover;
    flex: 0 0 auto;
}
.tutor-card h3 { font-size: 1.13rem; font-weight: 800; margin: 0; }
.tutor-card p { color: var(--tc-muted); margin-top: 12px; }
.stars { color: #f59e0b; letter-spacing: 0; }
.rate { color: var(--tc-blue-dark); font-size: 1.25rem; }

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}
.chip-row span,
.link-cloud a {
    border: 1px solid #cfe2f3;
    background: #f8fbff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .88rem;
}

.info-panel,
.quote-card,
.panel,
.filter-box,
.profile-main,
.booking-panel,
.auth-card { padding: 22px; }
.info-panel i { font-size: 2rem; color: var(--tc-green); }

.check-list { padding-left: 0; list-style: none; }
.check-list li { margin-bottom: 10px; }
.check-list li::before {
    content: "";
    display: inline-block;
    width: .45rem;
    height: .75rem;
    border: solid var(--tc-green);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 0 10px 1px 2px;
}

.quote-card { height: 100%; margin: 0; }
.quote-card footer { color: var(--tc-muted); font-weight: 700; }
.quote-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid #d7efe9;
}

.blog-preview,
.blog-card,
.link-list a,
.site-footer a {
    display: block;
}
.blog-preview { padding: 14px 0; border-bottom: 1px solid var(--tc-line); color: var(--tc-ink); }
.blog-preview span { display: block; color: var(--tc-muted); margin-top: 4px; }
.blog-card { padding: 22px; color: var(--tc-ink); height: 100%; }
.blog-card span { color: var(--tc-teal); font-weight: 800; font-size: .85rem; }
.blog-card h2 { font-size: 1.28rem; margin-top: 8px; }

.page-hero.compact {
    padding: 46px 0;
    background: linear-gradient(180deg, #f3fbff 0%, #fff 100%);
    border-bottom: 1px solid var(--tc-line);
}
.page-hero p { max-width: 780px; color: var(--tc-muted); font-size: 1.08rem; }
.breadcrumb a { color: var(--tc-muted); }
.sort-select { max-width: 220px; }

.link-cloud,
.link-list { display: flex; flex-wrap: wrap; gap: 8px; }
.link-list a { width: auto; border-bottom: 1px solid #e7eff6; padding: 4px 0; }

.auth-wrap { max-width: 720px; }
.auth-card { margin: 0 auto; max-width: 560px; }
.dashboard-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.profile-wrap h2 { font-size: 1.3rem; margin-top: 24px; }
.booking-panel { position: sticky; top: 92px; }

.readable { max-width: 900px; }
.readable p,
.faq-detail p { color: var(--tc-muted); font-size: 1.05rem; }
.faq-detail {
    border: 1px solid var(--tc-line);
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 10px;
}
.faq-detail summary { cursor: pointer; font-weight: 800; }

.site-footer {
    background: #f8fbff;
    border-top: 1px solid var(--tc-line);
}
.footer-title {
    font-size: .95rem;
    text-transform: uppercase;
    color: var(--tc-ink);
    font-weight: 800;
}
.site-footer a { color: var(--tc-muted); margin-bottom: 7px; }

.dashboard-shell {
    max-width: 1480px;
}

.admin-dashboard-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 22px;
}

.admin-sidebar {
    position: sticky;
    top: 86px;
    align-self: start;
    background: #fff;
    border: 1px solid var(--tc-line);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 12px 34px rgba(23,32,51,.06);
}

.admin-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--tc-ink);
    padding: 11px 12px;
    border-radius: 8px;
    font-weight: 700;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: #eef8f5;
    color: var(--tc-teal);
}

.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--tc-line);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 10px 26px rgba(23,32,51,.05);
}

.stat-card i {
    color: var(--tc-teal);
    font-size: 1.35rem;
}

.stat-card span {
    display: block;
    color: var(--tc-muted);
    font-weight: 700;
    margin-top: 8px;
}

.stat-card strong {
    display: block;
    font-size: 1.9rem;
    line-height: 1.1;
}

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

.admin-action-grid a,
.mini-conversation {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--tc-ink);
    border: 1px solid var(--tc-line);
    border-radius: 8px;
    padding: 12px;
    background: #fbfdff;
}

.admin-action-grid i {
    color: var(--tc-blue);
    font-size: 1.25rem;
}

.mini-conversation img,
.conversation-item img,
.chat-head img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #d7efe9;
}

.mini-conversation span,
.conversation-item span {
    min-width: 0;
    flex: 1;
}

.mini-conversation small,
.conversation-item small,
.conversation-item em {
    display: block;
    color: var(--tc-muted);
    font-size: .88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-style: normal;
}

.mini-conversation b,
.conversation-item b {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    background: var(--tc-blue);
    color: #fff;
    font-size: .82rem;
}

.message-layout {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
    min-height: 620px;
}

.conversation-list,
.chat-panel {
    min-height: 620px;
}

.conversation-list {
    overflow: auto;
}

.conversation-item {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--tc-ink);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.conversation-item:hover,
.conversation-item.active {
    background: #f8fbff;
    border-color: var(--tc-line);
}

.chat-panel {
    display: flex;
    flex-direction: column;
}

.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--tc-line);
}

.chat-head h2 {
    margin: 0;
    font-size: 1.25rem;
}

.chat-head p {
    margin: 0;
    color: var(--tc-muted);
}

.chat-history {
    flex: 1;
    overflow: auto;
    padding: 18px 4px;
}

.chat-message {
    display: flex;
    margin-bottom: 12px;
}

.chat-message.mine {
    justify-content: flex-end;
}

.chat-bubble {
    max-width: min(720px, 84%);
    border: 1px solid var(--tc-line);
    background: #f8fbff;
    border-radius: 8px;
    padding: 12px 14px;
}

.chat-message.mine .chat-bubble {
    background: #eef8f5;
    border-color: #bfe2d9;
}

.chat-bubble header {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
    margin-bottom: 6px;
}

.chat-bubble header span,
.audit-note {
    color: var(--tc-muted);
    font-size: .84rem;
}

.chat-bubble p {
    margin: 0;
}

.chat-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    border-top: 1px solid var(--tc-line);
    padding-top: 14px;
}

.chat-compose p {
    grid-column: 1 / -1;
}

.empty-state {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 360px;
    color: var(--tc-muted);
}

.empty-state i {
    font-size: 2.4rem;
    color: var(--tc-teal);
}

@media (max-width: 991px) {
    .category-grid,
    .location-grid,
    .tutor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-dashboard-grid,
    .message-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; }
    .admin-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .booking-panel { position: static; }
}

@media (max-width: 575px) {
    .home-hero { padding-top: 42px; }
    .category-grid,
    .location-grid,
    .tutor-grid { grid-template-columns: 1fr; }
    .search-panel { padding: 14px; }
    .dashboard-head { align-items: flex-start; flex-direction: column; }
    .tutor-card-top { align-items: flex-start; }
    .hero-actions .btn { width: 100%; }
    .admin-stat-grid,
    .admin-action-grid { grid-template-columns: 1fr; }
    .chat-compose { grid-template-columns: 1fr; }
    .chat-bubble { max-width: 100%; }
}
