/* ====================================================================
   THAIDENTAL ADMIN DESIGN SYSTEM & COMMON STYLES
   Royal Purple & Amethyst Theme (Inspired by Official DAT Logo)
   ==================================================================== */

:root {
  --admin-bg-gradient: linear-gradient(135deg, #1e1b4b 0%, #0f172a 50%, #030712 100%);
  --admin-primary: #6b21a8;
  --admin-primary-hover: #581c87;
  --admin-primary-gradient: linear-gradient(135deg, #7e22ce 0%, #581c87 100%);
  --admin-accent: #c084fc;
  --admin-accent-glow: rgba(192, 132, 252, 0.35);
  --admin-slate-header: linear-gradient(135deg, #2e1065 0%, #3b0764 100%);
  --admin-table-header: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%);
  --admin-text-main: #1e1b4b;
  --admin-text-muted: #64748b;
  --admin-border-color: #cbd5e1;
  --admin-card-bg: #ffffff;
  --admin-radius-sm: 6px;
  --admin-radius-md: 10px;
  --admin-radius-lg: 16px;
  --admin-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --admin-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.12);
  --admin-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Base icon alignment */
[class^="ri-"], [class*=" ri-"] {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

/* ====================================================================
   CARD HEADER & EW-CARD DESIGN SYSTEM (Matching Prototype webd)
   ==================================================================== */

.ew-card,
.admin-data-card {
  border-radius: 0.75rem !important;
  border: 1px solid rgba(126, 34, 206, 0.15) !important;
  overflow: hidden !important;
}

.ew-card-header,
.card-header.admin-card-header,
.historylog-card .card-header,
.colored-card-header {
  background: linear-gradient(135deg, #2e1065 0%, #3b0764 100%) !important;
  color: #ffffff !important;
  border-bottom: 1px solid #581c87 !important;
  border-radius: 0.75rem 0.75rem 0 0 !important;
  padding: 1.1rem 1.4rem !important;
}

.ew-card-header .ew-icon-wrap,
.admin-card-heading-icon {
  width: 3.2rem !important;
  height: 3.2rem !important;
  background: rgba(255, 255, 255, 0.18) !important;
  border-radius: 0.65rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin-right: 0.5rem !important;
}

.ew-card-header .ew-title,
.admin-card-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  color: #ffffff !important;
  line-height: 1.25 !important;
}

.ew-card-header .ew-subtitle,
.admin-card-subtitle {
  font-size: 0.9rem !important;
  color: rgba(255, 255, 255, 0.78) !important;
  margin-top: 2px !important;
}

/* ====================================================================
   HEADER COMBO BAR - SEAMLESS UNIFIED PILL CONTAINER
   ==================================================================== */

/* Outer pill container - ONLY this has border & radius */
.ew-hdr-combo {
  display: flex !important;
  align-items: stretch !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.375rem !important;
  overflow: hidden !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
}

.ew-hdr-combo:focus-within {
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
}

/*
 * NUCLEAR RESET: Strip ALL visual styling from EVERY child inside .ew-hdr-combo
 * Using the broadest possible selector to defeat Bootstrap 4 base styles.
 * This covers .form-control, .custom-select, .form-select, .btn, <input>, <select>, <button>, <a>, <div>
 */
.ew-hdr-combo > *:not(.ew-hdr-combo-divider),
.ew-hdr-combo > * > *,
.ew-hdr-combo > * > * > *,
.ew-hdr-combo .ew-hdr-combo-item,
.ew-hdr-combo .ew-hdr-combo-select,
.ew-hdr-combo .ew-hdr-combo-search,
.ew-hdr-combo .ew-hdr-combo-btn,
.ew-hdr-combo .ew-hdr-combo-reset,
.ew-hdr-combo .form-select,
.ew-hdr-combo .custom-select,
.ew-hdr-combo .form-control,
.ew-hdr-combo select,
.ew-hdr-combo input[type="text"],
.ew-hdr-combo input:not([type="hidden"]),
.ew-hdr-combo button,
.ew-hdr-combo a.btn,
.content-wrapper .ew-hdr-combo .form-control,
.content-wrapper .ew-hdr-combo .custom-select,
.content-wrapper .ew-hdr-combo select,
.content-wrapper .ew-hdr-combo input,
.content-wrapper .card .ew-hdr-combo .form-control,
.content-wrapper .card .ew-hdr-combo .custom-select,
.content-wrapper .card .ew-hdr-combo select,
.content-wrapper .card .ew-hdr-combo input {
  border: none !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
  -moz-border-radius: 0 !important;
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
}

/* Wrapper items inside combo (select/item wrappers) — strip completely */
.ew-hdr-combo .ew-hdr-combo-item {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* Override admin-data-page.css ID-level rules inside combo */
.content-wrapper .card:has(table#example) .ew-hdr-combo #searchtype,
.content-wrapper .card:has(table#example) .ew-hdr-combo #searchtext,
.content-wrapper .card .ew-hdr-combo #searchtype,
.content-wrapper .card .ew-hdr-combo #searchtext {
  border: none !important;
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
  border-left: none !important;
  border-width: 0 !important;
  border-style: none !important;
  border-color: transparent !important;
  border-radius: 0 !important;
  -webkit-border-radius: 0 !important;
  -moz-border-radius: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  color: #1e293b !important;
  height: 38px !important;
  min-height: auto !important;
  width: auto !important;
  padding: 0.45rem 0.75rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* Combo select dropdown arrow */
.content-wrapper .card .ew-hdr-combo #searchtype {
  padding-right: 1.8rem !important;
  cursor: pointer !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.6rem center !important;
  background-size: 10px 10px !important;
}

/* Combo focus state */
.content-wrapper .card .ew-hdr-combo #searchtype:focus,
.content-wrapper .card .ew-hdr-combo #searchtext:focus,
.content-wrapper .card:has(table#example) .ew-hdr-combo #searchtype:focus,
.content-wrapper .card:has(table#example) .ew-hdr-combo #searchtext:focus {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: rgba(248, 250, 252, 0.5) !important;
  background-image: none !important;
}

/* Combo search placeholder */
.content-wrapper .card .ew-hdr-combo #searchtext::placeholder,
.content-wrapper .card:has(table#example) .ew-hdr-combo #searchtext::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

/* Vertical divider lines between buttons & fields */
.ew-hdr-combo-divider {
  width: 1px !important;
  min-width: 1px !important;
  max-width: 1px !important;
  align-self: stretch !important;
  background: #e2e8f0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  flex-shrink: 0 !important;
}

/* Input and Select visual styling inside combo */
.ew-hdr-combo .form-select,
.ew-hdr-combo .custom-select,
.ew-hdr-combo .form-control,
.ew-hdr-combo select,
.ew-hdr-combo input:not([type="hidden"]) {
  background-color: transparent !important;
  background-image: none !important;
  color: #1e293b !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.75rem !important;
  height: 38px !important;
  line-height: 1.5 !important;
  letter-spacing: 0.01em !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  min-height: auto !important;
}

/* Focus state - keep clean, no glow ring */
.ew-hdr-combo input:focus,
.ew-hdr-combo select:focus,
.ew-hdr-combo .form-control:focus,
.ew-hdr-combo .custom-select:focus,
.ew-hdr-combo .form-select:focus,
.content-wrapper .ew-hdr-combo input:focus,
.content-wrapper .ew-hdr-combo select:focus,
.content-wrapper .ew-hdr-combo .form-control:focus,
.content-wrapper .ew-hdr-combo .custom-select:focus {
  border: none !important;
  border-width: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  background-color: rgba(248, 250, 252, 0.5) !important;
  background-image: none !important;
}

.ew-hdr-combo .form-control::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
}

.ew-hdr-combo .ew-hdr-search-input {
  padding-left: 0.75rem !important;
}

/* Dropdown arrow for select - re-apply AFTER background-image:none reset */
.ew-hdr-combo .custom-select,
.ew-hdr-combo .form-select,
.ew-hdr-combo select.custom-select,
.ew-hdr-combo select.form-select {
  padding-right: 1.8rem !important;
  cursor: pointer !important;
  background-color: transparent !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.6rem center !important;
  background-size: 10px 10px !important;
}

/* ====================================================================
   BUTTONS INSIDE COMBO BAR
   ==================================================================== */

.ew-hdr-combo-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
  white-space: nowrap !important;
  background: transparent !important;
  color: #1e293b !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  padding: 0.45rem 0.85rem !important;
  cursor: pointer !important;
  transition: background 0.15s, color 0.15s !important;
  line-height: 1.5 !important;
}

.ew-hdr-combo-btn i {
  font-size: 1rem !important;
  color: inherit !important;
}

.ew-hdr-combo-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.ew-hdr-combo-reset {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.2rem !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 0.95rem !important;
  padding: 0 0.85rem !important;
  cursor: pointer !important;
  transition: color 0.15s, background 0.15s !important;
  line-height: 1 !important;
}

.ew-hdr-combo-reset i {
  font-size: 1rem !important;
  color: inherit !important;
}

.ew-hdr-combo-reset:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* ====================================================================
   TABLE HEADER & PAGINATION
   ==================================================================== */

/* Light / Subtle Soft Pale Lavender Table Header */
#example thead th,
#example_history thead th,
.colored-table-header thead th,
.admin-data-table.table-header-light thead th,
.admin-data-table thead th {
  background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%) !important;
  color: #3b0764 !important;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  border: 1px solid #e9d5ff !important;
  padding: 0.85rem 0.75rem !important;
  vertical-align: middle !important;
}

/* Modern DataTables Pagination Styling */
.dataTables_wrapper .dataTables_paginate {
  margin-top: 0.85rem !important;
  margin-bottom: 0.5rem !important;
  display: flex !important;
  justify-content: flex-end !important;
}

.dataTables_wrapper .dataTables_paginate .pagination {
  gap: 0.25rem !important;
  margin: 0 !important;
  align-items: center !important;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link {
  color: #475569 !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%) !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 0.4rem 0.75rem !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  min-width: 36px !important;
  text-align: center !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s ease-in-out !important;
}

.dataTables_wrapper .dataTables_paginate .page-item .page-link:hover {
  color: #6b21a8 !important;
  background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%) !important;
  border-color: #c084fc !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 6px rgba(126, 34, 206, 0.2) !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.active .page-link {
  color: #ffffff !important;
  background: linear-gradient(135deg, #7e22ce 0%, #581c87 100%) !important;
  border-color: #581c87 !important;
  box-shadow: 0 3px 10px rgba(126, 34, 206, 0.35) !important;
  font-weight: 700 !important;
}

.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link {
  color: #94a3b8 !important;
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}

.dataTables_wrapper .dataTables_info {
  color: #64748b !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  padding-top: 0.85rem !important;
}
