/* =================================================================
   modern-ui.css — Global UI overrides for UltimatePOS
   Loaded last after app.css so all rules take priority.
   ================================================================= */

/* ================================================================
   BUTTONS — compact, modern
   ================================================================ */

/* Base reset for all Bootstrap btn */
.btn {
  border-radius: 7px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  padding: 5px 12px !important;
  line-height: 1.45 !important;
  letter-spacing: 0.01em;
  transition: all 0.15s ease !important;
  border-width: 1px !important;
  box-shadow: none !important;
  white-space: nowrap;
}
.btn:focus, .btn:active:focus { outline: none !important; box-shadow: none !important; }

/* btn-xs — used heavily in datatables */
.btn-xs {
  font-size: 11.5px !important;
  padding: 3px 8px !important;
  border-radius: 6px !important;
  line-height: 1.4 !important;
}

/* btn-sm */
.btn-sm {
  font-size: 12px !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
}

/* btn-lg */
.btn-lg {
  font-size: 14px !important;
  padding: 8px 18px !important;
  border-radius: 9px !important;
}

/* ---- Colour variants ---- */
.btn-default {
  background: #f8fafc !important;
  border-color: #d1d5db !important;
  color: #374151 !important;
}
.btn-default:hover, .btn-default:focus {
  background: #f1f5f9 !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}

.btn-primary {
  background: linear-gradient(135deg, #4f8ef7, #4f46e5) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-primary:focus {
  background: linear-gradient(135deg, #3b82f6, #4338ca) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.btn-success {
  background: linear-gradient(135deg, #34d399, #059669) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.btn-success:hover, .btn-success:focus {
  background: linear-gradient(135deg, #10b981, #047857) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.btn-danger:hover, .btn-danger:focus {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.btn-warning {
  background: linear-gradient(135deg, #fbbf24, #d97706) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.btn-warning:hover, .btn-warning:focus {
  background: linear-gradient(135deg, #f59e0b, #b45309) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.btn-info {
  background: linear-gradient(135deg, #38bdf8, #0284c7) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.btn-info:hover, .btn-info:focus {
  background: linear-gradient(135deg, #0ea5e9, #0369a1) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Outline variants */
.btn-default.btn-flat,
.btn-flat {
  background: transparent !important;
  border-color: #e2e8f0 !important;
  color: #64748b !important;
  box-shadow: none !important;
}
.btn-flat:hover {
  background: #f1f5f9 !important;
  color: #374151 !important;
}

/* Disabled state */
.btn[disabled], .btn.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
}

/* btn-group spacing */
.btn-group > .btn + .btn { margin-left: -1px !important; }
.btn-group > .btn:first-child:not(:last-child) { border-radius: 7px 0 0 7px !important; }
.btn-group > .btn:last-child:not(:first-child)  { border-radius: 0 7px 7px 0 !important; }
.btn-group > .btn:only-child { border-radius: 7px !important; }

/* The ⋮ action dropdown button in datatables */
.btn-group > .btn.dropdown-toggle {
  padding: 3px 8px !important;
  font-size: 13px !important;
}

/* ================================================================
   DATATABLES — beautiful & compact
   ================================================================ */
table.dataTable {
  border-collapse: collapse !important;
  font-size: 12.5px !important;
  width: 100% !important;
}

/* Headers */
table.dataTable thead th,
table.dataTable thead td {
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.55px !important;
  padding: 8px 12px !important;
  border-bottom: 2px solid #e2e8f0 !important;
  border-top: none !important;
  white-space: nowrap;
}
table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after { color: #94a3b8 !important; }
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after { color: #4f46e5 !important; }

/* Body cells */
table.dataTable tbody td {
  padding: 6px 12px !important;
  border-top: 1px solid #f1f5f9 !important;
  vertical-align: middle !important;
  color: #374151;
  font-size: 12.5px;
  line-height: 1.45;
}

/* Row striping & hover */
table.dataTable tbody tr.odd  > td { background: #fff !important; }
table.dataTable tbody tr.even > td { background: #fafbfd !important; }
table.dataTable tbody tr:hover > td { background: rgba(79,142,247,0.06) !important; }

/* Controls */
.dataTables_wrapper .dataTables_filter label,
.dataTables_wrapper .dataTables_length label {
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
}
.dataTables_wrapper .dataTables_filter input {
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  padding: 4px 10px !important;
  font-size: 12px !important;
  height: 30px !important;
  transition: border-color 0.2s, box-shadow 0.2s;
  color: #374151;
  margin-left: 4px !important;
}
.dataTables_wrapper .dataTables_filter input:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.10) !important;
  outline: none;
}
.dataTables_wrapper .dataTables_length select {
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  padding: 3px 8px !important;
  font-size: 12px !important;
  height: 30px !important;
  color: #374151;
  margin: 0 4px !important;
}
.dataTables_wrapper .dataTables_info {
  font-size: 12px;
  color: #94a3b8;
  padding-top: 6px !important;
}

/* Pagination */
.dataTables_wrapper .dataTables_paginate { padding-top: 4px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 6px !important;
  font-size: 12px !important;
  padding: 3px 8px !important;
  margin: 0 1px !important;
  line-height: 1.4 !important;
  border: 1px solid transparent !important;
  color: #64748b !important;
  transition: all 0.15s !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: linear-gradient(135deg, #4f8ef7, #4f46e5) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(79,70,229,0.22) !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:not(.current):hover {
  background: #f1f5f9 !important;
  border-color: #e2e8f0 !important;
  color: #374151 !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  color: #cbd5e1 !important;
  cursor: default;
  background: none !important;
}

/* DataTables Buttons extension */
.dt-buttons { margin-bottom: 2px; }
.dt-button, a.dt-button, button.dt-button {
  border-radius: 7px !important;
  font-size: 11.5px !important;
  padding: 4px 10px !important;
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: none !important;
  transition: all 0.15s !important;
  font-weight: 500;
}
.dt-button:hover, a.dt-button:hover, button.dt-button:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* Processing indicator */
.dataTables_processing {
  border-radius: 8px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08) !important;
  font-size: 12.5px !important;
  color: #4f46e5 !important;
  background: rgba(255,255,255,0.96) !important;
  border: 1px solid #e2e8f0 !important;
}

/* Scrollable table headers */
.dataTables_scrollHead thead th {
  background: #f1f5f9 !important;
  color: #475569 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.55px !important;
  padding: 8px 12px !important;
  border-bottom: 2px solid #e2e8f0 !important;
}
.dataTables_scrollBody { border-color: #e9ecef !important; }

/* ================================================================
   DROPDOWNS
   ================================================================ */
.dropdown-menu {
  border-radius: 10px !important;
  border: 1.5px solid #e8edf3 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10) !important;
  padding: 5px !important;
  overflow: hidden;
  min-width: 150px;
  z-index: 99999 !important;
}
.dropdown-menu > li > a {
  border-radius: 7px !important;
  font-size: 12.5px !important;
  color: #374151 !important;
  padding: 7px 11px !important;
  transition: background 0.12s !important;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
}
.dropdown-menu > li > a > i,
.dropdown-menu > li > a > .fa,
.dropdown-menu > li > a > .fas,
.dropdown-menu > li > a > .far {
  width: 14px;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
.dropdown-menu > li.active > a {
  background: #4f46e5 !important;
  color: #fff !important;
}
.dropdown-divider, .divider {
  border-color: #e8edf3 !important;
  margin: 4px 0 !important;
}

/* ================================================================
   FORMS & INPUTS
   ================================================================ */
.form-control {
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  font-size: 13px !important;
  color: #374151 !important;
  padding: 6px 10px !important;
  height: 34px !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  box-shadow: none !important;
}
.form-control:focus {
  border-color: #818cf8 !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.10) !important;
  outline: none !important;
}
textarea.form-control { height: auto !important; }
select.form-control { padding-right: 28px !important; }

/* ================================================================
   CARDS / BOXES
   ================================================================ */
.box {
  border-radius: 12px !important;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07) !important;
  border: 1px solid #e9ecef !important;
}
.box-header {
  border-radius: 12px 12px 0 0 !important;
  padding: 12px 18px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  border-bottom: 1px solid #f1f5f9 !important;
}
.box-body { padding: 16px 18px !important; }

/* ================================================================
   NAV TABS
   ================================================================ */
.nav-tabs-custom > .nav-tabs > li.active { border-top: 3px solid #4f46e5 !important; }
.nav-tabs-custom > .tab-content { padding: 16px 18px !important; }

/* ================================================================
   BADGES & LABELS
   ================================================================ */
.badge, .label {
  border-radius: 5px !important;
  font-weight: 600;
  font-size: 10.5px;
  padding: 2px 7px;
  letter-spacing: 0.02em;
}
.label-primary, .badge-primary { background: #4f46e5 !important; }
.label-success, .badge-success { background: #059669 !important; }
.label-danger,  .badge-danger  { background: #dc2626 !important; }
.label-warning, .badge-warning { background: #d97706 !important; color: #fff !important; }
.label-info,    .badge-info    { background: #0284c7 !important; }
.label-default, .badge-default { background: #64748b !important; color: #fff !important; }

/* ================================================================
   ALERTS
   ================================================================ */
.alert {
  border-radius: 10px !important;
  padding: 11px 16px !important;
  font-size: 13px;
  font-weight: 500;
  border: none !important;
}
.alert-success { background: #f0fdf4 !important; color: #166534 !important; border-left: 4px solid #22c55e !important; }
.alert-danger  { background: #fef2f2 !important; color: #991b1b !important; border-left: 4px solid #ef4444 !important; }
.alert-warning { background: #fffbeb !important; color: #92400e !important; border-left: 4px solid #f59e0b !important; }
.alert-info    { background: #eff6ff !important; color: #1e40af !important; border-left: 4px solid #3b82f6 !important; }

/* ================================================================
   MODALS
   ================================================================ */
.modal-content {
  border-radius: 14px !important;
  border: none !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important;
}
.modal-header {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 14px 20px !important;
  border-radius: 14px 14px 0 0 !important;
}
.modal-footer {
  border-top: 1px solid #f1f5f9 !important;
  padding: 12px 20px !important;
  border-radius: 0 0 14px 14px !important;
}
.modal-title { font-size: 15px !important; font-weight: 600 !important; color: #1e293b !important; }

/* ================================================================
   DAISYUI BUTTONS — compact overrides (tw-dw-btn*)
   ================================================================ */

/* Base DaisyUI btn — compact size */
.tw-dw-btn {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 12.5px !important;
  font-weight: 500 !important;
  border-radius: 7px !important;
  border-width: 1px !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  transition: all 0.15s ease !important;
  box-shadow: none !important;
  gap: 6px !important;
}

/* Override lg size back to compact */
.tw-dw-btn-lg {
  min-height: 32px !important;
  height: 32px !important;
  padding: 0 14px !important;
  font-size: 12.5px !important;
}

/* Override sm */
.tw-dw-btn-sm {
  min-height: 26px !important;
  height: 26px !important;
  padding: 0 10px !important;
  font-size: 11.5px !important;
}

/* Primary — Save, Update */
.tw-dw-btn-primary {
  background: linear-gradient(135deg, #4f8ef7, #4f46e5) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.tw-dw-btn-primary:hover, .tw-dw-btn-primary:focus {
  background: linear-gradient(135deg, #3b82f6, #4338ca) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Success — Save and Print */
.tw-dw-btn-success {
  background: linear-gradient(135deg, #34d399, #059669) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.tw-dw-btn-success:hover, .tw-dw-btn-success:focus {
  background: linear-gradient(135deg, #10b981, #047857) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Error/Danger — Delete, destructive actions */
.tw-dw-btn-error {
  background: linear-gradient(135deg, #f87171, #dc2626) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.tw-dw-btn-error:hover, .tw-dw-btn-error:focus {
  background: linear-gradient(135deg, #ef4444, #b91c1c) !important;
  border-color: transparent !important;
  color: #fff !important;
}

/* Warning */
.tw-dw-btn-warning {
  background: linear-gradient(135deg, #fbbf24, #d97706) !important;
  border-color: transparent !important;
  color: #fff !important;
}
.tw-dw-btn-warning:hover, .tw-dw-btn-warning:focus {
  background: linear-gradient(135deg, #f59e0b, #b45309) !important;
  color: #fff !important;
}

/* Neutral / ghost */
.tw-dw-btn-neutral {
  background: #f8fafc !important;
  border-color: #d1d5db !important;
  color: #374151 !important;
}
.tw-dw-btn-neutral:hover {
  background: #f1f5f9 !important;
  border-color: #9ca3af !important;
  color: #111827 !important;
}

/* Ghost */
.tw-dw-btn-ghost {
  background: transparent !important;
  border-color: transparent !important;
  color: #64748b !important;
}
.tw-dw-btn-ghost:hover {
  background: #f1f5f9 !important;
  color: #374151 !important;
}

/* ================================================================
   Bootstrap .btn-big — bring it down to normal compact size
   ================================================================ */
.btn-big {
  font-size: 12.5px !important;
  padding: 5px 14px !important;
  border-radius: 7px !important;
  line-height: 1.45 !important;
}

/* ================================================================
   DATATABLE EXPORT COLLECTION BUTTON & DROPDOWN
   ================================================================ */

/* The trigger icon button */
.dt-export-collection-btn,
.dt-colvis-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 7px !important;
  font-size: 13px !important;
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  color: #475569 !important;
  box-shadow: none !important;
  transition: all 0.15s !important;
}
.dt-export-collection-btn:hover,
.dt-colvis-btn:hover {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
  color: #1e293b !important;
}

/* The collection dropdown panel */
.dt-button-collection {
  border-radius: 10px !important;
  border: 1.5px solid #e8edf3 !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10) !important;
  padding: 5px !important;
  min-width: 180px !important;
  background: #fff !important;
  z-index: 99999 !important;
}
.dt-button-collection .dt-button {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  border-radius: 7px !important;
  font-size: 12.5px !important;
  padding: 7px 11px !important;
  background: transparent !important;
  border: none !important;
  color: #374151 !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  text-align: left !important;
  transition: background 0.12s !important;
}
.dt-button-collection .dt-button:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}
.dt-button-collection .dt-button i {
  width: 14px;
  text-align: center;
  color: #6b7280;
  font-size: 12px;
}

/* Align the export wrap col to vertically center */
.dt-export-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.dt-export-wrap .dt-buttons {
  display: flex !important;
  gap: 4px !important;
  margin-bottom: 0 !important;
}
