/* Boathouse Connect SPA - base styles (MaterialPro palette: topbar #1e88e5, bg #f2f4f8, dark sidebar #242a33). */
:root {
  --bc-primary: #1e88e5;
  --bc-primary-dark: #1565c0;
  --bc-info: #26c6da;
  --bc-success: #09af00;
  --bc-danger: #fc4b6c;
  --bc-warning: #ffb22b;
  --bc-purple: #7460ee;
  --bc-bg: #f2f4f8;
  --bc-sidebar: #242a33;
  --bc-sidebar-text: #b4bcc8;
  --bc-text: #2b2f36;
  --bc-muted: #6c757d;
  --bc-card: #ffffff;
  --bc-border: #e3e7ee;
  --bc-radius: 10px;
  --bc-sidebar-width: 250px;
  --bc-topbar-height: 60px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow-x: hidden; }
body {
  font-family: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  color: var(--bc-text);
  background: var(--bc-bg);
}
a { color: var(--bc-primary); text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 500; }

/* ---- splash while the bootstrap request runs ---- */
.bc-splash {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--bc-muted); gap: 1rem;
}
.bc-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--bc-border); border-top-color: var(--bc-primary);
  animation: bc-spin .8s linear infinite;
}
@keyframes bc-spin { to { transform: rotate(360deg); } }

/* ---- public pages (login, 404) ---- */
.bc-public { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, var(--bc-sidebar), var(--bc-primary-dark)); }
.bc-auth-card { width: 100%; max-width: 380px; margin: 1rem; background: var(--bc-card); border-radius: var(--bc-radius); padding: 2rem; box-shadow: 0 10px 40px rgba(0,0,0,.25); text-align: center; }
.bc-auth-card h1 { font-size: 1.5rem; }
.bc-form { text-align: left; display: grid; gap: .4rem; margin-top: 1rem; }
.bc-form label { font-size: .8rem; color: var(--bc-muted); margin-top: .5rem; }
.bc-form input { padding: .65rem .75rem; border: 1px solid var(--bc-border); border-radius: 6px; font: inherit; }
.bc-form input:focus { outline: 2px solid var(--bc-primary); border-color: transparent; }
.bc-muted { color: var(--bc-muted); }
.bc-alert { padding: .6rem .8rem; border-radius: 6px; margin: .75rem 0; font-size: .9rem; text-align: left; }
.bc-alert-danger { background: #fde8ec; color: #b3213f; }
.bc-alert-info { background: #e3f6f9; color: #0b7f8f; }

.bc-btn {
  display: inline-block; padding: .65rem 1.2rem; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--bc-primary); color: #fff; font: inherit; font-weight: 500;
}
.bc-btn:hover { background: var(--bc-primary-dark); }
.bc-btn-block { width: 100%; margin-top: 1rem; }
.bc-btn-light { background: #fff; color: var(--bc-text); border: 1px solid var(--bc-border); }
.bc-btn-light:hover { background: var(--bc-bg); }
.bc-btn-sm { padding: .35rem .7rem; font-size: .8rem; }

/* ---- app shell ---- */
.bc-shell { display: grid; grid-template-columns: var(--bc-sidebar-width) 1fr; min-height: 100vh; }
.bc-shell.is-collapsed { grid-template-columns: 0 1fr; }

.bc-sidebar { background: var(--bc-sidebar); color: var(--bc-sidebar-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; transition: width .2s; }
.bc-shell.is-collapsed .bc-sidebar { width: 0; overflow: hidden; }
.bc-brand { height: var(--bc-topbar-height); display: flex; align-items: center; padding: 0 1.25rem; color: #fff; font-weight: 600; font-size: 1.05rem; border-bottom: 1px solid rgba(255,255,255,.06); white-space: nowrap; }
.bc-nav { padding: .75rem 0 2rem; }
.bc-nav-header { padding: .9rem 1.25rem .35rem; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #7d8794; white-space: nowrap; }
.bc-nav a { display: flex; align-items: center; justify-content: space-between; padding: .5rem 1.25rem; color: var(--bc-sidebar-text); border-left: 3px solid transparent; white-space: nowrap; }
.bc-nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.bc-nav a.router-link-active { color: #fff; border-left-color: var(--bc-primary); background: rgba(30,136,229,.12); }
.bc-nav .bc-legacy-mark { font-size: .7rem; color: #7d8794; }

.bc-main { min-width: 0; display: flex; flex-direction: column; }
.bc-topbar { height: var(--bc-topbar-height); background: var(--bc-primary); color: #fff; display: flex; align-items: center; gap: 1rem; padding: 0 1.25rem; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.bc-topbar .bc-toggle { background: transparent; border: 0; color: #fff; font-size: 1.3rem; cursor: pointer; line-height: 1; }
.bc-topbar .bc-page-title { font-size: 1.05rem; font-weight: 500; flex: 1; }
.bc-topbar select { font: inherit; padding: .3rem .5rem; border-radius: 6px; border: 0; }
.bc-topbar .bc-user { display: flex; align-items: center; gap: .6rem; }
.bc-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.25); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; }
.bc-link-light { color: #fff; opacity: .9; cursor: pointer; background: none; border: 0; font: inherit; }
.bc-link-light:hover { opacity: 1; text-decoration: underline; }

.bc-content { padding: 1.5rem; flex: 1; }
.bc-content.is-loading { opacity: .6; }

/* ---- cards / grid ---- */
.bc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.bc-card { background: var(--bc-card); border-radius: var(--bc-radius); box-shadow: 0 1px 3px rgba(0,0,0,.06); padding: 1.25rem; }
.bc-card-title { font-size: 1rem; font-weight: 500; margin-bottom: .75rem; display: flex; justify-content: space-between; align-items: center; }
.bc-card-accent { border-top: 4px solid var(--bc-info); }
.bc-kv { display: grid; grid-template-columns: auto 1fr; gap: .25rem 1rem; font-size: .9rem; }
.bc-kv dt { color: var(--bc-muted); }
.bc-kv dd { margin: 0; }
.bc-pre { background: var(--bc-bg); border-radius: 6px; padding: .75rem; font-size: .75rem; overflow: auto; max-height: 240px; }

.bc-pills { display: inline-flex; background: #fff; border-radius: 999px; padding: .25rem; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-bottom: 1.25rem; }
.bc-pills button { border: 0; background: transparent; padding: .45rem 1rem; border-radius: 999px; font: inherit; cursor: pointer; color: var(--bc-muted); }
.bc-pills button.is-active { background: var(--bc-primary); color: #fff; }

.bc-list { list-style: none; margin: 0; padding: 0; }
.bc-list li { display: flex; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--bc-border); align-items: center; }
.bc-list li:last-child { border-bottom: 0; }
.bc-date { min-width: 64px; text-align: center; background: var(--bc-bg); border-radius: 8px; padding: .35rem; line-height: 1.1; }
.bc-date b { display: block; font-size: 1.2rem; }
.bc-date small { text-transform: uppercase; font-size: .65rem; color: var(--bc-muted); }
.bc-badge { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .7rem; background: var(--bc-bg); color: var(--bc-muted); }
.bc-badge-success { background: #e4f7e2; color: #087a00; }
.bc-badge-warning { background: #fff3dc; color: #9a6400; }
.bc-empty { color: var(--bc-muted); padding: 1.5rem; text-align: center; }
.bc-error { color: var(--bc-danger); }

.bc-backdrop { display: none; }

@media (max-width: 900px) {
  .bc-shell, .bc-shell.is-collapsed { grid-template-columns: 1fr; }
  /* the sidebar slides in under the topbar so the hamburger stays reachable; the backdrop closes it */
  .bc-sidebar { position: fixed; top: var(--bc-topbar-height); height: calc(100vh - var(--bc-topbar-height)); z-index: 20; width: var(--bc-sidebar-width); transform: translateX(-100%); transition: transform .2s; }
  .bc-sidebar .bc-brand { display: none; }
  .bc-shell.is-open .bc-sidebar { transform: none; }
  .bc-shell.is-open .bc-backdrop { display: block; position: fixed; inset: var(--bc-topbar-height) 0 0 0; z-index: 15; background: rgba(0,0,0,.35); }
  /* topbar must never overflow the viewport: drop the user name, let the org switcher shrink */
  .bc-topbar { gap: .6rem; padding: 0 .75rem; }
  .bc-topbar .bc-page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bc-topbar select { max-width: 40vw; min-width: 0; }
  .bc-topbar .bc-user > span:not(.bc-avatar) { display: none; }
  .bc-content { padding: 1rem; }
}

/* ---- forms ---- */
.bc-input, .bc-select, .bc-textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--bc-border); border-radius: 6px; font: inherit; background: #fff; color: var(--bc-text); }
.bc-input:focus, .bc-select:focus, .bc-textarea:focus { outline: 2px solid var(--bc-primary); border-color: transparent; }
.bc-field { display: grid; gap: .3rem; margin-bottom: .9rem; }
.bc-field > label { font-size: .8rem; color: var(--bc-muted); }
.bc-field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .9rem; }
.bc-help { font-size: .75rem; color: var(--bc-muted); }
.bc-link { background: none; border: 0; color: var(--bc-primary); cursor: pointer; font: inherit; padding: 0; }
.bc-btn-danger { background: var(--bc-danger); }
.bc-btn-danger:hover { background: #d93a58; }
.bc-btn-success { background: var(--bc-success); }
.bc-btn:disabled { opacity: .55; cursor: not-allowed; }
.bc-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.bc-page-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

/* ---- data table ---- */
.bc-table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.bc-table-toolbar-right { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.bc-table-search { max-width: 280px; }
.bc-table-scroll { overflow-x: auto; }
.bc-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.bc-table th, .bc-table td { padding: .65rem .75rem; text-align: left; border-bottom: 1px solid var(--bc-border); vertical-align: middle; }
.is-dense .bc-table th, .is-dense .bc-table td { padding: .4rem .6rem; }
.bc-table th { font-weight: 500; color: var(--bc-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; user-select: none; }
.bc-table th.is-sortable { cursor: pointer; }
.bc-table th .bc-sort-mark::after { content: '↕'; opacity: .35; margin-left: .3rem; }
.bc-table th.is-sorted-asc .bc-sort-mark::after { content: '↑'; opacity: 1; }
.bc-table th.is-sorted-desc .bc-sort-mark::after { content: '↓'; opacity: 1; }
.bc-table td.is-right, .bc-table th.is-right { text-align: right; }
.bc-table td.is-actions { text-align: right; white-space: nowrap; }
.bc-table tbody tr.is-clickable:hover { background: #f7f9fc; }
.bc-table-footer { display: flex; justify-content: space-between; align-items: center; padding-top: .75rem; }
.bc-pager { display: flex; gap: .5rem; align-items: center; }

/* ---- modal ---- */
body.bc-modal-open { overflow: hidden; }
.bc-modal-backdrop { position: fixed; inset: 0; background: rgba(20,24,31,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; overflow-y: auto; }
.bc-modal { background: #fff; border-radius: var(--bc-radius); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); display: flex; flex-direction: column; max-height: 92vh; }
.bc-modal-sm { max-width: 420px; } .bc-modal-md { max-width: 640px; } .bc-modal-lg { max-width: 920px; } .bc-modal-xl { max-width: 1200px; }
.bc-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--bc-border); }
.bc-modal-header h3 { margin: 0; font-size: 1.05rem; }
.bc-modal-close { background: none; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--bc-muted); }
.bc-modal-body { padding: 1.25rem; overflow-y: auto; }
.bc-modal-footer { display: flex; justify-content: flex-end; gap: .5rem; padding: .9rem 1.25rem; border-top: 1px solid var(--bc-border); }

/* ---- toasts ---- */
.bc-toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 200; max-width: 360px; }
.bc-toast { padding: .75rem 1rem; border-radius: 8px; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; font-size: .9rem; }
.bc-toast-success { background: var(--bc-success); } .bc-toast-info { background: var(--bc-primary); }
.bc-toast-warning { background: var(--bc-warning); color: #3b2a00; } .bc-toast-error { background: var(--bc-danger); }

/* ---- rich text ---- */
.bc-richtext { border: 1px solid var(--bc-border); border-radius: 6px; background: #fff; }
.bc-richtext-toolbar { display: flex; gap: .15rem; padding: .3rem; border-bottom: 1px solid var(--bc-border); flex-wrap: wrap; }
.bc-richtext-toolbar button { border: 0; background: transparent; padding: .3rem .5rem; border-radius: 4px; cursor: pointer; font: inherit; font-size: .8rem; }
.bc-richtext-toolbar button:hover { background: var(--bc-bg); }
.bc-richtext-body { padding: .6rem .75rem; outline: none; }
.bc-richtext-body:empty::before { content: attr(data-placeholder); color: #9aa3ad; }
.bc-richtext-body a { text-decoration: underline; }

/* ---- multi select ---- */
.bc-multiselect { position: relative; }
.bc-multiselect-toggle { text-align: left; cursor: pointer; }
.bc-multiselect-menu { position: absolute; z-index: 50; top: calc(100% + 4px); left: 0; right: 0; background: #fff; border: 1px solid var(--bc-border); border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: .4rem; max-height: 280px; overflow-y: auto; }
.bc-multiselect-option { display: flex; gap: .5rem; align-items: center; padding: .35rem .5rem; border-radius: 4px; cursor: pointer; }
.bc-multiselect-option:hover { background: var(--bc-bg); }
.bc-multiselect-footer { display: flex; justify-content: space-between; padding: .4rem .5rem 0; border-top: 1px solid var(--bc-border); margin-top: .3rem; }

/* ---- tabs ---- */
.bc-tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--bc-border); margin-bottom: 1rem; flex-wrap: wrap; }
.bc-tabs button { border: 0; background: transparent; padding: .6rem .9rem; font: inherit; cursor: pointer; color: var(--bc-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.bc-tabs button.is-active { color: var(--bc-primary); border-bottom-color: var(--bc-primary); }
