:root {
    color-scheme: light;
    --blue: #2550d6;
    --blue-dark: #1d43bc;
    --ink: #172033;
    --muted: #7d8799;
    --line: #e7eaf0;
    --soft: #f5f7fb;
    --white: #fff;
    font-family: "Inter Tight", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; border-radius: 0 !important; }
html { min-width: 320px; background: var(--soft); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--soft); font-size: 13px; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.app-shell { min-height: 100vh; }

.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: 254px; padding: 27px 17px 18px; background: var(--white); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 44px; margin: 0 4px 39px; }
.brand-mark { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; color: var(--white); background: var(--blue); font-size: 12px; font-weight: 800; letter-spacing: -.05em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.brand small { margin-top: 3px; color: #9099a9; font-size: 9px; font-weight: 600; letter-spacing: .16em; }
.nav-label, .eyebrow { color: #9aa3b2; font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.nav-label { margin: 0 11px 11px; }
.main-nav { display: grid; gap: 3px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 11px; color: #667185; font-size: 12px; font-weight: 500; transition: background .18s ease, color .18s ease; }
.nav-link:hover { color: var(--blue); background: #f5f7fd; }
.nav-link.active { color: var(--blue); background: #eef2ff; font-weight: 700; }
.nav-link.active::before { position: absolute; inset: 0 auto 0 -17px; width: 3px; background: var(--blue); content: ""; }
.nav-icon { display: grid; width: 17px; place-items: center; font-size: 17px; line-height: 1; }
.nav-count { display: grid; place-items: center; min-width: 20px; height: 20px; margin-left: auto; padding: 0 5px; color: var(--white); background: var(--blue); font-size: 10px; font-weight: 700; }
.sidebar-promo { margin-top: auto; padding: 16px 14px 14px; color: var(--white); background: #192b61; background-image: linear-gradient(140deg, #1a2c65 0%, #14224b 100%); }
.promo-kicker { color: #a9b8e4; font-size: 8px; font-weight: 700; letter-spacing: .12em; }
.sidebar-promo strong { display: block; margin-top: 9px; font-size: 19px; line-height: 1.15; letter-spacing: -.035em; }
.promo-button { display: flex; align-items: center; justify-content: space-between; margin-top: 15px; padding: 10px 11px; color: var(--white); background: var(--blue); font-size: 10px; font-weight: 700; transition: background .18s ease; }
.promo-button:hover { background: #3966ef; }
.promo-button span { font-size: 14px; }
.sidebar-foot { display: flex; align-items: center; gap: 7px; padding: 17px 4px 0; color: #9099a9; font-size: 9px; }
.online-dot, .live-status i, .live-pill i { width: 6px; height: 6px; background: #23bb80; }

.main-content { min-height: 100vh; margin-left: 254px; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; height: 70px; padding: 0 36px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.search-form { display: flex; align-items: center; width: min(390px, 42vw); height: 36px; padding: 0 10px; border: 1px solid var(--line); background: #fafbfc; }
.search-icon { margin-right: 8px; color: #8590a2; font-size: 21px; line-height: 1; transform: rotate(-20deg); }
.search-form input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-form input::placeholder { color: #9aa3b2; }
.search-form kbd { flex: 0 0 auto; padding: 3px 5px; border: 1px solid #e6e9ef; color: #a0a8b5; font-family: inherit; font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 19px; }
.icon-button, .profile-button { padding: 0; border: 0; background: transparent; cursor: pointer; }
.notification-button { position: relative; display: grid; width: 30px; height: 34px; place-items: center; color: #596477; }
.notification-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.notification-dot { position: absolute; top: 6px; right: 3px; width: 6px; height: 6px; border: 1px solid white; background: #ed6b63; }
.profile-button { display: flex; align-items: center; gap: 9px; text-align: left; }
.avatar { display: grid; width: 33px; height: 33px; place-items: center; color: #fff; background: #d7ddf0; font-size: 10px; font-weight: 700; }
.profile-copy strong, .profile-copy small { display: block; }
.profile-copy strong { font-size: 11px; font-weight: 700; }
.profile-copy small { margin-top: 3px; color: #929bab; font-size: 9px; }
.chevron { margin-left: 4px; color: #9aa3b2; font-size: 17px; }
.mobile-brand { display: none; }

.page-wrap { max-width: 1530px; margin: 0 auto; padding: 32px 36px 0; }
.welcome-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.welcome-row .eyebrow { margin: 0 0 10px; }
.eyebrow-divider { margin: 0 7px; color: #c3c9d2; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(24px, 2.2vw, 30px); font-weight: 700; letter-spacing: -.045em; line-height: 1.15; }
.wave { display: inline-block; color: #f3ac4e; font-size: 19px; }
.welcome-copy { margin-bottom: 0; color: #8791a1; font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 0 14px; border: 1px solid var(--blue); font-size: 11px; font-weight: 700; transition: background .18s ease, color .18s ease; }
.button-primary { color: var(--white); background: var(--blue); }
.button-primary:hover { background: var(--blue-dark); }
.button span { font-size: 16px; }
.database-alert { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; padding: 12px 14px; border: 1px solid #efc7c3; color: #823c37; background: #fff6f5; font-size: 11px; }
.database-alert strong { flex: 0 0 auto; }
.search-notice { margin-bottom: 20px; padding: 10px 12px; border: 1px solid #dfe5f6; color: #677287; background: #fff; font-size: 11px; }
.search-notice strong { color: var(--ink); }
.search-notice a { margin-left: 10px; color: var(--blue); font-weight: 700; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 17px; }
.stat-card { position: relative; min-height: 137px; overflow: hidden; padding: 16px 17px 13px; border: 1px solid var(--line); background: var(--white); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: #737e90; font-size: 11px; font-weight: 600; }
.stat-icon, .quick-icon { display: grid; flex: 0 0 auto; place-items: center; width: 29px; height: 29px; font-size: 16px; }
.blue-icon { color: #3a61db; background: #edf1ff; }
.purple-icon { color: #8062cc; background: #f3efff; }
.orange-icon { color: #d68a3a; background: #fff4e8; }
.green-icon { color: #279a70; background: #eaf8f1; }
.stat-value { margin-top: 13px; font-size: 29px; font-weight: 700; letter-spacing: -.06em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-bottom { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: #9aa3b2; font-size: 9px; }
.trend { color: #22976c; font-weight: 700; }
.neutral-trend { color: #8062cc; font-size: 7px; }
.live-status { display: inline-flex; align-items: center; gap: 5px; color: #22976c; font-weight: 700; }
.live-status i { display: inline-block; }
.stat-line { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; opacity: .7; }
.blue-line { background: #4567dd; }.purple-line { background: #9c7ee1; }.orange-line { background: #efad65; }.green-line { background: #55c497; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(260px, .95fr); gap: 16px; align-items: start; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--white); }
.projects-panel, .leads-panel, .chat-panel, .quick-panel { padding: 19px 19px 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-heading .eyebrow { margin: 0 0 5px; }
.panel-heading h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.035em; }
.text-link { color: var(--blue); font-size: 10px; font-weight: 700; white-space: nowrap; }
.text-link span { margin-left: 3px; font-size: 13px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 18px; }
.project-card { min-width: 0; border: 1px solid var(--line); background: #fff; }
.project-art { position: relative; display: flex; min-height: 123px; align-items: center; justify-content: center; overflow: hidden; }
.project-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.project-art.green { color: #537450; background: linear-gradient(135deg, #dce8d9, #f1eee1 55%, #c8d7c6); }
.project-art.violet { color: #5447a0; background: linear-gradient(135deg, #e0dcf3, #f3e5e9 55%, #d7d1ec); }
.project-art.blue { color: #3255ab; background: linear-gradient(135deg, #dbe5f5, #e8ecf3 55%, #c7d4ee); }
.project-art::before, .project-art::after { position: absolute; content: ""; border: 1px solid currentColor; opacity: .23; transform: rotate(-16deg); }
.project-art::before { width: 125px; height: 125px; }
.project-art::after { width: 78px; height: 78px; }
.project-art-mark { position: relative; z-index: 1; font-size: 31px; font-weight: 800; letter-spacing: -.08em; opacity: .86; }
.art-caption { position: absolute; bottom: 8px; left: 10px; z-index: 1; font-size: 8px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.project-open { position: absolute; top: 8px; right: 8px; z-index: 1; display: grid; width: 22px; height: 22px; place-items: center; color: #253044; background: rgba(255,255,255,.88); font-size: 13px; }
.project-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; padding: 10px 9px; }
.project-info h3 { overflow: hidden; margin: 0 0 4px; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.project-info p { margin: 0; color: #9099a9; font-size: 9px; }
.status-badge { display: inline-flex; align-items: center; flex: 0 0 auto; min-height: 19px; padding: 0 6px; color: #277e5c; background: #eaf7f0; font-size: 8px; font-weight: 700; white-space: nowrap; }
.status-badge.in-development, .status-badge.pending { color: #ac772c; background: #fff4e5; }
.status-badge.new { color: #3158c3; background: #edf2ff; }
.status-badge.contacted { color: #805db9; background: #f3effc; }
.empty-state { display: flex; grid-column: 1 / -1; min-height: 183px; flex-direction: column; align-items: center; justify-content: center; border: 1px dashed #dfe4ec; color: #9099a9; text-align: center; }
.empty-state > span { color: #b5c1e7; font-size: 25px; }
.empty-state strong { margin-top: 8px; color: #536075; font-size: 11px; }
.empty-state p { margin: 4px 0 0; font-size: 10px; }

.quick-panel { padding-bottom: 0; }
.heading-mark { color: #d7def6; font-size: 22px; }
.quick-action { display: flex; align-items: center; gap: 10px; min-height: 57px; border-top: 1px solid #eff1f5; transition: background .18s ease; }
.quick-action:hover { background: #fafbfe; }
.quick-icon { width: 31px; height: 31px; font-size: 17px; }
.quick-action > span:nth-child(2) { min-width: 0; flex: 1; }
.quick-action strong, .quick-action small { display: block; }
.quick-action strong { font-size: 10px; font-weight: 700; }
.quick-action small { overflow: hidden; margin-top: 4px; color: #929bab; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quick-action > b { color: #aab2c0; font-size: 13px; }
.quick-note { display: flex; gap: 9px; align-items: flex-start; margin: 8px -19px 0; padding: 12px 19px; color: #788398; background: #f7f8fc; font-size: 9px; line-height: 1.65; }
.quick-note > span:first-child { color: #d1a351; font-size: 14px; }
.quick-note strong { color: #39445a; }

.leads-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 10px 9px; border-top: 1px solid #eff1f5; border-bottom: 1px solid #eff1f5; color: #9aa3b2; font-size: 8px; font-weight: 700; letter-spacing: .08em; white-space: nowrap; }
td { padding: 10px 9px; border-bottom: 1px solid #f0f2f6; color: #707b8e; font-size: 9px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.lead-name { display: flex; align-items: center; gap: 7px; color: #313d52; }
.lead-name strong { font-size: 9px; font-weight: 600; }
.lead-avatar { display: grid; width: 25px; height: 25px; place-items: center; color: #465eaa; background: #edf1fb; font-size: 8px; font-weight: 700; }
.table-empty { padding: 30px 9px; color: #929bab; text-align: center; }
.table-footer-link, .chat-footer-link { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; margin-top: 2px; border-top: 1px solid #eff1f5; color: var(--blue); font-size: 9px; font-weight: 700; }
.table-footer-link span, .chat-footer-link span { font-size: 13px; }

.chat-panel { padding-bottom: 0; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; color: #2b936d; background: #eef9f4; font-size: 8px; font-weight: 700; }
.live-pill i { display: inline-block; width: 5px; height: 5px; }
.chat-list { display: grid; }
.chat-item { display: flex; align-items: flex-start; gap: 9px; padding: 12px 0; border-top: 1px solid #eff1f5; }
.chat-avatar { position: relative; display: grid; flex: 0 0 auto; width: 29px; height: 29px; place-items: center; color: #58689a; background: #edf0f7; font-size: 8px; font-weight: 700; }
.chat-avatar i { position: absolute; right: -1px; bottom: -1px; width: 7px; height: 7px; border: 1px solid white; background: #25bd83; }
.chat-copy { min-width: 0; flex: 1; }
.chat-meta { display: flex; justify-content: space-between; gap: 6px; }
.chat-meta strong { overflow: hidden; color: #354156; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.chat-meta time { flex: 0 0 auto; color: #a0a8b5; font-size: 8px; }
.chat-copy p { display: -webkit-box; overflow: hidden; margin: 5px 0 0; color: #8791a1; font-size: 9px; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chat-unread { flex: 0 0 auto; width: 6px; height: 6px; margin-top: 5px; background: var(--blue); }
.empty-chat { display: grid; min-height: 130px; place-content: center; justify-items: center; color: #9aa3b2; }
.empty-chat span { font-size: 22px; }
.empty-chat p { margin: 4px 0 0; font-size: 10px; }
.page-footer { display: flex; justify-content: space-between; padding: 19px 0 20px; color: #9ba4b1; font-size: 9px; }
.page-footer b { margin-left: 4px; color: var(--blue); }

@media (min-width: 1500px) {
    .page-wrap { padding-right: 46px; padding-left: 46px; }
    .topbar { padding-right: 46px; padding-left: 46px; }
}
@media (max-width: 1150px) {
    .sidebar { width: 220px; padding-right: 13px; padding-left: 13px; }
    .main-content { margin-left: 220px; }
    .nav-link.active::before { left: -13px; }
    .page-wrap { padding-right: 24px; padding-left: 24px; }
    .topbar { padding: 0 24px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1.5fr) minmax(245px, .95fr); gap: 12px; }
    .projects-panel, .leads-panel, .chat-panel, .quick-panel { padding-right: 14px; padding-left: 14px; }
    .quick-note { margin-right: -14px; margin-left: -14px; padding-right: 14px; padding-left: 14px; }
    .project-grid { gap: 8px; }
    .project-art { min-height: 100px; }
    .project-info { flex-direction: column; }
}
@media (max-width: 900px) {
    .sidebar { width: 68px; align-items: center; padding: 20px 8px 14px; }
    .brand { margin: 0 0 29px; }
    .brand > span:last-child, .nav-label, .nav-link > span:not(.nav-icon):not(.nav-count), .sidebar-promo, .sidebar-foot { display: none; }
    .main-nav { width: 100%; }
    .nav-link { justify-content: center; min-height: 43px; padding: 0; }
    .nav-link.active::before { left: -8px; }
    .nav-link .nav-icon { font-size: 18px; }
    .nav-count { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 3px; font-size: 8px; }
    .main-content { margin-left: 68px; }
    .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
    .quick-panel { order: 2; }
    .leads-panel { order: 3; }
    .chat-panel { order: 4; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .project-art { min-height: 130px; }
    .project-info { flex-direction: row; }
}
@media (max-width: 600px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .topbar { height: 61px; padding: 0 15px; }
    .mobile-brand { display: flex; align-items: center; gap: 8px; }
    .mobile-brand .brand-mark { width: 30px; height: 30px; font-size: 10px; }
    .mobile-brand strong { font-size: 9px; letter-spacing: .07em; }
    .search-form { width: 36px; height: 34px; padding: 0; justify-content: center; border: 0; background: transparent; }
    .search-form input, .search-form kbd { display: none; }
    .search-form:focus-within { position: absolute; inset: 0 105px 0 15px; z-index: 2; width: auto; padding: 0 10px; border: 1px solid var(--line); background: white; }
    .search-form:focus-within input { display: block; }
    .topbar-actions { gap: 9px; }
    .profile-copy, .chevron { display: none; }
    .profile-button .avatar { width: 30px; height: 30px; }
    .page-wrap { padding: 25px 14px 0; }
    .welcome-row { align-items: flex-start; }
    .welcome-row .eyebrow { max-width: 240px; font-size: 8px; }
    h1 { font-size: 24px; }
    .welcome-copy { max-width: 240px; font-size: 11px; }
    .welcome-row > .button { min-height: 34px; padding: 0 9px; font-size: 9px; white-space: nowrap; }
    .stats-grid { gap: 9px; }
    .stat-card { min-height: 124px; padding: 12px; }
    .stat-top { font-size: 10px; }
    .stat-icon { width: 25px; height: 25px; }
    .stat-value { font-size: 26px; }
    .stat-bottom { flex-wrap: wrap; gap: 4px; font-size: 8px; }
    .panel-heading h2 { font-size: 15px; }
    .project-grid { grid-template-columns: 1fr; }
    .project-art { min-height: 160px; }
    .project-info { align-items: center; }
    .projects-panel, .leads-panel, .chat-panel, .quick-panel { padding-right: 13px; padding-left: 13px; }
    .quick-note { margin-right: -13px; margin-left: -13px; padding-right: 13px; padding-left: 13px; }
    th { padding-right: 7px; padding-left: 7px; }
    td { padding-right: 7px; padding-left: 7px; }
    .database-alert { align-items: flex-start; flex-direction: column; gap: 4px; }
    .page-footer { font-size: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
