/**
 * OLEN shared component skin.
 *
 * This file is intentionally loaded after legacy/module CSS. It aligns the
 * visual contract without changing WordPress markup, Materialize behavior,
 * DataTables lifecycle or any PHP/JS business logic.
 */

body {
  color: var(--olen-color-text-primary);
  font-family: var(--olen-font-family);
}

body .btn:not(.btn-flat),
body .btn-large:not(.btn-flat),
body .btn-small:not(.btn-flat),
body .btn-new-visit {
  align-items: center;
  background: var(--olen-color-primary);
  border: 1px solid var(--olen-color-primary);
  border-radius: var(--olen-radius-md);
  box-shadow: none;
  box-sizing: border-box;
  color: #fff;
  display: inline-flex;
  font-family: var(--olen-font-family);
  font-size: var(--olen-font-size-md);
  font-weight: var(--olen-font-weight-semibold);
  gap: var(--olen-space-2);
  justify-content: center;
  line-height: var(--olen-line-height-normal);
  min-height: 36px;
  padding: 7px var(--olen-space-4);
  text-transform: none;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

body .btn:not(.btn-flat):hover,
body .btn-new-visit:hover {
  background: var(--olen-color-primary-hover);
  border-color: var(--olen-color-primary-hover);
  box-shadow: none;
}

body .btn:focus-visible,
body .btn-new-visit:focus-visible,
body button:focus-visible,
body a:focus-visible,
body input:focus-visible,
body select:focus-visible,
body textarea:focus-visible {
  outline: 2px solid var(--olen-color-focus);
  outline-offset: 2px;
}

body .btn:disabled,
body .btn.disabled,
body .btn-new-visit:disabled {
  background: var(--olen-color-surface-muted);
  border-color: var(--olen-color-border);
  color: var(--olen-color-text-muted);
  cursor: not-allowed;
  opacity: .7;
}

body input.form-control,
body textarea.form-control,
body select.browser-default,
body .select2-container--default .select2-selection--single {
  background: var(--olen-color-surface);
  border: 1px solid var(--olen-color-border);
  border-radius: var(--olen-radius-md);
  box-shadow: none;
  box-sizing: border-box;
  color: var(--olen-color-text-primary);
  font-family: var(--olen-font-family);
  font-size: var(--olen-font-size-md);
  line-height: var(--olen-line-height-normal);
  min-height: 36px;
  padding: 7px var(--olen-space-3);
  transition: border-color .2s ease, box-shadow .2s ease;
}

body input.form-control::placeholder,
body textarea.form-control::placeholder {
  color: var(--olen-color-text-muted);
  opacity: 1;
}

body input.form-control:focus,
body textarea.form-control:focus,
body select.browser-default:focus,
body .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--corporative_color_dark, var(--olen-color-primary));
  box-shadow: 0 0 0 3px var(--corporative_color_shadow, #212b3633);
  outline: 0;
}

body input.form-control:disabled,
body textarea.form-control:disabled,
body select.browser-default:disabled {
  background: var(--olen-color-surface-muted);
  color: var(--olen-color-text-muted);
  cursor: not-allowed;
}

body .card,
body .card-panel,
body .content-section {
  border-radius: var(--olen-radius-lg);
  box-shadow: var(--olen-shadow-sm);
}

body .status-tag,
body span.badge.status-tag {
  align-items: center;
  border-radius: var(--olen-radius-sm);
  display: inline-flex;
  font-size: var(--olen-font-size-xs);
  font-weight: var(--olen-font-weight-semibold);
  gap: var(--olen-space-1);
  line-height: var(--olen-line-height-tight);
  min-height: 24px;
  padding: 2px var(--olen-space-2);
}

body .status-tag.status-active,
body .status-tag.status-accepted,
body .status-tag.status-serviceable {
  background: var(--olen-status-success-bg);
  color: var(--olen-color-success);
}

body .status-tag.status-pending,
body .status-tag.status-arrival {
  background: var(--olen-status-warning-bg);
  color: var(--olen-color-warning);
}

body .status-tag.status-rejected,
body .status-tag.status-banned {
  background: var(--olen-status-error-bg);
  color: var(--olen-color-error);
}

body .status-tag.status-disabled,
body .status-tag.status-inactive,
body .status-tag.status-removed {
  background: var(--olen-status-disabled-bg);
  color: var(--olen-color-text-secondary);
}

body .dropdown-content,
body .select2-container--open .select2-dropdown {
  background: var(--olen-color-surface);
  border: 1px solid var(--olen-color-border);
  border-radius: var(--olen-radius-md);
  box-shadow: var(--olen-shadow-md);
  z-index: var(--olen-z-dropdown);
}

/* The legacy notification drawer is opened above filter overlays but below
   modal/toast layers. This replaces the historical 999/1050 split with the
   same named contract consumed by React. */
body .notifications-general,
body .notifications-general.is-open {
  z-index: var(--olen-z-drawer);
}

body .dropdown-content li > a,
body .dropdown-content li > span {
  color: var(--olen-color-text-primary);
  font-family: var(--olen-font-family);
  font-size: var(--olen-font-size-md);
  min-height: 36px;
  padding: 8px var(--olen-space-3);
}

body .dropdown-content li > a:hover,
body .dropdown-content li > span:hover {
  background: var(--olen-color-surface-muted);
}

body .adpn_modal {
  background: rgb(33 43 54 / 55%);
  z-index: var(--olen-z-overlay);
}

body .adpn_modal_content1,
body .adpn_modal_content2,
body .adpn_modal_content3,
body .adpn_modal_content4 {
  border: 1px solid var(--olen-color-border);
  border-radius: var(--olen-radius-lg);
  box-shadow: var(--olen-shadow-lg);
  overflow: hidden;
  z-index: var(--olen-z-modal);
}

body .adpn_modal_header {
  background: var(--olen-color-primary);
  border-radius: 0;
  min-height: 56px;
  padding: var(--olen-space-4) var(--olen-space-5);
}

body .adpn_modal_header h3 {
  color: #fff;
  font-size: var(--olen-font-size-lg);
  line-height: 24px;
}

body .adpn_modal_botton {
  background: var(--olen-color-surface);
  border-top: 1px solid var(--olen-color-border-subtle);
  border-radius: 0;
  padding: var(--olen-space-3) var(--olen-space-5);
}

body table.table,
body table.dataTable,
body table.ag-table,
body table.portfolio-template-table,
body table.role-table,
body table#organization_list_dashboard {
  background: var(--olen-color-surface);
  border-collapse: separate;
  border-radius: var(--olen-radius-lg);
  border-spacing: 0;
  color: var(--olen-color-text-primary);
  overflow: hidden;
}

body table.table > thead > tr > th,
body table.dataTable > thead > tr > th,
body table.ag-table > thead > tr > th,
body table.portfolio-template-table > thead > tr > th,
body table.role-table > thead > tr > th {
  background: var(--olen-color-surface-muted);
  color: var(--olen-color-text-secondary);
  font-size: var(--olen-font-size-xs);
  font-weight: var(--olen-font-weight-semibold);
  line-height: var(--olen-line-height-tight);
  padding: var(--olen-space-3) var(--olen-space-4);
}

body table.table > tbody > tr > td,
body table.dataTable > tbody > tr > td,
body table.ag-table > tbody > tr > td,
body table.portfolio-template-table > tbody > tr > td,
body table.role-table > tbody > tr > td {
  border-bottom: 1px dashed var(--olen-color-border-subtle);
  color: var(--olen-color-text-primary);
  font-size: var(--olen-font-size-md);
  line-height: var(--olen-line-height-normal);
  padding: var(--olen-space-3) var(--olen-space-4);
}

body .toast {
  background: var(--olen-color-text-primary);
  border-radius: var(--olen-radius-md);
  box-shadow: var(--olen-shadow-md);
  color: #fff;
  font-family: var(--olen-font-family);
  font-size: var(--olen-font-size-md);
  z-index: var(--olen-z-toast);
}

/* Shared notification surface used by dashboard, shop-visit and aside
   templates. Keeping this contract here removes per-template inline drift. */
.notification-card {
  margin-top: var(--olen-space-2);
}

.notification-block {
  height: 100px;
  padding: 10px;
}

.notification-toolbar {
  display: flex;
  padding: 5px;
}

.notification-view-all {
  margin: 0 auto;
}

@media (max-width: 767px) {
  body .adpn_modal_content1,
  body .adpn_modal_content2,
  body .adpn_modal_content3,
  body .adpn_modal_content4 {
    max-height: calc(100vh - 24px);
    max-width: calc(100vw - 24px);
    min-width: 0;
    width: calc(100vw - 24px);
  }

  body .adp_modal_body,
  body .adp_modal_body2 {
    max-height: calc(100vh - 180px);
    min-width: 0;
    padding: var(--olen-space-4) var(--olen-space-3);
  }

  body .btn:not(.btn-flat),
  body .btn-large:not(.btn-flat),
  body .btn-small:not(.btn-flat),
  body .btn-new-visit {
    min-height: 36px;
    padding-left: var(--olen-space-3);
    padding-right: var(--olen-space-3);
  }
}
