/* Wealthforce Advisor - same look as the Wealthforce Fax app */
:root {
  --theme: #1F3A5F;          /* Wealthforce navy */
  --theme-dark: #162B47;
  --theme-light: #E8EEF6;
  --text: #242424;
  --text-2: #5C5C5C;
  --line: #E0E0E0;
  --bg: #FAF9F8;
  --red: #A80F1B;
  --red-bg: #FDE7E9;
  --green: #0E6B0E;
  --green-bg: #DFF6DD;
  --amber-bg: #FFF4CE;
  --grey-bg: #EDEBE9;
  --radius: 4px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif;
       font-size: 14px; color: var(--text); background: var(--bg); }
[hidden] { display: none !important; }
h1 { font-size: 26px; font-weight: 600; margin: 0; }
h2 { font-size: 16px; font-weight: 600; margin: 0 0 12px; }
a { color: var(--theme); }
a:hover { color: var(--theme-dark); }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
:focus-visible { outline: 2px solid var(--theme); outline-offset: 2px; }

/* App bar (same as the fax app) */
.appbar { height: 64px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center;
          gap: 16px; padding: 0 32px; }
.logo-link { display: inline-flex; }
.logo { height: 22px; width: auto; display: block; }
.appbar-divider { width: 1px; height: 26px; background: #C8C6C4; }
.appbar-product { font-size: 18px; font-weight: 600; color: var(--theme); white-space: nowrap; }
.appbar .btn { white-space: nowrap; }
.appbar-spacer { flex: 1; }
.appbar-user { display: flex; align-items: center; gap: 12px; }
.appbar-user .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.appbar-user .who span { font-size: 12px; color: var(--text-2); }
.persona { width: 32px; height: 32px; border-radius: 50%; background: var(--theme-light); color: var(--theme);
           display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; }
@media (max-width: 700px) { .appbar { padding: 0 14px; gap: 10px; } .appbar-user .who { display: none; }
                            .appbar-product { font-size: 15px; } .logo { height: 18px; }
                            .appbar-divider, .persona { display: none; } }

.page { max-width: 1280px; margin: 0 auto; padding: 28px 32px 48px; }
@media (max-width: 700px) { .page { padding: 20px 14px 40px; } }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.intro { margin: 6px 0 20px; }
.badge { background: var(--amber-bg); color: #6B4500; font-size: 12px; padding: 3px 8px; border-radius: 10px; }

/* Buttons and fields */
.btn { font: inherit; font-weight: 600; min-height: 32px; padding: 5px 16px; border-radius: var(--radius);
       border: 1px solid #8A8886; background: #fff; color: var(--text); cursor: pointer; }
.btn:hover { background: #F3F2F1; }
.btn.primary { background: var(--theme); border-color: var(--theme); color: #fff; }
.btn.primary:hover { background: var(--theme-dark); }
.btn.subtle { font-weight: 400; min-height: 28px; padding: 3px 12px; }
.btn:disabled { opacity: .55; cursor: default; }
.link { background: none; border: none; font: inherit; color: var(--theme); cursor: pointer; padding: 4px 0;
        font-weight: 600; }
.link:hover { text-decoration: underline; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; font-weight: 600; }
.field input, .field textarea, .field select { font: inherit; font-weight: 400; border: 1px solid #8A8886;
        border-radius: var(--radius); padding: 7px 10px; background: #fff; }
.field textarea { resize: vertical; }
.req { color: var(--red); }

.msgbar { padding: 10px 12px; border-radius: var(--radius); margin: 12px 0; background: var(--theme-light); }
.msgbar.error { background: var(--red-bg); color: var(--red); }

/* Layout */
.layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.col-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.col-side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-head h2 { margin: 0; }
.card-head .link { white-space: nowrap; }
.section-title { margin-bottom: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.edit-hint { margin: -4px 0 12px; }
.tile.editing { border-style: dashed; }
.tile-roles { font-size: 12px; color: var(--text-2); }
.tile-tools { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 6px; }
.tile-tools .link { font-size: 13px; padding: 0; }
.tile-tools .link:disabled { color: #A19F9D; cursor: default; text-decoration: none; }
.tile-add { flex: 1 1 250px; min-height: 150px; border: 2px dashed #C8C6C4; border-radius: 8px; background: transparent;
            font: inherit; font-weight: 600; color: var(--theme); cursor: pointer; }
.tile-add:hover { border-color: var(--theme); background: var(--theme-light); }
.fs { border: none; padding: 0; margin: 0 0 14px; }
.fs legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 6px; cursor: pointer; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--theme); }
.check.newtab { margin-bottom: 14px; }
.role-checks { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.icon-pick { display: flex; align-items: center; gap: 10px; }
.icon-pick select { flex: 1; font: inherit; border: 1px solid #8A8886; border-radius: var(--radius); padding: 7px 10px; background: #fff; }
.empty { margin: 12px 0 0; }

.signin { max-width: 440px; margin: 48px auto; display: flex; flex-direction: column; gap: 12px; }
.signin h1 { font-size: 22px; }

/* Needs your attention */
.attention { list-style: none; margin: 8px 0 0; padding: 0; }
.attention li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0;
                border-top: 1px solid #EDEBE9; }
.attention .what { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; }
.attention .what b { font-weight: 600; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius); min-width: 72px; text-align: center; }
.tag.overdue { background: #FBE3D6; color: #8A3B0A; }
.tag.new { background: var(--theme-light); color: var(--theme); }
.tag.due { background: var(--grey-bg); color: #3B3A39; }

/* App tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 16px; }
.tile { flex: 1 1 250px; min-height: 150px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
        padding: 18px; display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
a.tile:hover { border-color: var(--theme); box-shadow: 0 2px 8px rgba(31, 58, 95, .12); color: var(--text); }
.tile.soon { background: #FBFAF9; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-icon { width: 40px; height: 40px; border-radius: 8px; background: var(--theme-light); display: inline-flex;
             align-items: center; justify-content: center; }
.tile.soon .tile-icon { background: var(--grey-bg); }
.tile-icon svg { width: 22px; height: 22px; fill: none; stroke: var(--theme); stroke-width: 1.8;
                 stroke-linecap: round; stroke-linejoin: round; }
.tile.soon .tile-icon svg { stroke: #605E5C; }
.tile-name { font-weight: 600; font-size: 16px; }
.tile-desc { color: var(--text-2); line-height: 1.45; }
.status { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: var(--radius); }
.status.live { background: var(--green-bg); color: var(--green); }
.status.soon { background: var(--grey-bg); color: #3B3A39; }

/* Announcements */
.news { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.news li { padding: 12px 0; border-top: 1px solid #EDEBE9; display: flex; flex-direction: column; gap: 4px; }
.news li:first-child { border-top: none; }
.news .n-title { font-weight: 600; }
.news .n-body { line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.news .n-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.news .n-remove { font-size: 12px; font-weight: 400; color: var(--red); }

/* Contact Compliance */
.contacts { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.contacts > li { padding: 12px 0; border-top: 1px solid #EDEBE9; }
.contacts > li:first-child { border-top: none; padding-top: 4px; }
.contact-who { margin: 0 0 10px; display: flex; flex-direction: column; gap: 2px; }
.contact-edit { display: flex; gap: 12px; margin-top: 8px; }
.contact-edit .link { font-size: 12px; padding: 0; font-weight: 400; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; min-height: 36px; }
.contact-btn.primary, .contact-btn.primary:hover { color: #fff; }
.contact-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
                   stroke-linecap: round; stroke-linejoin: round; }
.contact-email-text { margin: 10px 0 0; overflow-wrap: anywhere; }
.contact-phones { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.contact-phones li { display: flex; align-items: center; gap: 6px; }
.contact-phones svg { width: 14px; height: 14px; fill: none; stroke: var(--text-2); stroke-width: 1.8;
                      stroke-linecap: round; stroke-linejoin: round; flex: none; }
.contact-phones .p-label { color: var(--text-2); font-size: 12px; min-width: 40px; }
.contact-phones a { font-weight: 500; }
.field-row { display: flex; gap: 12px; }
.field-row .grow { flex: 1; }
.field-row .ext { width: 96px; }
.form-note { margin: -4px 0 12px; }
.tile-ext { font-size: 12px; color: var(--text-2); }

/* Quick links */
.links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.links a { font-weight: 500; }
.links li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.links .l-meta { font-size: 12px; color: var(--text-2); }
.links .link.danger { font-size: 12px; padding: 0; }
#links { margin-top: 8px; }

/* Dialog */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .35); display: flex; align-items: center;
           justify-content: center; padding: 16px; z-index: 10; }
.dialog { background: #fff; border-radius: 8px; padding: 24px; width: 100%; max-width: 520px;
          box-shadow: 0 8px 32px rgba(0, 0, 0, .2); max-height: 90vh; overflow: auto; }
.dialog-actions { display: flex; gap: 8px; margin-top: 8px; }
.dialog.wide { max-width: 760px; }
.overlay.top { z-index: 20; }
.link.danger { color: var(--red); font-weight: 400; }

/* Pictures and links on announcements */
.news .n-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 6px; background: var(--grey-bg);
               margin: 4px 0; }
.news .n-link { font-weight: 600; align-self: flex-start; }

/* Picture field in the post dialog */
.pic-box { display: flex; flex-direction: column; gap: 8px; font-weight: 400; border: 1px dashed #C8C6C4;
           border-radius: var(--radius); padding: 12px; }
.pic-none { margin: 0; }
.pic-preview { max-width: 100%; max-height: 180px; object-fit: contain; align-self: flex-start; border-radius: 4px; }
.pic-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Gallery */
.gallery { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 12px;
           grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gallery li { display: flex; flex-direction: column; gap: 4px; }
.gallery .g-pick { padding: 0; border: 2px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer;
                   overflow: hidden; aspect-ratio: 4 / 3; }
.gallery .g-pick:hover, .gallery .g-pick:focus-visible { border-color: var(--theme); }
.gallery .g-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .g-name { font-size: 12px; overflow-wrap: anywhere; }
.gallery .g-meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--text-2); }

/* Screen-reader-only labels */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* My advisors (branch managers) */
.team { list-style: none; margin: 8px 0 0; padding: 0; }
.team li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 10px 0;
           border-top: 1px solid #EDEBE9; }
.team li:first-child { border-top: none; }
.team .t-who { display: flex; flex-direction: column; }
#team-fax-link { text-decoration: none; color: var(--text); }

/* Advisors & branch managers (Compliance) */
.people-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.people-tools input, .people-tools select { font: inherit; border: 1px solid #8A8886; border-radius: var(--radius);
                                            padding: 6px 10px; background: #fff; }
.people-tools input { flex: 1 1 220px; }
.table-wrap { overflow-x: auto; }
table.people { width: 100%; border-collapse: collapse; min-width: 640px; }
table.people th { text-align: left; font-size: 12px; color: var(--text-2); font-weight: 600; padding: 8px;
                  border-bottom: 1px solid var(--line); }
table.people td { padding: 8px; border-bottom: 1px solid #EDEBE9; vertical-align: middle; }
table.people .p-who { display: flex; flex-direction: column; }
table.people .p-email { font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
table.people select { font: inherit; border: 1px solid #8A8886; border-radius: var(--radius); padding: 4px 6px;
                      background: #fff; max-width: 220px; }
table.people .pending { font-size: 12px; color: #6B4500; background: var(--amber-bg); padding: 1px 6px; border-radius: 8px; }
table.people .link.danger { font-size: 12px; }
