:root {
  --sb-red: #e31e25;       /* Style Baazar brand red */
  --sb-red-dark: #b3151b;
  --sb-navy: #14213d;      /* corporate navy for depth */
  --sb-black: #1a1a1a;
  --sb-white: #ffffff;
  --vb-saffron: #ff9933;
  --vb-green: #138808;
  --kid-yellow: #ffc83d;
  --kid-blue: #2f9bdb;
  --kid-purple: #8a5cf6;
  --grey-bg: #f5f6f9;
  --grey-border: #e2e2e6;
  --text-dark: #222226;
  --text-muted: #6b6b72;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 18px rgba(20,33,61,0.08);
  --shadow-lg: 0 14px 36px rgba(20,33,61,0.18);
  --font-display: 'Fredoka', 'Poppins', sans-serif;
  --font-body: 'Poppins', 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-body);
  background: var(--grey-bg);
  color: var(--text-dark);
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, .section-title, .brand-logo, .kid-name, .hero h1 {
  font-family: var(--font-display);
}

.tricolor-bar { height: 5px; width: 100%; display: flex; }
.tricolor-bar span { flex: 1; }
.tricolor-bar .saffron { background: var(--vb-saffron); }
.tricolor-bar .white { background: var(--sb-white); }
.tricolor-bar .green { background: var(--vb-green); }

/* Logo */
.logo-img { height: 38px; width: auto; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px 8px; }
.admin-sidebar .logo-img { height: 34px; }
.cert-logo { height: 46px; object-fit: contain; margin: 0 auto 6px; }
.footer-logo { height: 30px; object-fit: contain; background: #fff; border-radius: 6px; padding: 3px 6px; margin: 0 auto 8px; }

/* Header */
.site-header {
  background: linear-gradient(120deg, var(--sb-navy) 0%, var(--sb-black) 100%);
  color: var(--sb-white);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-logo {
  font-weight: 700;
  font-size: 20px;
  color: var(--sb-white);
  letter-spacing: .5px;
}
.brand-logo span { color: var(--sb-red); }
.campaign-title {
  font-size: 12.5px;
  color: #cfd3e0;
  font-weight: 500;
}
.nav-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-tabs a {
  padding: 9px 18px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: var(--sb-white);
  transition: .2s;
}
.nav-tabs a.active, .nav-tabs a:hover {
  background: var(--sb-red);
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--sb-navy) 0%, var(--sb-black) 55%, var(--sb-red-dark) 100%);
  color: var(--sb-white);
  padding: 44px 20px 34px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: var(--kid-yellow);
  opacity: .18;
  border-radius: 50%;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -50px; left: -40px;
  width: 160px; height: 160px;
  background: var(--kid-blue);
  opacity: .18;
  border-radius: 50%;
}
.hero .tricolor-edge {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 6px;
  background: linear-gradient(90deg, var(--vb-saffron), var(--sb-white), var(--vb-green));
}
.hero-content { position: relative; z-index: 2; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4.2vw, 38px);
  font-weight: 600;
}
.hero p {
  margin: 0;
  color: #e3e5ee;
  font-size: 14px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.hero .badge {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 18px;
  border: 1px solid var(--vb-saffron);
  border-radius: 30px;
  font-size: 12px;
  color: var(--vb-saffron);
  font-weight: 600;
  background: rgba(255,153,51,0.08);
}

/* Container/card */
.container {
  max-width: 760px;
  margin: -18px auto 40px;
  padding: 0 16px;
}
.card {
  background: var(--sb-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 22px;
  border: 1px solid #eef0f5;
}
.card-compact { padding: 18px; }

.section-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--sb-navy);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--grey-bg);
  position: relative;
}
.section-title::before {
  content: "";
  width: 6px; height: 22px;
  background: var(--sb-red);
  border-radius: 4px;
  display: inline-block;
}

/* Form elements */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-dark);
}
.form-row .req { color: var(--sb-red); }
.form-control {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--grey-border);
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none;
  border-color: var(--sb-red);
  box-shadow: 0 0 0 3px rgba(227,30,37,0.12);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
}
.help-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.error-text { font-size: 12px; color: var(--sb-red); margin-top: 4px; display: none; }
.form-row.has-error .form-control { border-color: var(--sb-red); }
.form-row.has-error .error-text { display: block; }

/* Child block */
.child-block {
  border: 1.5px dashed var(--kid-blue);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  position: relative;
  background: #f8fbff;
}
.child-block .child-block-title {
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--sb-navy);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.child-block .remove-child {
  background: none;
  border: none;
  color: var(--sb-red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform .12s, box-shadow .12s, background .15s;
}
.btn-primary { background: var(--sb-red); color: #fff; }
.btn-primary:hover { background: var(--sb-red-dark); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--sb-red);
  color: var(--sb-red);
}
.btn-outline:hover { background: rgba(227,30,37,0.06); }
.btn-dark { background: var(--sb-black); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Add child button */
.add-child-btn {
  width: 100%;
  padding: 12px;
  border: 1.5px dashed var(--sb-red);
  background: rgba(227,30,37,0.04);
  color: var(--sb-red);
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 16px;
}
.add-child-btn:disabled {
  border-color: var(--grey-border);
  color: var(--text-muted);
  background: var(--grey-bg);
  cursor: not-allowed;
}

/* Modal (Thank you) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,20,20,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 16px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  padding: 30px 26px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: pop .25s ease;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-box .tick {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vb-green), #1ea33d);
  color: #fff;
  font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.modal-box h3 { margin: 0 0 8px; font-size: 18px; color: var(--sb-navy); font-family: var(--font-display); }
.modal-box p { font-size: 14px; color: var(--text-muted); margin: 0 0 16px; }
.coupon-box {
  background: linear-gradient(135deg, #fff7ec, #fff);
  border: 2px dashed var(--sb-red);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 21px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--sb-red);
  margin-bottom: 18px;
}

/* Alerts */
.alert { padding: 12px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fdecec; color: var(--sb-red-dark); border: 1px solid #f5c6c6; }
.alert-success { background: #eaf7ea; color: #1e6b1e; border: 1px solid #c7e8c7; }
.alert-info { background: #eef3fb; color: #2a528a; border: 1px solid #c9dcf2; }

/* Drawing-submit page */
.kid-card {
  border: 1.5px solid var(--grey-border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: #fff;
}
.kid-card .kid-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.kid-card .kid-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.status-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 30px;
}
.status-pending { background: #fff4e0; color: #a16207; }
.status-done { background: #e6f6e9; color: #1e7a35; }

.drawing-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--grey-border);
  background: #fafafa;
  margin-bottom: 10px;
}

/* Certificate */
.certificate-wrap { max-width: 900px; margin: 24px auto; padding: 0 14px; }
.certificate {
  background: #fffefb;
  border-radius: 14px;
  position: relative;
  padding: 8px;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(255,153,51,0.10), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(19,136,8,0.10), transparent 40%);
  box-shadow: var(--shadow-lg);
}
.certificate-inner {
  border: 3px solid var(--sb-navy);
  outline: 2px solid var(--vb-saffron);
  outline-offset: -10px;
  border-radius: 10px;
  padding: 40px 36px 30px;
  text-align: center;
  font-family: var(--font-body);
  position: relative;
  overflow: hidden;
}
.certificate-inner::before,
.certificate-inner::after {
  content: "";
  position: absolute;
  width: 90px; height: 90px;
  border-radius: 50%;
}
.certificate-inner::before { top: -45px; left: -45px; background: var(--kid-yellow); opacity: .35; }
.certificate-inner::after { bottom: -45px; right: -45px; background: var(--kid-blue); opacity: .25; }

.cert-topline { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: 4px; }
.certificate .cert-header {
  font-size: 12px; letter-spacing: 3px; color: var(--vb-green); font-weight: 700;
  position: relative; z-index: 2;
}
.certificate h1 {
  font-family: var(--font-display);
  font-size: clamp(26px,4.4vw,40px);
  color: var(--sb-navy);
  margin: 8px 0 2px;
  position: relative; z-index: 2;
}
.certificate .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; position: relative; z-index: 2; }
.certificate .cert-name {
  font-family: var(--font-display);
  font-size: clamp(28px,5vw,42px);
  color: var(--sb-red);
  font-weight: 600;
  margin: 12px 0;
  border-bottom: 3px solid var(--vb-saffron);
  display: inline-block;
  padding-bottom: 6px;
  position: relative; z-index: 2;
}
.certificate .cert-body {
  font-size: 14.5px; color: #333; max-width: 560px; margin: 0 auto 22px; line-height: 1.7;
  position: relative; z-index: 2;
}
.certificate .cert-drawing-preview {
  width: 130px; height: 130px;
  object-fit: cover;
  border-radius: 12px;
  border: 4px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  margin: 0 auto 18px;
  position: relative; z-index: 2;
  transform: rotate(-2deg);
}
.certificate .cert-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 26px; flex-wrap: wrap; gap: 18px; position: relative; z-index: 2;
}
.certificate .cert-footer .block { text-align: center; min-width: 150px; }
.certificate .sign-img { height: 50px; object-fit: contain; margin: 0 auto 4px; }
.certificate .line { border-top: 1.5px solid #b9bcc6; width: 150px; margin: 0 auto 4px; }
.certificate .footer-label { font-size: 11.5px; color: var(--text-muted); }
.certificate .seal {
  position: absolute; top: 18px; right: 24px; z-index: 3;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--vb-saffron), var(--sb-red));
  color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.certificate .cert-id {
  font-size: 10px; color: #aaa; margin-top: 16px; position: relative; z-index: 2;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 22px 18px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Admin */
.admin-body { background: #f1f2f6; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 235px;
  background: linear-gradient(180deg, var(--sb-navy), var(--sb-black));
  color: #fff;
  flex-shrink: 0;
  padding: 18px 0;
}
.admin-sidebar .brand { padding: 0 18px 16px; border-bottom: 1px solid #333; margin-bottom: 12px; flex-direction: column; align-items: flex-start; gap: 8px; }
.admin-sidebar a {
  display: block;
  padding: 11px 20px;
  font-size: 14px;
  color: #d6d6d6;
  font-weight: 500;
}
.admin-sidebar a.active, .admin-sidebar a:hover { background: var(--sb-red); color: #fff; }
.admin-main { flex: 1; padding: 22px; max-width: 100%; overflow-x: auto; }
.admin-topbar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; flex-wrap: wrap; gap: 10px;
}
.admin-topbar h2 { margin: 0; font-size: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--sb-red); }
.stat-card .lbl { font-size: 12px; color: var(--text-muted); }
.filter-bar { background: #fff; border-radius: 10px; padding: 14px; margin-bottom: 16px; box-shadow: var(--shadow); display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filter-bar .form-row { margin-bottom: 0; min-width: 150px; flex: 1; }
.table-wrap { background: #fff; border-radius: 10px; box-shadow: var(--shadow); overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
table.data-table th { background: #fafafa; text-align: left; padding: 10px 12px; border-bottom: 2px solid var(--grey-border); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--grey-border); vertical-align: middle; }
table.data-table tr:hover td { background: #fbfbfb; }
.thumb-sm { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--grey-border); }
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; padding: 34px; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 360px; }

@media (max-width: 800px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; padding: 10px; }
  .admin-sidebar .brand { display: none; }
  .admin-sidebar a { white-space: nowrap; padding: 8px 14px; }
}
