/* Admin panel — same language as the storefront, denser. */
.panel-head { background: var(--sand); }
.panel-head.blue, .panel-head.red { background: var(--sand); color: var(--ink); }
body.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: var(--cream); font-size: 15px; }
.admin-side { background: var(--ink); color: #F4EFE7; padding: 24px 20px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.admin-side .brand { font-size: 1.3rem; color: #F4EFE7; }
.admin-side nav { display: flex; flex-direction: column; gap: 4px; }
.admin-side nav a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; text-decoration: none; font-weight: 500; border: 1px solid transparent; border-radius: 10px; }
.admin-side nav a:hover { border-color: var(--yellow); }
.admin-side nav a.is-active { background: var(--yellow); color: var(--ink); border-color: var(--yellow); font-weight: 700; }
.badge { background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; min-width: 24px; text-align: center; }
.admin-side nav a.is-active .badge { background: var(--ink); color: #fff; }
.admin-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: rgba(244, 238, 223, .7); }
.admin-side-foot a { color: #F4EFE7; }
.admin-main { padding: 32px clamp(20px, 4vw, 48px) 80px; max-width: 1240px; width: 100%; }
.admin-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.admin-head h1 { font-size: 2.2rem; }
.admin-head p { margin: 6px 0 0; color: var(--ink-2); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat { border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); padding: 18px 20px; text-decoration: none; }
.stat b { display: block; font-family: var(--font-head); font-size: 2.2rem; line-height: 1; margin-bottom: 6px; }
.stat span { font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--ink-2); }
.stat.red { background: var(--red); color: #fff; } .stat.red span { color: rgba(255,255,255,.85); }
.stat.yellow { background: var(--yellow); }
.stat.blue { background: var(--blue); color: #fff; } .stat.blue span { color: rgba(255,255,255,.85); }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; background: var(--cream); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
.thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--border); background: #fff; }
.status-new { background: var(--yellow); }
.status-confirmed { background: var(--blue); color: #fff; }
.status-ready { background: #7BC47F; }
.status-completed { background: var(--ink); color: #fff; }
.status-cancelled { background: var(--err); }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { text-decoration: none; border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: .9rem; background: var(--paper); }
.tabs a.is-active { background: var(--ink); color: #fff; }
.link-btn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--red); }
.muted-row td { color: var(--muted); }
.unavailable { opacity: .55; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.checks { display: flex; gap: 24px; flex-wrap: wrap; margin: 6px 0 16px; }
.checks label { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; cursor: pointer; }
.checks input { width: 20px; height: 20px; accent-color: var(--blue); }
.preview { width: 200px; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.panel + .panel { margin-top: 24px; }
.panel .field:last-child { margin-bottom: 0; }
.help { font-size: .85rem; color: var(--muted); margin: -4px 0 12px; }
.danger-zone { border-color: var(--red); }
.danger-zone .panel-head { background: var(--red); color: #fff; }
.inline-form { display: flex; gap: 10px; align-items: center; }
.inline-form input { font: inherit; padding: .5em .7em; border: 1px solid var(--border); border-radius: var(--radius-sm); }
pre.msg { white-space: pre-wrap; font: inherit; margin: 0; }
.login-wrap { grid-column: 1 / -1; min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(420px, 100%); }
.login-card .brand { justify-content: center; margin-bottom: 24px; }

@media (max-width: 860px) {
  body.admin { grid-template-columns: 1fr; }
  .admin-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px; }
  .admin-side nav { flex-direction: row; flex-wrap: wrap; }
  .admin-side-foot { margin-top: 0; flex-direction: row; width: 100%; }
  .form-grid, .two-col { grid-template-columns: 1fr; }
}

/* Tamil sub-block on the product form */
.tamil-block { border: 1px dashed var(--border); border-radius: var(--radius-sm); padding: 14px 16px 4px; background: rgba(246, 189, 43, .12); }
.tamil-head { font-weight: 800; margin-bottom: 12px; }
.tamil-head small { font-weight: 500; opacity: .75; }
