/* =====================================================================
   PARISH OFFICE — shell additions and Office-native screens.
   Sits on top of the bulletin app stylesheet (parish-bulletin.css),
   whose tokens have been aligned with the public website.
   ===================================================================== */

html, body.stj-office { margin: 0 !important; padding: 0; background: var(--pb-cream, #f6f7f9); }
body.stj-office [hidden] { display: none !important; }
body.stj-office { font-family: 'Inter', system-ui, sans-serif; }
.stj-office h1, .stj-office h2, .stj-office h3, .pb-view-title, .pb-card-title, .pb-modal-title { font-family: 'Montserrat', 'Inter', sans-serif; }
.stj-office :focus-visible { outline: 3px solid #ffa500; outline-offset: 2px; }
.stj-office * { scrollbar-width: thin; scrollbar-color: rgba(30,45,58,.25) transparent; }

/* ---- Sidebar ---- */
.pb-sidebar { background: linear-gradient(180deg, #1e2d3a 0%, #16222d 100%); }
.office-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; flex: 1; }
.office-brand .pb-logo-img { max-height: 34px; flex: none; }
.office-brand__mark { width: 34px; height: 34px; border-radius: 9px; background: #ffa500; color: #142029; display: grid; place-items: center; flex: none; }
.office-brand__text { font-family: 'Montserrat', sans-serif !important; font-weight: 700 !important; font-size: 15px !important; line-height: 1.15; }
.office-brand__text small { display: block; font-family: 'Inter', sans-serif; font-weight: 500; font-size: 10.5px; color: rgba(255,255,255,.5); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; }
.pb-nav-item { color: rgba(255,255,255,.68); }
.pb-nav-item.active { background: rgba(255,165,0,.14); color: #fff; box-shadow: inset 3px 0 0 #ffa500; }
.pb-nav-item.active .pb-nav-icon { color: #ffa500; }
.pb-nav-section-label { color: rgba(255,255,255,.38); }
.office-ext { font-size: 9px; opacity: .5; margin-left: 4px; }
.pb-app.sidebar-collapsed .office-brand__text { display: none; }

/* ---- Top bar ---- */
.pb-topbar { gap: 12px; }
.pb-topbar-title { font-family: 'Montserrat', sans-serif; font-size: 15px; }
.office-user { position: relative; }
.office-user__btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--pb-border); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; color: var(--pb-text); font: 500 13px 'Inter', sans-serif; }
.office-user__btn:hover { border-color: #ffa500; }
.office-user__avatar { width: 30px; height: 30px; border-radius: 50%; background: #1e2d3a; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.office-user__btn i { font-size: 10px; color: var(--pb-muted); }
.office-user__menu { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--pb-border); border-radius: 10px; box-shadow: var(--pb-shadow-lg); min-width: 190px; padding: 6px; z-index: 200; }
.office-user__menu a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 7px; color: var(--pb-text); text-decoration: none; font-size: 13.5px; }
.office-user__menu a:hover { background: var(--pb-indigo-bg); color: var(--pb-indigo); }
@media (max-width: 640px) {
  .office-user__name { display: none; }
  .office-user__btn { padding: 3px; }
  .office-user__btn i { display: none; }
}

/* ---- Content width & spacing ---- */
.pb-content { width: 100%; box-sizing: border-box; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.nowrap { white-space: nowrap; }

/* ---- Dashboard ---- */
.office-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 24px; }
.office-tile { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid var(--pb-border); border-radius: 12px; text-decoration: none; color: var(--pb-text); box-shadow: var(--pb-shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.office-tile:hover { transform: translateY(-2px); box-shadow: var(--pb-shadow-md); border-color: #ffa500; }
.office-tile__icon { width: 44px; height: 44px; border-radius: 11px; background: var(--pb-indigo-bg); color: var(--pb-indigo); display: grid; place-items: center; font-size: 18px; flex: none; }
.office-tile__body strong { display: block; font-family: 'Montserrat', sans-serif; color: var(--pb-navy); font-size: 15px; margin-bottom: 3px; }
.office-tile__body span { font-size: 13px; color: var(--pb-muted); }
.office-stat-text { font-size: 18px !important; }
.office-hint p { margin: 0; color: var(--pb-muted); }

/* ---- Tables ---- */
.office-table td { vertical-align: middle; }
.office-table th.num, .office-table td.num { text-align: center; width: 70px; }
.office-table td.actions { text-align: right; white-space: nowrap; }
.office-table td.check, .office-table th.check { width: 36px; }
.office-table input.pb-input { min-width: 220px; }
.office-notice-msg { font-weight: 500; color: var(--pb-text); }
.office-notice-msg i { color: var(--pb-indigo); margin-right: 4px; }
.office-when { font-size: 12.5px; color: var(--pb-muted); min-width: 180px; }
.office-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.office-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.office-status--active { background: #e7f6ee; color: #1e8e5a; }
.office-status--scheduled { background: #e8f1fb; color: #2b6cb0; }
.office-status--expired { background: #f1f3f5; color: #6b7a8d; }
.office-status--off { background: #fdf3e1; color: #a06100; }
.office-badge { display: inline-block; margin: 2px 4px 2px 0; }
@media (max-width: 760px) {
  .office-table thead { display: none; }
  .office-table, .office-table tbody, .office-table tr, .office-table td { display: block; width: 100%; box-sizing: border-box; }
  .office-table tr { border-bottom: 1px solid var(--pb-border); padding: 10px 4px; }
  .office-table td { border: 0 !important; padding: 4px 12px !important; }
  .office-table td.actions { text-align: left; }
  .office-table input.pb-input { min-width: 0; width: 100%; }
}

/* ---- Forms ---- */
.office-form .pb-field { display: flex; flex-direction: column; gap: 5px; }
.office-form--inline { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.office-form--inline .pb-field { margin: 0; min-width: 200px; }
.office-input-suffix { display: flex; align-items: center; gap: 8px; }
.office-input-suffix .pb-input { width: 90px; }
.office-input-suffix em { font-style: normal; color: var(--pb-muted); font-size: 13px; }
.office-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; margin: 6px 0 12px; }
.office-check input { width: 17px; height: 17px; accent-color: #e69500; }
.office-details summary { cursor: pointer; font-weight: 600; font-family: 'Montserrat', sans-serif; color: var(--pb-navy); }
.office-details summary i { color: var(--pb-indigo); margin-right: 6px; }
.office-details[open] summary { margin-bottom: 12px; }
.office-list { margin: 0 0 12px 18px; font-size: 13px; color: var(--pb-muted); max-height: 220px; overflow: auto; }

/* ---- Chips (team roles) ---- */
.office-role-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.office-chip { position: relative; cursor: pointer; }
.office-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.office-chip span { display: inline-block; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--pb-border); font-size: 12px; font-weight: 600; color: var(--pb-muted); background: #fff; transition: all .12s; }
.office-chip input:checked + span { background: #1e2d3a; border-color: #1e2d3a; color: #fff; }
.office-chip input:focus-visible + span { outline: 3px solid #ffa500; outline-offset: 2px; }
.office-chip input:disabled + span { opacity: .55; cursor: not-allowed; }
.office-role-key { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--pb-muted); }
.office-role-key strong { color: var(--pb-navy); }

/* ---- Notice preview ---- */
.office-preview { margin-bottom: 18px; }
.office-preview__label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pb-muted); margin-bottom: 6px; }
.office-preview__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; background: #142029; color: #fff; border-radius: 10px; padding: 12px 16px; font-size: 13.5px; }
.office-preview__bar i { color: #ffa500; }
.office-preview__bar a { color: #ffa500; font-weight: 700; }
.office-preview__bar em { margin-left: auto; color: rgba(255,255,255,.55); font-size: 12px; }

/* ---- Moved wp-admin screens (templates, media, AI) ---- */
.office-legacy-ui .pb-admin-wrap { max-width: none; padding-bottom: 0; }
.office-legacy-ui .button, .office-legacy-ui .button-primary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 8px; border: 1px solid #e69500 !important; background: #ffa500 !important; color: #142029 !important; font-weight: 600; cursor: pointer; font-size: 13px; }
.office-legacy-ui .pb-templates-admin h2 { font-size: 17px; color: var(--pb-navy); margin-top: 0; }
.office-legacy-ui .pb-templates-admin > div > div { background: #fff !important; border-color: var(--pb-border) !important; }

/* ---- Modal & toast polish ---- */
.pb-modal-box { border-radius: 14px; max-height: calc(100vh - 40px); overflow-y: auto; }
@media (max-width: 640px) {
  .pb-modal-box { width: calc(100vw - 20px) !important; max-width: none !important; padding: 20px !important; }
}

/* =====================================================================
   SIGN-IN
   ===================================================================== */
body.stj-office-login { margin: 0; min-height: 100vh; font-family: 'Inter', system-ui, sans-serif; background: #f6f7f9; color: #22313f; }
.ol-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.ol-brand { position: relative; overflow: hidden; background: linear-gradient(150deg, #2c3e50 0%, #142029 100%); color: rgba(255,255,255,.85); padding: clamp(32px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; }
.ol-brand::after { content: ''; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255,165,0,.25), transparent 70%); }
.ol-brand img { max-width: 220px; height: auto; margin-bottom: 36px; }
.ol-brand h2 { font-family: 'Montserrat', sans-serif; color: #fff; font-size: clamp(1.8rem, 3vw, 2.6rem); margin: 0 0 10px; }
.ol-brand p { font-size: 1.05rem; max-width: 420px; margin: 0 0 28px; }
.ol-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.ol-brand li { display: flex; gap: 12px; align-items: center; }
.ol-brand li i { width: 34px; height: 34px; border-radius: 9px; background: rgba(255,165,0,.15); color: #ffa500; display: grid; place-items: center; }
.ol-card { align-self: center; justify-self: center; width: min(420px, calc(100% - 40px)); padding: 40px 0; }
.ol-card h1 { font-family: 'Montserrat', sans-serif; font-size: 1.9rem; margin: 0 0 4px; color: #2c3e50; }
.ol-sub { color: #586977; margin: 0 0 26px; }
.ol-card label { display: block; font-weight: 600; font-size: .88rem; margin: 14px 0 6px; color: #2c3e50; }
.ol-card input[type=text], .ol-card input[type=password] { width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px; border: 1px solid #cfd7de; border-radius: 9px; font: inherit; background: #fff; }
.ol-card input:focus { outline: none; border-color: #ffa500; box-shadow: 0 0 0 3px rgba(255,165,0,.22); }
.ol-pass { position: relative; }
.ol-pass input { padding-right: 46px !important; }
.ol-eye { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; border: 0; background: none; color: #586977; cursor: pointer; border-radius: 7px; }
.ol-card .ol-remember { display: flex; align-items: center; gap: 8px; font-weight: 500; margin-top: 16px; }
.ol-remember input { accent-color: #e69500; width: 17px; height: 17px; }
.ol-btn { width: 100%; height: 50px; margin-top: 22px; border: 0; border-radius: 9px; background: #ffa500; color: #142029; font: 700 .95rem 'Montserrat', sans-serif; letter-spacing: .03em; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s; }
.ol-btn:hover { background: #e69500; }
.ol-btn:disabled { opacity: .7; cursor: wait; }
.ol-msg { padding: 12px 14px; border-radius: 9px; font-size: .9rem; margin-bottom: 8px; }
.ol-msg--error { background: #fdecea; color: #a5281b; }
.ol-msg a { color: inherit; font-weight: 600; }
.ol-foot { text-align: center; font-size: .86rem; color: #586977; margin-top: 22px; }
.ol-foot a { color: #2c3e50; }
@media (max-width: 860px) {
  .ol-wrap { grid-template-columns: 1fr; }
  .ol-brand { padding: 28px 24px; }
  .ol-brand img { max-width: 150px; margin-bottom: 14px; }
  .ol-brand h2 { font-size: 1.4rem; }
  .ol-brand p, .ol-brand ul { display: none; }
  .ol-card { padding: 28px 0 48px; }
}
