html,
body {
  min-height: 100%;
  background: #f5f5f9;
  color: #566a7f;
  font-family: "Public Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  margin: 0;
}

.layout-wrapper {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.app-menu {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.25rem 1rem;
  background: #ffffff;
  border-right: 1px solid #eceef1;
  box-shadow: 0 0.125rem 0.375rem rgba(67, 89, 113, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem 1.25rem;
  color: #566a7f;
  text-decoration: none;
}

.brand:hover {
  color: #696cff;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: #696cff;
  color: #ffffff;
  font-weight: 700;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 42px;
  padding: 0.625rem 0.85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #697a8d;
  font: inherit;
  font-weight: 500;
  text-align: left;
}

.menu-link:hover,
.menu-link.active {
  background: rgba(105, 108, 255, 0.12);
  color: #696cff;
}

.menu-link i {
  width: 1.25rem;
  font-size: 1.1rem;
}

.layout-page {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 1rem 1.5rem;
  color: #566a7f;
  background: rgba(245, 245, 249, 0.92);
  border-bottom: 1px solid rgba(67, 89, 113, 0.08);
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 0;
  color: #384551;
  font-size: 1.5rem;
  font-weight: 700;
}

.eyebrow {
  margin-bottom: 0.15rem;
  color: #a1acb8;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.version-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.version-strip .form-select {
  width: auto;
  min-width: 130px;
  background-color: #ffffff;
  font-size: 0.8rem;
}

.file-sort-select {
  width: auto;
  min-width: 120px;
}

.version-strip span {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #ffffff;
  color: #697a8d;
  font-size: 0.8rem;
  box-shadow: 0 0.125rem 0.375rem rgba(67, 89, 113, 0.08);
}

.content {
  padding: 1.5rem;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.app-card {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 0.125rem 0.5rem rgba(67, 89, 113, 0.12);
}

.app-card .card-header {
  padding: 1.25rem 1.25rem 0;
  border-bottom: 0;
  background: transparent;
}

.app-card .card-body {
  padding: 1.25rem;
}

.card-title {
  margin: 0;
  color: #384551;
  font-size: 1.05rem;
  font-weight: 700;
}

.card-subtitle {
  margin: 0.25rem 0 0;
  color: #a1acb8;
  font-size: 0.875rem;
}

.form-label {
  color: #566a7f;
  font-weight: 600;
}

.settings-section-title {
  margin: 0;
  color: #384551;
  font-size: 0.95rem;
  font-weight: 700;
}

.setting-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  color: #566a7f;
  font-weight: 600;
}

.settings-tabs {
  margin-bottom: 1.25rem;
}

.sites-tabs {
  margin-bottom: 1rem;
}

.settings-tab-content {
  min-height: 280px;
}

.form-control,
.form-select {
  border-color: #d9dee3;
  border-radius: 8px;
  color: #566a7f;
}

.form-control:focus,
.form-select:focus {
  border-color: #696cff;
  box-shadow: 0 0 0 0.2rem rgba(105, 108, 255, 0.18);
}

.btn {
  border-radius: 8px;
  font-weight: 600;
}

.btn-primary {
  border-color: #696cff;
  background: #696cff;
}

.btn-primary:hover,
.btn-primary:focus {
  border-color: #5f61e6;
  background: #5f61e6;
}

#box,
#logs-box,
.output-box {
  width: 100%;
  min-height: 320px;
  max-height: 68vh;
  padding: 1rem;
  border: 1px solid #d9dee3;
  border-radius: 8px;
  background: #111827;
  color: #d1d5db;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.8125rem;
  line-height: 1.45;
  outline: none;
  overflow: auto;
  resize: vertical;
  white-space: pre-wrap;
}

#box {
  height: 360px;
}

#logs-box {
  height: 70vh;
}

.output-box {
  margin: 0;
}

.table {
  color: #566a7f;
}

.table thead th {
  color: #697a8d;
  font-size: 0.75rem;
  text-transform: uppercase;
}

#filemanager {
  position: relative;
  height: 68vh;
  min-height: 480px;
  overflow: hidden;
  border: 1px solid #d9dee3;
  border-radius: 8px;
  background: #ffffff;
}

#filemanager .fe_fileexplorer_item_folder .fe_fileexplorer_item_wrap_inner {
  position: relative;
}

#filemanager .fe_fileexplorer_item_folder .fe_fileexplorer_item_icon {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

#filemanager .fe_fileexplorer_item_folder .fe_fileexplorer_item_icon::before {
  position: absolute;
  right: 2px;
  bottom: 2px;
  left: 2px;
  height: 4px;
  content: "";
  border-radius: 999px;
  background: rgba(105, 108, 255, 0.2);
}

#filemanager .fe_fileexplorer_item_folder .fe_fileexplorer_item_icon::after {
  position: absolute;
  bottom: 2px;
  left: 2px;
  width: var(--folder-fill, 0%);
  max-width: calc(100% - 4px);
  height: 4px;
  content: "";
  border-radius: 999px;
  background: #696cff;
}

#filemanager .fe_fileexplorer_item_folder .fe_fileexplorer_item_wrap_inner[data-folder-count]::after {
  position: absolute;
  top: 0.25rem;
  right: 0.35rem;
  min-width: 1.35rem;
  padding: 0.1rem 0.3rem;
  content: attr(data-folder-count);
  border-radius: 999px;
  background: #696cff;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.file-info-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  color: #697a8d;
  font-size: 0.875rem;
}

#resize-history-info {
  color: #2f8a56;
}

.file-info-bar .form-check {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.queue-list {
  display: grid;
  gap: 0.75rem;
}

.queue-item {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid #eceef1;
  border-radius: 8px;
  background: #ffffff;
}

.queue-main {
  min-width: 0;
}

.queue-url {
  overflow: hidden;
  color: #384551;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  color: #a1acb8;
  font-size: 0.8125rem;
}

.queue-progress {
  min-width: 0;
}

.queue-progress .progress {
  height: 8px;
  border-radius: 999px;
  background: #eceef1;
}

.queue-progress .progress-bar {
  background: #696cff;
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.queue-actions .btn {
  margin-top: 0 !important;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed #d9dee3;
  border-radius: 8px;
  color: #a1acb8;
  text-align: center;
}

.swal2-popup.swal2-toast {
  border-radius: 8px;
}

@media (max-width: 991.98px) {
  .layout-wrapper {
    grid-template-columns: 1fr;
  }

  .app-menu {
    position: static;
    height: auto;
  }

  .menu-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 575.98px) {
  .content {
    padding: 1rem;
  }

  .menu-list {
    grid-template-columns: 1fr;
  }

  .queue-item {
    grid-template-columns: 1fr;
  }

  .queue-actions {
    justify-content: flex-start;
  }
}
