/* COLORMENSIS — admin panel styles */
:root {
  --purple: #9C3CE4;
  --purple-deep: #7B23C2;
  --coral: #FC5454;
  --yellow: #FCCC24;
  --cream: #FFF9F0;
  --ink: #2E2438;
  --gray: #545454;
  --line: rgba(46, 36, 56, 0.12);
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--cream);
  color: var(--gray);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--purple-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: var(--ink);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; color: #fff; }
.topbar .brand img { width: 34px; height: 34px; border-radius: 9px; }
.topbar .brand:hover { text-decoration: none; }

.topbar nav { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.topbar nav a { color: #ddd; font-weight: 600; font-size: 0.92rem; }
.topbar nav a:hover { color: var(--yellow); text-decoration: none; }
.topbar nav a.active { color: var(--yellow); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 24px 80px; }

.page-title { font-size: 1.7rem; font-weight: 800; color: var(--ink); margin-bottom: 6px; }
.page-sub { margin-bottom: 26px; color: var(--gray); }

.lang-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  background: #F1EAF8;
  border: 1px solid #DCC7F0;
  border-radius: 14px;
  padding: 10px 12px;
}
.lang-tab {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: #fff;
  border: 1px solid #DCC7F0;
  color: var(--ink);
}
.lang-tab:hover { border-color: var(--purple); text-decoration: none; }
.lang-tab.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.lang-hint { margin-left: auto; font-size: 0.78rem; color: var(--gray); }

.flash {
  padding: 14px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-weight: 600;
}
.flash.ok { background: #E9F9EC; color: #1E7A34; border: 1px solid #BFE8C8; }
.flash.err { background: #FDEBEB; color: #B42318; border: 1px solid #F5C6C6; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 30px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(46,36,56,0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(46,36,56,0.12); text-decoration: none; }
.card h3 { color: var(--ink); font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.card p { font-size: 0.88rem; flex: 1; }
.card .go { font-weight: 700; color: var(--purple-deep); }

.status-list { display: grid; gap: 10px; margin-bottom: 30px; }
.status {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  font-size: 0.92rem;
}
.status.good { border-left-color: #2E9E44; }
.status.bad { border-left-color: var(--coral); }
.status .tag { font-weight: 700; color: var(--ink); }

details.sec {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(46,36,56,0.04);
  overflow: hidden;
}

details.sec summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 800;
  color: var(--ink);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fbf7ff;
  border-bottom: 1px solid transparent;
}

details.sec[open] summary { border-bottom-color: var(--line); }

details.sec summary::-webkit-details-marker { display: none; }

details.sec summary .hint { font-weight: 400; font-size: 0.8rem; color: var(--gray); }

.sec-body { padding: 18px 20px 22px; }

.fields { display: grid; gap: 14px; }

.field label { display: block; font-weight: 700; color: var(--ink); font-size: 0.85rem; margin-bottom: 6px; }

.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.field textarea { min-height: 80px; resize: vertical; }

.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--purple); }

.field.color-row { display: flex; align-items: center; gap: 10px; }
.field.color-row input[type="color"] { width: 52px; height: 40px; padding: 3px; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.field.color-row input[type="text"] { flex: 1; }

.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 10px; }
.list-head h4 { color: var(--ink); font-size: 0.9rem; }

.list-item {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  position: relative;
}

.list-item .item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.list-item .item-title { font-weight: 700; color: var(--purple-deep); font-size: 0.85rem; }

.list-item .btn-del {
  background: #FDEBEB;
  color: #B42318;
  border: 1px solid #F5C6C6;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.list-item .btn-del:hover { background: #FAD5D5; }

.item-fields { display: grid; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  border: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }

.btn-primary { background: var(--purple); color: #fff; box-shadow: 0 8px 20px rgba(156,60,228,.3); }
.btn-primary:hover { background: var(--purple-deep); }

.btn-add { background: #F3E8FF; color: var(--purple-deep); }
.btn-add:hover { background: #E9D9FC; }

.btn-ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--purple); color: var(--purple-deep); }

.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: #E83B3B; }

.actions { display: flex; gap: 12px; align-items: center; margin-top: 22px; flex-wrap: wrap; }

.save-bar {
  position: sticky;
  bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(46,36,56,0.18);
  padding: 10px 14px 10px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 26px;
}
.save-bar .saved-note { font-size: 0.85rem; color: #2E9E44; font-weight: 700; }

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

.login-box {
  max-width: 380px;
  margin: 8vh auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(46,36,56,.12);
  padding: 34px;
}
.login-box .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-box .brand img { width: 44px; height: 44px; border-radius: 12px; }
.login-box h1 { font-size: 1.3rem; color: var(--ink); }
.login-box input { width: 100%; padding: 12px 16px; border: 2px solid var(--line); border-radius: 10px; font-size: 1rem; margin-bottom: 14px; }
.login-box input:focus { border-color: var(--purple); outline: none; }
.login-box .btn { width: 100%; justify-content: center; padding: 13px; }

.hint-box { background: #FFF4C2; border: 1px solid #F0DA7A; border-radius: 10px; padding: 10px 14px; font-size: 0.85rem; margin-bottom: 14px; }

.img-table { display: grid; gap: 14px; }
.img-row {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.img-row .preview { width: 120px; height: 120px; border-radius: 10px; object-fit: cover; background: #eee; border: 1px solid var(--line); flex-shrink: 0; }
.img-row .preview.video-preview { object-fit: contain; }
.img-row .info { flex: 1; min-width: 220px; }
.img-row .info strong { color: var(--ink); display: block; }
.img-row .info small { color: var(--gray); }
.img-row input[type="file"] { font-size: 0.85rem; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.thumb { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.thumb img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; background: #eee; }
.thumb .name { font-size: 0.75rem; word-break: break-all; color: var(--gray); }
.thumb .url { font-size: 0.72rem; color: var(--purple-deep); }

table.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
table.grid th, table.grid td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
table.grid th { background: #fbf7ff; color: var(--ink); font-weight: 700; }
table.grid td code { background: var(--cream); padding: 3px 8px; border-radius: 6px; font-size: 0.82rem; }

@media (max-width: 640px) {
  .topbar { flex-direction: column; align-items: flex-start; }
  .img-row { flex-direction: column; align-items: flex-start; }
}
