/* ============================================================
   Pooja Ko Thali — Owner Dashboard styles
   ============================================================ */

.admin-body { background: #FBF6EA; min-height: 100vh; }

/* lock screen */
.lock-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #F6E9CD, #FBF6EA); }
.lock-card { background: #fff; border: 1px solid #EADFC6; border-radius: 20px; padding: 40px 32px;
  max-width: 380px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(138, 31, 28, .08); }
.lock-card h1 { font-family: 'Fraunces', serif; margin: 14px 0 2px; color: #611310; }
.lock-sub { color: #8a7a5c; margin: 0 0 22px; }
.brand-mark.big { width: 56px; height: 56px; }
#pinInput { width: 100%; font-size: 30px; letter-spacing: 14px; text-align: center; padding: 12px;
  border: 2px solid #EADFC6; border-radius: 12px; margin-bottom: 14px; font-family: inherit; }
#pinInput:focus { outline: none; border-color: #8A1F1C; }
.lock-hint { color: #8a7a5c; font-size: 14px; margin-top: 16px; }
.lock-err { color: #A32C22; font-weight: 600; margin-top: 10px; }

/* layout */
.admin-wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.admin-header { background: #fff; border-bottom: 1px solid #EADFC6; position: sticky; top: 0; z-index: 20; }
.admin-header-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; gap: 12px; flex-wrap: wrap; }
.admin-header-actions { display: flex; gap: 10px; }
.admin-title { font-family: 'Fraunces', serif; color: #611310; margin: 26px 0 4px; font-size: 30px; }
.admin-sub { color: #6f6248; margin: 0 0 8px; max-width: 60ch; line-height: 1.55; }
.admin-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.count-pill { background: #F0E4C8; color: #7A5A12; font-size: 14px; font-weight: 600;
  border-radius: 999px; padding: 3px 12px; vertical-align: middle; font-family: 'Inter', sans-serif; }

/* buttons */
.btn-big { font-size: 17px; padding: 14px 22px; }
.btn-danger { background: #fff; color: #A32C22; border: 1.5px solid #E4B6B2; }
.btn-danger:hover { background: #FBEDEC; }
.btn.small { font-size: 14px; padding: 8px 14px; }

/* product grid */
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.admin-card { background: #fff; border: 1px solid #EADFC6; border-radius: 16px; overflow: hidden;
  cursor: pointer; text-align: left; padding: 0; transition: transform .12s, box-shadow .12s; font-family: inherit; }
.admin-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(138, 31, 28, .10); }
.admin-card .thumb { aspect-ratio: 1/1; background: linear-gradient(160deg, #FDF9F1, #F1E6CF); position: relative; }
.admin-card .thumb svg, .admin-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-card .meta { padding: 12px 14px 14px; }
.admin-card .nm { display: block; font-weight: 600; color: #3A3226; line-height: 1.3; margin-bottom: 4px; }
.admin-card .pr { color: #8A1F1C; font-weight: 700; }
.admin-card .edit-hint { display: inline-block; margin-top: 8px; font-size: 13px; color: #fff;
  background: #8A1F1C; border-radius: 999px; padding: 4px 12px; }
.media-count { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; border-radius: 999px; padding: 2px 9px; }

.danger-zone { margin: 34px 0 60px; text-align: center; }

/* edit view */
#backBtn { margin: 22px 0 16px; }
.edit-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; margin-bottom: 20px; }
@media (max-width: 820px) { .edit-layout { grid-template-columns: 1fr; } }
.edit-card { background: #fff; border: 1px solid #EADFC6; border-radius: 18px; padding: 22px; }
.edit-h { font-family: 'Fraunces', serif; color: #611310; margin: 0 0 6px; font-size: 22px; }
.edit-h .np { font-size: 15px; color: #8a7a5c; font-weight: 500; font-family: 'Inter', sans-serif; }
.field-help { color: #6f6248; font-size: 14px; margin: 0 0 14px; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; color: #3A3226; margin-bottom: 6px; font-size: 15px; }
.field .np { color: #8a7a5c; font-style: normal; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1.5px solid #EADFC6; border-radius: 10px; font: inherit; font-size: 16px; background: #FDFBF5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: #8A1F1C; background: #fff; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* media manager */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 14px; }
.media-item { position: relative; aspect-ratio: 1/1; border-radius: 12px; overflow: hidden;
  border: 2px solid #EADFC6; background: #F1E6CF; }
.media-item.cover { border-color: #C08F2C; box-shadow: 0 0 0 2px #E8C25C; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .m-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between;
  background: linear-gradient(transparent, rgba(0,0,0,.55)); padding: 20px 6px 6px; }
.media-item .m-btn { border: 0; background: rgba(255,255,255,.92); border-radius: 8px; width: 32px; height: 32px;
  cursor: pointer; font-size: 15px; line-height: 1; }
.media-item .m-btn:hover { background: #fff; }
.cover-tag { position: absolute; top: 6px; left: 6px; background: #C08F2C; color: #fff; font-size: 11px;
  font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.vid-tag { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 11px;
  border-radius: 999px; padding: 3px 9px; }

.upload-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  border: 2px dashed #C9B888; border-radius: 14px; padding: 26px 16px; cursor: pointer;
  color: #6f6248; background: #FDFBF5; transition: background .15s, border-color .15s; }
.upload-drop:hover, .upload-drop.drag { background: #FBF3DD; border-color: #8A1F1C; }
.upload-ico { font-size: 30px; }
.upload-drop strong { color: #611310; font-size: 16px; }

.edit-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* sticky save bar */
.edit-bar { position: sticky; bottom: 0; z-index: 15; background: rgba(251, 246, 234, .95);
  backdrop-filter: blur(8px); border-top: 1px solid #EADFC6; margin: 0 -20px; padding: 14px 20px; }
.edit-bar-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center;
  justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.dirty-flag { color: #9A5B00; font-weight: 700; font-size: 15px; }
.dirty-flag .np { color: #8a7a5c; font-weight: 500; }
.btn.needs-save { box-shadow: 0 0 0 3px #F0D89B; }

/* list filters */
.admin-filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.admin-search { position: relative; flex: 1 1 260px; }
.admin-search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: #8a7a5c; pointer-events: none; }
.admin-search input { width: 100%; box-sizing: border-box; padding: 12px 14px 12px 42px;
  border: 1.5px solid #EADFC6; border-radius: 999px; font: inherit; font-size: 16px; background: #fff; }
.admin-search input:focus { outline: none; border-color: #8A1F1C; }
.admin-filter-cat select { padding: 12px 14px; border: 1.5px solid #EADFC6; border-radius: 999px;
  font: inherit; font-size: 15px; background: #fff; max-width: 260px; }
.admin-filter-cat select:focus { outline: none; border-color: #8A1F1C; }
.admin-empty { text-align: center; color: #6f6248; padding: 40px 10px; line-height: 1.7; }
.admin-empty .np { color: #8a7a5c; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* stock chip on the admin cards */
.admin-card .stock { display: inline-block; margin-top: 8px; margin-left: 6px; font-size: 12px;
  font-weight: 600; border-radius: 999px; padding: 3px 10px; }
.stk-in   { color: #1B7A45; background: #E6F4EC; }
.stk-low  { color: #9A5B00; background: #FCF0DC; }
.stk-made { color: #1D4F8B; background: #E7EFFA; }
.stk-out  { color: #8A1F1C; background: #F8E9E8; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #2F6E4E; color: #fff; font-weight: 600; padding: 13px 22px; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; pointer-events: none; transition: all .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
