/*
 * IRMTS theme layer. Loaded after the NiceAdmin template CSS to modernise it consistently on every page:
 * one font family (the template mixed Open Sans, Nunito and Poppins), softer cards, cleaner tables,
 * calmer buttons/badges, tidier forms. Colours stay on the template's blue so nothing clashes.
 */
:root {
  --irmts-primary: #4154f1;
  --irmts-ink: #1f2a44;
  --irmts-muted: #6b7690;
  --irmts-line: #e8ecf5;
  --irmts-surface: #ffffff;
  --irmts-bg: #f5f7fb;
  --irmts-radius: 12px;
  --irmts-shadow: 0 1px 2px rgba(20, 30, 60, 0.04), 0 4px 14px rgba(20, 30, 60, 0.05);
}

/* ---- Typography: one family everywhere ---- */
body,
.header .logo,
.dashboard .card-title,
.card-title,
.pagetitle h1,
.sidebar-nav .nav-link,
.sidebar-nav .nav-heading,
.breadcrumb,
.header-nav .nav-profile,
.dropdown-menu,
h1, h2, h3, h4, h5, h6,
.btn, .badge, .form-control, .form-select, .table {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif !important;
}

body {
  background: var(--irmts-bg);
  color: var(--irmts-ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---- Page title ---- */
.pagetitle h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--irmts-ink);
}

.breadcrumb {
  font-size: 12.5px;
  margin-bottom: 0;
}

.breadcrumb-item a { color: var(--irmts-muted); }
.breadcrumb-item.active { color: var(--irmts-ink); }

/* ---- Cards ---- */
.card {
  border: 1px solid var(--irmts-line);
  border-radius: var(--irmts-radius);
  box-shadow: var(--irmts-shadow);
  background: var(--irmts-surface);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--irmts-ink);
  padding: 18px 0 14px;
}

.card-title span {
  color: var(--irmts-muted);
  font-weight: 400;
  font-size: 13px;
}

/* ---- Header & sidebar ---- */
.header {
  box-shadow: 0 1px 0 var(--irmts-line);
  background: var(--irmts-surface);
}

.sidebar {
  box-shadow: 1px 0 0 var(--irmts-line);
  background: var(--irmts-surface);
}

.sidebar-nav .nav-link {
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  padding: 9px 14px;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link[aria-expanded="true"] {
  background: #eef1ff;
  color: var(--irmts-primary);
  font-weight: 600;
}

.sidebar-nav .nav-heading {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: #98a2b8;
}

/* ---- Buttons ---- */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 8px 14px;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-sm { padding: 5px 10px; font-size: 13px; }

.btn-primary { background: var(--irmts-primary); border-color: var(--irmts-primary); }
.btn-primary:hover { background: #2f42d9; border-color: #2f42d9; }
.btn-outline-primary { color: var(--irmts-primary); border-color: #c9d0fb; }
.btn-outline-primary:hover { background: var(--irmts-primary); border-color: var(--irmts-primary); }
.btn-outline-secondary { border-color: var(--irmts-line); color: var(--irmts-muted); }
.btn-outline-secondary:hover { background: #f0f3fa; color: var(--irmts-ink); border-color: var(--irmts-line); }

/* ---- Badges: soft tinted pills ---- */
.badge {
  font-weight: 600;
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: 999px;
}

.badge.bg-success { background: #e3f6ea !important; color: #17803d; }
.badge.bg-warning { background: #fff3d6 !important; color: #946200; }
.badge.bg-danger { background: #fde4e4 !important; color: #b42318; }
.badge.bg-info { background: #e1f1fb !important; color: #0b6b9a; }
.badge.bg-secondary { background: #eceff5 !important; color: #566079; }
.badge.bg-primary { background: #e8ebff !important; color: #2f42d9; }
.badge.bg-dark { background: #e4e7ee !important; color: #1f2a44; }
/* Count bubbles on the header icons stay solid so they stand out */
.header-nav .badge-number { color: #fff !important; padding: 3px 6px; }
.header-nav .badge-number.bg-primary { background: var(--irmts-primary) !important; }
.header-nav .badge-number.bg-success { background: #2eca6a !important; }

/* ---- Tables ---- */
.table { --bs-table-hover-bg: #f8f9fe; margin-bottom: 0; }

.table > thead > tr > th {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--irmts-muted);
  background: #f8f9fc;
  border-bottom: 1px solid var(--irmts-line);
  padding: 11px 14px;
  white-space: nowrap;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
  padding: 13px 14px;
  vertical-align: middle;
  border-bottom: 1px solid var(--irmts-line);
}

.table > tbody > tr:last-child > td { border-bottom: 0; }
.table-borderless > :not(caption) > * > * { border-bottom-width: 1px; }
.table .text-muted-sm { color: var(--irmts-muted); font-size: 12.5px; }

/* simple-datatables controls */
.datatable-top, .datatable-bottom { padding: 8px 0; }
.datatable-input, .datatable-selector {
  border: 1px solid var(--irmts-line);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: 13.5px;
}
.datatable-input:focus, .datatable-selector:focus { outline: none; border-color: var(--irmts-primary); box-shadow: 0 0 0 3px rgba(65, 84, 241, 0.12); }
.datatable-pagination a { border-radius: 8px; }
.datatable-pagination .datatable-active a { background: var(--irmts-primary); color: #fff; }
.datatable-sorter::before, .datatable-sorter::after { opacity: 0.35; }

/* ---- Forms ---- */
.form-control, .form-select {
  border-radius: 8px;
  border-color: #dbe1ee;
  padding: 8px 12px;
}

.form-control:focus, .form-select:focus {
  border-color: var(--irmts-primary);
  box-shadow: 0 0 0 3px rgba(65, 84, 241, 0.12);
}

.form-label { font-weight: 500; font-size: 13px; color: var(--irmts-ink); }

/* ---- Dropdowns & alerts ---- */
.dropdown-menu {
  border: 1px solid var(--irmts-line);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(20, 30, 60, 0.12);
  font-size: 13.5px;
}

.dropdown-item { border-radius: 6px; margin: 1px 4px; width: auto; }

.alert { border-radius: 10px; border: 0; }

/* ---- Reusable page pieces ---- */
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.segmented {
  display: inline-flex;
  background: #eef1f8;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.segmented a {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--irmts-muted);
}

.segmented a:hover { color: var(--irmts-ink); }
.segmented a.active { background: #fff; color: var(--irmts-primary); box-shadow: 0 1px 3px rgba(20, 30, 60, 0.12); }

.empty-state { text-align: center; padding: 48px 16px; color: var(--irmts-muted); }
.empty-state i { font-size: 38px; color: #c4cbe0; display: block; margin-bottom: 8px; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 320px; }

.datatable-sorter { padding-right: 20px; }
.datatable-sorter::before, .datatable-sorter::after { right: 4px; }

/* ---- Select2 (type-ahead pickers) to match the form controls ---- */
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
  border: 1px solid #dbe1ee;
  border-radius: 8px;
  min-height: 40px;
  padding: 3px 6px;
}
.select2-container--default .select2-selection--single { padding: 5px 6px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 38px; }
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--irmts-primary);
  box-shadow: 0 0 0 3px rgba(65, 84, 241, 0.12);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: #e8ebff; border: 0; color: #2f42d9; border-radius: 999px; padding: 2px 10px; font-weight: 500;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: #2f42d9; margin-right: 6px; }
.select2-dropdown { border: 1px solid var(--irmts-line); border-radius: 10px; box-shadow: 0 8px 28px rgba(20, 30, 60, 0.12); overflow: hidden; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: #eef1ff; color: var(--irmts-ink); }

/* ---- Passport photos: portrait source shown in circles/cards without squashing ---- */
.profile-card img { width: 120px; height: 120px; object-fit: cover; object-position: top center; }
.footer { border-top: 1px solid var(--irmts-line); color: var(--irmts-muted); }
