.admin-body { display: flex; min-height: 100vh; background: #f0f2f5; }
.admin-side {
  width: 220px; background: #1f2a37; color: #fff; padding: 20px 0; flex-shrink: 0;
}
.admin-brand { padding: 0 20px 20px; font-weight: 800; font-size: 18px; line-height: 1.4; color: #fd7753; }
.admin-brand small { color: #9aa4af; font-weight: 400; }
.admin-side a {
  display: block; color: #c9d1d9; padding: 12px 20px; text-decoration: none;
}
.admin-side a:hover, .admin-side a.active { background: #2b3645; color: #fff; }
.admin-main { flex: 1; padding: 24px; overflow: auto; }
.admin-main h1 { margin-top: 0; }
.admin-login-body {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(135deg, #1f2a37, #3d4f63);
}
.admin-login-box { width: min(400px, 92vw); }
.admin-login-box h1 { margin: 0 0 16px; font-size: 20px; text-align: center; }

.portal { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.portal-side {
  background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
  display: grid; gap: 4px; position: sticky; top: 12px;
}
.portal-side h2 { margin: 0 0 8px; font-size: 16px; }
.portal-side a {
  color: var(--text); padding: 8px 10px; border-radius: 8px;
}
.portal-side a.active, .portal-side a:hover { background: var(--theme-soft); color: var(--theme-dark); }
.portal-main { min-width: 0; }
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow); text-align: center;
}
.stat-card strong { display: block; font-size: 24px; color: var(--theme); }
.stat-card span { color: var(--muted); font-size: 13px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col section, .app-card {
  background: #fff; border-radius: 12px; padding: 16px; box-shadow: var(--shadow);
}
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.simple-list em { color: var(--theme); font-style: normal; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; }
.data-table th { background: #fafbfc; color: #4e5969; }
.tag { display: inline-block; background: var(--theme-soft); color: #c65335; padding: 2px 8px; border-radius: 6px; font-size: 12px; }
.tag.ok { background: #f6ffed; color: #389e0d; }
.ops { white-space: nowrap; }
.link-btn { border: 0; background: transparent; color: var(--theme); cursor: pointer; font: inherit; padding: 0 6px; }
.link-btn.danger { color: #cf1322; }
.btn-ghost {
  border: 1px solid var(--theme); background: #fff; color: var(--theme);
  border-radius: 10px; padding: 10px 18px; cursor: pointer; font: inherit;
}
.action-bar { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.inline-form input, .inline-form select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.app-card { margin-bottom: 12px; }
.app-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }

.side-actions {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  display: grid; gap: 8px;
}
.side-btn {
  display: block; width: 100%; text-align: center; border: 1px solid var(--line);
  background: #fff; color: var(--text); border-radius: 8px; padding: 8px 10px;
  font: inherit; cursor: pointer; text-decoration: none;
}
.side-btn:hover { border-color: var(--theme); color: var(--theme); }
.side-btn.danger { color: #cf1322; border-color: #ffccc7; }
.side-btn.danger:hover { background: #fff2f0; }
.account-actions {
  margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px;
}
.btn-ghost.danger-outline { border-color: #ffccc7; color: #cf1322; }
.settings-form { max-width: 820px; }
.settings-card {
  background: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.settings-card h2 { margin: 0 0 12px; font-size: 16px; }
.settings-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.settings-preview {
  width: 140px; height: 140px; border: 1px dashed var(--line); border-radius: 10px;
  display: grid; place-items: center; overflow: hidden; background: #fafbfc; flex-shrink: 0;
}
.settings-preview img { width: 100%; height: 100%; object-fit: contain; }
.settings-fields { flex: 1; min-width: 220px; display: grid; gap: 10px; }
.settings-fields label { display: grid; gap: 6px; font-size: 13px; color: #4e5969; }
.settings-fields input[type="url"],
.settings-fields input[type="text"] {
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; width: 100%;
  box-sizing: border-box;
}
.settings-form .btn {
  border: 0; background: #fd7753; color: #fff; border-radius: 10px;
  padding: 10px 22px; cursor: pointer; font: inherit; font-weight: 600;
}

.upload-box {
  background: var(--theme-soft); border-radius: 10px; padding: 12px;
}
.attach-row { margin: 8px 0 0; font-size: 14px; }
.attach-delete { margin-top: 10px; }

@media (max-width: 860px) {
  .portal, .two-col { grid-template-columns: 1fr; }
  .portal-side { position: static; grid-template-columns: repeat(2, 1fr); }
  .side-actions { grid-column: 1 / -1; }
  .admin-body { flex-direction: column; }
  .admin-side { width: 100%; }
}
