/* UI design system — scoped to page content; does not break CoreUI shell */

:root {
  --ui-primary: #434e78;
  --ui-primary-hover: #343d61;
  --ui-primary-soft: #e8eaf2;
  --ui-primary-focus-ring: rgba(67, 78, 120, 0.12);
  --ui-text: #2d3748;
  --ui-text-muted: #64748b;
  --ui-text-label: #475569;
  --ui-text-placeholder: #94a3b8;
  --ui-text-faint: #cbd5e1;
  --ui-body-bg: #f8fafc;
  --ui-surface: #ffffff;
  --ui-border: #e2e8f0;
  --ui-border-soft: #edf2f7;
  --ui-table-head-bg: #f8fafc;
  --ui-chip-bg: #f1f5f9;
  --ui-chip-info-bg: #eff6ff;
  --ui-chip-info-border: #bfdbfe;
  --ui-chip-info: #2563eb;
  --ui-chip-primary-bg: #eef2ff;
  --ui-chip-primary-border: #c7d2fe;
  --ui-chip-primary: #4f46e5;
  --ui-chip-warning-bg: #fff7ed;
  --ui-chip-warning-border: #fed7aa;
  --ui-chip-warning: #ea580c;
  --ui-chip-success-bg: #ecfdf5;
  --ui-chip-success-border: #a7f3d0;
  --ui-chip-success: #059669;
  --ui-chip-danger-bg: #fef2f2;
  --ui-chip-danger-border: #fecaca;
  --ui-chip-danger: #dc2626;
  --ui-font: 'Gandom', sans-serif;
  --ui-fs-base: 0.9rem;
  --ui-lh-base: 1.6;
  --ui-fs-page-title: 1.15rem;
  --ui-fs-card-title: 1.00rem;
  --ui-fs-section-title: 0.875rem;
  --ui-fs-label: 0.875rem;
  --ui-fs-table-head: 0.85rem;
  --ui-fs-btn-sm: 0.875rem;
  --ui-fs-empty-icon: 2.5rem;
  --ui-radius-input: 6px;
  --ui-radius-btn: 0.375rem;
  --ui-radius-chip: 0.55rem;
  --ui-content-pad: 1.25rem;
  --ui-header-pad-y: 0.75rem;
}

body {
  font-family: var(--ui-font), sans-serif;
  font-size: var(--ui-fs-base);
  line-height: var(--ui-lh-base);
  background: var(--ui-body-bg);
  color: var(--ui-text);
}

.ui-page,
.ui-page .form-label,
.ui-page .form-control,
.ui-page .form-select,
.ui-page .btn,
.ui-page .card,
.ui-page .table,
.ui-page h1,
.ui-page h2,
.ui-page h3,
.ui-page h4,
.ui-page h5,
.ui-page h6 {
  font-family: var(--ui-font), sans-serif;
}

/* Flat cards — only inside page content, never colored/stat cards */
.ui-page .card:not([class*="bg-"]):not(.text-white) {
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

.ui-page .card:not([class*="bg-"]):not(.text-white) > .card-body {
  background: #fff !important;
  padding: 1.25rem !important;
}

/* Main headers: underline accent */
.ui-page .card:not([class*="bg-"]) > .card-header,
.ui-page-header,
.ui-panel__header {
  background: transparent !important;
  color: #2d3748 !important;
  border: none !important;
  border-bottom: 2px solid #434e78 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

.ui-page .card:not([class*="bg-"]) > .card-header h1,
.ui-page .card:not([class*="bg-"]) > .card-header h2,
.ui-page .card:not([class*="bg-"]) > .card-header h3,
.ui-page .card:not([class*="bg-"]) > .card-header h4,
.ui-page .card:not([class*="bg-"]) > .card-header h5,
.ui-page .card:not([class*="bg-"]) > .card-header h6,
.ui-page-header__title,
.ui-panel__header {
  color: #2d3748 !important;
  font-size: 1rem !important;
  font-weight: 600 !important;
  margin-bottom: 0;
}

.ui-page-header__title,
.ui-panel__header {
  font-size: 1.15rem !important;
}

/* Nested section headers */
.ui-page .card .card > .card-header,
.ui-page form .card.mb-4 > .card-header,
.ui-form-section__title {
  border-bottom: none !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  color: #64748b !important;
}

/* Header action links */
.ui-page .card > .card-header .btn-light,
.ui-page .card > .card-header .btn-outline-light,
.ui-page-header__back {
  background: transparent !important;
  border: none !important;
  color: #434e78 !important;
  font-size: 0.875rem !important;
  box-shadow: none !important;
  text-decoration: none;
}

.ui-page .card > .card-header .btn-light:hover,
.ui-page .card > .card-header .btn-outline-light:hover,
.ui-page-header__back:hover {
  color: #343d61 !important;
  text-decoration: underline;
}

/* Forms */
.ui-page .form-label,
.ui-panel .form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.35rem;
}

.ui-page .form-control,
.ui-page .form-select,
.ui-panel .form-control,
.ui-panel .form-select {
  border-radius: 6px;
  border-color: #e2e8f0;
}

.ui-page .form-control:focus,
.ui-page .form-select:focus,
.ui-panel .form-control:focus,
.ui-panel .form-select:focus {
  border-color: #434e78;
  box-shadow: 0 0 0 0.15rem rgba(67, 78, 120, 0.12);
}

.ui-form-actions,
.ui-page form > .text-end,
.ui-page form > .text-start {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  margin-top: 0.25rem;
  border-top: 1px solid #edf2f7;
}

/* Tables */
.ui-table thead th,
.ui-page .table thead th,
.ui-page .table thead.table-dark th {
  background: #f8fafc !important;
  color: #434e78 !important;
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

.ui-page .table > :not(caption) > * > * {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Flat table action icons — color only, no chip backgrounds */
.ui-page .table .table-action-icons {
  display: inline-flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.35rem;
}

.ui-page .table .table-action-icons form {
  display: inline-flex !important;
  margin: 0;
}

.ui-page .table .btn-group > .btn,
.ui-page .table .table-action-icons > a,
.ui-page .table .table-action-icons > .btn,
.ui-page .table .table-action-icons form > .btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0 !important;
  border-radius: 0.55rem !important;
  border: none !important;
  background: transparent !important;
  color: #434e78 !important;
  box-shadow: none !important;
}

.ui-page .table .btn-group > .btn:hover,
.ui-page .table .table-action-icons > a:hover,
.ui-page .table .table-action-icons > .btn:hover,
.ui-page .table .table-action-icons form > .btn:hover {
  background: transparent !important;
  opacity: 0.75;
}

.ui-page .table .table-action-icons .icon {
  width: 1rem !important;
  height: 1rem !important;
  fill: currentColor !important;
}

.ui-page .table .btn-group > .btn.btn-outline-info,
.ui-page .table .btn-group > .btn.btn-info,
.ui-page .table .table-action-icons .btn-outline-info,
.ui-page .table .table-action-icons .btn-info,
.ui-page .table .table-action-icons .text-info {
  background: transparent !important;
  border: none !important;
  color: #434e78 !important;
}

.ui-page .table .btn-group > .btn.btn-outline-primary,
.ui-page .table .btn-group > .btn.btn-primary,
.ui-page .table .table-action-icons .btn-outline-primary,
.ui-page .table .table-action-icons .btn-primary,
.ui-page .table .table-action-icons .text-primary {
  background: transparent !important;
  border: none !important;
  color: #434e78 !important;
}

.ui-page .table .btn-group > .btn.btn-outline-warning,
.ui-page .table .btn-group > .btn.btn-warning,
.ui-page .table .table-action-icons .btn-outline-warning,
.ui-page .table .table-action-icons .btn-warning,
.ui-page .table .table-action-icons .text-warning {
  background: transparent !important;
  border: none !important;
  color: #434e78 !important;
}

.ui-page .table .btn-group > .btn.btn-outline-success,
.ui-page .table .btn-group > .btn.btn-success,
.ui-page .table .table-action-icons .btn-outline-success,
.ui-page .table .table-action-icons .btn-success,
.ui-page .table .table-action-icons .text-success {
  background: transparent !important;
  border: none !important;
  color: #434e78 !important;
}

.ui-page .table .btn-group > .btn.btn-outline-danger,
.ui-page .table .btn-group > .btn.btn-danger,
.ui-page .table .table-action-icons .btn-outline-danger,
.ui-page .table .table-action-icons .btn-danger,
.ui-page .table .table-action-icons .text-danger {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
}

.ui-page .table .btn-group > .btn.btn-outline-secondary,
.ui-page .table .btn-group > .btn.btn-secondary,
.ui-page .table .table-action-icons .btn-outline-secondary,
.ui-page .table .table-action-icons .btn-secondary {
  background: transparent !important;
  border: none !important;
  color: #64748b !important;
}

.ui-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #94a3b8;
}

.ui-empty-state i {
  font-size: 2.5rem;
  color: #cbd5e1;
}

.modal-header.bg-dark-green,
.modal-header.bg-primary,
.modal-header.bg-success {
  background-color: #434e78 !important;
  color: #fff !important;
  border-bottom: none !important;
}

.ui-page-header { margin-bottom: 1.25rem; }
.ui-panel__content { background: #fff; padding: 1.25rem; }
.ui-form-section { margin-bottom: 1.25rem; }
.ui-form-section__title { margin-bottom: 0.75rem; }

.ui-auto-fill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

/* Brand primary — do not override sidebar/nav shells */
.btn-primary,
.ui-page .btn-primary {
  background-color: #434e78 !important;
  border-color: #434e78 !important;
  color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.ui-page .btn-primary:hover,
.ui-page .btn-primary:focus,
.ui-page .btn-primary:active {
  background-color: #343d61 !important;
  border-color: #343d61 !important;
  color: #fff !important;
}

.btn-secondary {
  background-color: #64748b;
  border-color: #64748b;
  color: #fff !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active {
  background-color: #475569 !important;
  border-color: #475569 !important;
  color: #fff !important;
}

/* Form / page info buttons → brand primary */
.ui-page .btn-info,
.ui-page a.btn-info {
  background-color: #434e78 !important;
  border-color: #434e78 !important;
  color: #fff !important;
}

.ui-page .btn-info:hover,
.ui-page a.btn-info:hover {
  background-color: #343d61 !important;
  border-color: #343d61 !important;
  color: #fff !important;
}

.ui-page .bg-primary {
  background-color: #434e78 !important;
}

.ui-page .text-primary {
  color: #434e78 !important;
}

.ui-page a:not(.btn):not(.nav-link):not(.dropdown-item) {
  color: #434e78;
}

.ui-page a:not(.btn):not(.nav-link):not(.dropdown-item):hover {
  color: #343d61;
}

/* Shamsi datepicker theme */
.datepicker-plot-area {
  font-family: var(--ui-font), sans-serif !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 8px 24px rgba(45, 55, 72, 0.12) !important;
}
.datepicker-plot-area .datepicker-day-view .table-days td.selected span,
.datepicker-plot-area .datepicker-day-view .table-days td span.selected,
.datepicker-plot-area .datepicker-year-view .year-item-selected,
.datepicker-plot-area .datepicker-month-view .month-item-selected {
  background-color: #434e78 !important;
  border-color: #434e78 !important;
  color: #fff !important;
}
.datepicker-plot-area .datepicker-day-view .table-days td span:hover,
.datepicker-plot-area .datepicker-year-view .year-item:hover,
.datepicker-plot-area .datepicker-month-view .month-item:hover {
  background-color: #e8eaf2 !important;
  color: #434e78 !important;
}
.datepicker-plot-area .toolbox .pcal-btn,
.datepicker-plot-area .toolbox .btn-today,
.datepicker-plot-area .toolbox .btn-calendar {
  color: #434e78 !important;
}

.jalali-date {
  cursor: pointer;
  background-color: #fff;
}
.jalali-date[readonly] {
  background-color: #fff;
}

.ui-page form .btn-success,
.ui-page .text-end .btn-success,
.ui-page .ui-form-actions .btn-success {
  background-color: #434e78 !important;
  border-color: #434e78 !important;
  color: #fff !important;
}
