* {
  box-sizing: border-box;
}

:root {
  --bg: #080d13;
  --bg-soft: #0d141d;
  --panel: #111922;
  --panel-2: #0d151e;
  --border: #243140;

  --text: #f4f7fb;
  --muted: #8f9aa8;

  --blue: #1d9bf0;
  --blue-soft: rgba(29, 155, 240, 0.12);

  --green: #32d583;
  --green-soft: rgba(50, 213, 131, 0.12);

  --red: #f97066;

  --radius: 16px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    radial-gradient(
      circle at top right,
      rgba(29, 155, 240, 0.06),
      transparent 28%
    ),
    var(--bg);

  color: var(--text);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* ===============================
   LAYOUT
================================ */

.app-shell {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 260px;
  min-height: 100vh;

  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;

  padding: 28px 18px;

  background: rgba(9, 15, 22, 0.95);
  border-right: 1px solid var(--border);
}

.content {
  width: calc(100% - 260px);
  margin-left: 260px;
  padding: 34px;
}

/* ===============================
   LOGO
================================ */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.brand-logo {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 12px;

  background: linear-gradient(
    135deg,
    #1d9bf0,
    #0f69c9
  );

  color: white;
  font-size: 24px;
  font-weight: 800;
}

.brand-title {
  font-size: 20px;
  font-weight: 750;
}

.brand-subtitle {
  margin: 0 0 30px 54px;

  color: var(--muted);
  font-size: 13px;
}

/* ===============================
   SIDEBAR
================================ */

.nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;

  padding: 12px 14px;

  color: #c7d0da;

  border-radius: 11px;
  border: 1px solid transparent;

  transition: 0.18s ease;
}

.nav-link:hover {
  background: #111c27;
  color: white;
}

.nav-link.active {
  color: #54b7ff;

  background: var(--blue-soft);
  border-color: rgba(29, 155, 240, 0.25);
}

.nav-icon {
  width: 24px;
  text-align: center;
  font-size: 18px;
}

/* ===============================
   SYSTEM STATUS
================================ */

.system-status {
  position: absolute;
  bottom: 25px;
  left: 18px;
  right: 18px;

  padding: 17px;

  border-radius: 14px;
  border: 1px solid var(--border);

  background: var(--panel);
}

.system-status-title {
  margin-bottom: 15px;

  color: #d9e1ea;
  font-size: 13px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 9px;

  margin-top: 11px;

  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;
}

.status-dot.green {
  background: var(--green);
  box-shadow: 0 0 12px rgba(50, 213, 131, 0.55);
}

.status-dot.red {
  background: var(--red);
}

/* ===============================
   HEADER
================================ */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 24px;
}

.page-title {
  margin: 0;

  font-size: 36px;
  font-weight: 750;
  letter-spacing: -1px;
}

.page-subtitle {
  margin: 8px 0 0;

  color: var(--muted);
  font-size: 15px;
}

.worker-pill {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 11px 15px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--panel);

  font-size: 14px;
}

/* ===============================
   CONNECT CARD
================================ */

.connect-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  margin-bottom: 18px;
  padding: 24px 26px;

  border-radius: var(--radius);
  border: 1px solid rgba(29, 155, 240, 0.35);

  background:
    linear-gradient(
      120deg,
      rgba(29, 155, 240, 0.14),
      rgba(17, 25, 34, 0.95)
    );
}

.connect-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.x-circle {
  width: 68px;
  height: 68px;

  display: grid;
  place-items: center;

  border-radius: 50%;
  border: 1px solid #2c3b4b;

  background: #0b1118;

  font-size: 34px;
}

.connect-card h2 {
  margin: 0 0 5px;
  font-size: 25px;
}

.connect-card p {
  margin: 0;
  color: var(--muted);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 145px;
  padding: 12px 18px;

  border-radius: 11px;
  border: 1px solid rgba(82, 175, 255, 0.65);

  background:
    linear-gradient(
      180deg,
      rgba(29, 155, 240, 0.25),
      rgba(29, 155, 240, 0.12)
    );

  color: white;
  font-weight: 650;

  box-shadow:
    0 0 18px rgba(29, 155, 240, 0.14);

  transition: 0.18s ease;
}

.primary-button:hover {
  transform: translateY(-1px);

  box-shadow:
    0 0 22px rgba(29, 155, 240, 0.25);
}

/* ===============================
   STATS
================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;

  margin-bottom: 18px;
}

.stat-card {
  min-height: 130px;
  padding: 18px;

  border-radius: 14px;
  border: 1px solid var(--border);

  background: var(--panel);
}

.stat-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.stat-icon {
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 11px;

  background: var(--blue-soft);
  color: #58b9ff;

  font-size: 20px;
}

.stat-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.stat-value {
  font-size: 28px;
  font-weight: 750;
}

.stat-label {
  margin-top: 2px;

  color: var(--muted);
  font-size: 13px;
}

.stat-footer {
  margin-top: 18px;

  color: #6bbcff;
  font-size: 12px;
}

.stat-footer.green {
  color: #51d48d;
}

/* ===============================
   PANELS
================================ */

.panel {
  padding: 20px;

  border-radius: var(--radius);
  border: 1px solid var(--border);

  background: var(--panel);
}

.panel-title {
  margin: 0 0 16px;
  font-size: 18px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.quick-action {
  padding: 17px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: var(--panel-2);

  transition: 0.18s ease;
}

.quick-action:hover {
  border-color: rgba(29, 155, 240, 0.45);
  transform: translateY(-1px);
}

.quick-action-title {
  margin-bottom: 5px;
  font-weight: 650;
}

.quick-action-desc {
  color: var(--muted);
  font-size: 13px;
}

/* ===============================
   TABLES / FORMS
================================ */

.table-wrap {
  overflow-x: auto;

  border-radius: 14px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 13px;

  text-align: left;

  background: #0d151e;

  color: #8f9aa8;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

td {
  padding: 13px;

  border-top: 1px solid var(--border);

  color: #dbe2ea;
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;

  padding: 11px 12px;

  border: 1px solid #2a3949;
  border-radius: 10px;

  outline: none;

  background: #0a1118;
  color: white;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #1d9bf0;
}

.form-group {
  margin-bottom: 18px;
}

/* ===============================
   RESPONSIVE
================================ */

@media (max-width: 1050px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    position: static;

    width: 100%;
    min-height: auto;
  }

  .system-status {
    position: static;
    margin-top: 25px;
  }

  .app-shell {
    display: block;
  }

  .content {
    width: 100%;
    margin-left: 0;
    padding: 22px;
  }

  .page-header,
  .connect-card {
    flex-direction: column;
    align-items: stretch;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
.accounts-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.mini-stat {
  padding: 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.mini-stat-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.mini-stat-value {
  font-size: 27px;
  font-weight: 750;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 16px;
}

.panel-description {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-user {
  display: flex;
  align-items: center;
  gap: 11px;
}

.account-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
  color: #55b7ff;
  font-weight: 750;
}

.account-name {
  font-weight: 650;
  color: var(--text);
}

.account-username {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.account-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.account-status.active {
  color: #5de59a;
  background: var(--green-soft);
}

.account-status.warning {
  color: #f5c451;
  background: rgba(245, 196, 81, 0.1);
}

.account-status.offline {
  color: #ff8178;
  background: rgba(249, 112, 102, 0.1);
}

.table-action {
  display: inline-flex;
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid rgba(29, 155, 240, 0.35);
  color: #62bcff;
  background: var(--blue-soft);
  font-size: 12px;
}

.table-action:hover {
  border-color: #1d9bf0;
}

@media (max-width: 800px) {
  .accounts-summary {
    grid-template-columns: 1fr;
  }
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.schedule-panel {
  max-width: 850px;
}

.schedule-form {
  margin-top: 22px;
}

.schedule-form label {
  display: block;
  margin-bottom: 8px;
  color: #dce4ec;
  font-size: 13px;
  font-weight: 650;
}

.schedule-form textarea {
  resize: vertical;
  min-height: 170px;
}

.form-help {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0d151e;
  color: #cbd5df;
  font-weight: 650;
}

.secondary-button:hover {
  border-color: #3a4a5c;
  color: white;
}

.schedule-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.side-info-card {
  display: flex;
  gap: 13px;
  padding: 17px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--panel);
}

.side-info-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--blue-soft);
}

.side-info-title {
  margin-bottom: 5px;
  font-weight: 650;
}

.side-info-text {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 950px) {
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .schedule-panel {
    max-width: none;
  }
}
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.status-published {
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-pending {
  background: rgba(234, 179, 8, 0.14);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.25);
}

.status-processing {
  background: rgba(29, 155, 240, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(29, 155, 240, 0.25);
}

.status-failed {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-canceled {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}
.status-retry {
  background: rgba(249, 115, 22, 0.14);
  color: #fb923c;
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.status-token_refreshed {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}
.worker-total {
  margin-left: 8px;
  font-size: 11px;
  color: #7f8b99;
  font-weight: 500;
}
.table-action.attention {
  color: #facc15;
  border-color: rgba(250, 204, 21, 0.28);
  background: rgba(250, 204, 21, 0.08);
}

.table-action.attention:hover {
  background: rgba(250, 204, 21, 0.14);
}