:root {
  --accent: #7d2948;
  --accent-rgb: 125, 41, 72;
  --accent-soft: #f7edf1;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --text: #17191d;
  --muted: #69707a;
  --muted-2: #8a929e;
  --border: #dfe3e8;
  --border-dark: #cbd1d8;
  --success: #15803d;
  --success-soft: #eaf7ee;
  --warning: #b45309;
  --warning-soft: #fff6e6;
  --danger: #b42318;
  --danger-soft: #fff0ef;
  --info: #2563eb;
  --info-soft: #edf4ff;
  --nurture: #7655b5;
  --nurture-soft: #f4f0ff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 32px rgba(15, 23, 42, .10);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --sidebar: 266px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; }
body { min-height: 100vh; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.no-wrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Login */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, .95fr) minmax(520px, 1.35fr);
  background: #f9fafb;
}
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px; background: #fff; position: relative; z-index: 2; }
.login-card { width: min(100%, 430px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 38px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; box-shadow: 0 8px 24px rgba(var(--accent-rgb), .25); }
.brand-name { font-weight: 750; letter-spacing: -.02em; font-size: 18px; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.login-card h1 { margin: 0 0 9px; font-size: 31px; letter-spacing: -.04em; line-height: 1.12; }
.login-lead { margin: 0 0 26px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.login-form { display: grid; gap: 16px; }
.login-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.demo-label { display: flex; gap: 10px; align-items: center; margin: 25px 0 14px; color: var(--muted); font-size: 12px; }
.demo-label::before, .demo-label::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.demo-user { border: 1px solid var(--border); background: #fff; border-radius: 12px; padding: 11px 8px; text-align: center; cursor: pointer; transition: .18s ease; }
.demo-user:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(var(--accent-rgb), .11); transform: translateY(-1px); }
.demo-avatar { width: 34px; height: 34px; margin: 0 auto 7px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 750; }
.demo-user b { font-size: 12px; display: block; }
.demo-user small { color: var(--muted); font-size: 10px; }
.login-note { margin-top: 18px; color: var(--muted-2); font-size: 11px; line-height: 1.5; }
.login-visual { position: relative; overflow: hidden; background: linear-gradient(145deg, #7d2948 0%, #48172c 55%, #261018 100%); color: #fff; padding: 56px; display: flex; align-items: center; }
.login-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to bottom right, rgba(0,0,0,.9), transparent); }
.login-glow { position: absolute; width: 460px; height: 460px; border-radius: 50%; background: rgba(255,255,255,.12); filter: blur(90px); right: -140px; top: -160px; }
.login-preview { width: 100%; position: relative; z-index: 2; }
.login-preview-kicker { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.18); padding: 8px 12px; border-radius: 999px; font-size: 12px; backdrop-filter: blur(8px); }
.login-preview h2 { max-width: 650px; font-size: clamp(36px, 4vw, 61px); line-height: 1.02; letter-spacing: -.055em; margin: 22px 0 17px; }
.login-preview > p { max-width: 600px; color: rgba(255,255,255,.72); line-height: 1.65; margin-bottom: 35px; }
.preview-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; transform: perspective(1000px) rotateX(2deg) rotateY(-3deg); transform-origin: center; }
.preview-col { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.17); border-radius: 16px; padding: 12px; min-height: 240px; backdrop-filter: blur(9px); }
.preview-col-head { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.76); margin-bottom: 12px; }
.preview-card { background: rgba(255,255,255,.94); color: #252228; border-radius: 11px; padding: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.13); margin-bottom: 10px; }
.preview-card b { display: block; font-size: 12px; margin-bottom: 7px; }
.preview-line { height: 6px; border-radius: 8px; background: #e9e4e6; margin-bottom: 6px; }
.preview-line.short { width: 62%; }
.preview-tag { display: inline-block; font-size: 8px; padding: 4px 6px; color: var(--accent); background: #f7edf1; border-radius: 99px; }

/* Forms and buttons */
.field { display: grid; gap: 7px; min-width: 0; }
.field label, .field-label { font-size: 12px; font-weight: 650; color: #454b54; }
.field-required::after { content: " *"; color: var(--danger); }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border-dark);
  background: #fff;
  border-radius: 10px;
  color: var(--text);
  outline: none;
  transition: border .15s, box-shadow .15s;
}
.input, .select { height: 40px; padding: 0 12px; }
.textarea { min-height: 90px; resize: vertical; padding: 10px 12px; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.input::placeholder, .textarea::placeholder { color: #a3a9b2; }
.input-wrap { position: relative; }
.input-wrap .input { padding-left: 37px; }
.input-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); pointer-events: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .span-2 { grid-column: span 2; }
.form-section { padding: 17px 0 4px; border-top: 1px solid var(--border); margin-top: 10px; }
.form-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.form-section-title { font-size: 13px; font-weight: 750; margin-bottom: 13px; display: flex; align-items: center; gap: 8px; }
.help-text { font-size: 11px; color: var(--muted); line-height: 1.45; }
.validation { color: var(--danger); font-size: 11px; margin-top: 2px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: #4d535d; line-height: 1.45; }
.checkbox-line input { accent-color: var(--accent); margin-top: 2px; }
.btn { height: 38px; border: 1px solid transparent; border-radius: 10px; padding: 0 13px; font-weight: 650; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; transition: .16s ease; white-space: nowrap; text-decoration: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 4px 12px rgba(var(--accent-rgb), .20); }
.btn-primary:hover { filter: brightness(.95); box-shadow: 0 7px 17px rgba(var(--accent-rgb), .23); }
.btn-secondary { color: #363b43; background: #fff; border-color: var(--border-dark); }
.btn-secondary:hover { border-color: #929aa5; background: #fbfbfc; }
.btn-soft { color: var(--accent); background: var(--accent-soft); border-color: rgba(var(--accent-rgb), .12); }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: #ffd2cf; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f0f2f4; color: var(--text); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm { height: 31px; padding: 0 10px; border-radius: 8px; font-size: 11px; }
.btn-xs { height: 27px; padding: 0 8px; border-radius: 7px; font-size: 10px; }
.btn:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: .15s; position: relative; }
.icon-btn:hover { border-color: var(--border-dark); color: var(--text); background: #fafafa; }
.icon-btn.active { color: var(--accent); border-color: rgba(var(--accent-rgb), .28); background: var(--accent-soft); }
.icon-symbol { width: 17px; height: 17px; display: inline-grid; place-items: center; font-size: 16px; line-height: 1; }
.notification-dot { position: absolute; right: -4px; top: -5px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 9px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

/* Main shell */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.app-shell.sidebar-collapsed { --sidebar: 78px; }
.sidebar { position: fixed; z-index: 40; inset: 0 auto 0 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--border); display: flex; flex-direction: column; transition: width .2s ease, transform .2s ease; }
.sidebar-brand { height: 68px; display: flex; align-items: center; gap: 11px; padding: 0 17px; border-bottom: 1px solid var(--border); flex: none; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 17px; flex: none; }
.sidebar-brand-copy { overflow: hidden; white-space: nowrap; transition: opacity .15s; }
.sidebar-brand-copy strong { display: block; font-size: 13px; letter-spacing: -.01em; }
.sidebar-brand-copy small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; }
.sidebar-toggle { margin-left: auto; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.sidebar-toggle:hover { background: #f2f3f5; }
.sidebar-nav { flex: 1; min-height: 0; padding: 12px 10px 20px; overflow-y: auto; overflow-x: hidden; }
.nav-section { margin: 6px 0 16px; }
.nav-caption { padding: 0 10px 7px; color: #9aa1aa; font-size: 9px; letter-spacing: .12em; font-weight: 800; text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.nav-item { min-height: 37px; padding: 0 9px; border: 1px solid transparent; border-radius: 9px; display: flex; align-items: center; gap: 10px; color: #535a64; cursor: pointer; margin: 2px 0; font-size: 12px; position: relative; text-decoration: none; white-space: nowrap; overflow: hidden; transition: .14s; }
.nav-item:hover { background: #f5f6f7; color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(var(--accent-rgb), .10); font-weight: 700; }
.nav-icon { width: 18px; text-align: center; font-size: 15px; flex: none; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.nav-badge { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 999px; background: #eef0f2; color: #6c737d; font-size: 9px; text-align: center; font-weight: 750; }
.nav-item.active .nav-badge { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.nav-sub { margin-left: 28px; }
.nav-sub .nav-item { min-height: 32px; font-size: 11px; padding-left: 8px; }
.sidebar-footer { flex: none; padding: 10px; border-top: 1px solid var(--border); }
.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 7px; border-radius: 10px; cursor: pointer; overflow: hidden; }
.sidebar-user:hover { background: #f5f6f7; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; font-size: 11px; flex: none; }
.user-copy { min-width: 0; white-space: nowrap; }
.user-copy strong { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.user-copy small { color: var(--muted); font-size: 9px; }
.sidebar-collapsed .sidebar-brand-copy, .sidebar-collapsed .nav-caption, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-badge, .sidebar-collapsed .user-copy { opacity: 0; pointer-events: none; }
.sidebar-collapsed .sidebar-brand { padding: 0 12px; justify-content: center; }
.sidebar-collapsed .sidebar-toggle { position: absolute; right: -12px; top: 53px; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .nav-sub { margin-left: 0; }
.sidebar-collapsed .sidebar-user { justify-content: center; }

.main { grid-column: 2; min-width: 0; }
.header { position: sticky; top: 0; z-index: 30; height: 68px; background: rgba(255,255,255,.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.mobile-menu { display: none; }
.header-title { min-width: 160px; }
.header-title h1 { font-size: 16px; line-height: 1.15; letter-spacing: -.02em; margin: 0; }
.header-title p { font-size: 9px; color: var(--muted); margin: 4px 0 0; }
.global-search { width: min(360px, 31vw); }
.header-spacer { flex: 1; }
.header-filters { display: flex; gap: 8px; align-items: center; }
.header-select { height: 36px; max-width: 140px; border: 1px solid var(--border); background: #fff; border-radius: 9px; padding: 0 9px; font-size: 11px; color: #4b5159; outline: none; }
.header-profile { display: flex; align-items: center; gap: 8px; padding-left: 5px; cursor: pointer; }
.header-profile-copy { max-width: 100px; }
.header-profile-copy strong { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-profile-copy small { color: var(--muted); font-size: 8px; }
.content { padding: 20px; min-height: calc(100vh - 68px); background-color: var(--bg); background-image: radial-gradient(#d7dbe0 0.55px, transparent .55px); background-size: 19px 19px; }
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 17px; }
.page-title h2 { margin: 0; font-size: 23px; letter-spacing: -.035em; }
.page-title p { color: var(--muted); margin: 6px 0 0; font-size: 12px; line-height: 1.45; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-head { padding: 15px 17px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-head h3 { font-size: 13px; margin: 0; }
.panel-body { padding: 17px; }

/* Page controls */
.view-tabs { display: inline-flex; padding: 3px; background: #eceff2; border-radius: 10px; gap: 2px; }
.view-tab { border: 0; background: transparent; color: var(--muted); height: 31px; padding: 0 12px; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 650; }
.view-tab.active { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(15,23,42,.10); }
.board-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 13px; }
.saved-views { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.saved-view { border: 1px solid var(--border); background: #fff; border-radius: 999px; height: 30px; padding: 0 10px; color: #5b626c; font-size: 10px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.saved-view:hover, .saved-view.active { color: var(--accent); border-color: rgba(var(--accent-rgb), .30); background: var(--accent-soft); }
.filter-count { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: 9px; }
.filter-panel { margin-bottom: 13px; padding: 14px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 10px; }
.filter-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 11px; }

/* KPI dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--border); border-radius: 13px; padding: 15px; box-shadow: var(--shadow-sm); min-width: 0; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; margin-bottom: 12px; }
.kpi-icon { width: 29px; height: 29px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 14px; }
.kpi-value { font-size: 19px; font-weight: 780; letter-spacing: -.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { margin-top: 6px; font-size: 9px; color: var(--muted); line-height: 1.35; }
.kpi-sub strong { color: var(--success); }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 14px; }
.dashboard-stack { display: grid; gap: 14px; align-content: start; }
.chart-card { padding: 17px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 17px; }
.chart-head h3 { margin: 0; font-size: 13px; }
.chart-head p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.pipeline-bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 122px minmax(0, 1fr) 82px; gap: 11px; align-items: center; font-size: 10px; }
.bar-label { color: #555d66; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: #eef0f2; border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--accent); min-width: 2px; }
.bar-value { font-weight: 700; text-align: right; }
.donut-layout { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 20px; align-items: center; }
.donut { width: 124px; height: 124px; border-radius: 50%; position: relative; background: conic-gradient(var(--accent) 0 42%, #bf7892 42% 66%, #d5acbb 66% 82%, #e5d4da 82% 92%, #eceef0 92% 100%); }
.donut::after { content: ""; position: absolute; inset: 25px; border-radius: 50%; background: #fff; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; z-index: 2; text-align: center; font-size: 9px; color: var(--muted); }
.donut-center b { display: block; color: var(--text); font-size: 17px; }
.legend { display: grid; gap: 9px; }
.legend-item { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; gap: 8px; align-items: center; font-size: 10px; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.legend-item:nth-child(2) .legend-dot { opacity: .70; }
.legend-item:nth-child(3) .legend-dot { opacity: .48; }
.legend-item:nth-child(4) .legend-dot { opacity: .28; }
.legend-item:nth-child(5) .legend-dot { background: #d9dde2; }
.legend-item span { color: var(--muted); }
.legend-item b { font-size: 10px; }
.activity-feed { display: grid; gap: 14px; }
.feed-item { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 10px; }
.feed-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #f0f2f4; color: #5b626b; font-size: 12px; }
.feed-copy { font-size: 10px; line-height: 1.45; color: #4d545d; }
.feed-copy b { color: var(--text); }
.feed-time { display: block; color: var(--muted-2); font-size: 9px; margin-top: 3px; }

/* Kanban */
.kanban-shell { width: 100%; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: 293px; gap: 12px; align-items: start; min-width: max-content; }
.kanban-col { background: rgba(240,242,244,.92); border: 1px solid #dfe3e7; border-radius: 14px; min-height: 520px; transition: border .15s, background .15s; }
.kanban-col.drag-over { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), .15); }
.kanban-col-head { padding: 13px 13px 11px; border-bottom: 1px solid #dde1e5; position: sticky; top: 0; border-radius: 14px 14px 0 0; background: rgba(246,247,248,.96); backdrop-filter: blur(8px); z-index: 2; }
.stage-title-line { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: #89919c; flex: none; }
.stage-contacted .stage-dot { background: #55758b; }
.stage-qualified .stage-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stage-quotation .stage-dot { background: var(--info); }
.stage-negotiation .stage-dot { background: var(--warning); }
.stage-won .stage-dot { background: var(--success); }
.stage-nurture .stage-dot { background: var(--nurture); }
.stage-lost .stage-dot { background: #9b6268; }
.stage-title { font-size: 11px; font-weight: 780; flex: 1; }
.stage-count { min-width: 21px; height: 21px; padding: 0 6px; border-radius: 999px; background: #e6e9ec; color: #59616b; font-size: 9px; font-weight: 750; display: grid; place-items: center; }
.stage-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.stage-metric { min-width: 0; }
.stage-metric span { display: block; color: var(--muted); font-size: 8px; margin-bottom: 2px; }
.stage-metric b { display: block; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-add { width: 27px; height: 27px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.stage-add:hover { background: #e7e9ec; color: var(--text); }
.kanban-col-body { padding: 10px; min-height: 450px; }
.empty-column { min-height: 150px; border: 1px dashed #cbd1d7; border-radius: 11px; color: var(--muted-2); display: grid; place-items: center; text-align: center; padding: 20px; font-size: 10px; line-height: 1.5; }
.deal-card { background: #fff; border: 1px solid #d9dde2; border-radius: 12px; padding: 12px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(15,23,42,.04); cursor: grab; position: relative; transition: .14s ease; }
.deal-card:hover { border-color: #b7bdc5; box-shadow: 0 7px 18px rgba(15,23,42,.08); transform: translateY(-1px); }
.deal-card.dragging { opacity: .42; transform: rotate(1deg) scale(.98); }
.deal-card.overdue-card { border-left: 3px solid var(--danger); }
.deal-top { display: flex; align-items: flex-start; gap: 9px; }
.company-logo { width: 31px; height: 31px; border-radius: 9px; flex: none; display: grid; place-items: center; background: #f0f1f3; color: #4d535d; font-size: 10px; font-weight: 800; border: 1px solid #e2e4e7; }
.deal-title { flex: 1; min-width: 0; }
.deal-title h4 { font-size: 11px; letter-spacing: -.01em; margin: 1px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deal-title p { margin: 0; color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.priority-mark { width: 8px; height: 8px; border-radius: 50%; background: #a8afb8; margin-top: 4px; flex: none; }
.priority-mark.high { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.priority-mark.medium { background: var(--warning); }
.deal-tags { display: flex; gap: 5px; flex-wrap: wrap; margin: 10px 0; }
.tag { display: inline-flex; align-items: center; max-width: 100%; height: 21px; border-radius: 999px; padding: 0 7px; font-size: 8px; font-weight: 700; background: #f1f2f4; color: #5e6670; border: 1px solid #e4e6e9; white-space: nowrap; }
.tag-accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(var(--accent-rgb), .13); }
.tag-info { background: var(--info-soft); color: var(--info); border-color: #d8e6ff; }
.tag-success { background: var(--success-soft); color: var(--success); border-color: #caead4; }
.tag-warning { background: var(--warning-soft); color: var(--warning); border-color: #f5deae; }
.tag-danger { background: var(--danger-soft); color: var(--danger); border-color: #ffd2cf; }
.tag-purple { background: var(--nurture-soft); color: var(--nurture); border-color: #e3d8ff; }
.deal-value { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 9px; }
.deal-value b { font-size: 13px; letter-spacing: -.02em; }
.deal-value span { font-size: 8px; color: var(--muted); }
.probability { height: 4px; border-radius: 99px; background: #eceef0; overflow: hidden; margin-top: 5px; }
.probability-fill { height: 100%; background: var(--accent); border-radius: inherit; }
.deal-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; border-top: 1px solid #eef0f2; padding-top: 9px; }
.meta-item { min-width: 0; }
.meta-item span { display: block; color: var(--muted); font-size: 8px; margin-bottom: 2px; }
.meta-item b { display: block; font-size: 9px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-item.overdue b { color: var(--danger); }
.warning-strip { margin: 9px 0 0; display: flex; gap: 6px; align-items: flex-start; border-radius: 7px; padding: 6px 7px; background: var(--danger-soft); color: var(--danger); font-size: 8px; line-height: 1.35; }
.deal-footer { display: flex; align-items: center; gap: 5px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #eef0f2; }
.quick-action { width: 25px; height: 25px; border: 1px solid #e0e3e6; border-radius: 7px; background: #fff; color: #6d747e; display: grid; place-items: center; font-size: 10px; cursor: pointer; text-decoration: none; }
.quick-action:hover { color: var(--accent); border-color: rgba(var(--accent-rgb), .3); background: var(--accent-soft); }
.deal-owner { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 8px; max-width: 75px; }
.deal-owner .avatar { width: 22px; height: 22px; font-size: 8px; }

/* Tables */
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
.data-table th { position: sticky; top: 0; z-index: 1; background: #fafbfc; color: #737b85; font-size: 9px; letter-spacing: .035em; text-transform: uppercase; text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 11px 12px; border-bottom: 1px solid #edf0f2; font-size: 10px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover td { background: #fafbfc; }
.table-primary { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.table-primary .company-logo { width: 28px; height: 28px; }
.table-primary b { display: block; font-size: 10px; }
.table-primary small { color: var(--muted); font-size: 8px; }
.table-actions { display: flex; gap: 5px; }
.empty-state { min-height: 320px; display: grid; place-items: center; text-align: center; padding: 32px; color: var(--muted); }
.empty-state-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 23px; }
.empty-state h3 { margin: 0 0 7px; color: var(--text); font-size: 15px; }
.empty-state p { max-width: 410px; margin: 0 auto 16px; font-size: 11px; line-height: 1.55; }

/* Calendar / tasks / resources */
.calendar-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.55fr); gap: 14px; }
.calendar { padding: 14px; }
.calendar-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; }
.calendar-head h3 { font-size: 14px; margin: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); border: 1px solid var(--border); border-radius: 11px; overflow: hidden; }
.calendar-weekday { background: #f8f9fa; padding: 8px; color: var(--muted); text-align: center; font-size: 9px; font-weight: 700; border-right: 1px solid var(--border); }
.calendar-weekday:nth-child(7) { border-right: 0; }
.calendar-day { min-height: 105px; padding: 7px; border-top: 1px solid var(--border); border-right: 1px solid var(--border); background: #fff; overflow: hidden; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.other-month { background: #fafbfc; color: #b2b7bf; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--accent); }
.day-number { font-size: 9px; font-weight: 700; margin-bottom: 5px; }
.calendar-event { font-size: 8px; line-height: 1.25; padding: 4px 5px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.calendar-event.task { background: var(--info-soft); color: var(--info); }
.calendar-event.overdue { background: var(--danger-soft); color: var(--danger); }
.upcoming-list { display: grid; gap: 8px; }
.upcoming-item { padding: 11px; border: 1px solid var(--border); border-radius: 10px; display: grid; grid-template-columns: 42px minmax(0,1fr); gap: 10px; }
.date-tile { border-radius: 8px; background: #f1f2f4; text-align: center; padding: 6px 3px; }
.date-tile b { display: block; font-size: 15px; }
.date-tile span { font-size: 8px; color: var(--muted); text-transform: uppercase; }
.upcoming-copy b { display: block; font-size: 10px; margin-bottom: 4px; }
.upcoming-copy span { display: block; color: var(--muted); font-size: 9px; line-height: 1.4; }
.task-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }
.task-list { display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: 27px minmax(0,1fr) 120px 100px 78px; gap: 10px; align-items: center; padding: 12px 13px; border: 1px solid var(--border); background: #fff; border-radius: 11px; }
.task-row.done { opacity: .62; }
.task-row.done .task-title { text-decoration: line-through; }
.task-check { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.task-title { font-size: 10px; font-weight: 700; }
.task-sub { color: var(--muted); font-size: 8px; margin-top: 3px; }
.task-meta { font-size: 9px; color: #525963; }
.resources-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.resource-card { padding: 15px; border: 1px solid var(--border); background: #fff; border-radius: 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: .15s; }
.resource-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #bac0c7; }
.resource-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 18px; margin-bottom: 13px; }
.resource-card h3 { font-size: 12px; margin: 0 0 5px; }
.resource-card p { color: var(--muted); font-size: 9px; line-height: 1.45; margin: 0; }
.resource-footer { margin-top: 15px; display: flex; justify-content: space-between; color: var(--muted); font-size: 8px; }

/* Drawer */
.drawer-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(17,24,39,.32); opacity: 0; animation: fadeIn .16s forwards; }
.drawer { position: fixed; z-index: 90; right: 0; top: 0; bottom: 0; width: min(690px, 94vw); background: #fff; box-shadow: -14px 0 40px rgba(15,23,42,.18); transform: translateX(100%); animation: slideIn .22s ease forwards; display: flex; flex-direction: column; }
@keyframes slideIn { to { transform: translateX(0); } }
@keyframes fadeIn { to { opacity: 1; } }
.drawer-head { flex: none; padding: 17px 19px 14px; border-bottom: 1px solid var(--border); }
.drawer-head-top { display: flex; align-items: flex-start; gap: 12px; }
.drawer-head .company-logo { width: 40px; height: 40px; border-radius: 11px; }
.drawer-title { min-width: 0; flex: 1; }
.drawer-title h2 { margin: 1px 0 4px; font-size: 18px; letter-spacing: -.03em; }
.drawer-title p { margin: 0; color: var(--muted); font-size: 10px; }
.drawer-head-actions { display: flex; gap: 6px; }
.drawer-summary { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin-top: 14px; }
.summary-cell { padding: 9px; border-radius: 9px; background: #f7f8f9; min-width: 0; }
.summary-cell span { display: block; color: var(--muted); font-size: 8px; margin-bottom: 3px; }
.summary-cell b { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-tabs { flex: none; display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.drawer-tab { height: 43px; padding: 0 11px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.drawer-tab.active { color: var(--accent); border-color: var(--accent); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px; background: #fafbfc; }
.drawer-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px; }
.drawer-section-head { padding: 12px 14px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drawer-section-head h3 { margin: 0; font-size: 11px; }
.drawer-section-body { padding: 14px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px 17px; }
.detail-item { min-width: 0; }
.detail-item.span-2 { grid-column: span 2; }
.detail-item span { display: block; color: var(--muted); font-size: 8px; margin-bottom: 4px; }
.detail-item b, .detail-item p { display: block; margin: 0; color: #343941; font-size: 10px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.detail-item p { font-weight: 400; }
.timeline { position: relative; padding-left: 21px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 7px; bottom: 7px; width: 1px; background: #dfe3e7; }
.timeline-item { position: relative; padding-bottom: 16px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot { position: absolute; left: -20px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); z-index: 1; }
.timeline-copy { font-size: 10px; line-height: 1.5; color: #4c535d; }
.timeline-copy strong { color: var(--text); }
.timeline-meta { margin-top: 4px; color: var(--muted); font-size: 8px; display: flex; gap: 8px; }
.activity-composer { padding: 13px; background: #fff; border: 1px solid var(--border); border-radius: 11px; margin-bottom: 14px; }
.activity-composer-row { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 9px; margin-bottom: 9px; }
.quote-card { border: 1px solid var(--border); border-radius: 11px; padding: 13px; margin-bottom: 9px; }
.quote-head { display: flex; justify-content: space-between; gap: 10px; }
.quote-head h4 { margin: 0 0 4px; font-size: 11px; }
.quote-head p { margin: 0; color: var(--muted); font-size: 8px; }
.quote-value { text-align: right; }
.quote-value b { display: block; font-size: 12px; }
.quote-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; border-top: 1px solid #eef0f2; margin-top: 11px; padding-top: 10px; }
.quote-meta span { display: block; font-size: 8px; color: var(--muted); margin-bottom: 2px; }
.quote-meta b { display: block; font-size: 9px; }
.attachment-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.file-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--info-soft); color: var(--info); display: grid; place-items: center; }
.attachment-copy { min-width: 0; flex: 1; }
.attachment-copy b { display: block; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-copy span { display: block; color: var(--muted); font-size: 8px; margin-top: 3px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(17,24,39,.45); display: grid; place-items: center; padding: 20px; animation: fadeIn .15s both; }
.modal { width: min(720px, 100%); max-height: 91vh; background: #fff; border-radius: 16px; box-shadow: 0 22px 70px rgba(15,23,42,.28); display: flex; flex-direction: column; overflow: hidden; animation: modalUp .18s ease both; }
.modal-sm { width: min(480px, 100%); }
.modal-lg { width: min(960px, 100%); }
@keyframes modalUp { from { transform: translateY(10px) scale(.985); opacity: .7; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-head { padding: 16px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 12px; }
.modal-title { flex: 1; }
.modal-title h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.modal-title p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-footer { padding: 13px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: #fafbfc; }
.duplicate-alert { padding: 10px 11px; border-radius: 9px; background: var(--warning-soft); border: 1px solid #f4d7a0; color: #7a4b0d; font-size: 10px; line-height: 1.45; margin-bottom: 13px; }
.csv-preview { overflow: auto; max-height: 210px; border: 1px solid var(--border); border-radius: 10px; margin-top: 12px; }
.csv-preview table { min-width: 600px; width: 100%; border-collapse: collapse; }
.csv-preview th, .csv-preview td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 7px; font-size: 9px; text-align: left; white-space: nowrap; }
.csv-preview th { background: #f7f8f9; }
.mapping-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin-top: 13px; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 14px; }
.settings-menu { padding: 8px; align-self: start; }
.settings-item { height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 9px; border-radius: 8px; cursor: pointer; font-size: 10px; color: #565d67; }
.settings-item:hover { background: #f4f5f6; }
.settings-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.stage-setting-row { display: grid; grid-template-columns: 32px minmax(0,1fr) 110px 82px 92px; gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.stage-grip { color: var(--muted); text-align: center; }
.accent-options { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.accent-swatch { width: 32px; height: 32px; border-radius: 9px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-dark); cursor: pointer; }
.accent-swatch.active { box-shadow: 0 0 0 2px var(--text); }
.role-card { border: 1px solid var(--border); border-radius: 11px; padding: 13px; margin-bottom: 9px; }
.role-card h4 { margin: 0 0 5px; font-size: 11px; }
.role-card p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

/* Toast / misc */
#toast-root { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: grid; gap: 8px; max-width: 360px; }
.toast { background: #22262c; color: #fff; border-radius: 11px; padding: 11px 13px; box-shadow: 0 12px 34px rgba(15,23,42,.24); display: flex; align-items: flex-start; gap: 9px; animation: toastIn .18s ease both; font-size: 10px; line-height: 1.4; }
.toast.success { background: #14532d; }
.toast.error { background: #7f1d1d; }
.toast.warning { background: #7c460b; }
.toast-icon { font-size: 13px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.context-menu { position: fixed; z-index: 120; width: 200px; background: #fff; border: 1px solid var(--border); border-radius: 11px; padding: 6px; box-shadow: var(--shadow-md); }
.context-item { height: 34px; padding: 0 9px; border-radius: 7px; display: flex; align-items: center; gap: 9px; font-size: 10px; cursor: pointer; }
.context-item:hover { background: #f3f4f6; }
.context-item.danger { color: var(--danger); }
.tooltip { position: relative; }
.tooltip:hover::after { content: attr(data-tip); position: absolute; z-index: 120; bottom: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: #1f2328; color: #fff; font-size: 8px; padding: 5px 7px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.loading-screen { min-height: 100vh; display: grid; place-items: center; color: var(--muted); background: #f7f8f9; }
.loader { width: 30px; height: 30px; border-radius: 50%; border: 3px solid #e2e5e9; border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .filter-grid { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
  .resources-grid { grid-template-columns: repeat(3, 1fr); }
  .header-profile-copy { display: none; }
}
@media (max-width: 1050px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .app-shell, .app-shell.sidebar-collapsed { grid-template-columns: 1fr; --sidebar: 266px; }
  .main { grid-column: 1; }
  .sidebar { transform: translateX(-100%); box-shadow: 12px 0 32px rgba(15,23,42,.16); }
  .app-shell.mobile-sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-collapsed .sidebar-brand-copy, .sidebar-collapsed .nav-caption, .sidebar-collapsed .nav-label, .sidebar-collapsed .nav-badge, .sidebar-collapsed .user-copy { opacity: 1; pointer-events: auto; }
  .sidebar-collapsed .sidebar-brand { padding: 0 17px; justify-content: initial; }
  .sidebar-collapsed .nav-item { justify-content: initial; padding: 0 9px; }
  .sidebar-collapsed .nav-sub { margin-left: 28px; }
  .sidebar-collapsed .sidebar-user { justify-content: initial; }
  .sidebar-collapsed .sidebar-toggle { position: static; border: 0; box-shadow: none; }
  .mobile-menu { display: grid; }
  .header-title { min-width: 125px; }
  .global-search { width: min(300px, 35vw); }
  .header-filters .header-select { display: none; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-menu { display: flex; overflow-x: auto; }
  .settings-item { white-space: nowrap; }
}
@media (max-width: 760px) {
  .login-panel { padding: 30px 22px; }
  .demo-users { grid-template-columns: 1fr; }
  .demo-user { display: flex; align-items: center; text-align: left; gap: 10px; }
  .demo-avatar { margin: 0; flex: none; }
  .header { padding: 0 12px; gap: 8px; }
  .header-title { min-width: 0; flex: 1; }
  .header-title p { display: none; }
  .global-search { position: absolute; top: 67px; left: 0; right: 0; width: 100%; padding: 8px 12px; background: #fff; border-bottom: 1px solid var(--border); display: none; }
  .header.search-open .global-search { display: block; }
  .desktop-search { display: none; }
  .mobile-search { display: grid; }
  .header .btn-primary span:last-child { display: none; }
  .header .btn-primary { width: 36px; padding: 0; }
  .header .optional { display: none; }
  .content { padding: 14px 11px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi { padding: 12px; }
  .kpi-value { font-size: 16px; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .resources-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .drawer-summary { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.span-2 { grid-column: span 1; }
  .activity-composer-row { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 0; place-items: end center; }
  .modal { width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; }
  .mapping-grid { grid-template-columns: 1fr; }
  .task-row { grid-template-columns: 28px minmax(0,1fr) 76px; }
  .task-row > :nth-child(4), .task-row > :nth-child(5) { display: none; }
  .calendar-day { min-height: 77px; padding: 5px; }
  .calendar-event { font-size: 0; height: 6px; padding: 0; }
  .stage-setting-row { grid-template-columns: 28px minmax(0,1fr) 74px; }
  .stage-setting-row > :nth-child(4), .stage-setting-row > :nth-child(5) { display: none; }
}
@media (max-width: 470px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-top span:first-child { font-size: 9px; }
  .resources-grid { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr; }
  .kanban { grid-auto-columns: calc(100vw - 34px); }
  .drawer { width: 100vw; }
  .drawer-head-actions .optional { display: none; }
  .quote-meta { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 85px minmax(0,1fr) 65px; }
}
