/* ==========================================================================
   THRD Events Portal — brand theme
   Colours sampled from the THRD logo: deep navy wordmark, orange → coral
   ribbon, purple / blue figure.
   ========================================================================== */
:root {
  --thrd-navy: #0F1C44;
  --thrd-navy-2: #16275C;
  --thrd-blue: #1D3B7A;
  --thrd-orange: #F26B21;
  --thrd-amber: #F7931E;
  --thrd-coral: #F0455F;
  --thrd-purple: #7B3FA0;
  --thrd-gradient: linear-gradient(120deg, #F7931E 0%, #F26B21 30%, #F0455F 68%, #7B3FA0 100%);
  --thrd-gradient-soft: linear-gradient(120deg, rgba(247,147,30,.12), rgba(240,69,95,.12) 60%, rgba(123,63,160,.12));

  --bg: #F4F6FB;
  --surface: #FFFFFF;
  --surface-2: #F8F9FC;
  --border: #E4E8F1;
  --text: #0F1C44;
  --text-2: #4B5675;
  --muted: #7C869E;
  --sidebar-w: 256px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15,28,68,.04), 0 4px 16px rgba(15,28,68,.05);
  --shadow-lg: 0 10px 40px rgba(15,28,68,.12);

  --bs-body-font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-border-color: var(--border);
  --bs-link-color: var(--thrd-blue);
  --bs-link-hover-color: var(--thrd-coral);
  --bs-link-color-rgb: 29, 59, 122;
  --bs-link-hover-color-rgb: 240, 69, 95;
  --bs-primary: var(--thrd-navy);
  --bs-primary-rgb: 15, 28, 68;
  --bs-border-radius: 10px;
  --bs-border-radius-lg: 14px;
  --bs-focus-ring-color: rgba(240, 69, 95, .25);
}

html, body { background: var(--bg); }
body { font-size: .9rem; color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { color: var(--text); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.small-caps { font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fw-semi { font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.text-gradient { background: var(--thrd-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.text-coral { color: var(--thrd-coral) !important; }
.text-orange { color: var(--thrd-orange) !important; }
.text-navy { color: var(--thrd-navy) !important; }
.text-purple { color: var(--thrd-purple) !important; }
.bg-gradient-brand { background: var(--thrd-gradient) !important; color: #fff; }

/* ---------- Buttons ---------- */
.btn { font-weight: 600; border-radius: 10px; padding: .45rem .9rem; font-size: .875rem; }
.btn-sm { padding: .3rem .65rem; font-size: .8rem; border-radius: 8px; }
.btn-primary { --bs-btn-bg: var(--thrd-navy); --bs-btn-border-color: var(--thrd-navy); --bs-btn-hover-bg: var(--thrd-blue); --bs-btn-hover-border-color: var(--thrd-blue); --bs-btn-active-bg: var(--thrd-navy-2); --bs-btn-active-border-color: var(--thrd-navy-2); --bs-btn-disabled-bg: var(--thrd-navy); --bs-btn-disabled-border-color: var(--thrd-navy); }
.btn-outline-primary { --bs-btn-color: var(--thrd-navy); --bs-btn-border-color: #C9D0E2; --bs-btn-hover-bg: var(--thrd-navy); --bs-btn-hover-border-color: var(--thrd-navy); --bs-btn-active-bg: var(--thrd-navy); }
.btn-brand { color: #fff; background: var(--thrd-gradient); border: 0; box-shadow: 0 4px 14px rgba(240,69,95,.28); }
.btn-brand:hover, .btn-brand:focus { color: #fff; filter: brightness(1.05); box-shadow: 0 6px 18px rgba(240,69,95,.38); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: #CBD2E3; }
.btn-icon { width: 34px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Forms ---------- */
.form-control, .form-select { border-color: #D9DEEA; border-radius: 10px; font-size: .875rem; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--thrd-coral); box-shadow: 0 0 0 .2rem rgba(240,69,95,.15); }
.form-label { font-weight: 600; font-size: .8rem; color: var(--text-2); margin-bottom: .3rem; }
.form-check-input:checked { background-color: var(--thrd-coral); border-color: var(--thrd-coral); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(240,69,95,.15); }
.form-text { color: var(--muted); font-size: .75rem; }
.required::after { content: " *"; color: var(--thrd-coral); }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; }
.ts-control { border-radius: 10px !important; border-color: #D9DEEA !important; min-height: 38px; padding: .35rem .6rem !important; font-size: .875rem; }
.ts-wrapper.focus .ts-control { border-color: var(--thrd-coral) !important; box-shadow: 0 0 0 .2rem rgba(240,69,95,.15) !important; }
.ts-wrapper.multi .ts-control > div { background: #EEF1F8 !important; color: var(--thrd-navy) !important; border-radius: 6px !important; border: 0 !important; }
.ts-dropdown { border-radius: 10px; font-size: .875rem; box-shadow: var(--shadow-lg); border-color: var(--border); }
.ts-dropdown .active { background: #F2F4FA; color: var(--thrd-navy); }
/* Shared select menus match the THRD cards and escape table/modal clipping. */
.portal-select { font-family: var(--bs-body-font-family); text-align: left; }
.portal-select .ts-control { background-color: var(--surface); color: var(--text); box-shadow: none; }
.portal-select.single .ts-control { cursor: pointer; }
.portal-select.disabled .ts-control { opacity: .65; cursor: not-allowed; }
.portal-filter-select { width: 150px; min-width: 120px; max-width: 100%; }
.portal-select-dropdown { z-index: 2001 !important; padding: .35rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); font-family: var(--bs-body-font-family); text-align: left; }
.portal-select-dropdown .ts-dropdown-content { max-height: min(280px, 45vh); overscroll-behavior: contain; }
.portal-select-dropdown .option { display: flex; align-items: center; gap: .6rem; min-height: 36px; padding: .5rem .7rem; border-radius: 8px; color: var(--text-2); white-space: normal; cursor: pointer; }
.portal-select-dropdown .option.active { background: var(--thrd-gradient-soft); color: var(--thrd-navy); }
.portal-select-dropdown .option.selected { background: #EEF1F8; color: var(--thrd-navy); font-weight: 600; }
.portal-select-dropdown .option.selected::after { content: '\2713'; margin-left: auto; color: var(--thrd-purple); font-weight: 800; }
.portal-select-dropdown .option.disabled { opacity: .5; cursor: not-allowed; }
.portal-select-dropdown .no-results { padding: .6rem .7rem; color: var(--muted); }
.portal-status-select { display: inline-block; width: 138px; max-width: 100%; vertical-align: middle; border: 0; padding: 0; background: transparent; }
.portal-status-select.single .ts-control { min-height: 34px; padding: 0 18px 0 0 !important; border: 0 !important; background: transparent !important; overflow: visible; }
.portal-status-select .ts-control .pill { min-height: 30px; padding: .4rem .7rem; white-space: nowrap; }
.portal-status-select.single .ts-control::after { right: 2px !important; border-top-color: var(--muted) !important; }
.portal-status-select.focus .ts-control { box-shadow: 0 0 0 3px rgba(123,63,160,.16) !important; }
.portal-status-dropdown { min-width: 185px; }
.portal-status-dropdown .status-dot { display: inline-block; flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; }

/* ---------- Layout ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: var(--thrd-navy); color: rgba(255,255,255,.72); flex-shrink: 0; }
@media (min-width: 992px) {
  .sidebar.offcanvas-lg { background-color: var(--thrd-navy) !important; }
  .sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
  .sidebar .offcanvas-body { display: flex !important; flex-direction: column; overflow-y: auto; padding: 0; flex: 1; }
}
.sidebar.offcanvas-lg { --bs-offcanvas-width: 272px; --bs-offcanvas-bg: var(--thrd-navy); }
.sidebar .offcanvas-body { padding: 0; display: flex; flex-direction: column; }
.sidebar-brand { display: flex; align-items: center; gap: .7rem; padding: 1.15rem 1.25rem 1rem; color: #fff; }
.sidebar-brand img { width: 40px; height: 40px; object-fit: contain; }
.sidebar-brand .name { font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; line-height: 1; }
.sidebar-brand .name span { display: block; font-size: .58rem; letter-spacing: .38em; font-weight: 600; color: rgba(255,255,255,.55); margin-top: .3rem; }
.sidebar-brand::after { content: ""; position: absolute; }
.brand-bar { height: 3px; background: var(--thrd-gradient); }
.nav-section { padding: .9rem 1.25rem .35rem; font-size: .64rem; text-transform: uppercase; letter-spacing: .14em; color: rgba(255,255,255,.38); font-weight: 700; }
.side-link { display: flex; align-items: center; gap: .75rem; padding: .52rem 1.25rem; margin: 1px .65rem; border-radius: 10px; color: rgba(255,255,255,.74); font-weight: 500; font-size: .86rem; position: relative; }
.side-link i { font-size: 1.02rem; width: 1.2rem; text-align: center; opacity: .9; }
.side-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.side-link.active { color: #fff; background: rgba(255,255,255,.1); font-weight: 600; }
.side-link.active::before { content: ""; position: absolute; left: -.65rem; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--thrd-gradient); }
.side-link.active i { color: var(--thrd-amber); }
.side-link .count { margin-left: auto; background: var(--thrd-coral); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 99px; padding: .05rem .45rem; }
.sidebar-footer { margin-top: auto; padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: .65rem; }
.sidebar-footer .who { line-height: 1.2; min-width: 0; }
.sidebar-footer .who strong { color: #fff; font-size: .83rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .who small { color: rgba(255,255,255,.5); font-size: .72rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; background: rgba(244,246,251,.86); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); padding: .6rem 1.5rem; display: flex; align-items: center; gap: .75rem; }
.topbar .search { flex: 1; max-width: 520px; position: relative; }
.topbar .search input { padding-left: 2.3rem; background: #fff; border-radius: 12px; }
.topbar .search i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.topbar .kbd { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-size: .68rem; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; padding: 0 .35rem; background: var(--surface-2); }
.content { padding: 1.5rem; max-width: 1600px; width: 100%; }
@media (max-width: 575.98px) { .content { padding: 1rem; } .topbar { padding: .55rem 1rem; } }

.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); background: #fff; border: 1px solid var(--border); }
.icon-btn:hover { color: var(--thrd-navy); border-color: #CBD2E3; }
.icon-btn .dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--thrd-coral); color: #fff; font-size: .65rem; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 2px solid var(--bg); }

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.page-header h1 { font-size: 1.45rem; margin: 0; }
.page-header .subtitle { color: var(--muted); margin-top: .2rem; }
.breadcrumbs { font-size: .78rem; color: var(--muted); margin-bottom: .25rem; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--thrd-coral); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: .9rem 1.15rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-header h2, .card-header h3, .card-header .card-title { font-size: .95rem; margin: 0; font-weight: 700; }
.card-body { padding: 1.15rem; }
.card-footer { background: var(--surface-2); border-top: 1px solid var(--border); }
.card-accent { position: relative; overflow: hidden; }
.card-accent::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--thrd-gradient); }

.card.kpi, .kpi { padding: 1.05rem 1.15rem; display: flex; flex-direction: row; text-align: left; gap: .9rem; align-items: center; height: 100%; color: inherit; }
a.kpi:hover { color: inherit; }
a.card:hover { border-color: #CBD2E3; box-shadow: var(--shadow-lg); }
.kpi .ico { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.kpi .label { color: var(--muted); font-size: .76rem; font-weight: 600; }
.kpi .value { font-size: 1.4rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.kpi .sub { font-size: .74rem; color: var(--muted); }
.ico-navy { background: #E8ECF6; color: var(--thrd-navy); }
.ico-orange { background: #FEEFE6; color: #D9560F; }
.ico-coral { background: #FDE9EC; color: #D62D48; }
.ico-purple { background: #F2EAF8; color: var(--thrd-purple); }
.ico-green { background: #E5F6EB; color: #15803D; }
.ico-blue { background: #E6EEFB; color: #1D4ED8; }
.ico-gradient { background: var(--thrd-gradient); color: #fff; }

.hero { background: var(--thrd-navy); color: #fff; border-radius: 18px; padding: 1.4rem 1.6rem; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: var(--thrd-gradient); opacity: .35; filter: blur(10px); }
.hero h1 { color: #fff; font-size: 1.4rem; margin-bottom: .2rem; position: relative; z-index: 1; }
.hero p { color: rgba(255,255,255,.7); margin: 0; position: relative; z-index: 1; }
.hero .hero-mark { position: absolute; right: 1.4rem; bottom: -14px; width: 120px; opacity: .9; z-index: 1; }

/* ---------- Badges & status pills ---------- */
.badge-soft { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .25rem .55rem; border-radius: 99px; white-space: nowrap; line-height: 1.2; }
.badge-soft-gray { background: #EEF0F5; color: #4B5563; }
.badge-soft-blue { background: #E6EEFB; color: #1D4ED8; }
.badge-soft-navy { background: #E8ECF6; color: var(--thrd-navy); }
.badge-soft-orange { background: #FEEFE6; color: #C2410C; }
.badge-soft-red { background: #FDE9EC; color: #C81E3A; }
.badge-soft-green { background: #E5F6EB; color: #15803D; }
.badge-soft-purple { background: #F2EAF8; color: #6B2F91; }
.badge-soft-teal { background: #E0F5F4; color: #0F766E; }
.badge-soft-yellow { background: #FEF6DC; color: #A16207; }
.badge-soft-dark { background: #E5E7EB; color: #1F2937; }

/* monday-style solid status cells */
.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 112px; font-size: .74rem; font-weight: 600; padding: .32rem .6rem; border-radius: 8px; color: #fff; white-space: nowrap; border: 0; }
.pill-gray { background: #9AA3B5; } .pill-blue { background: #3B82F6; } .pill-navy { background: var(--thrd-blue); }
.pill-orange { background: #F59E0B; } .pill-red { background: #E2445C; } .pill-green { background: #00B46E; }
.pill-purple { background: #9D50DD; } .pill-teal { background: #14B8A6; } .pill-yellow { background: #EAB308; } .pill-dark { background: #374151; }
button.pill { cursor: pointer; } button.pill:hover { filter: brightness(1.06); }
.status-picker { cursor: pointer; min-height: 34px; padding-right: 1.6rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2' d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .55rem center; }
.status-picker option { background: #fff; color: var(--thrd-navy); }
.status-picker:focus-visible { outline: 3px solid var(--thrd-navy); outline-offset: 2px; }
.status-picker:disabled { cursor: wait; opacity: .65; }

/* ---------- Avatars ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0; border: 2px solid #fff; letter-spacing: .02em; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -8px; }
.avatar-more { background: #E5E8F0; color: var(--text-2); }

/* ---------- Progress ---------- */
.progress-thin { height: 7px; border-radius: 99px; background: #ECEFF5; overflow: hidden; }
.progress-thin > span { display: block; height: 100%; border-radius: 99px; background: var(--thrd-gradient); transition: width .4s ease; }
.progress-thin.green > span { background: #16A34A; }
.progress-thin.red > span { background: #DC2626; }
.progress-thin.navy > span { background: var(--thrd-blue); }
.ring { --v: 0; width: 64px; height: 64px; border-radius: 50%; background: conic-gradient(var(--thrd-coral) calc(var(--v) * 1%), #ECEFF5 0); display: grid; place-items: center; }
.ring::before { content: attr(data-label); width: 50px; height: 50px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: var(--text); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin: 0; font-size: .86rem; }
.table > :not(caption) > * > * { padding: .7rem .85rem; border-bottom-color: #EEF1F6; vertical-align: middle; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F7F8FC; }
.table .row-link { color: var(--text); font-weight: 600; }
.table .row-link:hover { color: var(--thrd-coral); }
.table-card { border-radius: var(--radius); overflow: hidden; }
.table-responsive { border-radius: 0 0 var(--radius) var(--radius); }
tr.is-late td:first-child { box-shadow: inset 3px 0 0 #DC2626; }
.group-row td { background: var(--surface-2) !important; font-weight: 700; font-size: .78rem; color: var(--text-2); }

/* ---------- Filters bar ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 1rem; }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; background-color: #fff; }
.filters .search-input { min-width: 220px; }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; }
.seg a, .seg button { padding: .32rem .75rem; border-radius: 8px; color: var(--text-2); font-weight: 600; font-size: .8rem; border: 0; background: transparent; white-space: nowrap; }
.seg a.active, .seg button.active { background: var(--thrd-navy); color: #fff; }
.seg a:hover:not(.active) { background: var(--surface-2); color: var(--thrd-navy); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.25rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .65rem .95rem; color: var(--text-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .86rem; }
.tabs a:hover { color: var(--thrd-navy); }
.tabs a.active { color: var(--thrd-navy); border-image: var(--thrd-gradient) 1; border-bottom: 3px solid; }
.tabs a .n { font-size: .7rem; background: #EEF0F5; border-radius: 99px; padding: .05rem .45rem; margin-left: .3rem; color: var(--text-2); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; align-items: start; }
.kanban-col { background: #EBEEF5; border-radius: 14px; padding: .65rem; min-height: 120px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: .25rem .35rem .65rem; font-weight: 700; font-size: .82rem; }
.kanban-col-head .bar { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: .45rem; }
.kanban-list { min-height: 60px; display: flex; flex-direction: column; gap: .55rem; }
.kanban-card { background: #fff; border-radius: 11px; padding: .7rem .8rem; box-shadow: 0 1px 2px rgba(15,28,68,.08); border: 1px solid transparent; cursor: grab; color: var(--text); display: block; }
.kanban-card:hover { border-color: #D3D9E8; color: var(--text); }
.kanban-card .t { font-weight: 600; font-size: .85rem; line-height: 1.35; }
.kanban-card .m { font-size: .74rem; color: var(--muted); }
.sortable-ghost { opacity: .35; }
.sortable-drag { box-shadow: var(--shadow-lg) !important; transform: rotate(1.5deg); }

/* ---------- Lists ---------- */
.list-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.15rem; border-bottom: 1px solid #EEF1F6; color: var(--text); }
.list-row:last-child { border-bottom: 0; }
a.list-row:hover { background: #F7F8FC; color: var(--text); }
.list-row .ttl { font-weight: 600; font-size: .86rem; line-height: 1.3; }
.list-row .meta { font-size: .75rem; color: var(--muted); }
.time-chip { font-size: .72rem; font-weight: 700; color: var(--thrd-navy); background: #EEF1F8; border-radius: 8px; padding: .25rem .5rem; white-space: nowrap; min-width: 66px; text-align: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.platform-badge { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; font-size: .72rem; }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .ico { width: 58px; height: 58px; margin: 0 auto .8rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; background: var(--thrd-gradient-soft); color: var(--thrd-coral); }
.empty h3 { font-size: 1rem; color: var(--text); margin-bottom: .25rem; }

/* ---------- Timeline / comments ---------- */
.timeline { position: relative; padding-left: 1.4rem; }
.timeline::before { content: ""; position: absolute; left: .45rem; top: .3rem; bottom: .3rem; width: 2px; background: #E8EBF2; }
.timeline-item { position: relative; padding-bottom: 1rem; }
.timeline-item .tl-dot { position: absolute; left: -1.28rem; top: .15rem; width: 14px; height: 14px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #DADFEA; }
.comment { display: flex; gap: .7rem; margin-bottom: 1rem; }
.comment .bubble { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; padding: .6rem .8rem; flex: 1; white-space: pre-wrap; word-break: break-word; }
.comment .who { font-size: .78rem; margin-bottom: .2rem; }

/* ---------- Detail lists ---------- */
.dl-grid { display: grid; grid-template-columns: 130px 1fr; gap: .55rem .75rem; font-size: .86rem; margin: 0; }
.dl-grid dt { color: var(--muted); font-weight: 500; }
.dl-grid dd { margin: 0; font-weight: 500; word-break: break-word; }

/* ---------- Calendar ---------- */
.fc { --fc-button-bg-color: #fff; --fc-button-border-color: var(--border); --fc-button-text-color: var(--text-2); --fc-button-hover-bg-color: var(--surface-2); --fc-button-hover-border-color: #CBD2E3; --fc-button-active-bg-color: var(--thrd-navy); --fc-button-active-border-color: var(--thrd-navy); --fc-border-color: #E8EBF2; --fc-today-bg-color: rgba(240,69,95,.06); --fc-page-bg-color: #fff; --fc-neutral-bg-color: var(--surface-2); --fc-event-border-color: transparent; font-size: .82rem; }
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 800; color: var(--text); }
.fc .fc-button { background: #fff; border: 1px solid var(--border); color: var(--text-2); font-weight: 600; text-transform: capitalize; border-radius: 9px !important; padding: .35rem .7rem; box-shadow: none !important; font-size: .8rem; }
.fc .fc-button:disabled { opacity: .55; background: #fff; color: var(--text-2); }
.fc .fc-button:hover { background: var(--surface-2); color: var(--thrd-navy); border-color: #CBD2E3; }
.fc .fc-button-primary:not(:disabled).fc-button-active, .fc .fc-button-primary:not(:disabled):active { background: var(--thrd-navy); border-color: var(--thrd-navy); color: #fff; }
.fc .fc-button-group { gap: 3px; }
.fc .fc-col-header-cell-cushion { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: .55rem 0; }
.fc .fc-daygrid-day-number { font-weight: 600; color: var(--text-2); font-size: .8rem; }
.fc .fc-day-today .fc-daygrid-day-number { background: var(--thrd-gradient); color: #fff; border-radius: 99px; min-width: 24px; text-align: center; margin: 3px; padding: 2px 6px; }
.fc-event { border-radius: 6px !important; padding: 1px 4px; font-weight: 600; cursor: pointer; }
.fc-event.ev-done { opacity: .6; text-decoration: line-through; }
.fc-daygrid-event-dot { border-color: currentColor; }
.fc .fc-list-event:hover td { background: var(--surface-2); }
.cal-legend label { display: flex; align-items: center; gap: .5rem; padding: .3rem 0; font-size: .84rem; cursor: pointer; font-weight: 500; }
.cal-legend .sw { width: 12px; height: 12px; border-radius: 4px; }

/* ---------- Team schedule grid ---------- */
.schedule { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 980px; }
.schedule th, .schedule td { border-bottom: 1px solid #EEF1F6; border-right: 1px solid #EEF1F6; vertical-align: top; padding: .5rem; }
.schedule thead th { background: var(--surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; }
.schedule thead th.today { color: var(--thrd-coral); }
.schedule td.today { background: rgba(240,69,95,.035); }
.schedule td.weekend { background: #FAFBFD; }
.schedule .person { width: 210px; position: sticky; left: 0; background: #fff; z-index: 1; }
.sched-item { display: block; font-size: .72rem; line-height: 1.25; padding: .28rem .4rem; border-radius: 6px; margin-bottom: .25rem; color: #fff; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-item:hover { color: #fff; filter: brightness(1.08); }
.sched-item.task { background: var(--thrd-blue); } .sched-item.post { background: var(--thrd-coral); } .sched-item.event { background: var(--thrd-orange); }
.sched-item.done { background: #A3ACBD; text-decoration: line-through; } .sched-item.late { background: #DC2626; }
.sched-leave { font-size: .72rem; font-weight: 700; color: #475569; background: repeating-linear-gradient(45deg, #EEF0F5, #EEF0F5 6px, #F6F7FA 6px, #F6F7FA 12px); border-radius: 6px; padding: .3rem .4rem; margin-bottom: .25rem; }
.load-bar { height: 4px; border-radius: 4px; background: #ECEFF5; margin-top: .3rem; overflow: hidden; }
.load-bar span { display: block; height: 100%; }

/* ---------- Invoice document ---------- */
.doc-paper { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); padding: 2.2rem; }
.doc-paper .doc-title { font-size: 1.6rem; font-weight: 800; letter-spacing: .06em; }
.doc-items th { background: var(--thrd-navy) !important; color: #fff !important; }
.totals td { padding: .35rem .85rem !important; border: 0 !important; }
.totals tr.grand td { font-size: 1.05rem; font-weight: 800; border-top: 2px solid var(--thrd-navy) !important; }
.line-item-row textarea { min-height: 38px; resize: vertical; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: var(--thrd-navy); color: #fff; padding: 3rem; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; }
.auth-art::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: var(--thrd-gradient); opacity: .45; right: -170px; bottom: -170px; filter: blur(8px); }
.auth-art::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 2px solid rgba(255,255,255,.08); left: -80px; top: 120px; }
.auth-art h1 { color: #fff; font-size: 2.3rem; line-height: 1.15; position: relative; z-index: 1; }
.auth-art p { color: rgba(255,255,255,.7); position: relative; z-index: 1; max-width: 420px; }
.auth-art .tag { letter-spacing: .3em; font-size: .72rem; color: rgba(255,255,255,.55); font-weight: 600; position: relative; z-index: 1; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- Misc ---------- */
.alert { border-radius: 12px; border: 0; font-weight: 500; }
.alert-success { background: #E5F6EB; color: #14532D; }
.alert-danger { background: #FDE9EC; color: #8B1027; }
.alert-warning { background: #FEF3E2; color: #7C3A06; }
.alert-info { background: #E8EEFA; color: #1E3A8A; }
.dropdown-menu { border-radius: 12px; border-color: var(--border); box-shadow: var(--shadow-lg); font-size: .86rem; padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .7rem; }
.dropdown-item:active { background: var(--thrd-navy); }
.notif-menu { width: 360px; max-width: calc(100vw - 2rem); }
.notif-item { display: flex; gap: .65rem; padding: .6rem .7rem; border-radius: 10px; color: var(--text); white-space: normal; }
.notif-item:hover { background: var(--surface-2); color: var(--text); }
.notif-item .ni { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.modal-content { border-radius: 16px; border: 0; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--border); }
.modal-footer { border-top-color: var(--border); }
.pagination { --bs-pagination-color: var(--thrd-navy); --bs-pagination-active-bg: var(--thrd-navy); --bs-pagination-active-border-color: var(--thrd-navy); --bs-pagination-border-radius: 8px; margin: 0; }
.caption-box { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 1rem; font-size: .9rem; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: #0F1C44; color: #fff; padding: .55rem .8rem; border-radius: 10px; letter-spacing: .03em; word-break: break-all; }
.perm-matrix .module { border: 1px solid var(--border); border-radius: 12px; padding: .9rem 1rem; height: 100%; }
.perm-matrix .module h3 { font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(244,246,251,.92); backdrop-filter: blur(8px); padding: .85rem 0; border-top: 1px solid var(--border); margin-top: 1rem; z-index: 5; }
.overdue { color: #DC2626 !important; font-weight: 600; }
.due-soon { color: #C2410C !important; font-weight: 600; }
.strike { text-decoration: line-through; color: var(--muted); }
.cursor-pointer { cursor: pointer; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media print { .sidebar, .topbar, .no-print { display: none !important; } .content { padding: 0; } .doc-paper { border: 0; box-shadow: none; } }

/* ---------- Collapsible sidebar categories ---------- */
.nav-toggle { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 1.3rem); margin: .35rem .65rem 0; padding: .55rem .6rem; border: 0; border-radius: 8px; background: transparent; text-align: left; cursor: pointer; }
.nav-toggle:hover { color: rgba(255,255,255,.75); background: rgba(255,255,255,.04); }
.nav-toggle i { font-size: .7rem; transition: transform .2s ease; }
.nav-toggle.collapsed i { transform: rotate(-90deg); }
#side-nav .collapse .side-link, #side-nav .collapsing .side-link { margin-left: .9rem; }

tr[data-href] { cursor: pointer; }

/* ---- Sales & marketing tools ---- */
.ico-gray { background: #EEF0F5; color: #4B5563; }
.ico-red { background: #FDE9EC; color: #C81E3A; }
.ico-teal { background: #E0F5F2; color: #0F766E; }
.ico-dark { background: #E5E7EB; color: #374151; }
.tl-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.kb-body { white-space: pre-line; line-height: 1.65; }
.review-page { max-width: 760px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
@media (max-width: 575.98px) {
  .page-header { flex-direction: column; align-items: flex-start !important; gap: .75rem; }
  .page-header > .d-flex { width: 100%; }
  .filters { flex-wrap: wrap; }
  .filters .form-select, .filters .form-control { max-width: 100% !important; flex: 1 1 140px; }
  .kanban { scroll-snap-type: x mandatory; }
  .kanban-col { scroll-snap-align: start; }
  .sticky-actions { padding: .6rem .75rem; }
}
.kb-article { line-height: 1.7; }
.kb-article h1, .kb-article h2, .kb-article h3 { font-size: 1.1rem; font-weight: 700; margin-top: 1.2rem; }
.kb-article ul, .kb-article ol { padding-left: 1.3rem; }
.kb-article table { width: 100%; margin-bottom: 1rem; }
.kb-article td, .kb-article th { border: 1px solid var(--border); padding: .35rem .5rem; }
.color-picker .swatch { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); padding: 0; cursor: pointer; }
.color-picker .swatch.active { box-shadow: 0 0 0 2px var(--thrd-navy); }

.sort-link { color: inherit; white-space: nowrap; }
.sort-link:hover, .sort-link.active { color: var(--thrd-navy); }

/* ---- Contacts / 人脉 ---- */
.tier-pill { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; }
.tier-core { background: #FDE9EC; color: #C81E3A; }
.tier-semi_core { background: #FEF6DC; color: #946C00; }
.tier-non_core { background: #EEF0F5; color: #4B5563; }
.tier-blacklist { background: #1F2937; color: #fff; }
.tier-none { background: #F4F6FB; color: #8490A3; border: 1px dashed #CBD2DF; }
.contact-avatar { width: var(--s); height: var(--s); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: calc(var(--s) * .38); color: #fff; flex-shrink: 0; }
.tier-bg-core { background: #D43A50; } .tier-bg-semi_core { background: #D4A300; } .tier-bg-non_core { background: #8490A3; }
.tier-bg-blacklist { background: #222; } .tier-bg-none { background: #B7C0CF; }
.fu-pill { display: inline-block; padding: .15rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 600; white-space: nowrap; cursor: help; }
.fu-late { background: #FDE9EC; color: #C81E3A; } .fu-today { background: #FEEFE6; color: #C2410C; }
.fu-soon { background: #E6EEFB; color: #1D4ED8; } .fu-later { background: #E5F6EB; color: #15803D; } .fu-none { background: #F4F6FB; color: #8490A3; }
.stat-filter { border: 2px solid transparent; transition: border-color .15s; }
.stat-filter:hover, .stat-filter.active { border-color: var(--thrd-coral); }
.contact-filters .search-box { position: relative; min-width: 260px; }
.contact-filters .search-box .bi-search { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: #8490A3; }
.contact-filters .search-box input { padding-left: 2.2rem; padding-right: 2.2rem; }
.contact-filters .help-dot { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 50%; border: 1px solid #CBD2DF; background: #fff; font-size: .75rem; color: #6B7280; line-height: 1; }
.more-filters { background: #F4F6FB; }
.filter-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border-radius: 99px; background: #E6EEFB; color: #1D3B7A; }
.filter-chip:hover { background: #D5E2F8; }
.contact-table .group-row td { background: #F7F8FC; font-weight: 600; font-size: .84rem; padding-top: .5rem; padding-bottom: .5rem; }
.contact-table.compact td { padding-top: .35rem; padding-bottom: .35rem; }
.contact-table.compact .badge-soft, .contact-table.compact .text-coral, .contact-table.compact .clamp-1 { display: none !important; }
.clamp-1, .clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-1 { -webkit-line-clamp: 1; } .clamp-2 { -webkit-line-clamp: 2; }
.match-score { height: 6px; border-radius: 99px; background: #EEF0F5; overflow: hidden; }
.match-score > span { display: block; height: 100%; background: var(--thrd-gradient); }
.event-card .date-badge { width: 58px; border-radius: 12px; background: var(--thrd-gradient-soft, #FDEFF1); padding: .35rem 0; line-height: 1.1; }
.event-card .date-badge .m { font-size: .7rem; font-weight: 700; color: var(--thrd-coral); text-transform: uppercase; }
.event-card .date-badge .d { font-size: 1.35rem; font-weight: 800; color: var(--thrd-navy); }
.event-card .date-badge .y { font-size: .66rem; color: #8490A3; }
.avatar-stack { display: flex; }
.avatar-stack .contact-avatar { border: 2px solid #fff; margin-left: -8px; }
.avatar-stack .contact-avatar:first-child { margin-left: 0; }
.order-num { width: 46px; padding: .15rem .3rem; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-weight: 600; font-size: .82rem; background: #fff; -moz-appearance: textfield; }
.order-num::-webkit-outer-spin-button, .order-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.order-num:focus { outline: 2px solid var(--thrd-coral); border-color: transparent; }
/* Contacts on phones: each row becomes a stacked card (no sideways swiping). */
@media (max-width: 767.98px) {
  .contact-table thead { display: none; }
  .contact-table, .contact-table tbody, .contact-table tr, .contact-table td { display: block; width: 100% !important; }
  .contact-table tr { padding: .7rem .85rem; border-bottom: 1px solid var(--border); }
  .contact-table td { border: 0 !important; padding: .15rem 0 !important; max-width: none !important; text-align: left !important; white-space: normal !important; }
  .contact-table td.m-hide { display: none; }
  .contact-table td.m-inline { display: inline-block; width: auto !important; margin-right: .5rem; vertical-align: middle; }
  .contact-table .group-row { padding: 0; }
  .contact-table .group-row td { padding: .45rem .85rem !important; }
  .contact-table td:last-child { padding-top: .4rem !important; }
  .contact-table td:last-child .small.text-muted { display: none; }
  .contact-table .clamp-2 { -webkit-line-clamp: 3; }
  .contact-filters .search-box { min-width: 100%; }
  .stat-filter { padding: .75rem .85rem; }
  .stat-filter .ico { width: 36px; height: 36px; font-size: 1rem; }
  .stat-filter .sub { display: none; }
}
/* Generic table → stacked cards on phones (used by Projects list). */
@media (max-width: 767.98px) {
  .stack-table thead { display: none; }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100% !important; }
  .stack-table tr { position: relative; padding: .75rem .85rem .75rem 4.6rem; border-bottom: 1px solid var(--border); }
  .stack-table td { border: 0 !important; padding: .12rem 0 !important; text-align: left !important; white-space: normal !important; }
  .stack-table td.stack-corner { position: absolute; left: .5rem; top: .7rem; width: auto !important; }
  .stack-table td.stack-inline { display: inline-block; width: auto !important; margin-right: .6rem; vertical-align: middle; }
}
/* Portal confirmation dialog (replaces the browser's confirm box). */
#confirm-modal .modal-content { border: 0; border-radius: 16px; box-shadow: 0 20px 60px rgba(15, 28, 68, .25); }
#confirm-modal .modal-footer { border-top: 0; padding: 0 1.5rem 1.25rem; }
#confirm-modal .confirm-ico { width: 44px; height: 44px; border-radius: 12px; background: #FDE9EC; color: #C81E3A; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
#confirm-modal .modal-title { font-weight: 700; color: var(--thrd-navy); }
#confirm-modal .confirm-ico-info { background: #E6EEFB; color: #1D4ED8; }

/* Social text toolbar (Unicode bold / italic for captions and titles) */
.social-toolbar .social-tool { min-width: 2rem; padding: .15rem .5rem; line-height: 1.3; border: 1px solid var(--border); }
.social-toolbar .social-tool:hover { background: var(--surface-2); }
.social-counts > span { white-space: nowrap; }

/* Multi-file picker list */
.file-picker-list { width: 100%; margin-top: .5rem; display: grid; gap: .4rem; }
.file-picker-item { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.file-picker-item.is-invalid { border-color: #DC2626; background: #FEF2F2; }
.file-picker-thumb { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 8px; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: 1.2rem; color: var(--text-2); }

/* ---- Manpower module ---- */
.mp-c-navy { background: #E8ECF6; color: var(--thrd-navy); }
.mp-c-blue { background: #E6EEFB; color: #1D4ED8; }
.mp-c-orange { background: #FEEFE6; color: #C2410C; }
.mp-c-green { background: #E5F6EB; color: #15803D; }
.mp-c-purple { background: #F2EAF8; color: #6B2F91; }
.mp-c-teal { background: #E0F5F2; color: #0F766E; }
.mp-c-red { background: #FDE9EC; color: #C81E3A; }
.mp-c-yellow { background: #FEF6DA; color: #92600A; }
.mp-c-gray { background: #EEF0F5; color: #4B5563; }
.mp-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px; font-weight: 800; font-size: .8rem; letter-spacing: .02em; vertical-align: middle; }
.mp-badge-sm { min-width: 20px; height: 20px; font-size: .7rem; border-radius: 6px; padding: 0 5px; }
.mp-types { display: flex; flex-wrap: wrap; gap: 10px; }
.mp-type { display: inline-flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 14px; border: 1.5px solid var(--border); background: #fff; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; font: inherit; }
.mp-type:hover { border-color: #F0455F80; transform: translateY(-1px); }
.mp-type.active { border-color: var(--thrd-coral, #F0455F); box-shadow: 0 6px 18px -10px rgba(240, 69, 95, .6); }
.mp-type strong { display: block; font-size: 1.15rem; line-height: 1.1; }
.mp-type small { display: block; color: var(--text-2, #6B7280); font-size: .8rem; }
.mp-type-code { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; font-size: 1rem; }
.mp-type-add { border-style: dashed; color: var(--text-2, #6B7280); padding-left: 16px; }
.mp-type-add i { font-size: 1.1rem; }
.mp-phone { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mp-act { width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%; text-decoration: none; font-size: .9rem; transition: transform .15s; }
.mp-act:hover { transform: scale(1.1); }
.mp-call { background: #E6EEFB; color: #1D4ED8; }
.mp-wa { background: #DDF6E6; color: #128C3F; }
.mp-note { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-type-row { display: grid; grid-template-columns: auto 1fr 80px 110px auto auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.mp-code-input { text-transform: uppercase; }
.mp-follow-list { max-height: 420px; overflow-y: auto; }
.mp-follow { padding: 10px 0; border-bottom: 1px solid var(--border); }
.mp-follow:last-child { border-bottom: 0; padding-bottom: 0; }
.mp-follow:first-child { padding-top: 0; }
.mp-sample td, .mp-sample th { font-size: .8rem; padding: 4px 6px; }
.mp-staff { min-width: 160px; }
.mp-bar { height: 7px; border-radius: 7px; background: #EEF0F5; overflow: hidden; margin-top: 5px; }
.mp-bar i { display: block; height: 100%; border-radius: 7px; }
.mp-bar-green { background: #22C55E; } .mp-bar-yellow { background: #F59E0B; } .mp-bar-red { background: #EF4444; } .mp-bar-blue { background: #3B82F6; } .mp-bar-gray { background: #9CA3AF; }
.mp-date { width: 46px; text-align: center; border-radius: 10px; background: #F6F7FB; padding: 5px 0; line-height: 1.1; }
.mp-date strong { display: block; font-size: 1.15rem; }
.mp-date small { font-size: .7rem; text-transform: uppercase; color: var(--text-2, #6B7280); }
.mp-month { display: flex; gap: 4px; }
.mp-month input { width: 170px; }
.mp-money { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; }
.mp-money dt { font-weight: 500; }
.mp-money dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mp-money .mp-total { border-top: 1px solid var(--border); padding-top: 6px; font-weight: 700; }
/* Month board (like a spreadsheet: days across, jobs down) */
.mp-board-card { overflow-x: auto; }
.mp-board { --label: 220px; min-width: calc(var(--label) + var(--days) * 27px); }
.mp-board-head, .mp-board-row { display: grid; grid-template-columns: var(--label) repeat(var(--days), minmax(26px, 1fr)); align-items: stretch; position: relative; }
.mp-board-head { position: sticky; top: 0; background: #fff; z-index: 2; border-bottom: 1px solid var(--border); }
.mp-board-label { position: sticky; left: 0; background: #fff; z-index: 1; padding: 10px 14px; border-right: 1px solid var(--border); min-width: 0; font-size: .9rem; grid-row: 1; grid-column: 1; }
.mp-board-label small { display: block; color: var(--text-2, #6B7280); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mp-board-label a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; }
.mp-day { text-align: center; font-weight: 700; font-size: .82rem; padding: 6px 0; line-height: 1.1; }
.mp-day small { display: block; font-weight: 500; font-size: .66rem; color: var(--text-2, #6B7280); }
.mp-day.we, .mp-cell.we { background: #F8F9FC; }
.mp-day.today { color: #fff; background: var(--thrd-coral, #F0455F); border-radius: 8px; }
.mp-board-row { border-bottom: 1px solid var(--border); min-height: 66px; }
.mp-board-label small i { font-size: .72rem; }
.mp-board-workers { color: #1D4ED8 !important; }
.mp-cell { grid-row: 1; border-right: 1px dashed #EEF0F5; }
.mp-span { grid-row: 1; align-self: center; margin: 0 2px; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 10px; border-radius: 9px; font-size: .78rem; font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden; min-width: 0; color: #3b2a00; background: #FDE68A; }
.mp-span span { overflow: hidden; text-overflow: ellipsis; }
.mp-span-short { justify-content: center; padding: 7px 4px; }
.mp-span-short span { display: none; }
.mp-span b { flex: none; background: rgba(255, 255, 255, .55); border-radius: 6px; padding: 1px 6px; }
.mp-span-filled { background: #BBF7D0; color: #14532D; }
.mp-span-partial { background: #FDE68A; color: #713F12; }
.mp-span-none { background: #FECACA; color: #7F1D1D; }
.mp-span-completed { background: #BFDBFE; color: #1E3A8A; }
.mp-span-cancelled { background: #E5E7EB; color: #4B5563; text-decoration: line-through; }
.mp-key { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }
@media (max-width: 768px) {
  .mp-type-row { grid-template-columns: auto 1fr 70px; }
  .mp-type-row select, .mp-type-row .form-check, .mp-type-row .btn { grid-column: span 1; }
  .mp-table td { white-space: normal; }
  .mp-board { --label: 140px; }
}

.mp-bankbox { display: flex; align-items: flex-start; gap: 4px; padding: 12px 14px; border-radius: 12px; background: #F6F7FB; border: 1px dashed var(--border); }
.mp-bankbox > i { font-size: 1.3rem; color: var(--thrd-navy); }

/* Invoice promoters */
.promoter-head, .promoter-row { display: grid; grid-template-columns: 1fr 180px 44px; gap: 8px; align-items: center; }
.promoter-head { font-size: .8rem; font-weight: 600; color: var(--text-2, #6B7280); margin-bottom: 6px; }
.promoter-row { margin-bottom: 8px; }
.promoter-totals { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 10px 14px; border-radius: 10px; background: #F6F7FB; }
@media (max-width: 576px) { .promoter-row { grid-template-columns: 1fr 110px 40px; } }

/* Repeating events */
.repeat-date-row { display: grid; grid-template-columns: 1fr 130px 130px 44px; gap: 8px; margin-bottom: 8px; align-items: center; }
.repeat-date-row:has(.repeat-time[hidden]) { grid-template-columns: 1fr 44px; }
.repeat-day { min-width: 52px; }
@media (max-width: 576px) { .repeat-date-row { grid-template-columns: 1fr 1fr; } }

/* Agenda (phone-friendly list) */
.agenda-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.agenda-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin-bottom: 18px; }
.agenda-day { margin-bottom: 18px; }
.agenda-date { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.agenda-date strong { display: block; line-height: 1.1; }
.agenda-date small { color: var(--text-2, #6B7280); }
.agenda-dnum { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #EEF0F5; font-weight: 800; font-size: 1.1rem; color: var(--thrd-navy); }
.agenda-day.is-today .agenda-dnum { background: var(--thrd-gradient); color: #fff; }
.agenda-count { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--text-2, #6B7280); background: #EEF0F5; border-radius: 999px; padding: 2px 9px; }
.agenda-list { overflow: hidden; }
.agenda-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; min-height: 60px; }
.agenda-item:first-child { border-top: 0; }
.agenda-item:hover { background: #F8F9FC; }
.agenda-bar { flex: 0 0 4px; align-self: stretch; border-radius: 4px; }
.agenda-time { flex: 0 0 78px; font-size: .8rem; font-weight: 700; color: var(--thrd-navy); line-height: 1.2; }
.agenda-title { display: block; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.agenda-meta { display: block; font-size: .78rem; color: var(--text-2, #6B7280); overflow-wrap: anywhere; }
@media (max-width: 575.98px) { .agenda-time { flex-basis: 64px; font-size: .74rem; } .agenda-filters .seg { flex: 1; } .agenda-filters .seg a { flex: 1; text-align: center; } }

/* =====================================================================
   Phones: app-like layout
   ===================================================================== */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(12px); border-top: 1px solid var(--border); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px -14px rgba(15,28,68,.35); }
.bottom-nav a, .bottom-nav button { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 52px; border: 0; background: none; color: #7C869E; font-size: .68rem; font-weight: 600; text-decoration: none; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.bottom-nav i { font-size: 1.3rem; line-height: 1; }
.bottom-nav .active { color: var(--thrd-coral); }
.bottom-nav .active::before { content: ""; position: absolute; top: -4px; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--thrd-gradient); }
.bottom-nav a:active, .bottom-nav button:active { background: #F4F6FB; }
.bn-dot { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--thrd-coral); color: #fff; font-size: .62rem; line-height: 18px; text-align: center; }

@media (max-width: 991.98px) {
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sticky-actions { bottom: calc(60px + env(safe-area-inset-bottom)); }
}

@media (max-width: 767.98px) {
  /* No zoom-in on iPhone when tapping a field; comfortable touch targets */
  .form-control, .form-select, .ts-control, .ts-control input { font-size: 16px !important; }
  .form-control, .form-select { min-height: 44px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .content { padding: 1rem .85rem; }
  .topbar { padding: .5rem .85rem; }

  /* Page header: title first, actions in one swipeable row */
  .page-header { margin-bottom: 1rem; gap: .6rem; }
  .page-header h1 { font-size: 1.3rem; line-height: 1.25; }
  .page-header .subtitle { font-size: .84rem; }
  .page-header > .d-flex { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -.85rem; padding: 2px .85rem 4px; width: calc(100% + 1.7rem) !important; }
  .page-header > .d-flex::-webkit-scrollbar { display: none; }
  .page-header > .d-flex > * { flex: 0 0 auto; }
  .page-header > .d-flex .btn { white-space: nowrap; }
  .page-header > .d-flex > .btn-brand, .page-header > .d-flex > form:has(> .btn-brand) { order: -1; }
  .page-header > .d-flex form.d-flex { flex-wrap: nowrap !important; }

  /* Summary cards: compact, labels never split mid-word */
  .kpi { padding: .8rem .85rem !important; gap: .65rem !important; }
  .kpi .ico { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
  .kpi .label { font-size: .72rem; line-height: 1.25; overflow-wrap: normal; word-break: normal; hyphens: none; }
  .kpi .value { font-size: 1.12rem; overflow-wrap: anywhere; }
  .kpi .sub { font-size: .7rem; }

  /* Cards */
  .card-header { flex-wrap: wrap; padding: .8rem 1rem; }
  .card-body { padding: 1rem; }
  .list-row { padding: .75rem 1rem; }
  .list-row .truncate { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

  /* Tabs and segmented buttons scroll sideways instead of being cut */
  .nav-tabs, .nav-pills, .seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav-tabs::-webkit-scrollbar, .nav-pills::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .nav-tabs .nav-link, .nav-pills .nav-link, .seg a { white-space: nowrap; }

  /* Filters: two per row, search full width */
  .filters { gap: .5rem !important; }
  .filters .search-input, .filters input[type="search"] { flex: 1 1 100% !important; }
  .filters .seg { margin-left: 0 !important; }

  /* Lists: every row becomes a card with "Label  value" lines */
  .table-responsive:has(> table.m-cards) { overflow: visible; }
  table.m-cards { margin-bottom: 0; }
  table.m-cards thead { display: none; }
  table.m-cards, table.m-cards tbody, table.m-cards tr, table.m-cards td { display: block; width: 100% !important; }
  table.m-cards tr { position: relative; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
  table.m-cards tr:last-child { border-bottom: 0; }
  table.m-cards td { border: 0 !important; padding: .18rem 0 !important; white-space: normal !important; min-width: 0 !important; max-width: none !important; }
  table.m-cards td[data-label] { display: flex; align-items: flex-start; justify-content: space-between; gap: .9rem; }
  table.m-cards td[data-label]::before { content: attr(data-label); flex: 0 0 auto; max-width: 42%; font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: #8490A3; padding-top: .2rem; }
  table.m-cards td > .m-val { flex: 1 1 auto; min-width: 0; text-align: right; overflow-wrap: anywhere; }
  table.m-cards td > .m-val .d-flex { justify-content: flex-end; }
  table.m-cards td:first-child { display: block; font-size: .95rem; padding-bottom: .45rem !important; }
  table.m-cards td:first-child::before { display: none; }
  table.m-cards td.m-nolabel { display: block; text-align: left !important; padding-top: .5rem !important; }
  table.m-cards td.m-nolabel:empty, table.m-cards td[data-label]:has(> .m-val:empty) { display: none !important; }
  table.m-cards tr.m-full td { text-align: center !important; }
  table.m-cards td.m-empty { display: none !important; }
  table.m-cards tr.is-late { box-shadow: inset 4px 0 0 #DC2626; }
  table.m-cards tr.is-late td { box-shadow: none !important; }

  /* Invoice / quotation document preview fits the phone */
  .doc-paper { padding: 1.1rem; }
  .doc-paper .doc-title { font-size: 1.25rem; }
  .doc-items { font-size: .78rem; }
  .doc-items th, .doc-items td { padding: .45rem .3rem !important; white-space: normal !important; }
  .doc-items th { font-size: .62rem; letter-spacing: 0; }

  /* Long choices in drop-downs stay on one line */
  .form-select { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 2rem; }

  /* Agenda: each switch gets its own full row */
  .agenda-filters .seg { flex: 1 1 100%; }
  table.m-cards .text-end, table.m-cards .text-nowrap { white-space: normal !important; }
  table.m-cards input.form-control, table.m-cards select.form-select { max-width: 160px; margin-left: auto; }

  /* Calendar toolbar: title on its own line, buttons below */
  .fc .fc-header-toolbar { flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem !important; }
  .fc .fc-toolbar-chunk:nth-child(2) { order: -1; flex: 1 1 100%; }
  .fc .fc-toolbar-title { font-size: 1.05rem !important; white-space: nowrap; }
  .fc .fc-toolbar-chunk:nth-child(3) { flex: 1 1 auto; display: flex; justify-content: flex-end; overflow-x: auto; scrollbar-width: none; }
  .fc .fc-toolbar-chunk:nth-child(3)::-webkit-scrollbar { display: none; }
  .fc .fc-toolbar-chunk:nth-child(1) { display: flex; gap: .25rem; align-items: center; }
  .fc .fc-toolbar-chunk:nth-child(1) > * { margin: 0 !important; }
  .fc .fc-button { padding: .4rem .6rem !important; font-size: .8rem !important; }
  .fc .fc-list-event-title, .fc .fc-list-event-time { font-size: .85rem; }

  /* Pop-up windows use the whole width */
  .modal-dialog { margin: .5rem; }
  .modal-content { border-radius: 16px; }
  .dropdown-menu { max-width: calc(100vw - 1.5rem); }
  .notif-menu { width: calc(100vw - 1.5rem) !important; }
}
/* Manpower money: wage type segments and income type choices */
.mp-seg { display: flex; background: var(--bs-tertiary-bg, #f1f3f8); border-radius: 10px; padding: 3px; gap: 2px; }
.mp-seg .btn { flex: 1; border: 0; border-radius: 8px; font-weight: 500; color: var(--bs-secondary-color, #667); white-space: nowrap; }
.mp-seg .btn-check:checked + .btn { background: #fff; color: var(--bs-body-color); box-shadow: 0 1px 3px rgba(20, 20, 50, .12); font-weight: 600; }
.mp-choice { display: grid; gap: 6px; }
.mp-choice-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border, #e3e6ef); border-radius: 10px; padding: 9px 12px; cursor: pointer; margin: 0; }
.mp-choice-item .form-check-input { margin-top: 3px; flex: none; }
.mp-choice-item strong { display: block; font-size: .9rem; }
.mp-choice-item small { display: block; color: var(--bs-secondary-color, #778); font-size: .78rem; line-height: 1.3; }
.mp-choice-item:has(:checked) { border-color: #f97316; background: rgba(249, 115, 22, .05); }
.mp-example { font-size: .82rem; background: var(--bs-tertiary-bg, #f6f7fb); border-radius: 8px; padding: 8px 10px; }
.mp-example:empty { display: none; }
.mp-units { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.mp-units .form-control { width: 70px; }
.mp-rate .form-control { width: 90px; }
.mp-num { width: 104px; min-width: 90px; }
.mp-month input::placeholder { color: var(--bs-body-color); opacity: 1; }
@media (max-width: 767.98px) { .mp-month { width: 100%; } .mp-month input { flex: 1; width: auto; min-width: 0; } }
/* Content: add many posts */
.bulk-row .card-header { display: flex; justify-content: space-between; align-items: center; }
.bulk-row-error { border-color: #dc3545 !important; box-shadow: 0 0 0 3px rgba(220, 53, 69, .15); }
@media (min-width: 992px) { .bulk-shared { position: sticky; top: 84px; } }
/* Image / video previews in a files card */
.att-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.att-tile { margin: 0; min-width: 0; }
.att-tile a, .att-tile video { display: block; border-radius: 10px; overflow: hidden; background: #EEF1F8; aspect-ratio: 1 / 1; width: 100%; }
.att-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.att-tile a:hover img { transform: scale(1.03); }
.att-tile video { object-fit: contain; background: #0F1C44; }
.att-tile figcaption { font-size: .75rem; color: var(--bs-secondary-color, #667); margin-top: 4px; }
.att-lightbox::backdrop { background: rgba(10, 14, 30, .85); }
@media (max-width: 767.98px) { .att-gallery { grid-template-columns: repeat(2, 1fr); padding: 12px; } }
/* Large previews for chosen files (before upload) */
.att-gallery-picker { padding: 0; border: 0; margin-top: 6px; }
.file-picker-gallery { display: block; }
.file-picker-frame { position: relative; border-radius: 10px; overflow: hidden; background: #EEF1F8; aspect-ratio: 1 / 1; }
.file-picker-frame img, .file-picker-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-picker-frame video { object-fit: contain; background: #0F1C44; }
.file-picker-frame > span, .att-tile .att-file { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 2rem; color: var(--text-2); }
.file-picker-remove { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(15, 28, 68, .75); color: #fff; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.file-picker-remove:hover { background: #DC2626; }
.file-picker-tile.is-invalid .file-picker-frame { outline: 2px solid #DC2626; }
.file-picker-list:empty { display: none; }
/* Delete / lock button on picture tiles */
.att-tile .file-picker-frame > a, .att-tile .file-picker-frame > video { border-radius: 0; aspect-ratio: auto; height: 100%; }
.att-tile .file-picker-frame form { margin: 0; }
.file-picker-remove { z-index: 2; cursor: pointer; }
.file-picker-lock { cursor: help; background: rgba(15, 28, 68, .55); }
.file-picker-lock:hover { background: rgba(15, 28, 68, .55); }
/* Live links of published content (one per platform) */
.live-links { display: inline-flex; flex-wrap: wrap; gap: 6px; position: relative; z-index: 2; }
.live-link { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: .76rem; font-weight: 600; text-decoration: none;
    color: var(--pc); background: color-mix(in srgb, var(--pc) 10%, #fff); border: 1px solid color-mix(in srgb, var(--pc) 35%, #fff); line-height: 1.4; }
.live-link:hover { background: var(--pc); color: #fff; }
.live-link .live-link-out { font-size: .65rem; opacity: .75; }
.live-box { border: 1px solid #BBF7D0; background: #F0FDF4; border-radius: 12px; padding: 12px 14px; }
.live-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed #BBF7D0; min-width: 0; }
.live-row:first-of-type { border-top: 0; }
.live-row-name { font-weight: 600; font-size: .85rem; width: 110px; flex: none; }
.live-row a { min-width: 0; font-size: .85rem; }
.live-link-label { min-width: 150px; font-size: .85rem; }
@media (max-width: 575.98px) { .live-row-name { width: auto; } .live-link-label { min-width: 0; } }
.list-row .stretched-link::after { z-index: 1; }
div.list-row.position-relative:hover { background: #F7F8FC; }
/* Picture viewer (zoom + next / previous) */
.att-lightbox { border: 0; padding: 0; background: transparent; width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; overflow: hidden; }
.att-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.att-lightbox .lb-stage { margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 56px 72px 20px; }
.att-lightbox .lb-stage img { max-width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.att-lightbox figcaption { color: #fff; font-size: .85rem; margin-top: 10px; text-align: center; opacity: .9; max-width: 90vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-lightbox .lb-count { opacity: .7; margin-left: 6px; }
.lb-btn { position: fixed; z-index: 3; width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.25rem; display: flex; align-items: center; justify-content: center; }
.lb-btn:hover { background: rgba(255,255,255,.28); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.att-lightbox.lb-single .lb-prev, .att-lightbox.lb-single .lb-next { display: none; }
@media (max-width: 575.98px) { .att-lightbox .lb-stage { padding: 56px 8px 16px; } .lb-prev, .lb-next { top: auto; bottom: 18px; transform: none; } .lb-prev { left: 30%; } .lb-next { right: 30%; } .att-lightbox .lb-stage img { max-height: calc(100vh - 150px); } }
/* "How many posts?" counter */
.post-count { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 5px 6px 5px 12px; }
.post-count-label { font-size: .85rem; font-weight: 600; white-space: nowrap; }
.post-count input { width: 56px; text-align: center; font-weight: 700; -moz-appearance: textfield; }
.post-count input::-webkit-outer-spin-button, .post-count input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
/* Tick several posts and act on them together */
.bulk-pick { position: relative; z-index: 2; flex: none; width: 1.15em; height: 1.15em; margin: 0; cursor: pointer; }
.bulk-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 20px; z-index: 1040; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
    background: var(--thrd-navy, #0F1C44); color: #fff; padding: 8px 10px 8px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(15, 28, 68, .3); max-width: calc(100vw - 24px); }
.bulk-bar .btn-light { background: rgba(255,255,255,.12); border: 0; color: #fff; }
@media (max-width: 991.98px) { .bulk-bar { bottom: 76px; } }
/* What is holding a post up (content list) */
.blocker { display: inline-block; margin-top: 3px; font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blocker-orange { background: #FFF4E5; color: #B45309; }
.blocker-purple { background: #F3EEFB; color: #6D28D9; }
.blocker-red { background: #FDECEE; color: #C81E3A; }
.blocker-blue { background: #EAF1FE; color: #1D4ED8; }
.blocker-green { background: #E9F8EF; color: #15803D; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; background: #EEF1F8; border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .85rem; font-weight: 600; }
.filter-chip a { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; color: inherit; background: #fff; font-size: .7rem; }
.plan-table { width: 100%; font-size: .85rem; }
.plan-table th, .plan-table td { padding: 5px 4px; vertical-align: top; }
.plan-table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.plan-table tbody th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.history-reason { border-left: 3px solid #DC2626; }
/* Calendar entries for posts: platform icons + status colour bar */
.cal-post { display: flex; align-items: center; gap: 3px; min-width: 0; width: 100%; padding: 1px 4px 1px 3px; border-left: 3px solid var(--c); border-radius: 4px; background: color-mix(in srgb, var(--c) 12%, #fff); color: #1F2937; font-size: .74rem; overflow: hidden; }
.cal-post .cal-pf { flex: none; width: 15px; height: 15px; border-radius: 4px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .58rem; }
.cal-post .cal-time { flex: none; font-weight: 600; margin-left: 2px; }
.cal-post .cal-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc .fc-daygrid-event:has(.cal-post), .fc .fc-timegrid-event:has(.cal-post) { background: transparent; border: 0; padding: 0; }
.fc .fc-timegrid-event .cal-post { height: 100%; align-items: flex-start; padding-top: 2px; }
.fc .fc-list-event .cal-post { background: transparent; border-left: 0; }
/* Followers & Growth */
.growth { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.growth small { font-weight: 500; opacity: .8; }
.growth-up { color: #15803D; }
.growth-down { color: #DC2626; }
.growth-flat { color: var(--muted); }
.sparkline { width: 90px; height: 30px; display: block; overflow: visible; }
.sparkline polyline { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.sparkline.up polyline { stroke: #16A34A; }
.sparkline.down polyline { stroke: #DC2626; }
/* Agenda (list) view on phones: let long post titles wrap instead of widening the page */
.fc .fc-list-event-time { width: 1%; white-space: nowrap; }
.fc .fc-list-event-graphic { width: 1%; }
.fc .fc-list-event-title { width: 98%; }
.fc .fc-list-event-title { white-space: normal; overflow-wrap: anywhere; text-align: left !important; }
.fc .fc-list-event-title .cal-post { justify-content: flex-start; }
.fc .fc-list-event .cal-post { flex-wrap: wrap; }
.fc .fc-list-event .cal-post .cal-title { white-space: normal; }
/* Content rows on phones: time, platforms and status on top, the post text full width underneath */
@media (max-width: 575.98px) {
  .content-row { flex-wrap: wrap; row-gap: .4rem; }
  .content-row > .flex-grow-1 { order: 10; flex: 1 1 100%; }
  .content-row > .avatar, .content-row > [class*="avatar"] { display: none; }
  .content-row > .badge-soft, .content-row > .status-badge, .content-row > span:last-of-type { margin-left: auto; }
  .content-row .truncate { -webkit-line-clamp: 3; }
}
