.scheduler-table td { position: relative; min-width: 150px; }
.appointment-card { border-radius: 6px; border-left: 4px solid rgba(0,0,0,0.3) !important; padding: 6px; cursor: pointer; overflow: hidden; transition: all 0.2s ease-in-out; font-size: 11px; }
.appointment-card:hover { z-index: 100 !important; transform: scale(1.03); box-shadow: 0 10px 15px rgba(0,0,0,0.1) !important; height: auto !important; min-height: 80px; }
.appointment-card .app-detail { display: none; }
.appointment-card:hover .app-detail { display: block; margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.2); padding-top: 4px; }
@media (max-width: 768px) { .scheduler-table th { min-width: 120px !important; font-size: 10px; } .appointment-card { padding: 3px; font-size: 10px; } .name-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } }

.db-circle-progress { width: 130px; height: 130px; border-radius: 50%; display: flex; align-items: center; justify-content: center; position: relative; margin: 0 auto; }
.db-circle-inner { width: 110px; height: 110px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #fff; box-shadow: inset 0 0 10px rgba(0,0,0,0.05); }
.db-circle-amount { font-size: 13px; font-weight: 700; color: #1e293b; }
.db-timeline-card { transition: all 0.2s ease; background: #fff; border: 1px solid #edf2f7 !important; margin-bottom: 8px; }
.db-timeline-card:hover { transform: translateX(5px); box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important; }

.db-sidebar-wrapper { height: calc(100vh - 160px); min-height: 600px; }
.db-stack-accordion { height: 99%; display: flex; flex-direction: column; }
.db-stack-accordion .accordion-item { display: flex; flex-direction: column; border: none !important; background: transparent !important; margin-bottom: 10px; border-radius: 16px !important; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.db-stack-accordion .accordion-item:has(.show) { flex-grow: 1; }
.db-stack-accordion .accordion-collapse { flex-grow: 1; height: 0; }
.db-stack-accordion .accordion-body { height: 100%; padding: 15px; background: #fff; display: flex; flex-direction: column; }
.db-stack-accordion .accordion-button { background: #fff !important; padding: 15px 20px; box-shadow: none !important; border-bottom: 1px solid #f1f5f9; }
.db-stack-accordion .accordion-button:not(.collapsed) { color: #1e293b; }
.db-icon-sm { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #fff; }

.sidebar-scroll { max-height: 200px; overflow-y: auto; padding-right: 5px; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 10px; transition: background 0.25s; }
.sidebar-scroll:hover::-webkit-scrollbar-thumb { background: #cbd5e0; }
.db-content-scroll { flex-grow: 1; overflow-y: auto; padding-right: 5px; }
.db-content-scroll::-webkit-scrollbar { width: 4px; }
.db-content-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 10px; transition: background 0.25s; }
.db-content-scroll:hover::-webkit-scrollbar-thumb { background: #cbd5e0; }
.shadow-blue { box-shadow: 0 4px 6px rgba(13, 110, 253, 0.2); }
.shadow-green { box-shadow: 0 4px 6px rgba(25, 135, 84, 0.2); }

.db-status-danger { background-color: #fff5f5; border-left: 4px solid #f44336 !important; }
.db-status-warning { background-color: #fffaf0; border-left: 4px solid #ff9800 !important; }
.db-status-success { background-color: #f0fff4; border-left: 4px solid #4caf50 !important; }
.db-status-normal { border-left: 4px solid #e2e8f0 !important; }
.dark-mode .db-circle-inner, .dark-mode .db-timeline-card { background-color: #1e293b !important; }
.dark-mode .db-circle-amount, .dark-mode .db-text-main { color: #f8fafc !important; }
.dark-mode .db-stack-accordion .accordion-button, .dark-mode .db-stack-accordion .accordion-body { background: #1e293b !important; color: #f8fafc; border-color: #334155; }
.dark-mode .db-timeline-card { background: #0f172a; border-color: #334155 !important; }

/* === EVENTS CRM GUIDE LAYOUT === */
.events-dashboard-area { height: 94vh; overflow-y: auto !important; overflow-x: hidden; display: block; }
.events-shell { height: auto; min-height: 100%; display: flex; flex-direction: column; background: #f5f5f5; border-radius: 0; overflow: visible; }
.events-topbar { height: 56px; background: #fff; border-bottom: 1px solid #e2e8f0; display: flex; align-items: center; gap: 12px; padding: 0 24px; flex-shrink: 0; }
.events-topbar-title { font-size: 16px; font-weight: 700; color: #0f172a; white-space: nowrap; }
.events-topbar-spacer { flex: 1; }
.events-topbar-fair { height: 38px; display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0 12px; color: #64748b; transition: all 0.2s ease; }
.events-topbar-fair:hover, .events-topbar-fair:focus-within { border-color: #cbd5e1; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.events-topbar-fair select, .events-topbar-select { border: 0 !important; outline: 0 !important; background: transparent !important; font-size: 13px; font-weight: 600; color: #1e293b; cursor: pointer; padding: 0 4px; min-width: 140px; max-width: 220px; box-shadow: none !important; }
.events-topbar-search { width: 260px; height: 38px; display: flex; align-items: center; gap: 8px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0 12px; color: #64748b; transition: all 0.2s ease; }
.events-topbar-search:hover, .events-topbar-search:focus-within { border-color: #cbd5e1; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.events-topbar-search input { width: 100%; border: 0; outline: 0; background: transparent; font-size: 13px; color: #1e293b; }
.events-icon-btn { width: 38px; height: 38px; border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc; color: #64748b; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; flex-shrink: 0; }
.events-icon-btn:hover { border-color: #0f172a; background: #fff; color: #0f172a; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.events-content { flex: 1; overflow: visible; padding: 24px; }
.events-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.events-page-header h1 { margin: 0; font-size: 22px; font-weight: 800; color: #111; letter-spacing: 0; }
.events-page-sub { font-size: 13px; color: #888; margin-top: 3px; }
.events-page-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.events-page-actions .btn { height: 38px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px; }
.events-page-body { margin-top: 0; }
.events-card, .events-panel, .events-notes-panel { background: #fff; border: 1px solid #ebebeb; border-radius: 12px; box-shadow: none; }
.events-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.events-shell .col-lg-4 > .mb-3 > .events-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.events-stat-card { background: #fff; border: 1px solid #ebebeb; border-radius: 12px; padding: 18px 20px; height: 100%; }
.events-stat-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.events-stat-label { font-size: 12px; color: #888; font-weight: 600; margin-bottom: 8px; text-transform: none; letter-spacing: 0; }
.events-stat-value { font-size: 22px; font-weight: 800; color: #111; letter-spacing: 0; margin: 0; }
.events-stat-sub { font-size: 12px; color: #aaa; margin-top: 4px; }
.events-stat-icon { width: 36px; height: 36px; border-radius: 8px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; color: #555; flex: 0 0 auto; }
.events-content-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-bottom: 16px; }
.events-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.events-panel { padding: 20px; }
.events-panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.events-panel-title { font-size: 14px; font-weight: 700; color: #111; }
.events-link-btn { border: 0; background: transparent; color: #888; font-size: 12px; text-decoration: underline; padding: 0; }
.events-module-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.events-module-row { min-height: 64px; border: 1px solid #ebebeb; border-radius: 8px; background: #fff; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; }
.events-module-row:hover { border-color: #111; }
.events-module-icon { width: 34px; height: 34px; border-radius: 8px; background: #f5f5f5; color: #555; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.events-module-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.events-module-title { font-size: 13px; font-weight: 700; color: #111; }
.events-module-desc { font-size: 12px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.events-module-arrow { color: #aaa; font-size: 12px; }
.events-funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.events-funnel-label { font-size: 12px; color: #555; width: 118px; flex-shrink: 0; }
.events-funnel-bar-bg { flex: 1; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
.events-funnel-bar-fill { height: 100%; border-radius: 4px; }
.events-funnel-count { width: 28px; text-align: right; font-size: 12px; font-weight: 700; color: #111; }
.events-process-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.events-process-grid button { height: 40px; border: 1px solid #e8e8e8; border-radius: 8px; background: #fff; color: #555; font-size: 13px; font-weight: 600; }
.events-process-grid button:hover { border-color: #111; color: #111; }
.events-activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.events-activity-item:last-child { border-bottom: 0; }
.events-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: #111; margin-top: 6px; flex: 0 0 auto; }
.events-activity-text { font-size: 13px; color: #333; line-height: 1.5; }
.events-activity-time { font-size: 11px; color: #aaa; margin-top: 2px; }
.events-filter-row, .events-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.events-filter-row .form-control, .events-filter-row .form-select, .events-toolbar .form-control, .events-toolbar .form-select { height: 36px; border: 1px solid #e8e8e8; border-radius: 8px; font-size: 13px; }
.events-table-wrap, .events-card .table-responsive { background: #fff; border: 1px solid #ebebeb; border-radius: 12px; overflow: hidden; }
.events-card .table-responsive { border: 0; border-radius: 0; }
.events-table { margin-bottom: 0; }
.events-table thead { background: #fafafa; }
.events-table thead th { padding: 11px 16px; font-size: 11px; font-weight: 700; color: #888; letter-spacing: .5px; text-transform: uppercase; border-bottom: 1px solid #ebebeb; white-space: nowrap; }
.events-table tbody td { padding: 13px 16px; font-size: 13px; color: #333; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.events-table tbody tr:last-child td { border-bottom: 0; }
.events-table tbody tr { cursor: pointer; }
.events-table tbody tr:hover td { background: #fafafa; }
.events-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.events-stage-track { display: grid; grid-template-columns: repeat(8, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.events-stage-step { min-width: 110px; text-align: center; }
.events-stage-dot { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; border: 2px solid #d8dee8; color: #94a3b8; background: #fff; font-weight: 800; font-size: 12px; }
.events-stage-step.done .events-stage-dot { background: #111; border-color: #111; color: #fff; }
.events-stage-step.active .events-stage-dot { border-color: #111; color: #111; box-shadow: 0 0 0 4px rgba(0,0,0,.08); }
.events-stage-name { font-size: 11px; color: #64748b; font-weight: 700; }
.events-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.events-column { min-width: 280px; max-width: 280px; }
.events-column-head { padding: 14px 16px; border-radius: 12px 12px 0 0; color: #fff; }
.events-column-body { background: #f8fafc; border: 1px solid #e2e8f0; border-top: 0; border-radius: 0 0 12px 12px; padding: 10px; min-height: 420px; }
.events-board-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-bottom: 10px; box-shadow: none; }
.events-chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.events-chip { border: 1px solid #e2e8f0; background: #fff; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; color: #334155; }

@media (max-width: 991px) {
    .events-dashboard-area { height: calc(100vh - 150px); }
    .events-topbar { padding: 0 12px; gap: 8px; }
    .events-topbar-search { width: min(48vw, 260px); }
    .events-content { padding: 16px; }
    .events-page-header { align-items: flex-start; flex-direction: column; }
    .events-page-actions { justify-content: flex-start; }
    .events-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .events-content-grid, .events-bottom-grid { grid-template-columns: 1fr; }
    .events-module-list, .events-process-grid { grid-template-columns: 1fr; }
    .events-stage-track { grid-template-columns: repeat(8, 150px); }
    .events-column { min-width: 240px; max-width: 240px; }
}

@media (max-width: 576px) {
    .events-topbar-title, .events-icon-btn { display: none; }
    .events-topbar-search { width: 100%; }
    .events-kpi-grid { grid-template-columns: 1fr; }
}

.events-shell { min-height: calc(100vh - 170px); }
.events-shell .events-page-header { background: linear-gradient(135deg, #111827, #1f2937); color: #fff; border-radius: 24px; padding: 28px; position: relative; overflow: hidden; }
.events-shell .events-page-header::after { content: ""; position: absolute; inset: auto -60px -80px auto; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,0.08); }
.events-shell .events-page-body { margin-top: 18px; }
.events-shell .events-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; box-shadow: 0 8px 30px rgba(15, 23, 42, 0.05); }
.events-shell .events-stat-card { border: 1px solid #edf2f7; border-radius: 18px; background: #fff; padding: 18px; height: 100%; }
.events-shell .events-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8; font-weight: 700; }
.events-shell .events-stat-value { font-size: 28px; font-weight: 800; color: #0f172a; margin-top: 4px; }
.events-shell .events-stat-sub { font-size: 12px; color: #64748b; margin-top: 4px; }
.events-shell .events-module-card { border: 1px solid #e5e7eb; border-radius: 20px; background: linear-gradient(180deg, #fff, #f8fafc); padding: 20px; height: 100%; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.events-shell .events-module-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08); }
.events-shell .events-module-card .icon-box { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: #111827; color: #fff; }
.events-shell .events-filter-row { gap: 10px; }
.events-shell .events-filter-row .form-control, .events-shell .events-filter-row .form-select { border-radius: 14px; border-color: #dbe2ea; }
.events-shell .events-table thead th { font-size: 11px; text-transform: uppercase; color: #94a3b8; border-bottom-width: 1px; }
.events-shell .events-table tbody tr { cursor: pointer; }
.events-shell .events-table tbody tr:hover { background: #f8fafc; }
.events-shell .events-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 700; }
.events-shell .events-stage-track { display: grid; grid-template-columns: repeat(8, minmax(110px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.events-shell .events-stage-step { min-width: 110px; text-align: center; }
.events-shell .events-stage-dot { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; border: 2px solid #cbd5e1; color: #94a3b8; background: #fff; font-weight: 800; }
.events-shell .events-stage-step.done .events-stage-dot { background: #111827; border-color: #111827; color: #fff; }
.events-shell .events-stage-step.active .events-stage-dot { border-color: #0d6efd; color: #0d6efd; box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.12); }
.events-shell .events-stage-name { font-size: 11px; color: #64748b; font-weight: 700; }
.events-shell .events-notes-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 20px; overflow: hidden; }
.events-shell .events-note-item { padding: 14px 0; border-bottom: 1px solid #eef2f7; }
.events-shell .events-note-item:last-child { border-bottom: 0; }
.events-shell .events-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.events-shell .events-column { min-width: 280px; max-width: 280px; }
.events-shell .events-column-head { padding: 14px 16px; border-radius: 18px 18px 0 0; color: #fff; }
.events-shell .events-column-body { background: #f8fafc; border: 1px solid #e2e8f0; border-top: 0; border-radius: 0 0 18px 18px; padding: 10px; min-height: 420px; }
.events-shell .events-board-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 12px; margin-bottom: 10px; box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04); }
.events-shell .events-board-card:last-child { margin-bottom: 0; }
.events-shell .events-chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.events-shell .events-chip { border: 1px solid #e2e8f0; background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 12px; font-weight: 700; color: #334155; }
.events-shortcut-btn { background: #fff; }
@media (max-width: 992px) {
    .events-shell .events-stage-track { grid-template-columns: repeat(8, 150px); }
    .events-shell .events-column { min-width: 240px; max-width: 240px; }
}


  /* Dashboard Content CSS */
  .page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
  .page-header h1 { font-size: 22px; font-weight: 700; color: #111; }
  .page-header-sub { font-size: 13px; color: #888; margin-top: 2px; }
  .date-badge { font-size: 12px; color: #888; background: #fff; border: 1px solid #e8e8e8; border-radius: 6px; padding: 6px 12px; }
  .kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
  @media (max-width: 991px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
  .kpi-card { background: #fff; border-radius: 12px; border: 1px solid #ebebeb; padding: 18px 20px; }
  .kpi-label { font-size: 12px; color: #888; font-weight: 500; margin-bottom: 8px; }
  .kpi-value { font-size: 22px; font-weight: 700; color: #111; letter-spacing: -0.5px; }
  .kpi-sub { font-size: 12px; color: #aaa; margin-top: 4px; }
  .kpi-change { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; margin-top: 6px; }
  .kpi-up { color: #16a34a; background: #f0fdf4; }
  .kpi-down { color: #dc2626; background: #fef2f2; }
  .kpi-neutral { color: #888; background: #f5f5f5; }
  .kpi-icon-row { display: flex; align-items: flex-start; justify-content: space-between; }
  .kpi-icon-box { width: 36px; height: 36px; border-radius: 8px; background: #f5f5f5; display: flex; align-items: center; justify-content: center; color: #555; }
  .kpi-icon-box.black { background: #111; color: #fff; }
  .content-grid { display: grid; grid-template-columns: 1fr 340px; gap: 16px; margin-bottom: 16px; }
  @media (max-width: 991px) { .content-grid { grid-template-columns: 1fr; } }
  .chart-card { background: #fff; border-radius: 12px; border: 1px solid #ebebeb; padding: 20px; }
  .card-header-ui { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
  .card-title-ui { font-size: 14px; font-weight: 600; color: #111; }
  .card-action-ui { font-size: 12px; color: #888; cursor: pointer; text-decoration: underline; }
  .bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 145px; }
  .bar-group { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; }
  .bar-wrap { display: flex; gap: 3px; align-items: flex-end; width: 100%; height: 120px; }
  .bar { flex: 1; min-height: 4px; border-radius: 4px 4px 0 0; }
  .bar.primary { background: #111; }
  .bar.secondary { background: #e5e5e5; }
  .bar-label { font-size: 10px; color: #aaa; white-space: nowrap; }
  .chart-legend { display: flex; gap: 16px; margin-top: 12px; }
  .legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #888; }
  .legend-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
  .funnel-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .funnel-label { font-size: 12px; color: #555; width: 120px; flex-shrink: 0; }
  .funnel-bar-bg { flex: 1; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden; }
  .funnel-bar-fill { height: 100%; background: #111; border-radius: 4px; }
  .funnel-count { font-size: 12px; font-weight: 600; color: #111; width: 28px; text-align: right; }
  .bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  @media (max-width: 991px) { .bottom-grid { grid-template-columns: 1fr; } }

/* Final guide-layout overrides for legacy Events styles above */
.events-dashboard-area .events-shell { height: auto; min-height: 100%; display: flex; flex-direction: column; background: #f5f5f5; overflow: visible; }
.events-dashboard-area .events-shell .events-page-header { background: transparent; color: inherit; border-radius: 0; padding: 0; position: static; overflow: visible; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.events-dashboard-area .events-shell .events-page-header::after { display: none; }
.events-dashboard-area .events-shell .events-page-header h1 { margin: 0; font-size: 22px; font-weight: 800; color: #111; }
.events-dashboard-area .events-shell .events-page-body { margin-top: 0; }
.events-dashboard-area .events-shell .events-card,
.events-dashboard-area .events-shell .events-notes-panel { border-radius: 12px; box-shadow: none; border-color: #ebebeb; }
.events-dashboard-area .events-shell .events-stat-card { border-radius: 12px; border-color: #ebebeb; padding: 18px 20px; }
.events-dashboard-area .events-shell .events-stat-label { font-size: 12px; color: #888; font-weight: 600; margin-bottom: 8px; text-transform: none; letter-spacing: 0; }
.events-dashboard-area .events-shell .events-stat-value { font-size: 22px; color: #111; margin: 0; letter-spacing: 0; }
.events-dashboard-area .events-shell .events-stat-sub { color: #aaa; }
.events-dashboard-area .events-shell .events-filter-row .form-control,
.events-dashboard-area .events-shell .events-filter-row .form-select { height: 36px; border-radius: 8px; border-color: #e8e8e8; font-size: 13px; }
.events-dashboard-area .events-shell .events-table thead th { color: #888; padding: 11px 16px; border-bottom: 1px solid #ebebeb; }
.events-dashboard-area .events-shell .events-table tbody tr:hover td { background: #fafafa; }
.events-dashboard-area .events-shell .events-badge { border-radius: 20px; padding: 3px 8px; gap: 4px; font-weight: 600; }
.events-dashboard-area .events-shell .events-stage-dot { width: 32px; height: 32px; border-color: #d8dee8; font-size: 12px; }
.events-dashboard-area .events-shell .events-stage-step.done .events-stage-dot { background: #111; border-color: #111; }
.events-dashboard-area .events-shell .events-stage-step.active .events-stage-dot { border-color: #111; color: #111; box-shadow: 0 0 0 4px rgba(0,0,0,.08); }
.events-dashboard-area .events-shell .events-column-head { border-radius: 12px 12px 0 0; }
.events-dashboard-area .events-shell .events-column-body { border-radius: 0 0 12px 12px; }
.events-dashboard-area .events-shell .events-board-card { border-radius: 8px; box-shadow: none; }
.events-dashboard-area .events-shell .events-chip { border-radius: 8px; }

/* Events contracts */
.events-contract-kpi{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;margin-bottom:20px;}
.events-contract-stat{background:#fff;border:1px solid #ebebeb;border-radius:12px;padding:14px 18px;}
.events-contract-label{font-size:11px;font-weight:700;color:#888;text-transform:uppercase;letter-spacing:.5px;margin-bottom:5px;}
.events-contract-value{font-size:20px;font-weight:800;color:#111;}
.events-contract-value.green{color:#16a34a}.events-contract-value.red{color:#dc2626}.events-contract-value.orange{color:#d97706}
.events-contract-sub{font-size:11px;color:#aaa;margin-top:3px;}
.events-contract-toolbar{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap;}
.events-contract-search{display:flex;align-items:center;background:#fff;border:1px solid #e8e8e8;border-radius:8px;padding:0 12px;gap:8px;height:36px;flex:1;max-width:320px;color:#bbb;}
.events-contract-search input{border:0;background:transparent;outline:0;width:100%;font-size:13px;color:#111;}
.events-contract-select{height:36px;padding:0 10px;border:1px solid #e8e8e8;border-radius:8px;background:#fff;font-size:13px;color:#555;}
.events-contract-count{margin-left:auto;font-size:12px;color:#aaa;}
.events-contract-table{background:#fff;border:1px solid #ebebeb;border-radius:12px;overflow:auto;}
.firm-cell{display:flex;align-items:center;gap:10px;}
.firm-av{width:30px;height:30px;border-radius:7px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800;flex-shrink:0;}
.firm-name{font-size:13px;font-weight:700;color:#111;white-space:nowrap;}
.firm-id{font-size:11px;color:#bbb;}
.contract-id{font-size:12px;font-weight:700;color:#555;background:#f5f5f5;padding:3px 8px;border-radius:5px;font-family:monospace;white-space:nowrap;}
.amount-primary{font-size:13px;font-weight:700;color:#111;white-space:nowrap;}
.amount-sub{font-size:11px;color:#aaa;margin-top:2px;white-space:nowrap;}
.amount-paid{font-size:12px;color:#16a34a;font-weight:700;white-space:nowrap;}
.amount-due{font-size:12px;color:#dc2626;font-weight:700;white-space:nowrap;}
.inst-bar{display:flex;gap:2px;margin-top:4px;}
.inst-dot{width:8px;height:8px;border-radius:2px;display:inline-block;}
.inst-paid{background:#22c55e}.inst-pending{background:#e5e5e5}.inst-overdue{background:#ef4444}
.rep-cell{display:flex;align-items:center;gap:6px;font-size:12px;white-space:nowrap;}
.rep-av{width:22px;height:22px;border-radius:50%;background:#333;color:#fff;display:flex;align-items:center;justify-content:center;font-size:8px;font-weight:700;}
.contract-status{display:inline-flex;align-items:center;font-size:11px;font-weight:700;padding:3px 8px;border-radius:20px;white-space:nowrap;}
.badge-green{background:#f0fdf4;color:#16a34a}.badge-yellow{background:#fffbeb;color:#d97706}.badge-red{background:#fef2f2;color:#dc2626}.badge-gray{background:#f5f5f5;color:#888}
.row-actions.always-visible{opacity:1;display:flex;gap:5px;}
.row-btn{width:28px;height:28px;border-radius:6px;border:1px solid #e5e5e5;background:#fff;color:#888;display:inline-flex;align-items:center;justify-content:center;}
.row-btn:hover{border-color:#111;color:#111}.row-btn.red:hover{border-color:#ef4444;color:#ef4444;background:#fff5f5;}
.events-contract-form{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start;}
.events-contract-form-scroll{min-width:0;}
.events-contract-summary{background:#fff;border:1px solid #ebebeb;border-radius:12px;padding:20px;position:sticky;top:0;}
.contract-section{background:#fff;border:1px solid #ebebeb;border-radius:12px;padding:20px 24px;margin-bottom:14px;}
.contract-section-title{font-size:13px;font-weight:800;color:#111;margin-bottom:16px;padding-bottom:12px;border-bottom:1px solid #f0f0f0;display:flex;align-items:center;gap:8px;}
.contract-section-title span{width:22px;height:22px;background:#111;color:#fff;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11px;}
.contract-section-title small{margin-left:auto;font-size:11px;color:#aaa;font-weight:500;}
.contract-grid{display:grid;gap:14px;margin-bottom:14px;}
.contract-grid.two{grid-template-columns:1fr 1fr}.contract-grid.three{grid-template-columns:repeat(3,1fr)}
.contract-grid label,.contract-section label{font-size:12px;font-weight:700;color:#555;}
.contract-grid input,.contract-grid select,.contract-installment-row input,.contract-installment-row select,.price-label-input,.price-amount-input{width:100%;height:40px;border:1px solid #e5e5e5;border-radius:8px;padding:0 12px;font-size:13px;color:#111;background:#fafafa;outline:0;margin-top:6px;}
.contract-grid input:focus,.contract-grid select:focus,.contract-installment-row input:focus,.contract-installment-row select:focus,.price-label-input:focus,.price-amount-input:focus{border-color:#111;background:#fff;}
.contract-pricing-table{width:100%;border-collapse:collapse;}
.contract-pricing-table th{font-size:11px;color:#888;text-transform:uppercase;padding:6px 0;border-bottom:1px solid #f0f0f0;}
.contract-pricing-table td{padding:10px 6px;border-bottom:1px solid #f8f8f8;}
.price-amount-input{text-align:right;}
.contract-installment-row{display:grid;grid-template-columns:40px 1fr 1fr 110px 32px;gap:8px;align-items:center;margin-bottom:8px;}
.inst-num{font-size:12px;font-weight:700;color:#888;text-align:center;}
.contract-add-btn{border:0;background:transparent;color:#888;font-size:13px;font-weight:700;padding:8px 0;display:inline-flex;align-items:center;gap:6px;}
.contract-add-btn:hover{color:#111;}
.summary-title{font-size:14px;font-weight:800;color:#111;margin-bottom:20px;}
.summary-firm-card{background:#f5f5f5;border-radius:10px;padding:14px 16px;margin-bottom:20px;display:flex;align-items:center;gap:10px;}
.s-firm-avatar{width:36px;height:36px;border-radius:8px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;}
.s-firm-name{font-size:13px;font-weight:700;color:#111}.s-firm-fuar{font-size:11px;color:#888;}
.summary-line{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #f5f5f5;font-size:13px;}
.summary-line span{color:#888}.summary-total{display:flex;align-items:center;justify-content:space-between;padding:14px 0;font-size:15px;font-weight:800;color:#111;border-top:1px solid #e5e5e5;margin-top:8px;}
.summary-section-title{font-size:11px;font-weight:700;color:#888;text-transform:uppercase;letter-spacing:.5px;margin:16px 0 8px;}
.summary-inst-row{display:flex;justify-content:space-between;font-size:12px;color:#555;padding:5px 0;}
.contract-ok,.contract-warn{border-radius:8px;padding:10px 12px;margin-top:16px;font-size:12px;}
.contract-ok{background:#f0fdf4;border:1px solid #bbf7d0;color:#16a34a}.contract-warn{background:#fffbeb;border:1px solid #fde68a;color:#d97706}
@media(max-width:991px){.events-contract-kpi{grid-template-columns:1fr 1fr}.events-contract-form{grid-template-columns:1fr}.events-contract-summary{position:static}.contract-grid.two,.contract-grid.three{grid-template-columns:1fr}.contract-installment-row{grid-template-columns:28px 1fr}.contract-installment-row select,.contract-installment-row .row-btn{grid-column:auto}}
@media(max-width:576px){.events-contract-kpi{grid-template-columns:1fr}}

/* Guide-style funnel board */
.kanban-toolbar{height:auto;display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap;}
.board-container{overflow-x:auto;overflow-y:hidden;display:flex;gap:12px;align-items:flex-start;padding-bottom:8px;}
.kanban-col{width:240px;min-width:240px;display:flex;flex-direction:column;}
.col-header{padding:10px 12px;border-radius:10px 10px 0 0;background:#fff;border:1px solid #ebebeb;border-bottom:none;display:flex;flex-direction:column;gap:2px;}
.col-header-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.col-name{font-size:12px;font-weight:800;color:#111;}
.col-count{font-size:12px;font-weight:700;color:#888;background:#f5f5f5;padding:1px 7px;border-radius:10px;}
.col-amount{font-size:11px;color:#aaa;margin-top:1px;}
.col-indicator{height:3px;border-radius:0 0 3px 3px;}
.ind-gray{background:#e5e5e5}.ind-blue{background:#93c5fd}.ind-yellow{background:#fcd34d}.ind-orange{background:#fb923c}.ind-purple{background:#c084fc}.ind-green{background:#4ade80}.ind-red{background:#f87171}.ind-slate{background:#94a3b8}
.cards-area{background:#f8f8f8;border:1px solid #ebebeb;border-top:none;border-radius:0 0 10px 10px;padding:8px;min-height:120px;display:flex;flex-direction:column;gap:6px;max-height:calc(100vh - 265px);overflow-y:auto;}
.kanban-card{background:#fff;border-radius:8px;border:1px solid #ebebeb;padding:10px 12px;cursor:pointer;transition:box-shadow .15s,border-color .15s;}
.kanban-card:hover{box-shadow:0 2px 8px rgba(0,0,0,.08);border-color:#d0d0d0;}
.kanban-card.focus{border-color:#111;box-shadow:0 0 0 2px rgba(0,0,0,.08);}
.card-firm-name{font-size:12px;font-weight:700;color:#111;margin-bottom:4px;line-height:1.3;}
.card-firm-id{font-size:10px;color:#bbb;margin-bottom:6px;}
.card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.card-amount{font-size:12px;font-weight:800;color:#111;}
.card-rep{display:flex;align-items:center;gap:4px;}
.card-rep-avatar{width:18px;height:18px;border-radius:50%;background:#555;color:#fff;display:flex;align-items:center;justify-content:center;font-size:7px;font-weight:800;}
.card-rep-name{font-size:10px;color:#aaa;max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.card-days{font-size:10px;color:#bbb;margin-top:5px;}
.card-days.warning{color:#ef4444;}
.kanban-card.won{border-left:3px solid #22c55e}.kanban-card.lost{border-left:3px solid #ef4444}.kanban-card.delayed{border-left:3px solid #f59e0b}
.kanban-stage-select{width:100%;height:30px;border:1px solid #e8e8e8;border-radius:6px;background:#fafafa;font-size:11px;color:#555;margin-top:8px;}
.add-card-btn{display:flex;align-items:center;gap:6px;padding:7px 8px;border-radius:6px;cursor:pointer;font-size:12px;color:#bbb;background:none;border:none;width:100%;}
.add-card-btn:hover{background:#f0f0f0;color:#555;}
.kanban-empty{font-size:12px;color:#aaa;padding:8px;}

/* Guide-style reports */
.report-tabs{display:flex;gap:4px;margin-bottom:16px;flex-wrap:wrap;}
.report-tab{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;color:#888;background:#fff;border:1px solid #e8e8e8;}
.report-tab:hover{border-color:#111;color:#111}.report-tab.active{background:#111;color:#fff;border-color:#111;}
.report-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px;}
.report-kpi-grid.secondary{margin-bottom:20px;}
.report-kpi-card{background:#fff;border-radius:12px;border:1px solid #ebebeb;padding:16px 18px;}
.report-kpi-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;}
.report-kpi-icon.black{background:#111;color:#fff}.report-kpi-icon.green{background:#f0fdf4;color:#16a34a}.report-kpi-icon.red{background:#fef2f2;color:#dc2626}.report-kpi-icon.gray{background:#f5f5f5;color:#888;}
.report-charts-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px;}
.report-card{background:#fff;border-radius:12px;border:1px solid #ebebeb;padding:20px;}
.report-card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.report-table-header{padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;margin-bottom:0;}
.report-card-title{font-size:13px;font-weight:800;color:#111;}
.report-card-sub{font-size:11px;color:#aaa;margin-top:1px;}
.report-card-action{font-size:12px;color:#888;cursor:pointer;white-space:nowrap;}
.report-card-action:hover{color:#111;}
.report-stage-bars{display:flex;flex-direction:column;gap:12px;}
.donut-wrap{display:flex;align-items:center;gap:20px;}
.donut{width:90px;height:90px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;position:relative;}
.donut::after{content:'';position:absolute;width:56px;height:56px;background:#fff;border-radius:50%;}
.donut-center{position:absolute;z-index:1;font-size:13px;font-weight:800;color:#111;}
.donut-legend{flex:1;}
.donut-item{display:flex;align-items:center;gap:6px;margin-bottom:6px;font-size:12px;}
.donut-dot{width:8px;height:8px;border-radius:2px;flex-shrink:0;display:inline-block;}
.donut-name{flex:1;color:#555;}
.rep-table{width:100%;border-collapse:collapse;}
.rep-table th{font-size:10px;font-weight:700;color:#aaa;text-transform:uppercase;letter-spacing:.5px;padding:6px 0;text-align:left;border-bottom:1px solid #f0f0f0;}
.rep-table td{padding:10px 0;border-bottom:1px solid #f8f8f8;font-size:13px;color:#333;vertical-align:middle;}
.mini-bar-bg{height:5px;background:#f0f0f0;border-radius:3px;overflow:hidden;margin-top:3px;width:100%;}
.mini-bar-fill{height:100%;background:#111;border-radius:3px;}
.report-badge{display:inline-flex;font-size:10px;font-weight:800;padding:2px 7px;border-radius:4px;}
.report-badge.green{background:#f0fdf4;color:#16a34a}.report-badge.yellow{background:#fffbeb;color:#d97706}.report-badge.red{background:#fef2f2;color:#dc2626}
.report-table-scroll{overflow-y:auto;max-height:260px;}
.contracts-table{width:100%;border-collapse:collapse;}
.contracts-table th{padding:10px 12px;text-align:left;font-size:11px;font-weight:700;color:#888;text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid #ebebeb;background:#fafafa;}
.contracts-table td{padding:11px 12px;font-size:13px;color:#333;border-bottom:1px solid #f5f5f5;}
.contracts-table tr:hover td{background:#fafafa;}
@media(max-width:991px){.report-kpi-grid,.report-charts-grid{grid-template-columns:1fr}.board-container{max-width:100%}.cards-area{max-height:none}}

/* #dashboardArea is the single scroll container for Events screens. */
#dashboardArea.events-dashboard-area,
#dashboardArea.events-crm-dashboard {
    height: calc(100vh - 118px) !important;
    max-height: calc(100vh - 118px) !important;
    min-height: 0 !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
}

@media (max-width: 991px) {
    #dashboardArea.events-dashboard-area,
    #dashboardArea.events-crm-dashboard {
        height: calc(100dvh - 150px) !important;
        max-height: calc(100dvh - 150px) !important;
    }
}

/* Modern CRM dashboard */
.events-crm-dashboard { width: 100%; height: calc(100vh - 118px); min-height: 0; overflow-y: auto; overflow-x: hidden; background: #f4f6f8; color: #111827; padding: 20px; box-sizing: border-box; }
.crm-page { width: 100%; max-width: none; min-width: 0; margin: 0; }
.crm-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 24px; margin-bottom: 18px; background: #111827; color: #fff; border: 1px solid #1f2937; border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, .10); }
.crm-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #93c5fd; margin-bottom: 6px; }
.crm-hero h1 { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: 0; }
.crm-hero p { margin: 6px 0 0; font-size: 13px; color: #cbd5e1; }
.crm-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.crm-date { font-size: 12px; color: #dbeafe; white-space: nowrap; }
.crm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.crm-action { height: 36px; border-radius: 6px; border: 1px solid transparent; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; }
.crm-action.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.crm-action.ghost { background: rgba(255,255,255,.08); color: #e5e7eb; border-color: rgba(255,255,255,.18); }
.crm-action:hover { filter: brightness(.97); }
.crm-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.crm-kpi-grid.firm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crm-kpi-card { position: relative; min-height: 126px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); }
.crm-kpi-card.ink { border-top: 3px solid #111827; }
.crm-kpi-card.success { border-top: 3px solid #16a34a; }
.crm-kpi-card.warning { border-top: 3px solid #f59e0b; }
.crm-kpi-card.danger { border-top: 3px solid #dc2626; }
.crm-kpi-card.form { padding-bottom: 58px; }
.crm-kpi-card.form.done { background: #fbfdfc; border-color: #bbf7d0; }
.crm-kpi-label { font-size: 11px; color: #6b7280; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.crm-kpi-value { font-size: 24px; font-weight: 800; color: #111827; line-height: 1.15; overflow-wrap: anywhere; }
.crm-kpi-value.small { font-size: 18px; }
.crm-kpi-sub { font-size: 12px; color: #6b7280; margin-top: 5px; }
.crm-kpi-icon { width: 38px; height: 38px; border-radius: 8px; background: #eef2ff; color: #2563eb; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.crm-kpi-card.success .crm-kpi-icon, .crm-kpi-card.form.done .crm-kpi-icon { background: #dcfce7; color: #16a34a; }
.crm-kpi-card.warning .crm-kpi-icon { background: #fef3c7; color: #d97706; }
.crm-kpi-card.danger .crm-kpi-icon { background: #fee2e2; color: #dc2626; }
.crm-card-button { position: absolute; left: 18px; right: 18px; bottom: 16px; height: 34px; border: 1px solid #111827; border-radius: 6px; background: #111827; color: #fff; font-size: 12px; font-weight: 800; }
.crm-kpi-card.form.done .crm-card-button { background: #fff; color: #15803d; border-color: #86efac; }
.crm-kpi-card.form.disabled { opacity: .62; }
.crm-kpi-card.form.disabled .crm-card-button { cursor: not-allowed; }
.crm-main-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; margin-bottom: 14px; }
.crm-main-grid.firm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crm-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, .9fr); gap: 14px; }
.crm-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); min-width: 0; }
.crm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.crm-panel-title { font-size: 14px; font-weight: 800; color: #111827; }
.crm-panel-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.crm-link { border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; color: #374151; height: 30px; padding: 0 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.crm-link:hover { border-color: #111827; color: #111827; }
.crm-link.danger { color: #dc2626; }
.crm-bars { height: 180px; display: flex; align-items: flex-end; gap: 10px; padding-top: 8px; }
.crm-bar-group { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crm-bar-wrap { width: 100%; height: 145px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid #e5e7eb; }
.crm-bar { width: min(22px, 42%); min-height: 6px; border-radius: 5px 5px 0 0; display: block; }
.crm-bar.income { background: #2563eb; }
.crm-bar.collected { background: #16a34a; }
.crm-bar-group small { max-width: 100%; color: #6b7280; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-legend { display: flex; gap: 16px; margin-top: 12px; color: #6b7280; font-size: 12px; }
.crm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.crm-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.crm-legend i.income { background: #2563eb; }
.crm-legend i.collected { background: #16a34a; }
.crm-funnel { display: flex; flex-direction: column; gap: 12px; }
.crm-funnel-row { display: grid; grid-template-columns: 128px minmax(0,1fr) 34px; align-items: center; gap: 10px; }
.crm-funnel-label { font-size: 12px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-funnel-track { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.crm-funnel-track span { display: block; height: 100%; border-radius: inherit; }
.crm-funnel-row strong { font-size: 12px; color: #111827; text-align: right; }
.crm-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.crm-shortcut { min-height: 58px; display: grid; grid-template-columns: 32px minmax(0,1fr) 16px; align-items: center; gap: 10px; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 10px; text-align: left; }
.crm-shortcut:hover { border-color: #2563eb; background: #f8fbff; }
.crm-shortcut > i:first-child { width: 32px; height: 32px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: #eef2ff; color: #2563eb; }
.crm-shortcut span { min-width: 0; }
.crm-shortcut strong { display: block; color: #111827; font-size: 12px; }
.crm-shortcut small { display: block; color: #6b7280; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-feed, .crm-overdue-list, .crm-shop-list { display: flex; flex-direction: column; gap: 8px; }
.crm-feed-item { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.crm-feed-item:last-child { border-bottom: 0; }
.crm-feed-item > span { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.crm-feed-text { font-size: 13px; color: #374151; line-height: 1.45; }
.crm-feed-item small { color: #94a3b8; font-size: 11px; }
.crm-feed-item.is-clickable { cursor: pointer; border-radius: 10px; padding-left: 8px; padding-right: 8px; transition: background-color .16s ease; }
.crm-feed-item.is-clickable:hover { background: #f8fafc; }
.crm-feed-firm-link { color: #2563eb; text-decoration: none; font-weight: 700; }
.crm-feed-firm-link:hover { color: #1d4ed8; text-decoration: underline; }
.crm-overdue-item, .crm-shop-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; }
.crm-overdue-item:last-child, .crm-shop-item:last-child { border-bottom: 0; }
.crm-overdue-item strong, .crm-shop-item strong { display: block; color: #111827; font-size: 13px; }
.crm-overdue-item small, .crm-shop-item small { display: block; color: #6b7280; font-size: 11px; margin-top: 2px; }
.crm-overdue-item > div:last-child { text-align: right; }
.crm-overdue-item > div:last-child strong { color: #dc2626; }
.crm-overdue-item > div:last-child small { color: #dc2626; background: #fef2f2; border-radius: 5px; padding: 2px 6px; display: inline-block; }
.crm-shop-item button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #dbeafe; background: #eff6ff; color: #2563eb; }
.crm-progress-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.crm-progress { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.crm-progress-bar { height: 9px; flex: 1; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.crm-progress-bar span { display: block; height: 100%; background: #2563eb; border-radius: inherit; }
.crm-progress strong { color: #111827; font-size: 13px; }
.crm-money-summary { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.crm-money-summary div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid #f1f5f9; }
.crm-money-summary div:last-child { border-bottom: 0; background: #fafafa; }
.crm-money-summary span { color: #6b7280; font-size: 12px; font-weight: 700; }
.crm-money-summary strong { color: #111827; font-size: 15px; }
.crm-wide-button { width: 100%; height: 40px; border-radius: 6px; border: 1px solid #2563eb; background: #2563eb; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 13px; }
.crm-wide-button.success { border-color: #16a34a; background: #16a34a; }
.crm-empty { min-height: 86px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; font-weight: 700; text-align: center; border: 1px dashed #dbe2ea; border-radius: 8px; background: #fafafa; padding: 16px; }
@media (max-width: 1200px) {
    .crm-secondary-grid { grid-template-columns: 1fr 1fr; }
    .crm-secondary-grid .crm-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 991px) {
    .events-crm-dashboard { height: calc(100vh - 82px); padding: 14px; }
    .crm-hero { align-items: flex-start; flex-direction: column; padding: 18px; }
.contract-grid input,.contract-grid select,.contract-installment-row input,.contract-installment-row select,.price-label-input,.price-amount-input{width:100%;height:40px;border:1px solid #e5e5e5;border-radius:8px;padding:0 12px;font-size:13px;color:#111;background:#fafafa;outline:0;margin-top:6px;}
.contract-grid input:focus,.contract-grid select:focus,.contract-installment-row input:focus,.contract-installment-row select:focus,.price-label-input:focus,.price-amount-input:focus{border-color:#111;background:#fff;}
.contract-pricing-table{width:100%;border-collapse:collapse;}
.contract-pricing-table th{font-size:11px;color:#888;text-transform:uppercase;padding:6px 0;border-bottom:1px solid #f0f0f0;}
.contract-pricing-table td{padding:10px 6px;border-bottom:1px solid #f8f8f8;}
.price-amount-input{text-align:right;}
.contract-installment-row{display:grid;grid-template-columns:40px 1fr 1fr 110px 32px;gap:8px;align-items:center;margin-bottom:8px;}
.inst-num{font-size:12px;font-weight:700;color:#888;text-align:center;}
.contract-add-btn{border:0;background:transparent;color:#888;font-size:13px;font-weight:700;padding:8px 0;display:inline-flex;align-items:center;gap:6px;}
.contract-add-btn:hover{color:#111;}
.summary-title{font-size:14px;font-weight:800;color:#111;margin-bottom:20px;}
.summary-firm-card{background:#f5f5f5;border-radius:10px;padding:14px 16px;margin-bottom:20px;display:flex;align-items:center;gap:10px;}
.s-firm-avatar{width:36px;height:36px;border-radius:8px;background:#111;color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:800;}
.s-firm-name{font-size:13px;font-weight:700;color:#111}.s-firm-fuar{font-size:11px;color:#888;}
.summary-line{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #f5f5f5;font-size:13px;}
.summary-line span{color:#888}.summary-total{display:flex;align-items:center;justify-content:space-between;padding:14px 0;font-size:15px;font-weight:800;color:#111;border-top:1px solid #e5e5e5;margin-top:8px;}
.summary-section-title{font-size:11px;font-weight:700;color:#888;text-transform:uppercase;letter-spacing:.5px;margin:16px 0 8px;}
.summary-inst-row{display:flex;justify-content:space-between;font-size:12px;color:#555;padding:5px 0;}
.contract-ok,.contract-warn{border-radius:8px;padding:10px 12px;margin-top:16px;font-size:12px;}
.contract-ok{background:#f0fdf4;border:1px solid #bbf7d0;color:#16a34a}.contract-warn{background:#fffbeb;border:1px solid #fde68a;color:#d97706}
@media(max-width:991px){.events-contract-kpi{grid-template-columns:1fr 1fr}.events-contract-form{grid-template-columns:1fr}.events-contract-summary{position:static}.contract-grid.two,.contract-grid.three{grid-template-columns:1fr}.contract-installment-row{grid-template-columns:28px 1fr}.contract-installment-row select,.contract-installment-row .row-btn{grid-column:auto}}
@media(max-width:576px){.events-contract-kpi{grid-template-columns:1fr}}

/* Guide-style funnel board */
.kanban-toolbar{height:auto;display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap;}
.board-container{overflow-x:auto;overflow-y:hidden;display:flex;gap:12px;align-items:flex-start;padding-bottom:8px;}
.kanban-col{width:240px;min-width:240px;display:flex;flex-direction:column;}
.col-header{padding:10px 12px;border-radius:10px 10px 0 0;background:#fff;border:1px solid #ebebeb;border-bottom:none;display:flex;flex-direction:column;gap:2px;}
.col-header-top{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.col-name{font-size:12px;font-weight:800;color:#111;}
.col-count{font-size:12px;font-weight:700;color:#888;background:#f5f5f5;padding:1px 7px;border-radius:10px;}
.col-amount{font-size:11px;color:#aaa;margin-top:1px;}
.col-indicator{height:3px;border-radius:0 0 3px 3px;}
.ind-gray{background:#e5e5e5}.ind-blue{background:#93c5fd}.ind-yellow{background:#fcd34d}.ind-orange{background:#fb923c}.ind-purple{background:#c084fc}.ind-green{background:#4ade80}.ind-red{background:#f87171}.ind-slate{background:#94a3b8}
.cards-area{background:#f8f8f8;border:1px solid #ebebeb;border-top:none;border-radius:0 0 10px 10px;padding:8px;min-height:120px;display:flex;flex-direction:column;gap:6px;max-height:calc(100vh - 265px);overflow-y:auto;}
.kanban-card{background:#fff;border-radius:8px;border:1px solid #ebebeb;padding:10px 12px;cursor:pointer;transition:box-shadow .15s,border-color .15s;}
.kanban-card:hover{box-shadow:0 2px 8px rgba(0,0,0,.08);border-color:#d0d0d0;}
.kanban-card.focus{border-color:#111;box-shadow:0 0 0 2px rgba(0,0,0,.08);}
.card-firm-name{font-size:12px;font-weight:700;color:#111;margin-bottom:4px;line-height:1.3;}
.card-firm-id{font-size:10px;color:#bbb;margin-bottom:6px;}
.card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;}
.card-amount{font-size:12px;font-weight:800;color:#111;}
.card-rep{display:flex;align-items:center;gap:4px;}
.card-rep-avatar{width:18px;height:18px;border-radius:50%;background:#555;color:#fff;display:flex;align-items:center;justify-content:center;font-size:7px;font-weight:800;}
.card-rep-name{font-size:10px;color:#aaa;max-width:64px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.card-days{font-size:10px;color:#bbb;margin-top:5px;}
.card-days.warning{color:#ef4444;}
.kanban-card.won{border-left:3px solid #22c55e}.kanban-card.lost{border-left:3px solid #ef4444}.kanban-card.delayed{border-left:3px solid #f59e0b}
.kanban-stage-select{width:100%;height:30px;border:1px solid #e8e8e8;border-radius:6px;background:#fafafa;font-size:11px;color:#555;margin-top:8px;}
.add-card-btn{display:flex;align-items:center;gap:6px;padding:7px 8px;border-radius:6px;cursor:pointer;font-size:12px;color:#bbb;background:none;border:none;width:100%;}
.add-card-btn:hover{background:#f0f0f0;color:#555;}
.kanban-empty{font-size:12px;color:#aaa;padding:8px;}

/* Guide-style reports */
.report-tabs{display:flex;gap:4px;margin-bottom:16px;flex-wrap:wrap;}
.report-tab{padding:8px 16px;border-radius:8px;font-size:13px;font-weight:700;cursor:pointer;color:#888;background:#fff;border:1px solid #e8e8e8;}
.report-tab:hover{border-color:#111;color:#111}.report-tab.active{background:#111;color:#fff;border-color:#111;}
.report-kpi-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px;}
.report-kpi-grid.secondary{margin-bottom:20px;}
.report-kpi-card{background:#fff;border-radius:12px;border:1px solid #ebebeb;padding:16px 18px;}
.report-kpi-icon{width:32px;height:32px;border-radius:8px;display:flex;align-items:center;justify-content:center;}
.report-kpi-icon.black{background:#111;color:#fff}.report-kpi-icon.green{background:#f0fdf4;color:#16a34a}.report-kpi-icon.red{background:#fef2f2;color:#dc2626}.report-kpi-icon.gray{background:#f5f5f5;color:#888;}
.report-charts-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px;}
.report-card{background:#fff;border-radius:12px;border:1px solid #ebebeb;padding:20px;}
.report-card-header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;}
.report-table-header{padding:16px 20px 12px;border-bottom:1px solid #f0f0f0;margin-bottom:0;}
.report-card-title{font-size:13px;font-weight:800;color:#111;}
.report-card-sub{font-size:11px;color:#aaa;margin-top:1px;}
.report-card-action{font-size:12px;color:#888;cursor:pointer;white-space:nowrap;}
.report-card-action:hover{color:#111;}
.report-stage-bars{display:flex;flex-direction:column;gap:12px;}
.donut-wrap{display:flex;align-items:center;gap:20px;}
.donut{width:90px;height:90px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;position:relative;}
.donut::after{content:'';position:absolute;width:56px;height:56px;background:#fff;border-radius:50%;}
.donut-center{position:absolute;z-index:1;font-size:13px;font-weight:800;color:#111;}
.donut-legend{flex:1;}
.donut-item{display:flex;align-items:center;gap:6px;margin-bottom:6px;font-size:12px;}
.donut-dot{width:8px;height:8px;border-radius:2px;flex-shrink:0;display:inline-block;}
.donut-name{flex:1;color:#555;}
.rep-table{width:100%;border-collapse:collapse;}
.rep-table th{font-size:10px;font-weight:700;color:#aaa;text-transform:uppercase;letter-spacing:.5px;padding:6px 0;text-align:left;border-bottom:1px solid #f0f0f0;}
.rep-table td{padding:10px 0;border-bottom:1px solid #f8f8f8;font-size:13px;color:#333;vertical-align:middle;}
.mini-bar-bg{height:5px;background:#f0f0f0;border-radius:3px;overflow:hidden;margin-top:3px;width:100%;}
.mini-bar-fill{height:100%;background:#111;border-radius:3px;}
.report-badge{display:inline-flex;font-size:10px;font-weight:800;padding:2px 7px;border-radius:4px;}
.report-badge.green{background:#f0fdf4;color:#16a34a}.report-badge.yellow{background:#fffbeb;color:#d97706}.report-badge.red{background:#fef2f2;color:#dc2626}
.report-table-scroll{overflow-y:auto;max-height:260px;}
.contracts-table{width:100%;border-collapse:collapse;}
.contracts-table th{padding:10px 12px;text-align:left;font-size:11px;font-weight:700;color:#888;text-transform:uppercase;letter-spacing:.5px;border-bottom:1px solid #ebebeb;background:#fafafa;}
.contracts-table td{padding:11px 12px;font-size:13px;color:#333;border-bottom:1px solid #f5f5f5;}
.contracts-table tr:hover td{background:#fafafa;}
@media(max-width:991px){.report-kpi-grid,.report-charts-grid{grid-template-columns:1fr}.board-container{max-width:100%}.cards-area{max-height:none}}

/* Modern CRM dashboard */
.events-crm-dashboard { width: 100%; height: calc(100vh - 118px); min-height: 0; overflow-y: auto; overflow-x: hidden; background: #f4f6f8; color: #111827; padding: 20px; box-sizing: border-box; }
.crm-page { width: 100%; max-width: none; min-width: 0; margin: 0; }
.crm-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 24px; margin-bottom: 18px; background: #111827; color: #fff; border: 1px solid #1f2937; border-radius: 8px; box-shadow: 0 12px 28px rgba(15, 23, 42, .10); }
.crm-eyebrow { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #93c5fd; margin-bottom: 6px; }
.crm-hero h1 { margin: 0; font-size: 25px; line-height: 1.15; font-weight: 800; color: #fff; letter-spacing: 0; }
.crm-hero p { margin: 6px 0 0; font-size: 13px; color: #cbd5e1; }
.crm-hero-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.crm-date { font-size: 12px; color: #dbeafe; white-space: nowrap; }
.crm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.crm-action { height: 36px; border-radius: 6px; border: 1px solid transparent; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 700; }
.crm-action.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.crm-action.ghost { background: rgba(255,255,255,.08); color: #e5e7eb; border-color: rgba(255,255,255,.18); }
.crm-action:hover { filter: brightness(.97); }
.crm-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.crm-kpi-grid.firm { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.crm-kpi-card { position: relative; min-height: 126px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); }
.crm-kpi-card.ink { border-top: 3px solid #111827; }
.crm-kpi-card.success { border-top: 3px solid #16a34a; }
.crm-kpi-card.warning { border-top: 3px solid #f59e0b; }
.crm-kpi-card.danger { border-top: 3px solid #dc2626; }
.crm-kpi-card.form { padding-bottom: 58px; }
.crm-kpi-card.form.done { background: #fbfdfc; border-color: #bbf7d0; }
.crm-kpi-label { font-size: 11px; color: #6b7280; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px; }
.crm-kpi-value { font-size: 24px; font-weight: 800; color: #111827; line-height: 1.15; overflow-wrap: anywhere; }
.crm-kpi-value.small { font-size: 18px; }
.crm-kpi-sub { font-size: 12px; color: #6b7280; margin-top: 5px; }
.crm-kpi-icon { width: 38px; height: 38px; border-radius: 8px; background: #eef2ff; color: #2563eb; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.crm-kpi-card.success .crm-kpi-icon, .crm-kpi-card.form.done .crm-kpi-icon { background: #dcfce7; color: #16a34a; }
.crm-kpi-card.warning .crm-kpi-icon { background: #fef3c7; color: #d97706; }
.crm-kpi-card.danger .crm-kpi-icon { background: #fee2e2; color: #dc2626; }
.crm-card-button { position: absolute; left: 18px; right: 18px; bottom: 16px; height: 34px; border: 1px solid #111827; border-radius: 6px; background: #111827; color: #fff; font-size: 12px; font-weight: 800; }
.crm-kpi-card.form.done .crm-card-button { background: #fff; color: #15803d; border-color: #86efac; }
.crm-main-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; margin-bottom: 14px; }
.crm-main-grid.firm { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.crm-secondary-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(300px, .9fr); gap: 14px; }
.crm-panel { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; box-shadow: 0 6px 18px rgba(15, 23, 42, .04); min-width: 0; }
.crm-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.crm-panel-title { font-size: 14px; font-weight: 800; color: #111827; }
.crm-panel-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.crm-link { border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; color: #374151; height: 30px; padding: 0 10px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.crm-link:hover { border-color: #111827; color: #111827; }
.crm-link.danger { color: #dc2626; }
.crm-bars { height: 180px; display: flex; align-items: flex-end; gap: 10px; padding-top: 8px; }
.crm-bar-group { min-width: 0; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.crm-bar-wrap { width: 100%; height: 145px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; border-bottom: 1px solid #e5e7eb; }
.crm-bar { width: min(22px, 42%); min-height: 6px; border-radius: 5px 5px 0 0; display: block; }
.crm-bar.income { background: #2563eb; }
.crm-bar.collected { background: #16a34a; }
.crm-bar-group small { max-width: 100%; color: #6b7280; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-legend { display: flex; gap: 16px; margin-top: 12px; color: #6b7280; font-size: 12px; }
.crm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.crm-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.crm-legend i.income { background: #2563eb; }
.crm-legend i.collected { background: #16a34a; }
.crm-funnel { display: flex; flex-direction: column; gap: 12px; }
.crm-funnel-row { display: grid; grid-template-columns: 128px minmax(0,1fr) 34px; align-items: center; gap: 10px; }
.crm-funnel-label { font-size: 12px; color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-funnel-track { height: 8px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.crm-funnel-track span { display: block; height: 100%; border-radius: inherit; }
.crm-funnel-row strong { font-size: 12px; color: #111827; text-align: right; }
.crm-shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.crm-shortcut { min-height: 58px; display: grid; grid-template-columns: 32px minmax(0,1fr) 16px; align-items: center; gap: 10px; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 10px; text-align: left; }
.crm-shortcut:hover { border-color: #2563eb; background: #f8fbff; }
.crm-shortcut > i:first-child { width: 32px; height: 32px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: #eef2ff; color: #2563eb; }
.crm-shortcut span { min-width: 0; }
.crm-shortcut strong { display: block; color: #111827; font-size: 12px; }
.crm-shortcut small { display: block; color: #6b7280; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crm-feed, .crm-overdue-list, .crm-shop-list { display: flex; flex-direction: column; gap: 8px; }
.crm-feed-item { display: grid; grid-template-columns: 10px minmax(0,1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid #f1f5f9; }
.crm-feed-item:last-child { border-bottom: 0; }
.crm-feed-item > span { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; }
.crm-feed-text { font-size: 13px; color: #374151; line-height: 1.45; }
.crm-feed-item small { color: #94a3b8; font-size: 11px; }
.crm-overdue-item, .crm-shop-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f1f5f9; }
.crm-overdue-item:last-child, .crm-shop-item:last-child { border-bottom: 0; }
.crm-overdue-item strong, .crm-shop-item strong { display: block; color: #111827; font-size: 13px; }
.crm-overdue-item small, .crm-shop-item small { display: block; color: #6b7280; font-size: 11px; margin-top: 2px; }
.crm-overdue-item > div:last-child { text-align: right; }
.crm-overdue-item > div:last-child strong { color: #dc2626; }
.crm-overdue-item > div:last-child small { color: #dc2626; background: #fef2f2; border-radius: 5px; padding: 2px 6px; display: inline-block; }
.crm-shop-item button { width: 30px; height: 30px; border-radius: 6px; border: 1px solid #dbeafe; background: #eff6ff; color: #2563eb; }
.crm-progress-panel { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.crm-progress { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.crm-progress-bar { height: 9px; flex: 1; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.crm-progress-bar span { display: block; height: 100%; background: #2563eb; border-radius: inherit; }
.crm-progress strong { color: #111827; font-size: 13px; }
.crm-money-summary { border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.crm-money-summary div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border-bottom: 1px solid #f1f5f9; }
.crm-money-summary div:last-child { border-bottom: 0; background: #fafafa; }
.crm-money-summary span { color: #6b7280; font-size: 12px; font-weight: 700; }
.crm-money-summary strong { color: #111827; font-size: 15px; }
.crm-wide-button { width: 100%; height: 40px; border-radius: 6px; border: 1px solid #2563eb; background: #2563eb; color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 13px; }
.crm-wide-button.success { border-color: #16a34a; background: #16a34a; }
.crm-empty { min-height: 86px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 13px; font-weight: 700; text-align: center; border: 1px dashed #dbe2ea; border-radius: 8px; background: #fafafa; padding: 16px; }
@media (max-width: 1200px) {
    .crm-secondary-grid { grid-template-columns: 1fr 1fr; }
    .crm-secondary-grid .crm-panel:last-child { grid-column: 1 / -1; }
}
@media (max-width: 991px) {
    .events-crm-dashboard { height: auto; min-height: 100%; overflow-y: auto; padding: 12px; }
    .crm-hero { align-items: flex-start; flex-direction: column; padding: 16px; border-radius: 16px; margin-bottom: 12px; }
    .crm-hero-side { align-items: flex-start; width: 100%; }
    .crm-kpi-grid, .crm-kpi-grid.firm { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
    .crm-main-grid, .crm-main-grid.firm, .crm-secondary-grid, .crm-bottom-grid { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
    .crm-progress-panel { align-items: flex-start; flex-direction: column; border-radius: 16px; padding: 14px; gap: 10px; margin-bottom: 12px; }
    .crm-progress { min-width: 0; width: 100%; }
    .crm-panel { border-radius: 16px; padding: 14px; }
}
@media (max-width: 576px) {
    .crm-hero { padding: 14px; }
    .crm-hero h1 { font-size: 19px; }
    .crm-hero p { font-size: 12px; }
    .crm-kpi-grid, .crm-kpi-grid.firm { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .crm-kpi-card { padding: 12px; border-radius: 14px; }
    .crm-kpi-label { font-size: 11px; }
    .crm-kpi-value { font-size: 17px; }
    .crm-kpi-sub { font-size: 11px; }
    .crm-kpi-icon { width: 30px; height: 30px; font-size: 13px; }
    .crm-actions { width: 100%; justify-content: stretch; gap: 6px; }
    .crm-action { flex: 1; min-width: 0; padding: 8px 10px; font-size: 12px; justify-content: center; }
    .crm-date { white-space: normal; font-size: 11px; margin-bottom: 6px; }
    .crm-shortcut-grid { grid-template-columns: 1fr; gap: 8px; }
    .crm-shortcut { padding: 12px; border-radius: 12px; }
    .crm-funnel-row { grid-template-columns: 92px minmax(0,1fr) 28px; }
}

/* Extension Modals: Minimum size modal-xl */
.modal-dialog:not(.modal-fullscreen) {
    max-width: 1140px;
    width: 95%;
}
@media (min-width: 1200px) {
    .modal-dialog:not(.modal-fullscreen) {
        max-width: 1140px;
        --bs-modal-width: 1140px;
    }
}

/* Guide Modal Overflow Protection */
#modalGuidesViewer .modal-dialog {
    max-width: 1200px;
    width: 95vw;
    height: 88vh;
    margin: 1.75rem auto;
}
#modalGuidesViewer .modal-content {
    height: 100%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
#modalGuidesViewer .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}
.guide-article-body {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.guide-article-body img {
    max-width: 100% !important;
    height: auto !important;
}
.guide-article-body table {
    max-width: 100% !important;
    display: block;
    overflow-x: auto;
}
.guide-article-body pre, .guide-article-body code {
    white-space: pre-wrap !important;
    word-break: break-word !important;
}
