* { box-sizing:border-box; }
:root {
  --bg:#f4f7f6; --surface:#fff; --text:#17221d; --muted:#68776f;
  --green:#136c47; --green-dark:#0c5034; --border:#dfe8e3; --danger:#a63b3b;
}
body {
  margin:0; font-family:Inter,"Segoe UI",Arial,sans-serif; background:var(--bg); color:var(--text);
}
a { color:inherit; }
.admin-header {
  min-height:66px; background:#fff; border-bottom:1px solid var(--border);
  padding:10px 28px; display:flex; justify-content:space-between; align-items:center; gap:20px;
}
.admin-header div { display:flex; flex-direction:column; }
.admin-header strong { color:var(--green-dark); font-size:18px; }
.admin-header span { color:var(--muted); font-size:11px; }
.admin-header nav { display:flex; flex-wrap:wrap; gap:9px; }
.admin-header nav a {
  text-decoration:none; padding:8px 10px; border:1px solid var(--border); background:#fff;
  border-radius:8px; font-size:12px; font-weight:700;
}
.admin-container { width:min(1450px,calc(100% - 32px)); margin:25px auto; }
.page-title { display:flex; justify-content:space-between; align-items:flex-end; gap:20px; margin-bottom:16px; }
h1 { margin:0 0 5px; font-size:28px; }
.page-title p { margin:0; color:var(--muted); font-size:13px; }
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
  border:1px solid var(--border); background:#fff; color:var(--text);
  border-radius:8px; padding:8px 10px; font-size:12px; font-weight:750;
  text-decoration:none; cursor:pointer;
}
.btn.primary { background:var(--green); color:#fff; border-color:var(--green); }
.btn.danger { color:var(--danger); }
.btn.full { width:100%; }
.flash {
  margin-bottom:14px; padding:11px 13px; background:#e8f3ed; color:var(--green-dark);
  border:1px solid #cde2d7; border-radius:9px; font-size:13px; font-weight:700;
}
.table-wrap { overflow:auto; background:#fff; border:1px solid var(--border); border-radius:12px; }
table { width:100%; border-collapse:collapse; min-width:970px; }
th,td { padding:11px 12px; border-bottom:1px solid var(--border); text-align:left; vertical-align:middle; font-size:12px; }
th { background:#f9fbfa; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.5px; }
td small { display:block; margin-top:3px; color:var(--muted); }
td.url { max-width:280px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mini-icon {
  display:inline-grid; place-items:center; min-width:44px; height:35px; padding:0 7px;
  border-radius:8px; color:#fff; background:var(--green); font-weight:900; font-size:10px;
}
.status { display:inline-block; padding:5px 7px; border-radius:20px; font-size:10px; font-weight:800; }
.status.on { background:#e8f3ed; color:var(--green-dark); }
.status.off { background:#eee; color:#666; }
.actions { display:flex; gap:5px; align-items:center; }
.actions form { margin:0; }
.empty { text-align:center; color:var(--muted); padding:30px; }

.form-page { max-width:900px; }
.app-form {
  margin-top:16px; background:#fff; padding:22px; border:1px solid var(--border);
  border-radius:12px; display:grid; gap:16px;
}
.app-form label { display:grid; gap:6px; font-size:12px; font-weight:800; }
input[type=text], input[type=password], input[type=number], select {
  width:100%; border:1px solid #cad8d0; border-radius:8px; padding:11px 12px;
  font:inherit; font-size:14px; background:#fff;
}
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
label small { color:var(--muted); font-weight:400; }
.check { display:flex !important; grid-template-columns:auto 1fr; align-items:center; justify-content:flex-start; }
.check input { width:auto; }
.form-actions { display:flex; gap:8px; margin-top:4px; }
.error-box {
  padding:11px 13px; background:#fff0f0; color:#8c2929; border:1px solid #ebc6c6;
  border-radius:9px; font-size:13px; margin:12px 0;
}

.login-page { min-height:100vh; display:grid; place-items:center; padding:20px; }
.login-box {
  width:min(390px,100%); background:#fff; border:1px solid var(--border); border-radius:14px;
  padding:28px; box-shadow:0 12px 28px rgba(17,55,39,.08);
}
.login-box h1 { color:var(--green-dark); font-size:23px; margin-bottom:4px; }
.login-box p { color:var(--muted); font-size:13px; margin:0 0 22px; }
.login-box label { display:block; font-size:12px; font-weight:800; margin-bottom:6px; }
.login-box input { margin-bottom:12px; }
.back-link { display:block; text-align:center; margin-top:14px; color:var(--muted); font-size:12px; text-decoration:none; }

@media(max-width:700px) {
  .admin-header { align-items:flex-start; flex-direction:column; padding:12px 16px; }
  .admin-container { width:calc(100% - 20px); margin-top:16px; }
  .page-title { align-items:flex-start; flex-direction:column; }
  .grid2 { grid-template-columns:1fr; }
}

.color-choice { display:flex; align-items:center; gap:12px; }
.color-choice input[type=color] { width:72px; height:44px; padding:3px; border:1px solid #cad8d0; border-radius:8px; background:#fff; cursor:pointer; }
.color-choice span { font-family:monospace; font-size:13px; color:var(--muted); }

.color-panel{border:2px solid #d5e4dc;background:#f8fbf9;border-radius:12px;padding:16px}
.color-title{font-size:14px;font-weight:900;color:#0c5034;margin-bottom:12px}
.color-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.color-row input[type=color]{width:72px;height:48px;padding:3px;border:1px solid #bccfc5;border-radius:9px;background:#fff;cursor:pointer}
.color-row input[type=text]{width:110px}
.color-preview{min-width:120px;height:44px;border-radius:9px;color:#fff;font-size:11px;font-weight:900;display:grid;place-items:center;padding:0 15px}
.preset-colors{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0 7px}
.swatch{width:30px;height:30px;border:2px solid #fff;border-radius:7px;box-shadow:0 0 0 1px #ccd8d1;cursor:pointer}
.swatch:hover{transform:scale(1.12)}

.db-color-dot { display:inline-block; width:16px; height:16px; border-radius:4px; vertical-align:middle; margin-right:5px; border:1px solid rgba(0,0,0,.15); }

.thumbnail-panel{border:2px solid #d5e4dc;background:#f8fbf9;border-radius:12px;padding:16px}
.thumbnail-panel input[type=file]{display:block;margin:10px 0}
.current-thumbnail{display:flex;align-items:center;gap:12px;margin:8px 0 12px}
.current-thumbnail img{width:72px;height:72px;object-fit:cover;border-radius:10px;border:1px solid #cad8d0;background:#fff}
.current-thumbnail span{font-size:13px;font-weight:700}
