:root {
  --bg-main: #050505;
  --bg-panel: #111111;
  --bg-panel-soft: #181818;
  --border-soft: #262626;
  --gold: #f3c553;
  --gold-soft: #e1b444;
  --text-main: #f5f5f5;
  --text-muted: #a4a4a4;
  --danger: #ff4f5e;
  --success: #53d17a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.ps12-body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #222 0, #050505 45%, #000 100%);
  color: var(--text-main);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ps12-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  border-bottom: 1px solid #242424;
  background: linear-gradient(90deg, #060606, #141414);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-img {
  height: 42px;
  object-fit: contain;
}

.panel-name {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.ps12-nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 18px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
}

.ps12-nav a:hover {
  color: var(--text-main);
}

.ps12-nav a.active {
  color: var(--gold);
  border-color: var(--gold);
}

.ps12-nav a.danger {
  color: var(--danger);
}

.ps12-main {
  padding: 24px 40px 80px;
  max-width: 1320px;
}

.ps12-card {
  background: radial-gradient(circle at top left, #202020 0, #111111 50%, #050505 100%);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  padding: 18px 20px 20px;
  box-shadow: 0 18px 35px rgba(0,0,0,0.55);
}

.ps12-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px,1fr));
  gap: 18px;
}

.ps12-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
  gap: 18px;
}

.metric {
  text-align: left;
  background: linear-gradient(145deg, #181818, #0a0a0a);
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.metric-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.form-row {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.form-row label {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  background: #050505;
  border-radius: 9px;
  border: 1px solid #303030;
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(243,197,83,0.25);
}

textarea {
  resize: vertical;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  border: none;
  border-radius: 999px;
  color: #1a1205;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 18px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary.full {
  width: 100%;
  justify-content: center;
}

.btn-mini {
  border-radius: 999px;
  border: 1px solid #444;
  background: #111;
  color: var(--text-main);
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
}

.btn-mini.danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-mini + form,
.btn-mini + .btn-mini {
  margin-left: 6px;
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 12px;
}

.tiny {
  font-size: 11px;
}

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

.template-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.template-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 6px 0;
  border-bottom: 1px dashed #262626;
}

.template-list li:last-child {
  border-bottom: none;
}

.badge {
  background: rgba(243,197,83,0.12);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid rgba(243,197,83,0.4);
  color: var(--gold);
}

.created-at {
  margin-left: auto;
}

.ps12-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.ps12-table th,
.ps12-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #252525;
}

.ps12-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
}

.ps12-table tr:last-child td {
  border-bottom: none;
}

.ps12-table tr.status-done td.status {
  color: var(--success);
}

.ps12-table tr.status-failed td.status {
  color: var(--danger);
}

.ps12-table .actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.alert {
  margin-bottom: 18px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
}

.alert.success {
  background: rgba(83,209,122,0.12);
  border: 1px solid rgba(83,209,122,0.52);
  color: var(--success);
}

.alert.danger {
  background: rgba(255,79,94,0.12);
  border: 1px solid rgba(255,79,94,0.6);
  color: var(--danger);
}

.ps12-footer {
  padding: 12px 40px 18px;
  border-top: 1px solid #181818;
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
}

.log-view {
  background: #030303;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 11px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #202020;
}

.code-snippet {
  background: #030303;
  border-radius: 9px;
  padding: 10px 12px;
  font-size: 12px;
  border: 1px solid #202020;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: radial-gradient(circle at top, #242424 0, #111 55%, #050505 100%);
  padding: 26px 26px 22px;
  border-radius: 16px;
  width: 320px;
  text-align: center;
  border: 1px solid #303030;
  box-shadow: 0 20px 40px rgba(0,0,0,0.65);
}

.login-card h1 {
  margin: 6px 0 4px;
  font-size: 20px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.login-logo {
  margin-bottom: 4px;
}

.login-logo .logo-img {
  height: 52px;
}

.login-card .form-row label {
  text-align: left;
}

.login-card .form-row input {
  background: #040404;
}

@media (max-width: 768px) {
  .ps12-header {
    padding: 10px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .ps12-main {
    padding: 18px 16px 60px;
  }
  .ps12-footer {
    padding: 10px 16px 18px;
  }
  .logo-img {
    height: 34px;
  }
}
