:root {
  --ui-btn-primary: #8893a5;
  --ui-btn-primary-hover: #738094;
  --ui-btn-outline: #6f7b8d;
  --ui-btn-outline-border: #cfd5de;
  --ui-btn-outline-bg: #f7f8fb;
}

/* Buttons */
.app-shell .btn {
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.app-shell .btn-primary {
  background: var(--ui-btn-primary);
  border-color: var(--ui-btn-primary);
}

.app-shell .btn-primary:hover,
.app-shell .btn-primary:focus {
  background: var(--ui-btn-primary-hover);
  border-color: var(--ui-btn-primary-hover);
}

.app-shell .btn-outline-primary {
  color: var(--ui-btn-outline);
  border-color: var(--ui-btn-outline-border);
  background: var(--ui-btn-outline-bg);
}

.app-shell .btn-outline-primary:hover,
.app-shell .btn-outline-primary:focus {
  color: #4f5868;
  border-color: #c3cad5;
  background: #eceff3;
}

.app-shell .btn-outline-secondary {
  color: #5e6674;
  border-color: #cfd5de;
  background: #f7f8fa;
}

.app-shell .btn-outline-secondary:hover,
.app-shell .btn-outline-secondary:focus {
  color: #2a313c;
  border-color: #bbc3cf;
  background: #eef1f5;
}

.app-shell .btn-outline-danger {
  color: #b86a7a;
  border-color: #e3b1bb;
  background: #fff9fa;
}

.app-shell .btn-outline-danger:hover,
.app-shell .btn-outline-danger:focus {
  color: #a85b6b;
  border-color: #d89daa;
  background: #fceef1;
}

/* Panel Header */
.app-shell .card-title-row {
  background: #f4f6f9;
  border-bottom: 1px solid #e2e6ed;
}

.app-shell .card-title-row h2,
.app-shell .card-title-row h3 {
  color: #2a313c;
  font-weight: 600;
}

/* Grid (all pages) */
.app-shell .table-responsive {
  border: 1px solid #dde2e9;
  background: #ffffff;
}

.app-shell .table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.app-shell .table thead th {
  background: #f3f5f8;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.76rem;
  text-align: center;
  vertical-align: middle;
  border-top: 1px solid #dde2e9;
  border-bottom: 1px solid #dde2e9;
  border-right: 1px solid #e3e7ee;
  white-space: nowrap;
  padding: 0.45rem 0.5rem;
}

.app-shell .table tbody td {
  color: #6b7280;
  font-weight: 400;
  font-size: 0.81rem;
  border-bottom: 1px solid #edf0f3;
  border-right: 1px solid #edf0f3;
  white-space: nowrap;
  padding: 0.45rem 0.5rem;
}

.app-shell .table thead th:last-child,
.app-shell .table tbody td:last-child {
  border-right: 0;
}

.app-shell .table tbody tr:hover td {
  background: #f7f9fc;
}

/* CommonCodes layout safety */
.commoncodes-grid-only {
  max-width: 100%;
  overflow: hidden;
}

.commoncodes-grid-only .commoncodes-panel {
  min-width: 0;
  overflow: hidden;
}

.commoncodes-grid-only .commoncodes-panel .card-body-area {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
}

.commoncodes-grid-only .commoncodes-search-row,
.commoncodes-grid-only .commoncodes-panel .card-body-area > .d-flex.align-items-center.justify-content-between {
  padding: 0.75rem 1rem;
}

.commoncodes-grid-only .commoncodes-sub-table-wrap {
  width: 100%;
  overflow-x: auto !important;
  overflow-y: auto;
  scrollbar-gutter: stable both-edges;
}

.commoncodes-grid-only .commoncodes-sub-table-wrap .commoncodes-table {
  min-width: 1700px !important;
}

/* Home calendar option */
.calendar-grid.no-radius {
  border-radius: 0 !important;
}

/* CommonCodes grid full-bleed (remove left spacing) */
.commoncodes-grid-only .commoncodes-table-wrap {
  flex: 1;
  min-height: 0;
  margin: 0;
  width: 100%;
  border-left: 0;
  border-right: 0;
}
