/* assets/css/app.css
   Minimalist, modern, neutral theme. Rounded-square component style.
   Density: between compact and comfortable. Left nav on desktop.
*/

:root {
  --apex-bg: #f5f5f4;
  --apex-surface: #ffffff;
  --apex-border: #e2e2e0;
  --apex-text: #2a2a28;
  --apex-muted: #6b6b68;
  --apex-primary: #2f3e46;
  --apex-primary-hover: #1f2a30;
  --apex-accent: #52796f;
  --apex-radius: 10px;
  --apex-sidebar-width: 200px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--apex-bg);
  color: var(--apex-text);
  font-family: -apple-system, Roboto, Helvetica, Arial, sans-serif;
  font-size: 14.5px;
}

.apex-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.apex-sidebar {
  width: var(--apex-sidebar-width);
  background: var(--apex-primary);
  color: #eee;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.apex-sidebar-brand { padding: 20px 16px; display: flex; justify-content: center; }
.apex-sidebar-brand img { height: 26px; width: auto; max-width: 100%; }
.apex-nav { list-style: none; margin: 0; padding: 8px; flex: 1; overflow-y: auto; }
.apex-nav li a {
  display: flex; align-items: center; gap: 10px;
  color: #dfe3e2; text-decoration: none;
  padding: 10px 12px; border-radius: var(--apex-radius);
  margin-bottom: 2px; font-size: 14px;
}
.apex-nav li a:hover, .apex-nav li a.active { background: rgba(255,255,255,0.08); color: #fff; }
.apex-sidebar-user {
  padding: 14px 16px; border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px; display: flex; align-items: center; gap: 8px;
}
.apex-logout { margin-left: auto; color: #dfe3e2; }

/* ---- Content ---- */
.apex-content { flex: 1; padding: 24px 28px; max-width: 100%; }

/* ---- Rounded-square components ---- */
.card, .btn, .form-control, .form-select, .alert, .table, .modal-content, .badge {
  border-radius: var(--apex-radius) !important;
}
.card { border: 1px solid var(--apex-border); box-shadow: none; }
.btn-primary { background-color: var(--apex-primary); border-color: var(--apex-primary); }
.btn-primary:hover { background-color: var(--apex-primary-hover); border-color: var(--apex-primary-hover); }
.btn-accent { background-color: var(--apex-accent); border-color: var(--apex-accent); color: #fff; }

/* ---- Multi-column form layout ---- */
.apex-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 24px; }
.apex-form-grid .full-width { grid-column: 1 / -1; }
@media (max-width: 900px) { .apex-form-grid { grid-template-columns: 1fr; } }

/* ---- Listing pages ---- */
.apex-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.apex-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.apex-filters-narrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 250px)); gap: 10px; margin-bottom: 16px; }
table.apex-table th { font-size: 12.5px; text-transform: uppercase; color: var(--apex-muted); border-bottom: 2px solid var(--apex-border); }
table.apex-table td, table.apex-table th { padding: 10px 12px; vertical-align: middle; }

/* ---- Dashboard tiles ---- */
.apex-tile {
  background: var(--apex-surface); border: 1px solid var(--apex-border); border-radius: var(--apex-radius);
  padding: 10px; text-decoration: none; color: inherit; display: flex; flex-direction: column; justify-content: center;
  min-height: 76px; /* reserves space for 3 lines (label + value + sub-value) so every tile is the same height by default, even ones with only 2 lines of actual content */
}
.apex-tile:hover { border-color: var(--apex-primary); }
.apex-tile .tile-value { font-size: 20px; font-weight: 700; line-height: 1.25; }
.apex-tile .tile-label { color: var(--apex-muted); font-size: 11px; text-transform: uppercase; }

/* ---- Dashboard sidebar scroll panels (Account Tasks / Opportunity Tasks / Assigned
   Opportunities) — shows roughly 5 rows before scrolling internally, header stays
   pinned in view while the body scrolls. ---- */
/* Exact dashboard column split — Bootstrap's 12-column grid can't express 60/40
   precisely (closest is 7/5, i.e. 58.3%/41.7%), so these set the ratio directly. */
.apex-col-60 { flex: 0 0 60%; max-width: 60%; }
.apex-col-40 { flex: 0 0 40%; max-width: 40%; }
@media (max-width: 900px) { .apex-col-60, .apex-col-40 { flex: 0 0 100%; max-width: 100%; } }

.apex-scroll-panel { max-height: 240px; overflow-y: auto; }
.apex-scroll-panel table thead th { position: sticky; top: 0; background: var(--apex-surface); z-index: 1; }
.apex-scroll-panel tr.apex-row-link { cursor: pointer; }
.apex-scroll-panel tr.apex-row-link:hover { background: var(--apex-bg); }

/* ---- Kanban ---- */
.apex-kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.apex-kanban-col { background: var(--apex-surface); border: 1px solid var(--apex-border); border-radius: var(--apex-radius); min-width: 260px; flex: 1; padding: 10px; }
.apex-kanban-col h6 { text-transform: uppercase; font-size: 12px; color: var(--apex-muted); }
.apex-kanban-card { background: var(--apex-bg); border: 1px solid var(--apex-border); border-radius: var(--apex-radius); padding: 10px; margin-bottom: 8px; cursor: grab; }

/* ---- File manager ---- */
.apex-file-drop { border: 2px dashed var(--apex-border); border-radius: var(--apex-radius); padding: 30px; text-align: center; color: var(--apex-muted); }
.apex-file-drop.dragover { border-color: var(--apex-accent); background: #eef2f0; }

/* ---- Notes stream ---- */
.apex-note { border: 1px solid var(--apex-border); border-radius: var(--apex-radius); padding: 12px 14px; margin-bottom: 10px; background: var(--apex-surface); }
.apex-note-meta { font-size: 12px; color: var(--apex-muted); margin-bottom: 6px; }

/* ---- Status/probability badge colors ----
   Bootstrap's built-in badge palette doesn't include purple/true-orange, and
   its "warning" is more yellow than orange — these give exact colors for
   Account Status and Opportunity Probability badges. */
.badge-blue   { background-color: #0d6efd; color: #fff; }
.badge-purple { background-color: #6f42c1; color: #fff; }
.badge-yellow { background-color: #ffc107; color: #2a2a28; }
.badge-orange { background-color: #fd7e14; color: #fff; }
.badge-green  { background-color: #198754; color: #fff; }
.badge-grey   { background-color: #6c757d; color: #fff; }
