* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-1: #ffffff;
  --bg-2: #f8f9fa;
  --bg-3: #e9ecef;
  --text-1: #212529;
  --text-2: #495057;
  --text-3: #6c757d;
  --border: #dee2e6;
  --primary: #0d6efd;
  --primary-hover: #0b5ed7;
  --success: #198754;
  --danger: #dc3545;
  --error: #dc3545;
  --warning: #ffc107;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-2);
  color: var(--text-1);
}

.layout {
  display: flex;
  height: 100vh;
}

/* ═══ SIDEBAR ═══ */
.sidebar {
  width: 240px;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-icon {
  font-size: 24px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
}

.brand-ver {
  font-size: 11px;
  color: var(--text-3);
}

.nav {
  flex: 1;
  padding: 20px 0;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 10px 20px;
  border: none;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  text-align: left;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text-1);
}

.nav-item.active {
  background: var(--bg-2);
  color: var(--primary);
  font-weight: 500;
}

/* ═══ MAIN ═══ */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

.section-header {
  margin-bottom: 30px;
  text-align: left !important;
}

.section-header h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: left !important;
}

.section-sub {
  color: var(--text-3);
  font-size: 14px;
}

/* ═══ MONITOR LAYOUT ═══ */
.monitor-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 180px);
}

.sellers-panel {
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.panel-title {
  padding: 16px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.sellers-list {
  overflow-y: auto;
  max-height: calc(100% - 50px);
}

.seller-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}

.seller-item:hover {
  background: var(--bg-2);
}

.seller-item.active {
  background: var(--bg-2);
  border-left: 3px solid var(--primary);
}

.seller-alias {
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.seller-sub {
  font-size: 12px;
  color: var(--text-3);
}

.empty-hint {
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

.results-panel {
  flex: 1;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  overflow-y: auto;
}

.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-3);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.results-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.results-alias {
  font-size: 20px;
  font-weight: 600;
}

.results-count {
  font-size: 13px;
  color: var(--text-3);
}

.header-btns {
  display: flex;
  gap: 8px;
}

/* ═══ BUTTONS ═══ */
.btn-primary, .btn-secondary, .btn-run {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

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

.btn-secondary {
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-3);
}

.btn-run {
  background: var(--success);
  color: white;
}

.btn-run:hover {
  background: #157347;
}

.btn-run:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ═══ PROGRESS BAR ═══ */
.progress-bar {
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: 6px;
}

.progress-track {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s;
}

.progress-bar span {
  font-size: 13px;
  color: var(--text-2);
}

/* ═══ ERROR MESSAGE ═══ */
.error-msg {
  padding: 12px;
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}

/* ═══ TABLE ═══ */
.table-wrap {
  overflow-x: auto;
}

.results-table, .settings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.results-table th, .settings-table th {
  text-align: left;
  padding: 12px;
  background: var(--bg-2);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
}

.results-table td, .settings-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.results-table tr:hover, .settings-table tr:hover {
  background: var(--bg-2);
}

/* ═══ SETTINGS ═══ */
.settings-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.stab {
  padding: 12px 20px;
  border: none;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.stab:hover {
  color: var(--text-1);
}

.stab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.stab-content {
  display: none;
}

.stab-content.active {
  display: block;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.settings-header h2 {
  font-size: 20px;
  font-weight: 600;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.account-card {
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.account-login {
  font-weight: 600;
}

.account-actions {
  display: flex;
  gap: 8px;
}

.account-info {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}

.account-flags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.flag-badge {
  padding: 4px 8px;
  background: var(--bg-3);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ═══ MODAL ═══ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-1);
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-3);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
}

.form-group input, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input {
  width: auto;
}

.additional-url-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.additional-url-item input {
  flex: 1;
}

/* Price Change */
.price-change-layout {
  padding: 20px;
}

.price-up {
  color: var(--success);
  font-weight: 600;
}

.price-down {
  color: var(--danger);
  font-weight: 600;
}


/* Loading animation */
@keyframes loading {
  0% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ═══ SCHEDULER ═══ */
.scheduler-layout {
  padding: 20px;
}

.scheduler-header {
  margin-bottom: 20px;
}

.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.task-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: box-shadow 0.2s;
}

.task-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.task-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.task-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
}

.task-seller {
  font-size: 14px;
  color: var(--text-3);
}

.task-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.task-status.active {
  background: #d1f4e0;
  color: var(--success);
}

.task-status.paused {
  background: #f8d7da;
  color: var(--danger);
}

.task-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.module-badge {
  padding: 4px 10px;
  background: var(--bg-3);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-2);
}

.task-schedule {
  padding: 12px;
  background: var(--bg-2);
  border-radius: 6px;
  margin-bottom: 12px;
}

.schedule-info {
  margin-bottom: 8px;
}

.schedule-type {
  font-size: 14px;
  color: var(--text-2);
}

.next-execution {
  font-size: 13px;
  color: var(--text-3);
}

.next-execution strong {
  color: var(--primary);
  font-weight: 600;
}

.task-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-icon {
  padding: 6px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--bg-3);
  border-color: var(--text-3);
}

/* Modal wide */
.modal-wide {
  max-width: 700px;
}

/* Checkbox group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  cursor: pointer;
}

/* Schedule fields */
.schedule-fields {
  margin-top: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Status indicators in history */
.status-success {
  color: var(--success);
  font-weight: 600;
}

.status-failed {
  color: var(--danger);
  font-weight: 600;
}

.status-running {
  color: var(--warning);
  font-weight: 600;
}


/* ═══ USER MENU ═══ */
.user-menu {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--bg-2);
  border-radius: 6px;
}

.user-icon {
  font-size: 20px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-1);
}

.btn-logout {
  padding: 8px 12px;
  font-size: 13px;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-logout:hover {
  opacity: 0.9;
}
