:root { --brand-orange: #ff9900; --brand-grey: #3c4853; --brand-line: #d9dde2; }
body { border-top: 5px solid var(--brand-orange); }
.app-header { background: var(--brand-grey); border-bottom: 3px solid var(--brand-orange); }
.app-header .crm-nav { max-width: 1440px; margin: auto; padding: 14px 24px; display: flex; align-items: center; gap: 28px; background: transparent; color: white; flex-wrap: wrap; }
.app-header .crm-nav a { color: white; text-decoration: none; }
.app-header .crm-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
.app-brand { display: flex; align-items: center; min-width: 180px; }
.app-brand .brand-name { margin: 0; color: white; font-size: 20px; white-space: nowrap; }
.brand-name strong { color: #ffab70; font-weight: 600; }
.company-logo { display: block; width: auto; max-width: 210px; height: 48px; object-fit: contain; padding: 4px 8px; background: white; border-radius: 4px; }
.login-company-logo { max-width: 240px; height: 64px; margin-bottom: 12px; }
.app-links, .app-account { display: flex; align-items: center; gap: 22px; }
.app-account { margin-left: auto; }
.app-header .crm-nav span { margin: 0; }
.app-header .crm-nav form { margin: 0; }
.app-header .crm-nav button { background: var(--brand-orange); border: 1px solid #ffab70; color: var(--brand-grey); border-radius: 5px; padding: 8px 13px; cursor: pointer; }
.dashboard-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 26px 0; border-bottom: 1px solid var(--brand-line); margin-bottom: 20px; }
.dashboard-toolbar h2 { font-size: 28px; margin: 0; color: var(--brand-grey); }
.dashboard-toolbar .eyebrow { margin-bottom: 5px; }
.layout-switch { display: flex; gap: 4px; padding: 4px; background: #e7e9ec; border-radius: 7px; }
.layout-switch button { border: 0; border-radius: 5px; background: transparent; color: var(--brand-grey); padding: 10px 16px; font: inherit; cursor: pointer; }
.layout-switch button[aria-pressed="true"] { background: var(--brand-grey); color: white; }
.layout-switch button:focus-visible, .module-sidebar a:focus-visible { outline: 3px solid var(--brand-orange); outline-offset: 3px; }
.dashboard-overview { display: none; }
.dashboard-workspace { min-width: 0; }
.dashboard-list .dashboard-content > .hero, .dashboard-list .dashboard-content > .modules, .dashboard-list .dashboard-content > .closing { display: none; }
.dashboard-list .dashboard-overview { display: block; padding: 30px 0; }
.dashboard-overview h1 { color: var(--brand-grey); font-size: clamp(30px, 4vw, 54px); }
.dashboard-overview p { color: #5b6068; line-height: 1.6; }
.quick-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 28px; }
.quick-actions a { color: var(--brand-orange); }
.quick-actions .crm-button { color: var(--brand-grey); background: var(--brand-orange); padding: 12px 18px; border-radius: 5px; text-decoration: none; }

.module-sidebar h2 { padding: 20px; margin: 0; font-size: 19px; color: var(--brand-grey); }
.module-sidebar nav { display: flex; flex-direction: column; gap: 0; align-items: stretch; }
.module-sidebar nav > a, .module-planned { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; border-top: 1px solid #eceef0; font-size: 14px; }
.module-sidebar a { color: var(--brand-grey); text-decoration: none; }
.module-sidebar a:hover, .module-sidebar a[aria-current="page"] { background: #fff0e3; color: var(--brand-orange); }
.module-children { display: flex; flex-direction: column; padding: 2px 20px 12px 36px; gap: 12px; font-size: 14px; }
.module-planned { color: #676c74; }
.module-planned small { color: #676c74; font-size: 11px; }
.module-ready { font-size: 11px; color: var(--brand-orange); }
@media (max-width: 760px) {
 .app-header .crm-nav { padding: 12px 16px; gap: 14px; }
 .app-account { margin-left: 0; width: 100%; justify-content: space-between; }
 .app-links { gap: 16px; }
 .dashboard-toolbar { align-items: start; flex-direction: column; }
 .company-logo { max-width: 170px; }
}

.branding-preview { padding: 16px; background: #f0f2f4; border-radius: 8px; }
.branding-preview img { display: block; max-width: 100%; max-height: 220px; object-fit: contain; }
.branding-form input[type="color"] { width: 100px; height: 48px; padding: 4px; }
.branding-checkbox { display: flex; align-items: center; gap: 10px; }
.branding-checkbox input { width: auto; }
.branding-success { padding: 12px 16px; background: #e9f5eb; color: #235d30; border-radius: 6px; }

.scene { background: var(--brand-grey); }
.scene .eyebrow { color: var(--brand-orange); }
.entry button { background: var(--brand-orange); color: var(--brand-grey); }
.entry button:hover { filter: brightness(.92); }
.company-logo { width: 180px; height: 80px; padding: 0; background: transparent; }
.login-company-logo { width: 240px; height: 140px; }

/* Shared navigation remains on the left on every authenticated workspace page. */
.app-workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; max-width: 1600px; margin: 0 auto; padding: 24px; align-items: start; }
.app-workspace > main { min-width: 0; width: 100%; max-width: none; margin: 0; }
.app-workspace > .dashboard-main { padding: 0; }
.app-workspace > .crm-main { padding: 24px; }
.module-sidebar { display: block; position: sticky; top: 16px; max-height: calc(100dvh - 32px); overflow-y: auto; background: white; border: 1px solid var(--brand-line); border-top: 4px solid var(--brand-orange); border-radius: 8px; }
.module-menu > summary { padding: 16px 20px; color: var(--brand-grey); font-weight: 700; cursor: pointer; }
.module-sidebar nav { flex-wrap: nowrap; }
.module-sidebar h2 { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px 8px; font-size: 14px; }
.module-group { border-top: 1px solid #eceef0; }
.module-active h2 { background: #f5f6f8; }
.module-children { gap: 2px; padding: 0 8px 10px 20px; }
.module-children a { display: block; padding: 8px 12px; border-radius: 4px; }
.module-sidebar a[aria-current="page"] { border-left: 3px solid var(--brand-orange); font-weight: 700; color: var(--brand-grey); background: #fff0e3; }
.module-section { padding: 6px 12px 0; color: #676c74; font-size: 12px; }
.module-planned { gap: 10px; padding: 9px 20px; }
.module-planned small { white-space: nowrap; }
.app-workspace .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 36px 0; }
.app-workspace .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) {
 .app-workspace { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 16px; }
 .module-sidebar { position: static; max-height: 280px; }
 .module-menu > summary::after { content: " · Show / hide modules"; font-size: 12px; font-weight: 400; }
 .app-workspace > .crm-main { padding: 16px; }
 .app-workspace .grid { grid-template-columns: minmax(0, 1fr); }
}

.app-account { flex-wrap: wrap; gap: 16px; }
.app-account a[aria-current="page"] { text-decoration: underline; text-underline-offset: 5px; }
.account-planned { font-size: 13px; color: #e0e4e8; }
.account-planned small { display: inline-block; font-size: 10px; border: 1px solid currentColor; padding: 0 4px; border-radius: 3px; }
