/* BIMCAD Projects — Corporate grey + blue theme */
:root {
  --bim-blue: #1d4ed8;
  --bim-blue-600: #1e40af;
  --bim-blue-50: #eff4ff;
  --bim-blue-100: #dbe6ff;
  --bim-ink: #0f172a;
  --bim-ink-soft: #1e293b;
  --bim-muted: #64748b;
  --bim-muted-2: #94a3b8;
  --bim-line: #e5e9f0;
  --bim-line-soft: #eef1f6;
  --bim-bg: #f5f7fb;
  --bim-surface: #ffffff;
  --bim-success: #10b981;
  --bim-warning: #f59e0b;
  --bim-danger: #ef4444;
  --bim-info: #0ea5e9;
  --bim-shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.04);
  --bim-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --bim-shadow-lg: 0 10px 15px -3px rgba(15,23,42,.07), 0 20px 40px -10px rgba(15,23,42,.12);
  --bim-radius: .75rem;
  --bim-radius-sm: .5rem;
  --bim-radius-lg: 1rem;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 72px;
  --header-h: 64px;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bim-bg);
  color: var(--bim-ink);
  font-size: 14px;
  letter-spacing: -0.005em;
}
h1,h2,h3,h4,h5,h6 { color: var(--bim-ink); font-weight: 600; letter-spacing: -0.015em; }
a { color: var(--bim-blue); text-decoration: none; }
a:hover { color: var(--bim-blue-600); }

/* ===== Auth (login) ===== */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 991.98px) { .auth-shell { grid-template-columns: 1fr; } .auth-illustration { display: none; } }
.auth-illustration {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
  position: relative; overflow: hidden; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
.auth-illustration::before, .auth-illustration::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(40px); opacity: .35;
}
.auth-illustration::before { width: 420px; height: 420px; background: #60a5fa; top: -120px; right: -120px; }
.auth-illustration::after  { width: 360px; height: 360px; background: #1e40af; bottom: -140px; left: -100px; }
.auth-illustration .brand, .auth-illustration .quote, .auth-illustration .meta { position: relative; z-index: 1; }
.auth-illustration .quote h2 { color: #fff; font-size: 2rem; line-height: 1.25; max-width: 440px; }
.auth-illustration .quote p { color: rgba(255,255,255,.78); max-width: 460px; }
.auth-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px; background: #fff; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .form-control { padding: .7rem .9rem; }
.auth-card .form-control:focus { border-color: var(--bim-blue); box-shadow: 0 0 0 4px rgba(29,78,216,.12); }

/* ===== Brand mark ===== */
.brand-mark { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--bim-ink); }
.brand-mark .logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--bim-blue), #3b82f6);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px;
  box-shadow: 0 4px 10px rgba(29,78,216,.35);
}
.brand-mark .name { font-size: 1.05rem; letter-spacing: -0.01em; }
.brand-mark .name small { display: block; font-size: 10px; color: var(--bim-muted); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.auth-illustration .brand-mark { color: #fff; }
.auth-illustration .brand-mark .name small { color: rgba(255,255,255,.7); }
.brand-logo-icon { width: 38px; height: 38px; object-fit: contain; display: block; }
.brand-logo-text { width: 142px; height: auto; object-fit: contain; display: block; }
.brand-logo-all { width: min(420px, 68%); height: auto; object-fit: contain; display: block; }
.brand-logo-text-dark {
  width: min(320px, 100%);
  height: auto;
  object-fit: contain;
  display: block;
  filter: invert(1) brightness(0.18);
}
.auth-brand-all { margin-bottom: 8px; }
.auth-brand-text { width: 100%; justify-content: center; }

/* ===== App shell ===== */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) 1fr; transition: grid-template-columns .25s ease; }
.app-shell.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }
@media (max-width: 991.98px) { .app-shell { grid-template-columns: 0 1fr; } }

/* Sidebar */
.sidebar {
  background: #fff; border-right: 1px solid var(--bim-line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d6dde7; border-radius: 3px; }
.sidebar-header { padding: 18px 18px; border-bottom: 1px solid var(--bim-line-soft); display: flex; align-items: center; justify-content: space-between; }
/* Sidebar brand: 12% smaller than base .brand-logo-* (icon + wordmark) */
.sidebar .brand-mark { gap: calc(10px * 0.88); }
.sidebar .brand-logo-icon { width: calc(38px * 0.88); height: calc(38px * 0.88); }
.sidebar .brand-logo-text { width: calc(142px * 0.88); }
.sidebar-section { padding: 14px 12px 4px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--bim-muted-2); font-weight: 600; }
.sidebar .nav { padding: 4px 8px 16px; gap: 2px; }
.sidebar .nav-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  color: var(--bim-ink-soft); font-weight: 500; font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.sidebar .nav-link i { font-size: 17px; color: var(--bim-muted); width: 18px; text-align: center; }
.sidebar .nav-link:hover { background: var(--bim-blue-50); color: var(--bim-blue-600); }
.sidebar .nav-link:hover i { color: var(--bim-blue); }
.sidebar .nav-link.active { background: var(--bim-blue); color: #fff; box-shadow: 0 4px 12px rgba(29,78,216,.25); }
.sidebar .nav-link.active i { color: #fff; }
.sidebar .nav-link .badge { margin-left: auto; }
.sidebar-footer { margin-top: auto; padding: 14px; border-top: 1px solid var(--bim-line-soft); }

.app-shell.collapsed .sidebar .nav-link span,
.app-shell.collapsed .sidebar .sidebar-section,
.app-shell.collapsed .sidebar .brand-mark .name,
.app-shell.collapsed .sidebar .nav-link .badge { display: none; }
.app-shell.collapsed .sidebar .brand-logo-text { display: none; }
.app-shell.collapsed .sidebar .nav-link { justify-content: center; }
.app-shell.collapsed .sidebar-header { justify-content: center; }

/* Mobile drawer */
.sidebar-backdrop { display: none; }
@media (max-width: 991.98px) {
  .sidebar { position: fixed; top: 0; left: 0; width: 260px; transform: translateX(-100%); z-index: 1050; transition: transform .25s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 1040; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
}

/* Main */
.main { display: flex; flex-direction: column; min-width: 0; }

/* Header */
.app-header {
  position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--bim-line); height: var(--header-h);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
}
.app-header .search {
  flex: 1; max-width: 520px; position: relative;
}
.header-brand-mini {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  border: 1px solid var(--bim-line);
  background: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-right: 2px;
}
.header-brand-mini img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.app-header .search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px; border-radius: 9px;
  background: var(--bim-bg); border: 1px solid transparent; font-size: 13.5px;
}
.app-header .search input:focus { background: #fff; border-color: var(--bim-blue); box-shadow: 0 0 0 4px rgba(29,78,216,.10); outline: none; }
.app-header .search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--bim-muted); }
.app-header .header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--bim-line); background: #fff;
  display: inline-grid; place-items: center; color: var(--bim-ink-soft); position: relative;
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--bim-blue-50); color: var(--bim-blue); border-color: var(--bim-blue-100); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--bim-danger); border: 2px solid #fff; }

.profile-chip { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--bim-line); background: #fff; }
.profile-chip:hover { background: var(--bim-blue-50); }
.profile-chip .avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.profile-chip .role-tag { font-size: 11px; color: var(--bim-muted); }

.role-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--bim-blue-50); color: var(--bim-blue-600); border: 1px solid var(--bim-blue-100); }
.role-badge.admin { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.role-badge.employee { background: #dcfce7; color: #166534; border-color: #bbf7d0; }

.privacy-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--bim-line); background: #fff; font-size: 12.5px; color: var(--bim-ink-soft); cursor: pointer; }
.privacy-toggle.on { background: #fef3c7; border-color: #fcd34d; color: #92400e; }

/* Content */
.content { padding: 24px; max-width: 1600px; width: 100%; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.5rem; margin: 0; }
.page-header .crumb { font-size: 12.5px; color: var(--bim-muted); margin-bottom: 4px; }
.page-header .crumb a { color: var(--bim-muted); }

/* Cards */
.card { border: 1px solid var(--bim-line); border-radius: var(--bim-radius); box-shadow: var(--bim-shadow-sm); background: #fff; }
.card-header { background: #fff; border-bottom: 1px solid var(--bim-line-soft); padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header h5, .card-header .h5 { font-size: 15px; margin: 0; font-weight: 600; }
.card-body { padding: 18px; }

/* KPI cards */
.kpi { padding: 18px; border-radius: var(--bim-radius); background: #fff; border: 1px solid var(--bim-line); box-shadow: var(--bim-shadow-sm); position: relative; overflow: hidden; }
.kpi .label { font-size: 12px; color: var(--bim-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.kpi .value { font-size: 1.65rem; font-weight: 700; margin-top: 6px; letter-spacing: -0.02em; }
.kpi .delta { font-size: 12px; color: var(--bim-success); margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; }
.kpi .delta.down { color: var(--bim-danger); }
.kpi .icon { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--bim-blue-50); color: var(--bim-blue); font-size: 18px; }
.kpi.success .icon { background: #dcfce7; color: #15803d; }
.kpi.warning .icon { background: #fef3c7; color: #b45309; }
.kpi.danger .icon { background: #fee2e2; color: #b91c1c; }

/* Buttons */
.btn { font-weight: 500; border-radius: 8px; padding: .5rem 1rem; font-size: 13.5px; transition: all .15s ease; }
.btn-primary { background: var(--bim-blue); border-color: var(--bim-blue); }
.btn-primary:hover { background: var(--bim-blue-600); border-color: var(--bim-blue-600); }
.btn-soft { background: var(--bim-blue-50); color: var(--bim-blue-600); border: 1px solid var(--bim-blue-100); }
.btn-soft:hover { background: var(--bim-blue-100); color: var(--bim-blue-600); }
.btn-light-bordered { background: #fff; border: 1px solid var(--bim-line); color: var(--bim-ink-soft); }
.btn-light-bordered:hover { background: var(--bim-bg); }
.btn-icon { width: 32px; height: 32px; padding: 0; display: inline-grid; place-items: center; }

/* Tables */
.table-wrap { background: #fff; border: 1px solid var(--bim-line); border-radius: var(--bim-radius); overflow: hidden; box-shadow: var(--bim-shadow-sm); }
.table-toolbar { padding: 14px 16px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--bim-line-soft); }
.table-toolbar .search-mini { position: relative; }
.table-toolbar .search-mini input { padding-left: 34px; height: 36px; border-radius: 8px; border: 1px solid var(--bim-line); background: #fff; font-size: 13px; min-width: 240px; }
.table-toolbar .search-mini i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--bim-muted); font-size: 14px; }
.table-toolbar select.form-select-sm { height: 36px; border-radius: 8px; font-size: 13px; }
.table { margin: 0; }
.table thead th { background: #fafbfd; color: var(--bim-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; padding: 12px 16px; border-bottom: 1px solid var(--bim-line); white-space: nowrap; cursor: pointer; user-select: none; }
.table thead th:hover { color: var(--bim-blue-600); }
.table tbody td { padding: 13px 16px; vertical-align: middle; border-color: var(--bim-line-soft); font-size: 13.5px; }
.table tbody tr:hover { background: #fafbfd; }
.table-pagination { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--bim-line-soft); font-size: 12.5px; color: var(--bim-muted); flex-wrap: wrap; gap: 8px; }

/* DataTables inside BIMCAD table card — padding, radius, themed toolbar + pagination */
.table-wrap.bimcad-dt-card {
  border-radius: var(--bim-radius-lg);
  padding: 1.125rem 1.25rem 1.25rem;
  box-shadow: var(--bim-shadow);
}
.table-wrap.bimcad-dt-card .dataTables_wrapper {
  margin: 0;
}
.table-wrap.bimcad-dt-card .dataTables_wrapper > .row {
  margin-left: 0;
  margin-right: 0;
  --bs-gutter-x: 0;
}
.table-wrap.bimcad-dt-card .dataTables_wrapper > .row > [class*="col-"] {
  padding-left: 0;
  padding-right: 0;
}
.table-wrap.bimcad-dt-card .dataTables_wrapper > .row.align-items-center.mb-2 {
  padding-bottom: 0.875rem;
  margin-bottom: 0.875rem !important;
  border-bottom: 1px solid var(--bim-line-soft);
}
.table-wrap.bimcad-dt-card .dataTables_wrapper > .row.align-items-center.mt-2 {
  padding-top: 0.875rem;
  margin-top: 0.875rem !important;
  border-top: 1px solid var(--bim-line-soft);
}
.table-wrap.bimcad-dt-card .dataTables_length label,
.table-wrap.bimcad-dt-card .dataTables_filter label {
  font-size: 12.5px;
  color: var(--bim-muted);
  font-weight: 500;
  margin-bottom: 0;
}
.table-wrap.bimcad-dt-card .dataTables_length select {
  margin-left: 0.5rem;
  height: 36px;
  padding: 0.35rem 2rem 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--bim-line);
  font-size: 13px;
  color: var(--bim-ink-soft);
  background-color: #fff;
  min-width: 4.75rem;
}
.table-wrap.bimcad-dt-card .dataTables_filter {
  text-align: right;
}
@media (max-width: 767.98px) {
  .table-wrap.bimcad-dt-card .dataTables_filter {
    text-align: left;
    margin-top: 0.75rem;
  }
}
.table-wrap.bimcad-dt-card .dataTables_filter input {
  margin-left: 0.5rem;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--bim-line);
  padding: 0.35rem 0.85rem;
  font-size: 13px;
  max-width: min(100%, 260px);
}
.table-wrap.bimcad-dt-card .dataTables_filter input:focus {
  border-color: var(--bim-blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
  outline: 0;
}
.table-wrap.bimcad-dt-card .table-responsive,
.table-wrap.bimcad-dt-card .dataTables_wrapper .table-responsive {
  border: 1px solid var(--bim-line-soft);
  border-radius: var(--bim-radius-sm);
  overflow: auto;
  background: var(--bim-surface);
}
.table-wrap.bimcad-dt-card .dataTables_info {
  font-size: 12.5px;
  color: var(--bim-muted);
  padding-top: 0.25rem;
}
.table-wrap.bimcad-dt-card .dataTables_paginate {
  text-align: right;
}
.table-wrap.bimcad-dt-card .dataTables_paginate .pagination {
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-bottom: 0;
}
.table-wrap.bimcad-dt-card .dataTables_paginate .page-item .page-link {
  margin-left: 0;
  border-radius: 8px;
  border: 1px solid var(--bim-line);
  color: var(--bim-ink-soft);
  font-weight: 500;
  font-size: 13px;
  padding: 0.38rem 0.65rem;
  min-width: 2.35rem;
  text-align: center;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.table-wrap.bimcad-dt-card .dataTables_paginate .page-item + .page-item .page-link {
  margin-left: 0;
}
.table-wrap.bimcad-dt-card .dataTables_paginate .page-item.active .page-link {
  background: var(--bim-blue);
  border-color: var(--bim-blue);
  color: #fff;
  box-shadow: 0 2px 10px rgba(29, 78, 216, 0.28);
  z-index: 1;
}
.table-wrap.bimcad-dt-card .dataTables_paginate .page-item:not(.disabled):not(.active) .page-link:hover {
  background: var(--bim-blue-50);
  border-color: var(--bim-blue-100);
  color: var(--bim-blue-600);
}
.table-wrap.bimcad-dt-card .dataTables_paginate .page-item.disabled .page-link {
  opacity: 0.5;
  background: var(--bim-bg);
  color: var(--bim-muted-2);
  border-color: var(--bim-line-soft);
  box-shadow: none;
}

/* Deadline tone (client spec: green / orange / red) */
.deadline-ok { color: #15803d; font-weight: 600; }
.deadline-soon { color: #c2410c; font-weight: 600; }
.deadline-today { color: #b91c1c; font-weight: 700; }

/* Status pills */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.todo,
.pill.assigned { background: #f1f5f9; color: #475569; }
.pill.progress,
.pill.in_progress { background: #dbeafe; color: #1d4ed8; }
.pill.invoicing,
.pill.for_review { background: #fef3c7; color: #92400e; }
.pill.completed { background: #dcfce7; color: #15803d; }
.pill.hold,
.pill.on_hold { background: #fde68a; color: #92400e; }
.pill.cancelled { background: #e2e8f0; color: #64748b; text-decoration: line-through; }
.pill.cancelled::before { opacity: 0.45; }
.pill.draft { background: #e2e8f0; color: #475569; }
.pill.sent { background: #dbeafe; color: #1d4ed8; }
.pill.paid { background: #dcfce7; color: #15803d; }
.pill.overdue { background: #fee2e2; color: #b91c1c; }

/* Project invoice status (separate from workflow status) */
.pill.invoice-not-ready-for-invoice { background: #f1f5f9; color: #475569; }
.pill.invoice-ready-for-invoice { background: #fef3c7; color: #92400e; }
.pill.invoice-invoiced { background: #dcfce7; color: #15803d; }

/* Avatars stack */
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: linear-gradient(135deg, #60a5fa, #1d4ed8); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; border: 2px solid #fff; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar-sm + .avatar-sm { margin-left: -8px; }

/* Privacy mode blur */
body.privacy-on .privacy-blur { filter: blur(8px); user-select: none; transition: filter .25s ease; }
body.privacy-on .privacy-hide { visibility: hidden; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
@media (max-width: 1199.98px) { .kanban { grid-template-columns: repeat(6, 260px); } }
.kanban-col { background: #f3f5fa; border: 1px solid var(--bim-line); border-radius: var(--bim-radius); display: flex; flex-direction: column; min-height: 480px; }
.kanban-col-header { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--bim-line); }
.kanban-col-header .title { font-weight: 600; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.kanban-col-header .title .dot { width: 8px; height: 8px; border-radius: 50%; }
.kanban-col[data-status="assigned"] .dot,
.kanban-col[data-status="todo"] .dot { background: #94a3b8; }
.kanban-col[data-status="in_progress"] .dot,
.kanban-col[data-status="progress"] .dot { background: #3b82f6; }
.kanban-col[data-status="for_review"] .dot,
.kanban-col[data-status="invoicing"] .dot { background: #f59e0b; }
.kanban-col[data-status="completed"] .dot { background: #10b981; }
.kanban-col[data-status="on_hold"] .dot,
.kanban-col[data-status="hold"] .dot { background: #f97316; }
.kanban-col[data-status="cancelled"] .dot { background: #94a3b8; }
.kanban-col-header .count { font-size: 12px; color: var(--bim-muted); background: #fff; padding: 2px 8px; border-radius: 999px; }
.kanban-list { padding: 10px; flex: 1; min-height: 100px; display: flex; flex-direction: column; gap: 10px; }
.kanban-card { background: #fff; border: 1px solid var(--bim-line); border-radius: 10px; padding: 12px; box-shadow: var(--bim-shadow-sm); cursor: grab; transition: all .15s ease; }
.kanban-card:hover { box-shadow: var(--bim-shadow); transform: translateY(-1px); }
.kanban-card.sortable-ghost { opacity: .4; }
.kanban-card .name { font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.kanban-card .client { font-size: 12px; color: var(--bim-muted); margin-bottom: 10px; }
.kanban-card .meta { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--bim-muted); }
.kanban-card .meta i { margin-right: 3px; }

/* Activity feed */
.activity-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--bim-line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-item .a-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--bim-blue-50); color: var(--bim-blue); display: grid; place-items: center; flex-shrink: 0; }
.activity-item .a-text { font-size: 13px; }
.activity-item .a-time { font-size: 11.5px; color: var(--bim-muted); margin-top: 2px; }

/* Modal polish */
.modal-content { border: 0; border-radius: var(--bim-radius-lg); box-shadow: var(--bim-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--bim-line-soft); padding: 18px 22px; }
.modal-header .modal-title { font-size: 16px; font-weight: 600; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--bim-line-soft); padding: 14px 22px; position: sticky; bottom: 0; background: #fff; border-radius: 0 0 var(--bim-radius-lg) var(--bim-radius-lg); }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--bim-ink-soft); margin-bottom: 6px; }
.form-control, .form-select { border-color: var(--bim-line); border-radius: 8px; font-size: 13.5px; padding: .5rem .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--bim-blue); box-shadow: 0 0 0 3px rgba(29,78,216,.10); }
.form-text { font-size: 12px; color: var(--bim-muted); }

/* Offcanvas */
.offcanvas { border-left: 1px solid var(--bim-line); }
.offcanvas-header { border-bottom: 1px solid var(--bim-line-soft); padding: 18px 20px; }

/* Notifications dropdown */
.notif-dropdown { width: 360px; padding: 0; border: 1px solid var(--bim-line); border-radius: var(--bim-radius); box-shadow: var(--bim-shadow-lg); overflow: hidden; }
.notif-dropdown .head { padding: 14px 16px; border-bottom: 1px solid var(--bim-line-soft); display: flex; justify-content: space-between; align-items: center; }
.notif-dropdown .item { padding: 12px 16px; border-bottom: 1px solid var(--bim-line-soft); display: flex; gap: 10px; }
.notif-dropdown .item:hover { background: #fafbfd; }
.notif-dropdown .item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bim-blue); margin-top: 6px; flex-shrink: 0; }
.notif-dropdown .item.read .dot { background: #cbd5e1; }
.notif-dropdown .foot { padding: 10px 16px; text-align: center; font-size: 12.5px; }

/* Calendar */
.calendar { background: #fff; border: 1px solid var(--bim-line); border-radius: var(--bim-radius); overflow: hidden; }
.calendar-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #fafbfd; border-bottom: 1px solid var(--bim-line); }
.calendar-head div { padding: 10px; font-size: 11px; font-weight: 600; color: var(--bim-muted); text-align: center; text-transform: uppercase; letter-spacing: .05em; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: minmax(110px, 1fr); }
.calendar-cell { border-right: 1px solid var(--bim-line-soft); border-bottom: 1px solid var(--bim-line-soft); padding: 8px; position: relative; font-size: 12px; }
.calendar-cell.muted { background: #fafbfd; color: var(--bim-muted-2); }
.calendar-cell .num { font-weight: 600; color: var(--bim-ink); }
.calendar-cell.today .num { background: var(--bim-blue); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; }
.calendar-event { display: block; font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-top: 4px; background: var(--bim-blue-50); color: var(--bim-blue-600); border-left: 2px solid var(--bim-blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-event.warn { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.calendar-event.success { background: #dcfce7; color: #15803d; border-color: #10b981; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 20px; color: var(--bim-muted); }
.empty-state .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--bim-bg); display: grid; place-items: center; margin: 0 auto 16px; font-size: 28px; color: var(--bim-muted-2); }
.empty-state h5 { color: var(--bim-ink); margin-bottom: 6px; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f5f7fb 37%, #eef1f6 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; border-radius: 6px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Toast container — slide + fade (smoother than default Bootstrap fade-only) */
.toast-container { position: fixed; top: 76px; right: 20px; z-index: 1080; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast-container .toast { pointer-events: auto; }
.toast { border-radius: 10px; border: 1px solid var(--bim-line); box-shadow: var(--bim-shadow-lg); }
.toast.toast--success { border-left: 4px solid var(--bim-success); background: linear-gradient(to right, rgba(16, 185, 129, 0.09), #fff); }
.toast.toast--error { border-left: 4px solid var(--bim-danger); background: linear-gradient(to right, rgba(239, 68, 68, 0.07), #fff); }
.toast.toast--warning { border-left: 4px solid var(--bim-warning); background: linear-gradient(to right, rgba(245, 158, 11, 0.08), #fff); }
.toast.toast--info { border-left: 4px solid var(--bim-info); background: linear-gradient(to right, rgba(14, 165, 233, 0.08), #fff); }

/* BIM toasts: longer eased transition + slide from right */
.toast-container .toast.fade {
  --bim-toast-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --bim-toast-dur: 0.48s;
  transition:
    opacity var(--bim-toast-dur) var(--bim-toast-ease),
    transform var(--bim-toast-dur) var(--bim-toast-ease),
    box-shadow 0.35s ease;
}
.toast-container .toast.fade:not(.show) {
  transform: translate3d(18px, 0, 0) scale(0.985);
}
.toast-container .toast.fade.show {
  transform: translate3d(0, 0, 0) scale(1);
  box-shadow: var(--bim-shadow-lg);
}

@media (prefers-reduced-motion: reduce) {
  .toast-container .toast.fade {
    transition-duration: 0.01ms !important;
    transform: none !important;
  }
  .toast-container .toast.fade.show { transform: none !important; }
}

/* Tabs */
.nav-tabs-clean { border-bottom: 1px solid var(--bim-line); gap: 4px; }
.nav-tabs-clean .nav-link { border: 0; color: var(--bim-muted); font-weight: 500; padding: 10px 14px; border-bottom: 2px solid transparent; border-radius: 0; }
.nav-tabs-clean .nav-link:hover { color: var(--bim-blue); }
.nav-tabs-clean .nav-link.active { color: var(--bim-blue-600); border-bottom-color: var(--bim-blue); background: transparent; }

/* Misc */
.divider { height: 1px; background: var(--bim-line-soft); margin: 14px 0; }
.muted { color: var(--bim-muted); }
.text-tiny { font-size: 11.5px; }
.fw-medium { font-weight: 500 !important; }

/* File icons grid */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.file-card { background: #fff; border: 1px solid var(--bim-line); border-radius: var(--bim-radius); padding: 16px; text-align: center; transition: all .15s ease; }
.file-card:hover { border-color: var(--bim-blue); box-shadow: var(--bim-shadow); }
.file-card .ficon { width: 48px; height: 48px; border-radius: 10px; background: var(--bim-blue-50); color: var(--bim-blue); display: grid; place-items: center; margin: 0 auto 10px; font-size: 22px; }
.file-card .fname { font-size: 13px; font-weight: 600; word-break: break-word; }
.file-card .fmeta { font-size: 11px; color: var(--bim-muted); margin-top: 2px; }

/* Quick add menu */
.dropdown-menu { border: 1px solid var(--bim-line); border-radius: var(--bim-radius); box-shadow: var(--bim-shadow-lg); padding: 6px; }
.dropdown-item { border-radius: 7px; font-size: 13.5px; padding: 8px 10px; }
.dropdown-item:hover { background: var(--bim-blue-50); color: var(--bim-blue-600); }
.dropdown-item i { margin-right: 8px; color: var(--bim-muted); }
.dropdown-item:hover i { color: var(--bim-blue); }
.dropdown-divider { border-color: var(--bim-line-soft); margin: 4px 0; }

/* Error / unauthorized */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px; background: var(--bim-bg); }
.error-card { max-width: 460px; text-align: center; }
.error-card .big { font-size: 96px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--bim-blue), #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
