.admin-products-body { min-height: 100vh; background: #050506; }
.products-admin-shell { width: min(1240px, calc(100% - 30px)); margin: 0 auto; padding: 34px 0 90px; }
.products-admin-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 32px; }
.products-admin-head h1 { font-size: clamp(52px, 8vw, 94px); }
.admin-subtitle { max-width: 650px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.admin-top-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.button.ghost { background: transparent; border: 1px solid rgba(255,255,255,.1); color: #aaaab2; }

.admin-login-card { width: min(520px, 100%); margin: 70px auto; padding: 30px; border: 1px solid rgba(255,255,255,.13); border-radius: 26px; background: linear-gradient(160deg, rgba(21,25,56,.95), rgba(10,10,14,.96)); box-shadow: var(--shadow); }
.admin-login-card h2 { font-size: 38px; }
.admin-login-card p { color: var(--muted); line-height: 1.6; }
.admin-login-card label { display: grid; gap: 8px; margin: 24px 0 14px; color: #d9ddf2; font-weight: 700; }
.admin-login-card input, .catalog-toolbar input, .catalog-toolbar select, .online-product-form input, .online-product-form select, .online-product-form textarea { width: 100%; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: #151519; color: #fff; outline: none; }
.admin-login-card input, .catalog-toolbar input, .catalog-toolbar select, .online-product-form input, .online-product-form select { height: 49px; padding: 0 13px; }
.online-product-form textarea { padding: 13px; resize: vertical; min-height: 120px; }
.admin-login-card input:focus, .catalog-toolbar input:focus, .catalog-toolbar select:focus, .online-product-form input:focus, .online-product-form select:focus, .online-product-form textarea:focus { border-color: #6179ff; box-shadow: 0 0 0 3px rgba(57,87,255,.16); }
.login-crown { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 18px; color: var(--gold); background: rgba(231,196,107,.09); font-size: 32px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.stats-grid article { padding: 20px; border: 1px solid rgba(255,255,255,.1); border-radius: 19px; background: rgba(255,255,255,.035); }
.stats-grid span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.stats-grid strong { display: block; margin-top: 8px; font-size: 34px; }

.catalog-toolbar { display: grid; grid-template-columns: minmax(240px,1fr) 190px auto; gap: 12px; align-items: end; margin: 22px 0; padding: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: rgba(255,255,255,.03); }
.catalog-toolbar label { display: grid; gap: 7px; color: #cfd3e7; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.new-product-button { white-space: nowrap; }

.products-admin-list { display: grid; gap: 14px; }
.admin-product-card { display: grid; grid-template-columns: 120px minmax(0,1fr) auto; gap: 18px; align-items: center; padding: 16px; border: 1px solid rgba(255,255,255,.11); border-radius: 22px; background: #0d0d10; }
.admin-product-card.is-inactive { opacity: .68; }
.admin-product-image { width: 120px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 16px; background: linear-gradient(145deg,#1b2c99,#5430be); color: rgba(255,255,255,.75); font-size: 34px; }
.admin-product-image img { width: 100%; height: 100%; object-fit: contain; padding: 8px; background: #111116; }
.admin-product-info { min-width: 0; }
.admin-product-topline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.product-status { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.product-status.active { background: rgba(53,212,138,.14); color: #75e8b2; }
.product-status.inactive { background: rgba(255,111,143,.12); color: #ff92a9; }
.product-category-tag { color: #9aa3c9; font-size: 12px; }
.admin-product-info h2 { margin: 0; font-size: clamp(22px,3vw,34px); line-height: 1.05; }
.admin-product-meta { margin-top: 10px; color: #aaaab2; line-height: 1.65; font-size: 14px; }
.admin-product-meta strong { color: #fff; }
.admin-product-actions { display: flex; flex-direction: column; gap: 8px; min-width: 136px; }
.admin-product-actions button { min-height: 42px; padding: 0 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.045); cursor: pointer; font-weight: 800; }
.admin-product-actions button:hover { border-color: rgba(100,122,255,.7); }
.admin-product-actions .danger { color: #ff8da5; }
.admin-empty { padding: 50px 20px; text-align: center; color: var(--muted); }

.product-modal-overlay { position: fixed; inset: 0; z-index: 140; background: rgba(0,0,0,.78); backdrop-filter: blur(8px); }
.product-modal { width: min(920px,100%); height: 100dvh; position: fixed; top: 0; right: 0; z-index: 150; overflow-y: auto; transform: translateX(104%); transition: transform .28s ease; padding: 28px; background: #09090c; border-left: 1px solid rgba(255,255,255,.12); box-shadow: -30px 0 90px rgba(0,0,0,.55); }
.product-modal.open { transform: translateX(0); }
.product-modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 25px; }
.product-modal-head h2 { font-size: clamp(38px,6vw,62px); }
.online-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.online-form-grid label, .image-url-label { display: grid; gap: 7px; color: #d6daec; font-size: 13px; font-weight: 750; }
.online-form-grid .wide { grid-column: 1 / -1; }

.image-manager { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 20px; align-items: center; margin-top: 22px; padding: 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 20px; background: rgba(255,255,255,.025); }
.image-preview { aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 17px; background: linear-gradient(145deg,#1b2c99,#5430be); color: #cfd5ff; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; background: #111116; }
.image-controls h3 { margin: 0; font-size: 26px; }
.image-controls p { margin: 8px 0 14px; color: var(--muted); line-height: 1.5; }
.upload-button { width: fit-content; min-height: 44px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 12px; background: rgba(72,93,255,.18); color: #cfd7ff; cursor: pointer; font-weight: 850; }
#image-file-name { display: block; margin: 10px 0 16px; color: #8d94ad; font-size: 12px; }
.text-danger { margin-top: 10px; padding: 0; border: 0; background: transparent; color: #ff829d; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.form-submit-row { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.admin-message { min-height: 20px; margin: 12px 0 0; color: #ff829d; }
.admin-toast { position: fixed; left: 50%; bottom: 22px; z-index: 200; max-width: calc(100% - 30px); transform: translate(-50%,25px); opacity: 0; pointer-events: none; padding: 13px 18px; border: 1px solid rgba(255,255,255,.14); border-radius: 13px; background: #17171d; box-shadow: 0 18px 60px rgba(0,0,0,.5); transition: .22s ease; }
.admin-toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 820px) {
  .products-admin-head { flex-direction: column; }
  .admin-top-actions { justify-content: flex-start; }
  .catalog-toolbar { grid-template-columns: 1fr 1fr; }
  .new-product-button { grid-column: 1 / -1; }
  .admin-product-card { grid-template-columns: 90px minmax(0,1fr); }
  .admin-product-image { width: 90px; }
  .admin-product-actions { grid-column: 1 / -1; flex-direction: row; min-width: 0; }
  .admin-product-actions button { flex: 1; }
  .image-manager { grid-template-columns: 190px minmax(0,1fr); }
}

@media (max-width: 570px) {
  .products-admin-shell { width: min(100% - 20px,1240px); padding-top: 22px; }
  .products-admin-head h1 { font-size: 52px; }
  .stats-grid { grid-template-columns: 1fr; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .new-product-button { grid-column: auto; }
  .admin-product-card { grid-template-columns: 72px minmax(0,1fr); gap: 12px; padding: 13px; }
  .admin-product-image { width: 72px; border-radius: 13px; }
  .admin-product-info h2 { font-size: 22px; }
  .admin-product-actions { flex-wrap: wrap; }
  .admin-product-actions button { min-width: calc(50% - 4px); }
  .product-modal { padding: 20px 14px 40px; }
  .online-form-grid { grid-template-columns: 1fr; }
  .online-form-grid .wide { grid-column: auto; }
  .image-manager { grid-template-columns: 1fr; }
  .image-preview { max-width: 260px; width: 100%; margin: 0 auto; }
  .form-submit-row { flex-direction: column-reverse; }
  .form-submit-row .button { width: 100%; }
}
