/* =========================================================
   RIEMS UI — matches the approved design mockups
   Navy sidebar · amber/brown accent · warm cream canvas
   ========================================================= */
:root {
  --accent: #b5651d;
  --accent-2: #c9812f;
  --accent-soft: #fbf1e6;
  --navy: #151d2e;
  --navy-2: #1d2740;
  --navy-text: #c6cbd6;
  --canvas: #f6f2ec;
  --card: #ffffff;
  --line: #eee6dc;
  --ink: #1f2937;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04), 0 2px 8px rgba(17, 24, 39, .04);
  --sidebar-w: 222px;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-size: .875rem;
  --bs-body-color: var(--ink);
  --bs-link-color: #1d4ed8;
  --bs-link-color-rgb: 29, 78, 216;
  --bs-border-color: #e7e0d7;
}
body { background: var(--canvas); color: var(--ink); font-size: .875rem; }
a { text-decoration: none; }
.text-accent { color: var(--accent) !important; }
.bg-accent { background: var(--accent) !important; }
.fw-semibold { font-weight: 600; }
.small-xs { font-size: .72rem; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); background: linear-gradient(180deg, var(--navy) 0%, #111827 100%); color: var(--navy-text); position: fixed; inset: 0 auto 0 0; overflow-y: auto; z-index: 1040; scrollbar-width: thin; scrollbar-color: #334155 transparent; transition: transform .2s; }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.content { padding: 20px 24px 90px; }

.brand { display: flex; align-items: center; gap: 12px; padding: 18px 16px 14px; color: #fff; }
.brand-logo { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, #d08a3c, var(--accent)); display: grid; place-items: center; font-weight: 800; font-size: 22px; color: #1b1308; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.brand-logo-img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; background: #fff; }
.brand-text { line-height: 1.15; }
.brand-text b { font-size: 1.25rem; letter-spacing: .5px; }
.brand-text small { font-size: .65rem; color: #9aa3b5; margin-left: 2px; }
.brand-text em { display: block; font-style: normal; font-size: .62rem; color: #9aa3b5; margin-top: 3px; }

.side-nav { padding: 4px 10px 30px; }
.nav-section { font-size: .66rem; letter-spacing: 1.2px; color: #7d879b; padding: 16px 10px 6px; font-weight: 600; }
.nav-link-main { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; color: var(--navy-text); font-weight: 500; position: relative; }
.nav-link-main i:first-child { font-size: 1.05rem; width: 20px; text-align: center; }
.nav-link-main:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link-main .caret { margin-left: auto; font-size: .7rem; transition: transform .2s; }
.nav-item.active > .nav-link-main { background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%); color: #fff; box-shadow: 0 2px 8px rgba(181,101,29,.35); }
.nav-item.open > .nav-link-main .caret { transform: rotate(180deg); }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; border-radius: 999px; font-size: .68rem; padding: 1px 7px; font-weight: 700; }
.sub-nav { display: none; padding: 4px 0 6px 18px; border-left: 1px solid #2b3550; margin-left: 20px; }
.nav-item.open .sub-nav { display: block; }
.sub-nav a { display: flex; align-items: center; gap: 6px; padding: 6px 10px; color: #aab2c3; font-size: .82rem; border-radius: 6px; }
.sub-nav a:hover { color: #fff; background: rgba(255,255,255,.04); }
.sub-nav a.current { color: #f3b26b; background: rgba(255,255,255,.06); }

.topbar { display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: var(--canvas); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1020; }
.page-head { min-width: 0; }
.page-head h1 { font-size: 1.55rem; font-weight: 700; margin: 0; color: #111827; letter-spacing: -.3px; font-family: Georgia, "Times New Roman", serif; }
.crumbs, .subtitle { color: var(--muted); font-size: .85rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--accent); }
.crumbs i { font-size: .6rem; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-icon { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line); color: #374151; padding: 0; }
.btn-icon:hover { background: var(--accent-soft); color: var(--accent); }
.dot-badge { position: absolute; top: -5px; right: -5px; background: #ef4444; color: #fff; font-size: .62rem; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; font-weight: 700; padding: 0 4px; }
.user-chip { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 4px 6px; border-radius: 10px; }
.user-chip b { display: block; font-size: .85rem; } .user-chip small { color: var(--muted); font-size: .72rem; }
.avatar { border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; object-fit: cover; flex-shrink: 0; }

.gsearch { position: relative; width: 320px; }
.gsearch > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.gsearch input { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px 9px 36px; font-size: .84rem; outline: none; }
.gsearch input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,101,29,.12); }
.gsearch-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); max-height: 70vh; overflow-y: auto; display: none; z-index: 1100; min-width: 380px; }
.gsearch-results.show { display: block; }
.gs-group { font-size: .68rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); padding: 8px 12px 4px; background: #faf7f3; }
.gs-item { display: flex; gap: 10px; padding: 8px 12px; color: var(--ink); align-items: center; }
.gs-item:hover, .gs-item.active { background: var(--accent-soft); }
.gs-item i { color: var(--accent); }
.gs-item small { color: var(--muted); display: block; }

.notif-drop { width: 360px; max-height: 480px; overflow-y: auto; }
.notif-drop .n-item { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid #f3efe9; color: var(--ink); }
.notif-drop .n-item.unread { background: #fffaf3; }
.notif-drop .n-item:hover { background: var(--accent-soft); }

/* ---------------- cards ---------------- */
.card-x { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-x-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px 0; flex-wrap: wrap; }
.card-x-head h3 { font-size: 1.02rem; font-weight: 700; margin: 0; display: flex; align-items: center; }
.card-x-tools { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-x-body { padding: 14px 18px 18px; }
.card-x.tinted-blue > .card-x-head { background: #eaf2fe; margin: 0; padding: 12px 18px; border-radius: var(--radius) var(--radius) 0 0; }
.card-x.flush .card-x-body { padding: 0; }
.section-title { font-weight: 700; font-size: 1rem; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-title i { color: var(--accent); font-size: 1.2rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { display: flex; gap: 12px; align-items: center; padding: 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--c) 7%, #fff); border: 1px solid color-mix(in srgb, var(--c) 18%, #fff); color: var(--ink); box-shadow: var(--shadow); transition: transform .12s; min-width: 0; }
a.stat-card:hover { transform: translateY(-2px); color: var(--ink); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, #fff); color: var(--c); display: grid; place-items: center; font-size: 1.45rem; flex-shrink: 0; }
.stat-body { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: .78rem; color: #4b5563; font-weight: 500; }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1.15; color: #111827; }
.stat-sub { font-size: .72rem; color: #16a34a; }
.stat-sub.down { color: #dc2626; }

/* ---------------- badges ---------------- */
.badge-soft { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge-soft-success { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.badge-soft-warning { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.badge-soft-orange { background: #ffedd5; color: #c2410c; border-color: #fed7aa; }
.badge-soft-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.badge-soft-primary { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.badge-soft-info { background: #e0f2fe; color: #0369a1; border-color: #bae6fd; }
.badge-soft-purple { background: #f3e8ff; color: #7e22ce; border-color: #e9d5ff; }
.badge-soft-secondary { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge-md { display: inline-block; padding: 2px 9px; border-radius: 6px; font-size: .74rem; font-weight: 600; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); border: 1px solid color-mix(in srgb, var(--c) 25%, #fff); white-space: nowrap; }
.badge-solid { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: .74rem; font-weight: 600; color: #fff; background: var(--c, #6b7280); }
.prio { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.prio i { font-size: .6rem; }
.tag-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #eef2ff; color: #3730a3; font-size: .72rem; margin: 1px; border: 1px solid #e0e7ff; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .78rem; color: #334155; }
.old-ticket { display: inline-block; font-family: ui-monospace, monospace; font-size: .78rem; padding: 2px 8px; border-radius: 6px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; font-weight: 600; }
.highlight-box { border: 2px solid #ef4444; border-radius: 10px; padding: 10px 12px; background: #fff; }

/* ---------------- tables ---------------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > thead th { font-size: .76rem; color: #374151; font-weight: 700; background: #faf7f3; border-bottom: 1px solid var(--line); white-space: nowrap; padding: 10px 10px; }
.table > tbody td { padding: 10px; border-color: #f3eee7; vertical-align: middle; }
.table-hover > tbody > tr:hover > * { background: #fffaf3; }
.table .row-accent { border-left: 3px solid var(--c, transparent); }
a.sort { color: inherit; }
.btn-xs { padding: 2px 7px; font-size: .75rem; border-radius: 6px; }
.act-btns .btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.page-link { color: #374151; border-color: var(--line); }
.active > .page-link, .page-link.active { background: var(--accent); border-color: var(--accent); }

/* ---------------- forms ---------------- */
.form-label { font-weight: 600; font-size: .8rem; color: #374151; margin-bottom: 4px; }
.form-control, .form-select { border-color: #e2dbd2; border-radius: 8px; font-size: .86rem; padding: .45rem .7rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,101,29,.12); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.btn { border-radius: 8px; font-weight: 600; font-size: .86rem; }
.btn-accent { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border: 0; }
.btn-accent:hover, .btn-accent:focus { background: #9c5416; color: #fff; }
.btn-outline-accent { border: 1px solid var(--accent); color: var(--accent); background: #fff; }
.btn-outline-accent:hover { background: var(--accent); color: #fff; }
.btn-light { background: #fff; border: 1px solid var(--line); }
.btn-soft-green { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.btn-soft-blue { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.btn-soft-purple { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.form-footer { position: sticky; bottom: 0; background: rgba(246,242,236,.96); backdrop-filter: blur(4px); border-top: 1px solid var(--line); padding: 12px 24px; margin: 0 -24px -90px; display: flex; gap: 10px; align-items: center; z-index: 10; }
.form-footer .ms-auto { display: flex; gap: 8px; }
.photo-upload { border: 2px dashed #d6ccc0; border-radius: 12px; background: #faf7f3; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; color: var(--muted); font-size: .78rem; padding: 12px; min-height: 150px; position: relative; overflow: hidden; }
.photo-upload i { font-size: 2rem; color: #6b7280; }
.photo-upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone { border: 2px dashed #cfd8e3; border-radius: 12px; background: #f8fbff; padding: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: #4b5563; width: 100%; }
.dropzone i { font-size: 2rem; color: #3b82f6; }
.dropzone small { color: var(--muted); }
.dropzone.drag { background: #eff6ff; border-color: #3b82f6; }
.dup-box { border-radius: 10px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; }
.dup-box.ok { background: #fff7e6; border: 1px solid #fde7c0; }
.dup-box.warn { background: #fef2f2; border: 1px solid #fecaca; }
.dup-box .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.rich-toolbar { display: flex; gap: 2px; border: 1px solid #e2dbd2; border-bottom: 0; border-radius: 8px 8px 0 0; padding: 4px; background: #fbf9f6; }
.rich-toolbar button { border: 0; background: transparent; width: 30px; height: 28px; border-radius: 6px; }
.rich-toolbar button:hover { background: #eee6dc; }
.rich-area { border-radius: 0 0 8px 8px !important; overflow-y: auto; max-height: 360px; }
.rich-area:empty:before { content: attr(data-placeholder); color: #9ca3af; }
.ts-wrapper.form-select, .ts-wrapper.form-control { padding: 0; border: 0; }
.ts-control { border-radius: 8px !important; border-color: #e2dbd2 !important; min-height: 36px; font-size: .86rem; }
.ts-wrapper.multi .ts-control > div { background: var(--accent-soft); border-radius: 6px; color: #7c3d0b; }
.ts-dropdown { font-size: .86rem; z-index: 1060; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); color: var(--c); background: color-mix(in srgb, var(--c) 6%, #fff); font-size: .8rem; font-weight: 600; }
.chip.active { background: color-mix(in srgb, var(--c) 16%, #fff); box-shadow: inset 0 0 0 1px var(--c); }
.chip b { font-weight: 600; }
.nav-tabs-x { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; }
.nav-tabs-x a { padding: 10px 14px; color: #4b5563; font-weight: 600; white-space: nowrap; border-bottom: 2px solid transparent; font-size: .85rem; }
.nav-tabs-x a.active { color: var(--accent); border-bottom-color: var(--accent); }
.nav-tabs-x a .count { font-size: .7rem; background: #f1ebe3; border-radius: 999px; padding: 1px 7px; margin-left: 4px; color: #6b4a2b; }

/* ---------------- 360 header ---------------- */
.hero { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.hero-title { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.3px; }
.hero-logo { width: 64px; height: 64px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.8rem; color: var(--accent); flex-shrink: 0; overflow: hidden; }
.hero-logo img { width: 100%; height: 100%; object-fit: contain; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.metric { background: #faf7f3; border: 1px solid #f0e8de; border-radius: 10px; padding: 9px 12px; }
.metric > span { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.metric b { font-size: 1.02rem; }
.metric.warn { background: #fef2f2; border-color: #fecaca; } .metric.warn b { color: #b91c1c; }
.metric.good b { color: #15803d; }
.contact-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; height: 100%; }
.contact-card .name { font-weight: 700; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: .84rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }

/* ---------------- timeline ---------------- */
.tl { list-style: none; padding: 0; margin: 0; position: relative; }
.tl:before { content: ""; position: absolute; left: 17px; top: 4px; bottom: 4px; width: 2px; background: #efe7dd; }
.tl li { display: flex; gap: 12px; padding: 8px 0; position: relative; }
.tl-dot { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); display: grid; place-items: center; flex-shrink: 0; z-index: 1; border: 2px solid #fff; box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, #fff); }
.tl-body { flex: 1; min-width: 0; background: #fcfaf7; border: 1px solid #f2ebe2; border-radius: 10px; padding: 8px 12px; }
.vtl { list-style: none; padding: 0; margin: 0; }
.vtl li { display: grid; grid-template-columns: 90px 24px 1fr; gap: 8px; padding-bottom: 14px; position: relative; }
.vtl li:before { content: ""; position: absolute; left: 101px; top: 22px; bottom: 0; width: 2px; background: #e5e7eb; }
.vtl li:last-child:before { display: none; }
.vtl .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .7rem; z-index: 1; }

/* ---------------- misc widgets ---------------- */
.empty-state { text-align: center; padding: 28px 10px; color: var(--muted); }
.empty-state i { font-size: 2rem; color: #c9bfb2; display: block; margin-bottom: 6px; }
.empty-state p { margin: 0 0 8px; }
.list-x { list-style: none; padding: 0; margin: 0; }
.list-x li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #efe7dd; }
.list-x li:last-child { border-bottom: 0; }
.alert-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--ink); }
.alert-row .cnt { margin-left: auto; min-width: 26px; text-align: center; border-radius: 6px; font-weight: 700; font-size: .78rem; padding: 1px 6px; }
.sched { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f3eee7; align-items: start; }
.sched:last-child { border-bottom: 0; }
.legend-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .82rem; }
.legend-row .sw { width: 10px; height: 10px; border-radius: 50%; }
.legend-row .v { margin-left: auto; color: #374151; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 30px; align-items: center; gap: 8px; font-size: .82rem; padding: 4px 0; }
.bar-row .bar { height: 12px; border-radius: 3px; background: var(--c); }
.progress { height: 8px; border-radius: 999px; background: #eee7de; }
.progress-bar { background: var(--accent); }
.kpi-ring { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--v) * 1%), #efe7dd 0); position: relative; flex-shrink: 0; }
.kpi-ring:before { content: ""; position: absolute; inset: 12px; background: #fff; border-radius: 50%; }
.kpi-ring b { position: relative; font-size: 1.8rem; font-weight: 800; }
.kpi-ring small { position: absolute; bottom: 26px; font-size: .7rem; color: var(--muted); }
.why-row { display: flex; gap: 10px; padding: 7px 10px; border-radius: 8px; align-items: center; }
.why-row.pos { background: #f0fdf4; } .why-row.neg { background: #fef2f2; } .why-row.neu { background: #f8fafc; }
.why-row .pts { font-weight: 800; width: 56px; text-align: right; flex-shrink: 0; }
.why-row.pos .pts { color: #15803d; } .why-row.neg .pts { color: #b91c1c; }
.folder-tree a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; color: var(--ink); }
.folder-tree a:hover, .folder-tree a.active { background: #eef4ff; }
.folder-tree .bi-folder-fill { color: #f5b53f; }
.folder-tree .children { padding-left: 18px; }
.doc-preview { background: #f1f5f9; border-radius: 10px; min-height: 220px; display: grid; place-items: center; overflow: hidden; }
.doc-preview img, .doc-preview iframe { width: 100%; max-height: 420px; object-fit: contain; border: 0; }
.fab-quick { position: fixed; right: 22px; bottom: 22px; z-index: 1030; background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: #fff; border: 0; border-radius: 999px; padding: 12px 20px; font-weight: 700; box-shadow: 0 8px 20px rgba(181,101,29,.4); display: flex; gap: 8px; align-items: center; }
.fab-quick:hover { filter: brightness(1.05); }
.cal-legend .form-check { padding: 3px 0 3px 1.8em; }
.fc { --fc-border-color: #eee6dc; --fc-button-bg-color: #fff; --fc-button-text-color: #374151; --fc-button-border-color: #e2dbd2; --fc-button-active-bg-color: var(--accent); --fc-button-active-border-color: var(--accent); --fc-button-hover-bg-color: #faf3ea; --fc-button-hover-border-color: #e2dbd2; --fc-today-bg-color: #fff8ee; font-size: .8rem; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc-event { border-radius: 6px !important; padding: 1px 3px; border-width: 0 0 0 3px !important; }
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 700; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-side { background: linear-gradient(160deg, #151d2e, #0f172a 60%, #3b2410); color: #e5e7eb; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-form { display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 400px; }
.print-only { display: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 1399.98px) { .gsearch { width: 240px; } }
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar-backdrop.show { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 14px 12px 90px; }
  .topbar { padding: 10px 12px; gap: 8px; }
  .form-footer { margin: 0 -12px -90px; padding: 10px 12px; }
  .login-wrap { grid-template-columns: 1fr; } .login-side { display: none; }
}
@media (max-width: 767.98px) {
  .page-head h1 { font-size: 1.15rem; }
  .crumbs { display: none; }
  .gsearch { position: fixed; top: 58px; left: 8px; right: 8px; width: auto; display: none; z-index: 1100; }
  .gsearch.show { display: block; }
  .gsearch-results { min-width: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 12px; } .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; } .stat-value { font-size: 1.25rem; }
  .fab-quick span { display: none; } .fab-quick { padding: 16px; }
  .kv { grid-template-columns: 1fr; } .kv dt { margin-top: 6px; }
  .table-mobile-cards thead { display: none; }
  .table-mobile-cards tbody tr { display: block; border: 1px solid var(--line); border-radius: 10px; margin: 8px; padding: 6px; background: #fff; }
  .table-mobile-cards tbody td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 4px 6px; text-align: right; }
  .table-mobile-cards tbody td:before { content: attr(data-label); font-weight: 600; color: var(--muted); text-align: left; }
  .table-mobile-cards tbody td.no-label:before { content: none; }
  .notif-drop { width: 92vw; }
  .form-footer .ms-auto { width: 100%; justify-content: stretch; } .form-footer .ms-auto .btn { flex: 1; }
}
@media print {
  .sidebar, .topbar, .fab-quick, .form-footer, .btn, .pager { display: none !important; }
  .main { margin: 0; } .card-x { box-shadow: none; break-inside: avoid; }
}
.sched { grid-template-columns: 64px 1fr; }
.sched > .badge-soft { grid-column: 2; justify-self: start; }
.table td.nowrap, .nowrap { white-space: nowrap; }
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.form-footer ~ * .fab-quick, body:has(.form-footer) .fab-quick { bottom: 78px; }

.date-wrap { position: relative; }
.date-wrap > input[type=text] { padding-right: 30px; }
.date-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: #6b7280; padding: 0 2px; }
.date-native { position: absolute !important; right: 0; bottom: 0; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; padding: 0 !important; border: 0 !important; }
.table td, .table th { word-wrap: break-word; }

/* list-group active uses brand accent */
.list-group-item.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.list-group-item.active .opacity-75 { color: #fff; }
.accordion-button:not(.collapsed) { background: var(--accent-soft); color: var(--ink); box-shadow: none; }

/* dense data tables (list pages per design) */
.table-dense { font-size: .8rem; }
.table-dense > :not(caption) > * > * { padding: .45rem .4rem; }
.table-dense thead th { font-size: .74rem; white-space: nowrap; }
.table-dense .badge-soft { font-size: .7rem; padding: .18rem .45rem; }
.table-dense .act-btns .btn { padding: .15rem .35rem; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 220px; }
tr[data-sel] { cursor: pointer; }
tr.row-selected > td { background: var(--accent-soft) !important; }
.col-wide { display: none; }
@media (min-width: 1700px) { .col-wide { display: table-cell; } }
@media (min-width: 1200px) { .stat-grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; } .stat-grid-6 .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; } }
.user-chip b, .user-chip small { white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
/* dashboard KPI strip: 7 per row on wide screens, compact cards */
@media (min-width: 1300px) { .stat-grid-dash { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; } }
.stat-grid-dash .stat-card { padding: 12px; gap: 10px; }
.stat-grid-dash .stat-icon { width: 38px; height: 38px; font-size: 1.1rem; flex: 0 0 38px; }
.stat-grid-dash .stat-value { font-size: clamp(1.05rem, 1.25vw, 1.45rem); white-space: nowrap; }
.stat-grid-dash .stat-label, .stat-grid-dash .stat-sub { font-size: .72rem; line-height: 1.25; }
.stat-body { min-width: 0; }
/* compact schedule list */
.sched-compact { display: grid; grid-template-columns: 64px 1fr auto; gap: 8px; align-items: start; padding: 7px 0; border-bottom: 1px dashed var(--line); color: inherit; }
.sched-compact:last-child { border-bottom: 0; }
.sched-compact .t { font-size: .72rem; color: var(--muted); padding-top: 2px; }
.sched-compact .ttl { font-size: .8rem; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-compact .sub { font-size: .72rem; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-compact > span:nth-child(2) { min-width: 0; }
@media (max-width: 575.98px) {
  body:has(.form-footer) .fab-quick { display: none; }
  .form-footer { flex-wrap: wrap; gap: 6px; }
  .form-footer > label, .form-footer > .form-check { font-size: .8rem; width: 100%; }
  .form-footer .btn { padding: .45rem .6rem; font-size: .85rem; white-space: nowrap; }
  .form-footer .ms-auto { flex-wrap: nowrap; }
}
