/**
 * Panel checkboxes & switches — clear on/off, compact (beats legacy input{} rules).
 */

body.g-sidenav-show .form-check,
#page_layout .form-check,
#panel-ajax-content .form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  min-height: auto;
  padding-left: 0;
}

body.g-sidenav-show .form-check .form-check-input,
#page_layout .form-check .form-check-input,
#panel-ajax-content .form-check .form-check-input {
  float: none;
  flex-shrink: 0;
  margin-left: 0 !important;
  margin-right: 0 !important;
  margin-top: 0.15em !important;
  padding: 0 !important;
  letter-spacing: normal !important;
  height: auto !important;
  min-height: 0 !important;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* Square checkbox */
body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]),
#page_layout .form-check-input[type="checkbox"]:not([role="switch"]),
#panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]) {
  width: 1rem !important;
  height: 1rem !important;
  border-radius: 4px !important;
  border: 2px solid #94a3b8 !important;
  background-color: #fff !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]):hover,
#page_layout .form-check-input[type="checkbox"]:not([role="switch"]):hover,
#panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]):hover {
  border-color: #64748b !important;
}

body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]):focus,
#page_layout .form-check-input[type="checkbox"]:not([role="switch"]):focus,
#panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]):focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22) !important;
  outline: none !important;
}

body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]):checked,
#page_layout .form-check-input[type="checkbox"]:not([role="switch"]):checked,
#panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]):checked {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e") !important;
  background-size: 100% 100% !important;
  background-position: center !important;
}

body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]):disabled,
#page_layout .form-check-input[type="checkbox"]:not([role="switch"]):disabled,
#panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]):disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Toggle switch */
body.g-sidenav-show .form-switch .form-check-input,
#page_layout .form-switch .form-check-input,
#panel-ajax-content .form-switch .form-check-input {
  width: 2.125rem !important;
  height: 1.125rem !important;
  margin-top: 0.2em !important;
  border-radius: 999px !important;
  border: 2px solid #cbd5e1 !important;
  background-color: #e2e8f0 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
  background-position: left center !important;
  background-size: contain !important;
  transition: background-position 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

body.g-sidenav-show .form-switch .form-check-input:focus,
#page_layout .form-switch .form-check-input:focus,
#panel-ajax-content .form-switch .form-check-input:focus {
  border-color: #93c5fd !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2) !important;
  outline: none !important;
}

body.g-sidenav-show .form-switch .form-check-input:checked,
#page_layout .form-switch .form-check-input:checked,
#panel-ajax-content .form-switch .form-check-input:checked {
  background-color: #2563eb !important;
  border-color: #2563eb !important;
  background-position: right center !important;
}

body.g-sidenav-show .form-switch .form-check-input:not(:checked),
#page_layout .form-switch .form-check-input:not(:checked),
#panel-ajax-content .form-switch .form-check-input:not(:checked) {
  background-color: #cbd5e1 !important;
  border-color: #94a3b8 !important;
}

body.g-sidenav-show .form-check-label,
#page_layout .form-check-label,
#panel-ajax-content .form-check-label {
  cursor: pointer;
  line-height: 1.4;
  padding-top: 0.05em;
}

/* Radio — compact circle */
body.g-sidenav-show .form-check-input[type="radio"],
#page_layout .form-check-input[type="radio"],
#panel-ajax-content .form-check-input[type="radio"] {
  width: 1rem !important;
  height: 1rem !important;
  border: 2px solid #94a3b8 !important;
  background-color: #fff !important;
}

body.g-sidenav-show .form-check-input[type="radio"]:checked,
#page_layout .form-check-input[type="radio"]:checked,
#panel-ajax-content .form-check-input[type="radio"]:checked {
  background-color: #fff !important;
  border-color: #2563eb !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%232563eb'/%3e%3c/svg%3e") !important;
  background-size: 100% 100% !important;
}

html.dark-mode body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]),
html.dark-mode #page_layout .form-check-input[type="checkbox"]:not([role="switch"]),
html.dark-mode #panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]) {
  background-color: #0f172a !important;
  border-color: #64748b !important;
}

html.dark-mode body.g-sidenav-show .form-check-input[type="checkbox"]:not([role="switch"]):checked,
html.dark-mode #page_layout .form-check-input[type="checkbox"]:not([role="switch"]):checked,
html.dark-mode #panel-ajax-content .form-check-input[type="checkbox"]:not([role="switch"]):checked {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

html.dark-mode body.g-sidenav-show .form-switch .form-check-input:not(:checked),
html.dark-mode #page_layout .form-switch .form-check-input:not(:checked),
html.dark-mode #panel-ajax-content .form-switch .form-check-input:not(:checked) {
  background-color: #475569 !important;
  border-color: #64748b !important;
}

html.dark-mode body.g-sidenav-show .form-switch .form-check-input:checked,
html.dark-mode #page_layout .form-switch .form-check-input:checked,
html.dark-mode #panel-ajax-content .form-switch .form-check-input:checked {
  background-color: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

html.dark-mode body.g-sidenav-show .form-check-input[type="radio"],
html.dark-mode #page_layout .form-check-input[type="radio"],
html.dark-mode #panel-ajax-content .form-check-input[type="radio"] {
  background-color: #0f172a !important;
  border-color: #64748b !important;
}
