:root {
  --bg: #0a0705;
  --bg-2: #130d08;
  --card: #1a120d;
  --card-2: #231710;
  --ink: #fff3e8;
  --muted: #d8b9a0;
  --line: #5b3a1f;
  --accent: #ff7a00;
  --accent-2: #ffad33;
  --warning: #ffb84d;
  --danger: #d64545;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 122, 0, .24) 0, rgba(255, 122, 0, 0) 36%),
    radial-gradient(circle at 90% 15%, rgba(255, 184, 77, .16) 0, rgba(255, 184, 77, 0) 34%),
    linear-gradient(180deg, var(--bg), #0f0906 45%, #090604 100%);
}

.login-body { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card {
  width: min(460px, 96vw);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, .35);
}

h1, h2, h3 { margin: 0 0 6px; }
p { margin: 0 0 14px; color: var(--muted); }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 240px;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #1b120d, #120b08);
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.brand-block {
  padding: 20px 18px;
  border-bottom: 1px solid var(--line);
}

.brand-block h2 { font-size: 26px; letter-spacing: .4px; }
.brand-block p { margin: 4px 0 0; font-size: 12px; }

.side-nav { padding: 14px 10px; display: grid; gap: 8px; align-content: start; }
.side-link {
  text-decoration: none;
  color: #ffd7b3;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
}
.side-link:hover { background: #2a1c12; border-color: #5b3a1f; }
.side-link.active { background: linear-gradient(135deg, #ff7a00, #ff9a2f); color: #fff; }

.side-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.user-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #2a1a10;
  display: grid;
}
.user-card small { color: var(--muted); }

.content-area {
  margin-left: 240px;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  margin: 22px 22px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #2a1b10, #20140d);
}

.topbar-form { margin: 0; }

.layout {
  width: calc(100% - 44px);
  margin: 14px 22px 24px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}

.panel {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 10px 24px rgba(0,0,0,.2);
  animation: fadeIn .35s ease both;
}

#upload { grid-column: span 12; }
#sites { grid-column: span 7; }
#status { grid-column: span 5; }
#overview { grid-column: span 12; }
#library { grid-column: span 12; }
#logs { grid-column: span 12; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stack-form { display: grid; gap: 10px; }
label { font-size: 13px; font-weight: 600; }
.hint { color: var(--muted); font-size: 12px; }

input[type="text"],
input[type="password"],
input[type="url"],
input[type="file"],
input[type="number"],
select,
textarea,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  background: #1a120d;
  color: #fff3e8;
}

textarea { resize: vertical; min-height: 120px; }

button,
.btn {
  background: linear-gradient(135deg, #ff7a00, #ff9a2f);
  color: #fff;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  padding: 10px 12px;
  border-radius: 10px;
  transition: transform .15s ease, opacity .2s ease;
}

button:hover,
.btn:hover { transform: translateY(-1px); opacity: .96; }

.btn-muted { background: #4d2f1b; }
.btn-danger { background: linear-gradient(135deg, #bb3144, #cb4558); }
.btn-copy { background: linear-gradient(135deg, #ff8c00, #ffb23c); font-size: 12px; padding: 8px 10px; }

.alert {
  grid-column: span 12;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid;
  font-weight: 600;
}
.alert-ok { background: #13271f; border-color: #275d48; color: #9fe2c8; }
.alert-err { background: #2a151a; border-color: #6c2f3a; color: #ffb5c0; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-check { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }

.check-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: #1a120d;
}
.check-item span { display: grid; gap: 3px; }
.check-item small { color: var(--muted); }
.inline-check { display: flex; align-items: center; gap: 8px; }

.section-divider { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

.batch-actions { display: grid; grid-template-columns: 1fr 140px; gap: 8px; }
.batch-status {
  background: #1a120d;
  border: 1px solid #6a4524;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

progress { width: 100%; height: 12px; accent-color: var(--accent); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.stat-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #20150f;
  display: grid;
  gap: 4px;
}
.stat-card strong { font-size: 12px; color: var(--muted); }
.stat-card span { font-size: 22px; font-weight: 800; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 10px; }

table { width: 100%; border-collapse: collapse; background: #140e0a; }
th,
td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid #4a311b;
  font-size: 13px;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }

.log-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: #1a120d;
}

.log-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.ok-badge,
.err-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 999px;
  margin-right: 8px;
}

.ok-badge { background: #3f2a12; color: #ffd6a8; }
.err-badge { background: #4a1e1e; color: #ffb5b5; }

pre {
  background: #140d09;
  color: #ffe2bf;
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  overflow: auto;
}

code {
  background: #2f1e10;
  border: 1px solid #60381b;
  border-radius: 6px;
  padding: 1px 6px;
}

.url-copy-wrap { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0; }
.clean-url-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
  background: #1a120d;
}

@media (max-width: 1100px) {
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
    grid-template-rows: auto auto auto;
  }
  .content-area { margin-left: 0; }
}

@media (max-width: 900px) {
  #sites,
  #status,
  #overview,
  #library,
  #upload,
  #logs { grid-column: span 12; }

  .two-col { grid-template-columns: 1fr; }
  .layout { width: calc(100% - 22px); margin: 12px 11px 18px; }
  .topbar { margin: 12px 11px 0; }
}
