.admin-shell { min-height: 100vh; display: flex; flex-direction: column; }

.admin-header {
  background: var(--green-900);
  color: #fff;
  padding: 0 20px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.admin-header .brand .logo-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 800; color: #201a08;
}
.admin-header .actions { display: flex; gap: 10px; align-items: center; }
.admin-header a.view-site { color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 600; }

.admin-subnav {
  background: #fff; border-bottom: 1px solid var(--border); padding: 0 20px;
  display: flex; gap: 4px;
}
.admin-subnav a {
  padding: 13px 16px; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft);
  border-bottom: 3px solid transparent;
}
.admin-subnav a:hover { color: var(--ink); }
.admin-subnav a.active { color: var(--green-900); border-bottom-color: var(--gold); }

.admin-main { flex: 1; padding: 26px 20px 60px; max-width: 1100px; margin: 0 auto; width: 100%; }

.admin-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.admin-toolbar h1 { font-size: 1.3rem; margin: 0; }

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px 30px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.login-card .logo-mark {
  width: 52px; height: 52px; border-radius: 14px; background: var(--gold);
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  font-weight: 800; color: #201a08;
  margin: 0 auto 12px;
}
.login-card h1 { font-size: 1.2rem; margin: 0 0 4px; }
.login-card p.sub { color: var(--ink-soft); font-size: 0.88rem; margin: 0 0 22px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-card label { font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); }
.login-card input {
  width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--border); font-size: 0.95rem;
}
.login-card .btn { margin-top: 6px; }
.error-msg { color: var(--danger); font-size: 0.85rem; min-height: 18px; text-align: left; }

/* Table */
.admin-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.admin-table th, table.admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.admin-table th { background: var(--green-100); color: var(--green-900); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table img.thumb-sm { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; background: var(--earth-100); }
table.admin-table .row-actions { display: flex; gap: 8px; }
table.admin-table td.note-cell { max-width: 220px; font-size: 0.85rem; color: #7a5b12; font-style: italic; }
table.admin-table .row-actions .btn { padding: 6px 12px; font-size: 0.82rem; }

/* Form */
.form-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form-section-title { font-weight: 700; font-size: 1rem; margin: 22px 0 12px; color: var(--green-900); }
.form-section-title:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.form-field input, .form-field select, .form-field textarea {
  padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border); font-size: 0.92rem; font-family: inherit;
}
.form-field textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }

.internal-note-box {
  background: #fff7e6; border: 1.5px dashed #d8a53a; border-radius: 10px; padding: 14px 16px;
}
.internal-note-hint { margin: 0 0 10px; font-size: 0.83rem; color: #7a5b12; line-height: 1.5; }
.internal-note-box textarea { background: #fffdf8; }

.lang-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.lang-tabs .lang-tab {
  border: 1px solid var(--border); background: var(--bg); color: var(--ink-soft);
  padding: 8px 16px; border-radius: 9px 9px 0 0; font-size: 0.88rem; font-weight: 700;
  border-bottom: none; position: relative; top: 1px;
}
.lang-tabs .lang-tab.active { background: #fff; color: var(--green-700); border-color: var(--green-600); border-bottom: 1px solid #fff; }
.lang-panel { border: 1px solid var(--border); border-radius: 0 9px 9px 9px; padding: 16px; margin-bottom: 8px; background: #fff; }
.lang-panel[hidden] { display: none; }

.lang-tabs-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.btn-ai-translate {
  background: var(--green-900); color: var(--gold); border: 1px solid var(--gold);
  padding: 8px 14px; border-radius: 9px; font-size: 0.85rem; font-weight: 700;
  margin-bottom: 6px; white-space: nowrap;
}
.btn-ai-translate:hover { background: #221f14; }
.btn-ai-translate:disabled { opacity: 0.6; cursor: default; }
.ai-translate-status { font-size: 0.82rem; color: var(--ink-soft); margin: -6px 0 12px; min-height: 1.1em; }
.ai-translate-status.error { color: #b3261e; }
.ai-translate-status.success { color: #2f7a4f; }

.image-uploader { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.image-uploader .img-item {
  position: relative; width: 110px; height: 84px; border-radius: 9px; overflow: hidden;
  border: 1px solid var(--border); background: var(--earth-100);
}
.image-uploader .img-item img { width: 100%; height: 100%; object-fit: cover; }
.image-uploader .img-item .remove-btn {
  position: absolute; top: 3px; right: 3px; background: rgba(20,20,20,0.65); color: #fff; border: none;
  width: 22px; height: 22px; border-radius: 50%; font-size: 0.8rem; line-height: 1;
}
.image-uploader .img-item .cover-tag {
  position: absolute; bottom: 0; left: 0; right: 0; background: rgba(31,61,43,0.85); color: #fff;
  font-size: 0.65rem; text-align: center; padding: 2px 0;
}
.image-uploader .upload-btn {
  width: 110px; height: 84px; border-radius: 9px; border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  color: var(--ink-soft); font-size: 0.75rem; background: var(--bg); cursor: pointer;
}
.image-uploader .upload-btn:hover { border-color: var(--green-600); color: var(--green-700); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 0.88rem; box-shadow: var(--shadow-lg); z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }
