:root {
  --bg: #f4f0e7;
  --card: #fffdf9;
  --ink: #1f1c18;
  --muted: #6b645d;
  --accent: #ff5a1f;
  --accent-2: #d81e5b;
  --line: #e7dccf;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, #ffe8cf 0, transparent 45%),
    radial-gradient(circle at 85% 30%, #ffd2d2 0, transparent 42%),
    var(--bg);
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
}

.sidebar {
  background: linear-gradient(155deg, #2c211c, #5d3928);
  color: #fff;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand h1 {
  margin: 0;
  font-size: 28px;
}

.brand p {
  margin: 8px 0 0;
  color: #f6d3c7;
}

.menu {
  display: grid;
  gap: 10px;
}

.menu button {
  border: 1px solid #8a5b46;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.menu button.active,
.menu button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.sidebar-actions {
  margin-top: auto;
  display: grid;
  gap: 10px;
}

button.primary,
button.ghost {
  padding: 11px 14px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
}

button.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
}

button.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.workspace {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.topbar h2 {
  margin: 0;
}

.topbar a {
  color: #55311a;
  font-weight: 700;
}

.panel {
  display: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.panel.active {
  display: block;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.one {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
input[type="password"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 15px;
}

input[type="color"] {
  width: 80px;
  height: 42px;
  border: 0;
  background: transparent;
}

.preview-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}

.preview-wrap h3 {
  margin: 0 0 12px;
}

#previewFrame {
  width: 100%;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
}

.widget-list {
  display: grid;
  gap: 12px;
}

.widget-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  background: #fff;
}

.widget-card h4 {
  margin: 0 0 10px;
  font-size: 14px;
}

.widget-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.widget-grid label {
  font-size: 12px;
}

.login-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 14, 9, 0.66);
  display: grid;
  place-items: center;
}

.login-modal.hidden {
  display: none;
}

.zs-login-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
  overflow: hidden;
  background: #081b29;
}

.zs-login-overlay.hidden {
  display: none;
}

#particles-js {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.zs-login-container {
  position: relative;
  z-index: 1;
  width: min(850px, calc(100vw - 24px));
  height: min(550px, calc(100vh - 24px));
  background: #081b29;
  border: 2px solid #0ef;
  border-radius: 15px;
  box-shadow: 0 0 25px rgba(0, 238, 255, 0.2);
  overflow: hidden;
}

.zs-form-box {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: 0.6s ease-in-out;
  z-index: 11;
}

.zs-login-box {
  left: 0;
  opacity: 1;
  pointer-events: auto;
}

.zs-support-box {
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
}

.zs-login-container.active .zs-login-box {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
}

.zs-login-container.active .zs-support-box {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.zs-form-box h2 {
  color: #fff;
  font-size: 32px;
  text-align: center;
  margin-bottom: 30px;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.zs-input-box {
  position: relative;
  width: 100%;
  height: 50px;
  margin: 25px 0;
}

.zs-input-box input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 2px solid #fff;
  color: #fff;
  font-size: 16px;
  padding: 10px 35px 0 5px;
  transition: border-bottom-color 0.3s;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.zs-input-box input[type="password"],
.zs-input-box input[data-visible="1"] {
  font-family: monospace;
  letter-spacing: 4px;
  font-size: 20px;
}

.zs-input-box input:focus {
  border-bottom-color: #0ef;
}

.zs-input-box label {
  position: absolute;
  top: -5px;
  left: 5px;
  color: #0ef;
  font-size: 13px;
  pointer-events: none;
  font-weight: 400;
}

.zs-input-box > i.fa-user,
.zs-input-box > i.fa-envelope,
.zs-input-box > i.fa-comment {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  color: #fff;
  font-size: 18px;
  transition: 0.5s;
}

.zs-input-box input:focus ~ i {
  color: #0ef;
}

.zs-eye-container {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: #fff;
  transition: color 0.3s;
}

.zs-eye-container i {
  font-size: 16px;
  transition: transform 0.15s ease-in-out;
}

.zs-eye-container:hover {
  color: #0ef;
}

.zs-eye-container.active {
  color: #0ef;
  text-shadow: 0 0 10px rgba(0, 238, 255, 0.5);
}

.zs-btn {
  position: relative;
  width: 100%;
  height: 45px;
  background: #0ef;
  border: none;
  outline: none;
  border-radius: 40px;
  cursor: pointer;
  font-size: 16px;
  color: #081b29;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(0, 238, 255, 0.6);
  margin-top: 15px;
  transition: 0.5s;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.zs-btn:hover {
  box-shadow: 0 0 20px rgba(0, 238, 255, 1);
}

.zs-login-register {
  font-size: 14px;
  color: #fff;
  text-align: center;
  margin-top: 25px;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.zs-login-register a {
  color: #0ef;
  text-decoration: none;
  font-weight: 600;
  margin-left: 5px;
}

.zs-login-register a:hover {
  text-decoration: underline;
}

.zs-error-msg {
  min-height: 20px;
  background: rgba(255, 51, 51, 0.1);
  color: #ff6b6b;
  border-left: 3px solid #ff3333;
  padding: 10px;
  font-size: 13px;
  margin-bottom: 6px;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.zs-error-msg:empty {
  border-left: 0;
  padding: 0;
  margin: 0;
  min-height: 0;
}

.zs-toggle-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #0ef 0%, #00a8cc 100%);
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0% 100%);
  transition: all 0.6s ease-in-out;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.zs-login-container.active .zs-toggle-panel {
  right: 50%;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
}

.zs-toggle-text {
  position: absolute;
  width: 100%;
  padding: 40px;
  text-align: center;
  color: #fff;
  transition: 0.6s ease-in-out;
  font-family: "Poppins", "Segoe UI", sans-serif;
}

.zs-toggle-text h3 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 15px;
}

.zs-toggle-text p {
  font-size: 15px;
  font-weight: 400;
}

.zs-toggle-text-right {
  opacity: 1;
}

.zs-toggle-text-left {
  opacity: 0;
  transform: translateX(-50px);
}

.zs-login-container.active .zs-toggle-text-right {
  opacity: 0;
  transform: translateX(50px);
}

.zs-login-container.active .zs-toggle-text-left {
  opacity: 1;
  transform: translateX(0);
}

.login-card {
  width: min(420px, calc(100vw - 24px));
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  display: grid;
  gap: 12px;
}

.login-card h2 {
  margin: 0;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.login-card button {
  border: 0;
  padding: 11px;
  border-radius: 9px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.error {
  min-height: 18px;
  color: #be1f3c;
  font-size: 14px;
}

@media (max-width: 1000px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 14px;
  }

  .grid.two,
  .widget-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .grid.two,
  .widget-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .zs-login-container {
    width: 95%;
    height: min(600px, calc(100vh - 20px));
  }

  .zs-form-box {
    width: 100%;
    height: 65%;
    padding: 20px 30px;
  }

  .zs-login-box {
    top: 35%;
    left: 0;
  }

  .zs-support-box {
    top: 0;
    right: 0;
    transform: translateY(-20px) translateX(0);
  }

  .zs-login-container.active .zs-login-box {
    transform: translateY(20px) translateX(0);
    opacity: 0;
  }

  .zs-login-container.active .zs-support-box {
    transform: translateY(0) translateX(0);
    opacity: 1;
  }

  .zs-toggle-panel {
    width: 100%;
    height: 35%;
    top: 0;
    right: 0;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
  }

  .zs-login-container.active .zs-toggle-panel {
    top: 65%;
    right: 0;
    clip-path: polygon(0 15%, 100% 0, 100% 100%, 0 100%);
  }

  .zs-toggle-text {
    padding: 20px;
  }

  .zs-toggle-text h3 {
    font-size: 22px;
    margin-bottom: 5px;
  }

  .zs-toggle-text p {
    font-size: 12px;
  }

  .zs-toggle-text-left {
    transform: translateY(-30px) translateX(0);
  }

  .zs-login-container.active .zs-toggle-text-right {
    transform: translateY(30px) translateX(0);
    opacity: 0;
  }

  .zs-login-container.active .zs-toggle-text-left {
    transform: translateY(0) translateX(0);
    opacity: 1;
  }

  .zs-form-box h2 {
    font-size: 26px;
    margin-bottom: 15px;
  }

  .zs-input-box {
    margin: 15px 0;
    height: 45px;
  }

  .zs-btn {
    height: 40px;
    font-size: 14px;
    margin-top: 10px;
  }

  .zs-login-register {
    margin-top: 15px;
    font-size: 13px;
  }
}