/* Legacy custom overrides placeholder.
 *
 * In the original Yii2 app the layout referenced `/public/custom/style.css`.
 * Keep the file to avoid 404s; project-specific styles can be added here.
 */

/* Keep logo dimensions stable in legacy-themed headers/auth blocks. */
.top-left-part .logo img,
.new-login-register .inner-panel img {
  height: 28px !important;
  width: auto !important;
  max-width: none !important;
  display: inline-block;
}

/* Protect icon glyph rendering from global CSS overrides. */
.mdi:before,
.mdi-set {
  font-family: "Material Design Icons" !important;
}

/* Admin catalog groups tree: legacy bootstrap-treeview-like look. */
.catalog-groups-tree.treeview .list-group {
  margin-bottom: 0;
  list-style: none;
  padding-left: 0;
}

.catalog-groups-tree.treeview .list-group > li {
  list-style: none;
}

.catalog-groups-tree .catalog-tree-row.list-group-item {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  padding-top: 6px;
  padding-bottom: 6px;
}

.catalog-groups-tree .catalog-tree-row .catalog-tree-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  width: 14px;
  min-width: 14px;
  line-height: 1;
  color: inherit;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.catalog-groups-tree .catalog-tree-row .catalog-tree-toggle:focus {
  outline: none;
}

.catalog-groups-tree .catalog-tree-toggle-spacer {
  width: 14px;
  min-width: 14px;
}

.catalog-groups-tree .catalog-tree-folder {
  width: 14px;
  min-width: 14px;
  text-align: center;
}

.catalog-groups-tree .catalog-tree-link {
  display: block;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: inherit;
}

.catalog-groups-tree .catalog-tree-row.active .catalog-tree-link {
  color: #fff;
}

.catalog-groups-tree .catalog-tree-row-muted {
  color: #aaa;
}

/* Admin catalog item properties tab: align inputs/options and keep a stable layout. */
.catalog-properties-tab .catalog-property-block {
  border: 1px solid #eef0f2;
  border-radius: 4px;
  background: #fff;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.catalog-properties-tab .catalog-property-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2f3d4a;
}

.catalog-properties-tab .catalog-property-hidden {
  font-weight: 400;
  color: #8a99a8;
}

.catalog-properties-tab .catalog-property-options {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.catalog-properties-tab .catalog-property-option {
  width: 50%;
  padding: 0 8px;
}

.catalog-properties-tab .catalog-property-option .checkbox {
  margin-top: 0;
  margin-bottom: 6px;
}

.catalog-properties-tab .catalog-property-radio-group {
  display: flex;
  gap: 20px;
}

.catalog-properties-tab .catalog-property-radio-group .radio {
  margin-top: 0;
  margin-bottom: 0;
}

.catalog-properties-tab .catalog-property-input {
  max-width: 420px;
}

@media (max-width: 767px) {
  .catalog-properties-tab .catalog-property-option {
    width: 100%;
  }
}

@media (min-width: 992px) {
  .catalog-items-edit-layout {
    display: flex;
    align-items: stretch;
  }

  .catalog-items-edit-layout > [class*="col-"] {
    display: flex;
    flex-direction: column;
  }

  .catalog-items-edit-layout > [class*="col-"] > .white-box,
  .catalog-items-edit-layout > [class*="col-"] > .panel {
    flex: 1;
  }
}

.catalog-items-search-btn {
  width: 39px !important;
  height: 34px;
  padding: 8px 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.panel-default-search .typeahead__container {
  width: 100% !important;
  display: block;
}

.panel-default-search .typeahead__field.input-group {
  width: 100%;
}

/* Admin profile notifications table: custom styling independent from legacy table/checkbox CSS. */
.profile-notifications-table-wrap {
  margin-top: 10px;
}

.profile-notifications-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e5eaf0;
  border-radius: 10px;
  background: #fff;
}

.profile-notifications-table {
  width: 100%;
  min-width: 340px;
  border-collapse: separate;
  border-spacing: 0;
  color: #2f3d4a;
  font-size: 14px;
}

.profile-notifications-table thead th {
  background: #f7f9fc;
  color: #506173;
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e5eaf0;
  white-space: nowrap;
}

.profile-notifications-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: middle;
  background: #fff;
  color: #2f3d4a;
}

.profile-notifications-table tbody tr:last-child td {
  border-bottom: 0;
}

.profile-notifications-table__channel,
.profile-notifications-table__check-cell {
  width: 80px;
  min-width: 80px;
  text-align: center !important;
}

.profile-notifications-table__check {
  appearance: auto !important;
  -webkit-appearance: checkbox !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: static !important;
  width: 16px !important;
  height: 16px !important;
  margin: 0 !important;
  cursor: pointer;
  accent-color: #21a366;
}

.profile-notifications-table__action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
}

.profile-notifications-table__empty {
  text-align: center;
  color: #8a99a8 !important;
  padding: 16px 12px !important;
}

@media (max-width: 767px) {
  .profile-notifications-table {
    font-size: 13px;
  }

  .profile-notifications-table thead th,
  .profile-notifications-table tbody td {
    padding: 9px 10px;
  }
}

/* Frontend shell modernization (scoped to Inertia layout only). */
body.opt-modern-shell {
  --opt-bg: #eef2f7;
  --opt-surface: #ffffff;
  --opt-surface-muted: #f5f8fc;
  --opt-border: #d8e0ea;
  --opt-text: #243447;
  --opt-text-muted: #60758a;
  --opt-brand: #0f4d9f;
  --opt-brand-soft: #1f6fd2;
  --opt-success: #1e9b63;
  --opt-shadow-soft: 0 8px 30px rgba(21, 44, 74, 0.07);
  --opt-shadow-nav: 0 2px 12px rgba(12, 29, 51, 0.2);
  background:
    radial-gradient(1100px 420px at -10% -15%, rgba(31, 111, 210, 0.12), transparent 60%),
    radial-gradient(900px 360px at 110% -20%, rgba(30, 155, 99, 0.1), transparent 65%),
    var(--opt-bg);
  color: var(--opt-text);
  font-family: "Manrope", "IBM Plex Sans", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body.opt-modern-shell .opt-main-shell .navbar.opt-main-navbar {
  background: linear-gradient(120deg, #1b2737 0%, #223348 48%, #1a2a3d 100%);
  border: 0;
  box-shadow: var(--opt-shadow-nav);
}

body.opt-modern-shell .opt-main-shell .navbar.opt-main-navbar .navbar-header {
  background: transparent;
}

body.opt-modern-shell .opt-main-sidebar {
  background: linear-gradient(180deg, #24364a 0%, #1e2f42 100%);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

body.opt-modern-shell .opt-main-shell #page-wrapper {
  background: transparent;
}

body.opt-modern-shell .opt-main-shell .opt-page-header {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 255, 0.92));
  border: 1px solid var(--opt-border);
  border-radius: 14px;
  box-shadow: var(--opt-shadow-soft);
  margin: 18px 0 14px;
}

body.opt-modern-shell .opt-main-shell .panel,
body.opt-modern-shell .opt-main-shell .white-box,
body.opt-modern-shell .opt-main-shell .right-sidebar {
  border-radius: 14px;
  border-color: var(--opt-border);
  box-shadow: var(--opt-shadow-soft);
}

body.opt-modern-shell .opt-main-shell .panel-heading,
body.opt-modern-shell .opt-main-shell .white-box .box-title {
  color: #2a3f56;
}

body.opt-modern-shell .opt-main-shell .footer {
  color: var(--opt-text-muted);
  background: transparent;
}

body.opt-modern-shell .opt-main-shell .btn.btn-success {
  background-color: var(--opt-success);
  border-color: var(--opt-success);
}

body.opt-modern-shell .opt-main-shell .btn.btn-info.btn-outline,
body.opt-modern-shell .opt-main-shell .btn.btn-default.btn-outline {
  border-color: #2f6fb3;
  color: #235a93;
}

body.opt-modern-shell .opt-main-shell .btn.btn-info.btn-outline:hover,
body.opt-modern-shell .opt-main-shell .btn.btn-default.btn-outline:hover {
  background: rgba(47, 111, 179, 0.1);
}

body.opt-modern-shell .opt-main-shell .opt-muted-header-label,
body.opt-modern-shell .opt-main-shell .opt-muted-header-rates {
  color: rgba(238, 245, 255, 0.84);
}

body.opt-modern-shell .opt-main-shell .cart-summary-split {
  background: var(--opt-surface-muted);
  color: var(--opt-text-muted);
  padding-bottom: 3px !important;
}

body.opt-modern-shell .opt-main-shell .cart-actions-row {
  padding-bottom: 12px;
}

body.opt-modern-shell .opt-main-shell .cart-actions-divider {
  margin: 0 10px 10px;
}

body.opt-modern-shell .opt-main-shell a:focus,
body.opt-modern-shell .opt-main-shell button:focus,
body.opt-modern-shell .opt-main-shell input:focus,
body.opt-modern-shell .opt-main-shell select:focus,
body.opt-modern-shell .opt-main-shell textarea:focus {
  outline: 2px solid rgba(31, 111, 210, 0.45);
  outline-offset: 1px;
}

body.opt-modern-shell .opt-auth-shell {
  background:
    radial-gradient(900px 360px at 100% -15%, rgba(31, 111, 210, 0.2), transparent 60%),
    radial-gradient(900px 360px at -5% 100%, rgba(30, 155, 99, 0.16), transparent 60%),
    #ecf2f8;
}

body.opt-modern-shell .opt-auth-shell .opt-auth-card {
  border: 1px solid var(--opt-border);
  border-radius: 14px;
  box-shadow: var(--opt-shadow-soft);
}

@media (prefers-reduced-motion: reduce) {
  body.opt-modern-shell * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}
