/* SphericalOne Design System — Zoho CRM–inspired extension layer */



:root {

  --sphere-primary: #2684ff;

  --sphere-primary-soft: #e8f3ff;

  --sphere-surface: #ffffff;

  --sphere-muted: #616e88;

  --sphere-border: #dde4ee;

  --sphere-success: #12b76a;

  --sphere-warning: #f79009;

  --sphere-danger: #e53e3e;

  --sphere-shadow-sm: none;

  --sphere-shadow-md: 0 2px 8px rgba(49, 57, 73, 0.1);

  --sphere-radius: 6px;

}



/* Grouped sidebar — light theme */

.sidebar-group {

  margin-bottom: 0.25rem;

}



.sidebar-group-toggle {

  width: 100%;

  display: flex;

  align-items: center;

  justify-content: space-between;

  gap: 0.5rem;

  padding: 0.4rem 0.75rem;

  border: 0;

  background: transparent;

  color: var(--crm-muted);

  font-size: 0.6875rem;

  font-weight: 700;

  letter-spacing: 0.06em;

  text-transform: uppercase;

  border-radius: var(--crm-radius-sm);

}



.sidebar-group-toggle:hover {

  color: var(--crm-text);

  background: var(--crm-sidebar-hover);

}



.sidebar-group-toggle i {

  font-size: 0.7rem;

  transition: transform 0.15s ease;

  color: var(--crm-muted);

}



.sidebar-group.is-collapsed .sidebar-group-items {

  display: none;

}



.sidebar-group.is-collapsed .sidebar-group-toggle i {

  transform: rotate(-90deg);

}



.sidebar-group-items {

  padding-bottom: 0.15rem;

}



/* Topbar — Zoho-style compact header */

.topbar-company {

  display: flex;

  align-items: center;

  gap: 0.55rem;

  min-width: 0;

  padding-right: 0.75rem;

  border-right: 1px solid var(--crm-border);

  margin-right: 0.25rem;

}



.topbar-company-logo {

  width: 28px;

  height: 28px;

  border-radius: 4px;

  object-fit: cover;

  flex-shrink: 0;

}



.topbar-company-name {

  font-weight: 600;

  font-size: 0.875rem;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

  max-width: 180px;

}



.topbar-search-wide {

  min-width: min(320px, 40vw);

}



.topbar-search-wide .form-control {

  border-radius: var(--crm-radius-sm);

  padding-left: 2.25rem;

  background: #f6f7fb;

  border-color: transparent;

  min-height: 34px;

}



.topbar-search-wide .form-control:focus {

  background: var(--crm-surface);

  border-color: var(--crm-primary);

}



.topbar-search-wrap {

  position: relative;

  flex: 1;

  max-width: 380px;

}



.topbar-search-wrap .bi-search {

  position: absolute;

  left: 0.75rem;

  top: 50%;

  transform: translateY(-50%);

  color: var(--crm-muted);

  pointer-events: none;

  font-size: 0.875rem;

}



.btn-quick-create {

  border-radius: var(--crm-radius-sm);

  padding-left: 0.75rem;

  padding-right: 0.85rem;

  font-weight: 600;

}



.btn-theme-toggle {

  opacity: 0.5;

  border-color: var(--crm-border);

}



/* Filter panel — compact Zoho list toolbar */

.crm-filter-panel {

  background: var(--crm-surface);

  border: 1px solid var(--crm-border);

  border-radius: var(--sphere-radius);

  padding: 0.75rem 1rem;

  margin-bottom: 0.75rem;

  box-shadow: none;

}



.crm-filter-panel .filter-panel-title {

  font-size: 0.75rem;

  font-weight: 600;

  color: var(--crm-muted);

  text-transform: uppercase;

  letter-spacing: 0.04em;

  margin-bottom: 0.65rem;

}



.crm-filter-panel .form-label {

  font-size: 0.75rem;

  margin-bottom: 0.25rem;

}



.crm-filter-panel .form-control,

.crm-filter-panel .form-select {

  min-height: 32px;

  font-size: 0.8125rem;

}



/* List table */

.crm-table-wrap {

  position: relative;

}



.crm-table-wrap .table thead {

  position: sticky;

  top: 0;

  z-index: 2;

  background: #f6f7fb;

}



.crm-table-wrap .table thead th {

  font-size: 0.8125rem;

  font-weight: 600;

  text-transform: none;

  letter-spacing: normal;

  color: var(--crm-muted);

  border-bottom: 1px solid var(--crm-border);

}



.crm-table-wrap .table thead th.sortable {

  cursor: pointer;

  user-select: none;

}



.crm-table-wrap .table thead th.sortable:hover {

  color: var(--sphere-primary);

}



.crm-table-wrap .table tbody tr:hover {

  background: #f4f8ff;

}



.crm-table-wrap .table tbody td a {

  color: var(--sphere-primary);

  text-decoration: none;

  font-weight: 500;

}



.crm-table-wrap .table tbody td a:hover {

  text-decoration: underline;

}



.crm-bulk-bar {

  display: none;

  align-items: center;

  justify-content: space-between;

  gap: 0.75rem;

  padding: 0.55rem 1rem;

  background: var(--sphere-primary-soft);

  border-bottom: 1px solid var(--crm-border);

  font-size: 0.8125rem;

}



.crm-bulk-bar.is-visible {

  display: flex;

}



.crm-pagination {

  display: flex;

  align-items: center;

  justify-content: space-between;

  flex-wrap: wrap;

  gap: 0.75rem;

  padding: 0.65rem 1rem;

  border-top: 1px solid var(--crm-border);

  background: var(--crm-surface);

  font-size: 0.8125rem;

}



.crm-pagination .pagination .page-link {

  border-radius: var(--crm-radius-sm);

  color: var(--crm-text);

  font-size: 0.8125rem;

  padding: 0.3rem 0.6rem;

  border-color: #c8d0dc;

}



.crm-pagination .pagination .page-item.active .page-link {

  background: var(--sphere-primary);

  border-color: var(--sphere-primary);

}



/* Executive stat cards */

.exec-stat-card {

  background: var(--crm-surface);

  border: 1px solid var(--crm-border);

  border-radius: var(--sphere-radius);

  padding: 1rem 1.15rem;

  height: 100%;

  box-shadow: none;

  display: flex;

  gap: 0.75rem;

  align-items: flex-start;

}



.exec-stat-icon {

  width: 38px;

  height: 38px;

  border-radius: 6px;

  display: flex;

  align-items: center;

  justify-content: center;

  flex-shrink: 0;

  font-size: 1rem;

}



.exec-stat-icon.blue { background: #e8f3ff; color: #2684ff; }

.exec-stat-icon.green { background: #e6f9ef; color: #12b76a; }

.exec-stat-icon.orange { background: #fff4e5; color: #c56a00; }

.exec-stat-icon.red { background: #fdeaea; color: #e53e3e; }

.exec-stat-icon.gray { background: #f4f6f9; color: #616e88; }



.exec-stat-label {

  font-size: 0.8125rem;

  color: var(--crm-muted);

  margin-bottom: 0.1rem;

}



.exec-stat-value {

  font-size: 1.375rem;

  font-weight: 700;

  line-height: 1.2;

  color: var(--crm-text);

}



.exec-stat-trend {

  font-size: 0.75rem;

  margin-top: 0.2rem;

}



.exec-stat-trend.up { color: var(--sphere-success); }

.exec-stat-trend.down { color: var(--sphere-danger); }



/* Calendar grid */

.calendar-grid {

  display: grid;

  grid-template-columns: repeat(7, minmax(0, 1fr));

  gap: 0.5rem;

}



.calendar-day {

  background: var(--crm-surface);

  border: 1px solid var(--crm-border);

  border-radius: var(--crm-radius-sm);

  min-height: 100px;

  padding: 0.5rem;

}



.calendar-day-header {

  font-size: 0.75rem;

  font-weight: 600;

  color: var(--crm-muted);

  margin-bottom: 0.35rem;

}



.calendar-event {

  display: block;

  font-size: 0.6875rem;

  padding: 0.2rem 0.35rem;

  border-radius: 3px;

  background: var(--sphere-primary-soft);

  color: var(--sphere-primary);

  text-decoration: none;

  margin-bottom: 0.2rem;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;

}



.calendar-event:hover {

  background: #d4e8ff;

}



/* System info */

.system-info-grid {

  display: grid;

  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));

  gap: 0.75rem;

}



.system-info-item {

  background: #f6f7fb;

  border: 1px solid var(--crm-border);

  border-radius: var(--crm-radius-sm);

  padding: 0.75rem 1rem;

}



.system-info-item dt {

  font-size: 0.75rem;

  color: var(--crm-muted);

  text-transform: uppercase;

  letter-spacing: 0.03em;

}



.system-info-item dd {

  margin: 0.2rem 0 0;

  font-weight: 600;

  font-size: 0.875rem;

}



/* Zoho-style record form */

.content-card form .mb-3:last-of-type {

  margin-bottom: 1.25rem !important;

}



.content-card form > .d-flex {

  margin-top: 0.5rem;

  padding-top: 1rem;

  border-top: 1px solid var(--crm-border);

  gap: 0.5rem !important;

}



.content-card form > .d-flex .btn-primary {

  min-width: 80px;

  font-weight: 600;

}



/* Zoho-style record detail */

.content-card dl.row dt {

  font-size: 0.8125rem;

  font-weight: 500;

  color: var(--crm-muted);

  padding-top: 0.5rem;

  padding-bottom: 0.5rem;

  border-bottom: 1px solid #f0f2f5;

}



.content-card dl.row dd {

  font-size: 0.875rem;

  font-weight: 500;

  color: var(--crm-text);

  padding-top: 0.5rem;

  padding-bottom: 0.5rem;

  border-bottom: 1px solid #f0f2f5;

  margin-bottom: 0;

}



.content-card dl.row dt:last-of-type,

.content-card dl.row dd:last-of-type {

  border-bottom: 0;

}



/* Dropdown menus — Zoho action menus */

.dropdown-menu {

  padding: 0.35rem 0;

  font-size: 0.8125rem;

}



.dropdown-item {

  padding: 0.4rem 0.85rem;

  color: var(--crm-text);

}



.dropdown-item:hover,

.dropdown-item:focus {

  background: #f4f8ff;

  color: var(--sphere-primary);

}



.dropdown-item.text-danger:hover {

  background: #fdeaea;

  color: var(--sphere-danger);

}



@media (max-width: 991.98px) {

  .topbar-company-name {

    display: none;

  }



  .topbar-search-wrap {

    display: none;

  }

}



@media (max-width: 767.98px) {

  .page-actions-toolbar .btn span.btn-label,

  .page-actions .btn span.btn-label {

    display: none;

  }

}


