:root {
  --iaoth-primary: #4f46e5;
  --iaoth-primary-hover: #4338ca;
  --iaoth-sidebar-bg: #1e1b4b;
  --iaoth-sidebar-hover: #2e2a72;
  --iaoth-bg-gray: #f8fafc;
  --iaoth-card-bg: #ffffff;
  --iaoth-border: #e2e8f0;
  --iaoth-text-dark: #0f172a;
  --iaoth-text-muted: #64748b;
}

/* ==========================================================================
   WP MEDIA MODAL & BACKDROP STACKING FIX
   ========================================================================== */

/* 1. Dark Backdrop (Background Overlay) stays behind the popup window */
.media-modal-backdrop {
  z-index: 9999990 !important;
}

/* 2. Media Modal Dialog Window renders ABOVE the backdrop overlay */
.media-modal,
.media-modal-wrapper,
#TB_overlay,
#TB_window,
.moxiemanager-window,
.mce-floatpanel,
.mce-tooltip,
.mce-menu {
  z-index: 10000000 !important;
}

/* 3. Force modal elements to stay interactive */
.media-modal * {
  pointer-events: auto !important;
}

/* App Viewport Structure */
.iaoth-fixed-dashboard-app {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--iaoth-bg-gray);
}

/* Top Header Bar */
.iaoth-top-header {
  height: 65px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--iaoth-border);
  flex-shrink: 0;
  z-index: 1000;
}

/* Logo Box - No Bottom White Line */
.iaoth-header-logo-box {
  width: 250px;
  height: 100%;
  background: var(--iaoth-sidebar-bg);
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-sizing: border-box;
  border-bottom: none !important;
  transition: all 0.3s ease-in-out 0s;
}
@media (max-width: 767.98px){
  .iaoth-header-logo-box{
    padding-left: 10px;
    padding-right: 10px;
    width: 60px;
  }
}

.iaoth-header-logo-box img {
  max-height: 40px;
  width: auto;
}

.iaoth-header-right-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.iaoth-sidebar-toggle-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--iaoth-text-muted);
  cursor: pointer;
}

.iaoth-user-profile-menu {
  position: relative;
  cursor: pointer;
}

.iaoth-user-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--iaoth-text-dark);
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.iaoth-user-greeting:hover {
  background: #f1f5f9;
}

.user-avatar-icon {
  font-size: 22px;
  color: var(--iaoth-primary);
}

.arrow {
  font-size: 11px;
  color: var(--iaoth-text-muted);
}

.iaoth-user-dropdown-box {
  position: absolute;
  right: 0;
  top: 45px;
  background: #ffffff;
  border: 1px solid var(--iaoth-border);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  min-width: 170px;
  border-radius: 8px;
  padding: 8px;
  z-index: 1100;
}

.iaoth-user-dropdown-box.show {
  display: flex;
}

.iaoth-user-dropdown-box a {
  padding: 10px 14px;
  color: var(--iaoth-text-dark);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
}

.iaoth-user-dropdown-box a:hover {
  background: #f1f5f9;
}

.iaoth-user-dropdown-box a.logout-btn {
  color: #ef4444;
}

.iaoth-user-dropdown-box a.logout-btn:hover {
  background: #fee2e2;
}

/* Workspace Body Layout */
.iaoth-workspace-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 65px);
  overflow: hidden;
}

/* Fixed Sidebar */
.iaoth-fixed-sidebar {
  width: 250px;
  height: 100%;
  background: var(--iaoth-sidebar-bg);
  flex-shrink: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: none !important;
  transition: all 0.3s ease-in-out 0s;
}
@media (max-width: 767.98px){
  .iaoth-fixed-sidebar{
    width: 60px;
  }
}

.iaoth-sidebar-menu-list {
  list-style: none;
  padding: 16px 12px;
  margin: 0;
  transition: all 0.3s ease-in-out 0s;
}
@media (max-width: 767.98px){
  .iaoth-sidebar-menu-list{
    padding-left: 10px;
    padding-right: 10px;
  }
}

.iaoth-sidebar-menu-list li {
  margin-bottom: 6px;
}

.iaoth-sidebar-menu-list li a {
  display: flex;
  align-items: center;
  column-gap: 0;
  row-gap: 12px;
  padding: 12px 16px 12px 0;
  color: #c7d2fe;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.iaoth-sidebar-menu-list li a i{
  align-items: center;
  display: flex;
  flex:  0 0 40px;
  justify-content: center;
  max-width: 40px;
}

.iaoth-sidebar-menu-list li.active a,
.iaoth-sidebar-menu-list li a:hover {
  background: var(--iaoth-sidebar-hover);
  color: #ffffff;
}

/* Main Container Area */
.iaoth-main-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Sticky Action Bar */
.iaoth-page-action-header {
  background: #ffffff;
  border-bottom: 1px solid var(--iaoth-border);
  padding: 14px 40px;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  z-index: 100;
}

.iaoth-action-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
}

.iaoth-action-btn.primary {
  background: var(--iaoth-primary);
  color: #ffffff;
}

.iaoth-action-btn.primary:hover {
  background: var(--iaoth-primary-hover);
}

.iaoth-action-btn.secondary {
  background: #ffffff;
  color: var(--iaoth-text-dark);
  border: 1px solid var(--iaoth-border);
}

.iaoth-action-btn.secondary:hover {
  background: #f1f5f9;
}

/* Independent Scrollable Content Area */
.iaoth-scrollable-content-area {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 28px 40px;
  box-sizing: border-box;
}

/* Cards & Modern Input Styling */
.iaoth-card-box {
  background: var(--iaoth-card-bg) !important;
  border: 1px solid var(--iaoth-border) !important;
  border-radius: 12px !important;
  padding: 24px 28px !important;
  margin-bottom: 24px !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

.iaoth-card-box h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 17px;
  font-weight: 700;
  color: var(--iaoth-text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.iaoth-field-col label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--iaoth-text-dark);
  margin-bottom: 6px;
}

/* Form Inputs */
.iaoth-card-box input[type="text"],
.iaoth-card-box input[type="email"],
.iaoth-card-box input[type="url"],
.iaoth-card-box input[type="password"] {
  display: block !important;
  width: 100% !important;
  height: 42px !important;
  padding: 8px 14px !important;
  background-color: #ffffff !important;
  border: 1px solid var(--iaoth-border) !important;
  border-radius: 8px !important;
  color: var(--iaoth-text-dark) !important;
  font-size: 14px !important;
  box-sizing: border-box !important;
  transition:
    border-color 0.2s,
    box-shadow 0.2s !important;
}

.iaoth-card-box input:focus {
  border-color: var(--iaoth-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

/* 2-Column Grid Layout */
.iaoth-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

/* Leaflet Map Styling */
#iaoth-leaflet-map {
  position: relative !important;
  z-index: 1 !important;
  width: 100% !important;
  height: 320px !important;
  border-radius: 10px !important;
  border: 1px solid var(--iaoth-border) !important;
  margin-bottom: 15px !important;
}

/* Gallery & Upload Item Styling */
.iaoth-gallery-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.iaoth-gallery-item {
  position: relative;
  width: 120px;
  height: 90px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--iaoth-border);
}

.iaoth-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.iaoth-gallery-item .remove-media,
.iaoth-attachment-item .remove-media,
.iaoth-video-card .remove-video {
  position: absolute;
  top: 4px;
  right: 6px;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
}

.iaoth-attachment-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--iaoth-border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.iaoth-videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.iaoth-video-card {
  position: relative;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid var(--iaoth-border);
}

/* Alert Boxes */
.iaoth-alert-box {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 14px;
}

.iaoth-alert-box.success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.iaoth-alert-box.error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* BUSINESS HOURS TAB */

.iaoth-toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.iaoth-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.iaoth-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.iaoth-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .iaoth-toggle-slider {
  background-color: #0284c7;
}

input:checked + .iaoth-toggle-slider:before {
  transform: translateX(20px);
}

/* DASHBOARD MODALS FIX */
body .iaoth-modal-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 99999999 !important;
  display: none; /* JS will toggle flex */
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 20px !important;
  box-sizing: border-box !important;
}

body .iaoth-modal-overlay.active {
  display: flex !important;
}

body .iaoth-modal-card {
  position: relative !important;
  background: #ffffff !important;
  width: 100% !important;
  max-width: 520px !important;
  padding: 28px !important;
  border-radius: 12px !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
  z-index: 100000000 !important;
  margin: auto !important;
}

body .iaoth-modal-card.iaoth-modal-large {
  max-width: 820px !important; /* Width increased to 820px */
  width: 90% !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
}

#iaoth-article-dropzone:hover {
  border-color: #2563eb !important;
  background-color: #eff6ff !important;
}

/* DATATABLES STYLING */
.dataTables_wrapper .dataTables_length {
  float: left;
  margin-bottom: 15px;
  font-size: 13px;
  color: #475569;
}

.dataTables_wrapper .dataTables_length select {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin: 0 6px;
  font-size: 13px;
}

.dataTables_wrapper .dataTables_filter {
  float: right;
  margin-bottom: 15px;
  font-size: 13px;
  color: #475569;
}

.dataTables_wrapper .dataTables_filter input {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  margin-left: 8px;
  outline: none;
  font-size: 13px;
}

.dataTables_wrapper .dataTables_info {
  float: left;
  margin-top: 15px;
  font-size: 13px;
  color: #64748b;
}

.dataTables_wrapper .dataTables_paginate {
  float: right;
  margin-top: 15px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  padding: 6px 12px !important;
  margin-left: 2px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  color: #334155 !important;
  font-size: 13px !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* DATATABLE SORTING ARROWS STYLING */
table.dataTable thead th {
  position: relative;
  padding-right: 26px !important;
  cursor: pointer;
  user-select: none;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 600;
  color: #1e293b;
}

table.dataTable thead th.no-sort {
  cursor: default;
  padding-right: 10px !important;
}

/* Default Dual Arrows */
table.dataTable thead th:not(.no-sort)::after {
  content: "\f0dc"; /* FontAwesome fa-sort icon */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: #94a3b8;
}

/* Ascending Sorted Arrow Up */
table.dataTable thead th.sorting_asc::after {
  content: "\f0de"; /* fa-sort-up */
  color: #2563eb;
}

/* Descending Sorted Arrow Down */
table.dataTable thead th.sorting_desc::after {
  content: "\f0dd"; /* fa-sort-down */
  color: #2563eb;
}

table.dataTable thead th.no-sort::after {
  content: "" !important;
}

/* DASHBOARD ALERT MESSAGES */
.iaoth-alert-box {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.iaoth-alert-box.success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.iaoth-alert-box.error {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
/* Dashboard CSS */
.iaoth-fixed-dashboard-app {
  transition: all 0.3s ease-in-out 0s;
}
@media (max-width: 767.98px) {
  .iaoth-fixed-dashboard-app .iaoth-top-header .iaoth-header-right-content {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media (max-width: 767.98px) {
  .iaoth-fixed-dashboard-app .iaoth-top-header .iaoth-header-right-content .iaoth-sidebar-toggle-btn {
    opacity: 0;
    pointer-events: none !important;
    visibility: hidden;
  }
}
@media (max-width: 767.98px) {
  .iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-page-action-header {
    flex-wrap: wrap;
    justify-content: space-between;
    padding-left: 12px;
    padding-right: 12px;
  }
}
.iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-page-action-header .iaoth-action-btn {
  white-space: nowrap;
}
@media (max-width: 599.98px) {
  .iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-page-action-header .iaoth-action-btn {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media (max-width: 767.98px) {
  .iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-scrollable-content-area {
    padding-left: 12px;
    padding-right: 12px;
  }
}
@media (max-width: 767.98px) {
  .iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-scrollable-content-area .iaoth-content-inner .iaoth-tab-profile-wrapper .iaoth-card-box {
    padding: 1rem !important;
  }
}
@media (max-width: 599.98px) {
  .iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-scrollable-content-area .iaoth-content-inner .iaoth-tab-profile-wrapper .iaoth-card-box .iaoth-media-upload-row {
    flex-wrap: wrap;
  }
}
.iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-scrollable-content-area .iaoth-content-inner .iaoth-tab-profile-wrapper .iaoth-card-box .iaoth-media-upload-row .iaoth-preview-thumb {
  flex: 0 0 120px;
  max-width: 120px;
}
@media (max-width: 767.98px) {
  .iaoth-fixed-dashboard-app .iaoth-workspace-body .iaoth-main-container .iaoth-scrollable-content-area .iaoth-content-inner .iaoth-tab-profile-wrapper .iaoth-card-box .iaoth-grid-2col {
    grid-template-columns: 1fr;
  }
}
.iaoth-fixed-dashboard-app.menu-toggle .iaoth-top-header .iaoth-header-logo-box {
  padding-left: 10px;
  padding-right: 10px;
  width: 60px;
}
.iaoth-fixed-dashboard-app.menu-toggle .iaoth-workspace-body .iaoth-fixed-sidebar {
  width: 60px;
}
.iaoth-fixed-dashboard-app.menu-toggle .iaoth-workspace-body .iaoth-fixed-sidebar .iaoth-sidebar-menu-list {
  padding-left: 10px;
  padding-right: 10px;
}