/*BEGIN_USER_STYLES*/

/* ============================================ */
/* 1. Modern Typography & Base Styles           */
/* ============================================ */
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 0.9375rem;          /* 15px */
  line-height: 1.5;
  color: #1e293b;                /* Slate 800 */
  background-color: #f8fafc;     /* Slate 50 */
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #0f172a;                /* Slate 900 */
}

/* ============================================ */
/* 2. Color Palette (Modern Green/Blue Accents) */
/* ============================================ */
:root {
  --primary: #0f6e3f;            /* Rich procurement green */
  --primary-dark: #0a4d2c;
  --primary-light: #eaf7f0;
  --secondary: #475569;          /* Slate 600 */
  --accent: #2c7da0;             /* Trustworthy blue */
  --border-light: #e2e8f0;       /* Slate 200 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

/* Override Bootstrap theme colours (optional) */
[data-bs-theme="light"] .ew-grid {
  border-color: var(--border-light);
}
[data-bs-theme="light"] .ew-grid .ew-grid-upper-panel {
  border-bottom-color: var(--primary);
}
[data-bs-theme="light"] .ew-grid .ew-table > thead > *,
[data-bs-theme="light"] .ew-grid .ew-table > thead > * > * {
  border-bottom-color: var(--primary) !important;
}
[data-bs-theme="light"] .ew-grid .ew-table .ew-table-header > th,
[data-bs-theme="light"] .ew-grid .ew-table .ew-table-header > td {
  background-color: var(--primary);
  color: white;
  font-weight: 500;
}

/* ============================================ */
/* 3. Cards, Panels & Grid Containers           */
/* ============================================ */
.card,
.ew-grid,
.ew-search-panel > .card {
  border: none;
  border-radius: 1rem;
  background-color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease;
}

.card:hover,
.ew-grid:hover {
  box-shadow: var(--shadow-md);
}

.ew-grid-upper-panel.card-header,
.ew-grid-lower-panel.card-footer {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 1rem;
}

.ew-grid-lower-panel.card-footer {
  border-top: 1px solid var(--border-light);
  border-bottom: none;
}

/* ============================================ */
/* 4. Tables – Clean & Modern                   */
/* ============================================ */
.ew-table {
  font-size: 0.875rem;
  border-collapse: separate;
  border-spacing: 0;
}

.ew-table > thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #334155;
  background-color: #f1f5f9;
  border-bottom: 1px solid var(--border-light);
  padding: 0.75rem 1rem;
}

.ew-table > tbody td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
  color: #1e293b;
}

.ew-table > tbody tr:hover td {
  background-color: #f8fafc;
}

.ew-table-striped > tbody tr:nth-of-type(odd) > * {
  background-color: #fafcff;
}

/* ============================================ */
/* 5. Buttons & Action Links                    */
/* ============================================ */
.btn,
a.btn,
button.ew-btn {
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.15s ease-in-out;
  box-shadow: none;
  border: 1px solid transparent;
}

.btn-primary,
a.btn-primary {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}
.btn-primary:hover,
a.btn-primary:hover {
  background-color: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary {
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Icon buttons – more subtle */
a:not(.btn) .icon-view,
a:not(.btn) .icon-edit,
a:not(.btn) .icon-inline-edit,
a:not(.btn) .icon-copy,
a:not(.btn) .icon-inline-copy {
  color: #64748b;
  transition: color 0.2s;
}
a:not(.btn):hover .icon-view,
a:not(.btn):hover .icon-edit,
a:not(.btn):hover .icon-inline-edit,
a:not(.btn):hover .icon-copy,
a:not(.btn):hover .icon-inline-copy {
  color: var(--primary);
}

/* ============================================ */
/* 6. Forms – Improved Inputs & Focus           */
/* ============================================ */
.form-control,
.form-select,
.input-group-text {
  border-radius: 0.5rem;
  border: 1px solid var(--border-light);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 110, 63, 0.15);
  outline: none;
}

label {
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.25rem;
}

/* ============================================ */
/* 7. Pagination & Pager                        */
/* ============================================ */
.ew-pager .pagination {
  gap: 0.25rem;
}
.ew-pager .page-link {
  border-radius: 0.5rem;
  border: 1px solid var(--border-light);
  color: #334155;
  background-color: white;
  transition: all 0.2s;
}
.ew-pager .page-link:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-light);
  color: var(--primary);
}
.ew-pager .active .page-link {
  background-color: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* ============================================ */
/* 8. Search Panel & Filters                    */
/* ============================================ */
.ew-search-panel {
  margin-bottom: 1.5rem;
}
.ew-search-panel .card-header {
  background-color: #f8fafc;
  border-bottom: none;
  font-weight: 600;
  padding: 1rem 1rem 0 1rem;
}
.ew-search-panel .card-body {
  padding: 1rem;
}
.ew-extended-search .row {
  align-items: flex-end;
}

/* ============================================ */
/* 9. Responsive Adjustments                    */
/* ============================================ */
@media (min-width: 768px) {
  .ew-grid {
    border-radius: 1rem;
    overflow: hidden;
  }
  .ew-table > thead th:first-child {
    border-top-left-radius: 1rem;
  }
  .ew-table > thead th:last-child {
    border-top-right-radius: 1rem;
  }
}

@media (max-width: 767.98px) {
  .ew-grid .ew-grid-middle-panel {
    border-radius: 0;
  }
  .ew-table > thead th {
    font-size: 0.7rem;
    padding: 0.5rem;
  }
  .ew-table > tbody td {
    padding: 0.75rem 0.5rem;
  }
}

/* ============================================ */
/* 10. Tooltips & Notifications                 */
/* ============================================ */
.tippy-box {
  background-color: #1e293b;
  font-size: 0.8125rem;
  border-radius: 0.5rem;
}
.tippy-box .tippy-arrow {
  color: #1e293b;
}

.toast {
  border-radius: 0.75rem;
  border: none;
  box-shadow: var(--shadow-md);
  background-color: white;
}

/* ============================================ */
/* 11. Modern Scrollbars (optional)             */
/* ============================================ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/*END_USER_STYLES*/