:root{
  --bg:#eef3f4;
  --card:#ffffff;
  --text:#1d2a2c;
  --muted:#667476;
  --primary:#27745f;
  --primary-2:#1f5c4c;
  --ok:#167246;
  --ok-bg:#e9f8ef;
  --bad:#a62222;
  --bad-bg:#fff1f1;
  --border:#d6e0df;
  --shadow:0 18px 40px rgba(25,48,50,.08);
}
*{box-sizing:border-box}
html{min-height:100%;background:var(--bg)}
body{margin:0;min-height:100vh;font-family:Arial,sans-serif;background:linear-gradient(180deg,#f8fbfa 0%,var(--bg) 100%) fixed;color:var(--text);padding:18px}
a{color:var(--primary)}
.wrap{max-width:1260px;margin:0 auto}
.card{background:var(--card);border-radius:8px;padding:22px;box-shadow:var(--shadow);margin-bottom:20px;border:1px solid rgba(214,224,223,.7)}
.hero,.home-header,.section-head{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.section-head{justify-content:space-between}
.home-header{justify-content:space-between}
.brand-mark{width:58px;height:58px;border-radius:8px;background:linear-gradient(135deg,#27745f,#b4c953);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:900;letter-spacing:.04em}
.home-account{margin-left:auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 12px;text-align:right;max-width:520px}
.home-account strong{font-size:18px;line-height:1.1}
.home-account span{color:var(--muted);font-size:12px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-account .btn{grid-row:1 / span 2;grid-column:2;width:auto;min-height:38px;padding:9px 14px}
h1,h2,h3{margin:0 0 14px}
p{line-height:1.5}
.small,.muted{color:var(--muted);font-size:14px}
.grid-2{display:grid;grid-template-columns:1.1fr .9fr;gap:20px}
.compact-grid{grid-template-columns:1fr 220px}
.grid-auto{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px}
label{display:block;margin:14px 0 6px;font-weight:700}
input,select,button{width:100%;padding:12px 14px;border-radius:8px;border:1px solid var(--border);font-size:16px;background:#fff}
input[readonly]{background:#f4f7f7;color:#59686a}
input:focus,select:focus{outline:none;border-color:#5c947f;box-shadow:0 0 0 4px rgba(39,116,95,.13)}
.password-field{position:relative}
.password-field input{padding-right:52px}
.password-toggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:40px;height:40px;min-height:40px;padding:0;border:0;background:transparent;color:#667476;box-shadow:none}
.password-toggle:hover{background:#eef4f2;color:var(--primary)}
.password-toggle svg{width:22px;height:22px;display:block;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.password-field.is-visible .password-toggle{color:var(--primary)}
button,.btn{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--primary);color:#fff;border:none;font-weight:700;cursor:pointer;text-decoration:none;min-height:46px;border-radius:8px}
button:hover,.btn:hover{background:var(--primary-2)}
.btn.secondary,.btn-link{background:#edf2f1;color:var(--text)}
.btn.secondary:hover,.btn-link:hover{background:#dfe8e6}
.btn-soft{border:1px solid var(--border);background:linear-gradient(180deg,#f8fbfa 0%,#e8efee 100%);box-shadow:0 8px 18px rgba(19,32,61,.06);color:var(--text)}
.btn-soft:hover{background:linear-gradient(180deg,#f1f8f5 0%,#dce9e5 100%)}
.btn-glow{position:relative;overflow:hidden;isolation:isolate;border:0;background:linear-gradient(135deg,#1c8b64 0%,#27745f 55%,#98a83a 100%);color:#fff;box-shadow:0 14px 30px rgba(39,116,95,.22)}
.btn-glow:hover{background:linear-gradient(135deg,#157552 0%,#1f5c4c 55%,#7d8c2c 100%)}
.actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.actions > *{flex:1 1 220px}
.auth-tabs{display:flex;gap:8px;margin-bottom:18px}
.auth-tabs a{flex:1;text-align:center;text-decoration:none;background:#eef4f2;color:var(--text);padding:12px;border-radius:8px;font-weight:700}
.auth-tabs a.active{background:var(--primary);color:#fff}
.notice{padding:14px 16px;border-radius:8px;margin-bottom:18px}
.notice.success{background:var(--ok-bg);color:#126236;border:1px solid #9bd4b3}
.notice.error{background:var(--bad-bg);color:#8d1f1f;border:1px solid #e0a2a2}
.notice.info{background:#edf5ff;color:#174a84;border:1px solid #b9d1f3}
.score-box{background:#f7faf9;border:1px solid var(--border);border-radius:8px;padding:14px;display:grid;gap:4px}
.sale-card strong,.score-box strong{font-size:19px;line-height:1.2}
.status-chip{display:inline-flex;align-items:center;width:max-content;border-radius:999px;padding:6px 10px;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.status-chip.open{background:#e4f5e8;color:#17603c}
.status-chip.closed{background:#f0f1f1;color:#687477}
.spacer-top{margin-top:16px}
.table-responsive{overflow:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;min-width:720px}
th,td{border:1px solid var(--border);padding:12px;text-align:left;vertical-align:top}
th{background:var(--primary);color:#fff;position:sticky;top:0}
.admin-products-table input{min-width:160px}
.admin-products-table input[type="file"]{min-width:220px;padding:9px;background:#fff}
.admin-product-image-cell{outline:none}
.admin-product-image-cell:focus{box-shadow:inset 0 0 0 3px rgba(39,116,95,.16);background:#fbfdfc}
.admin-product-image{width:92px;height:70px;border:1px solid var(--border);border-radius:8px;background:#f4f8f7;display:flex;align-items:center;justify-content:center;overflow:hidden;margin-bottom:8px;color:var(--muted);font-size:12px;font-weight:700;text-align:center}
.admin-product-image img{width:100%;height:100%;object-fit:cover;display:block}
.paste-hint{display:inline-flex;margin:7px 0 4px;padding:6px 8px;border-radius:8px;background:#eef4f2;color:#365f55;font-size:12px;font-weight:800}
.admin-product-image-cell.has-pasted-image .paste-hint{background:#e4f5e8;color:#17603c}
.summary-product-cell{display:flex;align-items:center;gap:10px}
.summary-product-image{width:44px;height:44px;border-radius:8px;object-fit:cover;border:1px solid var(--border);background:#f4f8f7}
.admin-inline-actions{display:flex;gap:8px;flex-wrap:wrap}
.admin-inline-actions form{margin:0}
.admin-inline-actions .btn,.admin-inline-actions button{width:auto;min-height:36px;padding:8px 12px}
.admin-attempt-list{display:grid;gap:10px;max-height:520px;overflow:auto}
.admin-attempt-group{border:1px solid var(--border);border-radius:8px;padding:12px;background:rgba(255,255,255,.72)}
.admin-attempt-meta{display:flex;flex-wrap:wrap;gap:12px;align-items:baseline;margin-bottom:4px}
.admin-attempt-emails{font-size:14px;line-height:1.45;color:var(--muted)}
.mail-debug-log{max-height:260px;overflow:auto;background:#172321;color:#e8fff6;border-radius:8px;padding:12px;font-size:12px;line-height:1.45;white-space:pre-wrap}
.stat-card{background:#f4f8f7;border:1px solid var(--border);border-radius:8px;padding:16px}
.stat-label{color:var(--muted);font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.stat-value{font-size:28px;font-weight:800;margin-top:6px}
.catalogue-list{display:grid;gap:10px}
.product-row{display:grid;grid-template-columns:82px minmax(0,1fr) 110px;gap:12px;align-items:center;background:#f7faf9;border:1px solid var(--border);border-radius:8px;padding:12px;overflow:visible}
.product-row strong{display:block;font-size:17px}
.product-row span{display:block;color:var(--muted);font-size:14px;margin-top:3px}
.product-row input{min-width:0;text-align:center;font-weight:800}
.product-image-wrap{position:relative;width:82px;height:72px;z-index:1}
.product-image-wrap img,.product-image-placeholder{width:82px;height:72px;border-radius:8px;border:1px solid var(--border);background:#e8efee;object-fit:cover;display:flex;align-items:center;justify-content:center;color:#6f7b7d;font-weight:900;font-size:13px;letter-spacing:.04em;transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease}
.product-image-wrap:hover{z-index:30}
.product-image-wrap:hover img,.product-image-wrap:hover .product-image-placeholder{transform:scale(2.35);transform-origin:left center;box-shadow:0 18px 45px rgba(25,48,50,.28);border-color:#fff}
.center{text-align:center}
.catalogue-return-card{margin-bottom:20px}
.catalogue-return-card .actions{margin-top:0}

@media (max-width: 780px){
  body{padding:8px;font-size:13px}
  .wrap{max-width:100%}
  .card{padding:10px;margin-bottom:8px;border-radius:7px;box-shadow:0 8px 20px rgba(25,48,50,.06)}
  .hero,.home-header{gap:8px;flex-wrap:nowrap;align-items:center}
  .brand-mark{width:38px;height:38px;border-radius:7px;font-size:11px;flex:0 0 38px}
  h1{font-size:19px;line-height:1.05;margin:0 0 4px}
  h2{font-size:15px;line-height:1.1;margin:0 0 8px}
  h3{font-size:14px;line-height:1.1;margin:0 0 7px}
  p{margin:0 0 8px;line-height:1.32}
  .small,.muted{font-size:11px;line-height:1.25}
  .sale-title{display:block;max-width:calc(100vw - 120px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .hero .muted{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:calc(100vw - 120px)}
  .status-chip{padding:4px 7px;font-size:9px;letter-spacing:0;flex:0 0 auto}
  .grid-2,.compact-grid{grid-template-columns:1fr}
  .grid-2{gap:8px}
  .grid-auto{grid-template-columns:1fr;gap:8px}
  .home-account{width:100%;grid-template-columns:1fr;text-align:left;margin-left:0}
  .home-account strong,.account-box strong{display:block;max-width:100%;font-size:13px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .home-account span,.account-box .small{display:block;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .home-account .btn{grid-row:auto;grid-column:auto}
  label{margin:8px 0 4px;font-size:12px}
  input,select,button{padding:8px 9px;min-height:36px;font-size:14px;border-radius:7px}
  button,.btn{min-height:36px;padding:8px 10px;font-size:13px}
  .password-field input{padding-right:42px}
  .password-toggle{width:34px;height:34px;min-height:34px;right:3px}
  .password-toggle svg{width:19px;height:19px}
  .actions{gap:7px;margin-top:9px}
  .actions > *{flex:1 1 140px}
  .auth-tabs{gap:6px;margin-bottom:10px}
  .auth-tabs a{padding:8px;font-size:13px}
  .notice{padding:9px 10px;margin-bottom:8px;font-size:12px;line-height:1.3}
  .score-box{padding:9px;border-radius:7px;gap:2px}
  .sale-card strong,.score-box strong{font-size:14px;line-height:1.1}
  .spacer-top{margin-top:8px}
  .stat-card{padding:10px;border-radius:7px}
  .stat-label{font-size:10px;letter-spacing:.02em}
  .stat-value{font-size:20px;margin-top:3px}
  .catalogue-list{gap:7px}
  .product-row{grid-template-columns:48px minmax(0,1fr) 64px;gap:7px;padding:7px;border-radius:7px}
  .product-row strong{font-size:13px;line-height:1.08;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .product-row span{font-size:11px;line-height:1.1;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .product-row input{font-size:14px;padding:6px 5px;min-height:32px}
  .product-image-wrap,.product-image-wrap img,.product-image-placeholder{width:48px;height:42px;font-size:9px;border-radius:7px}
  .product-image-wrap:hover img,.product-image-wrap:hover .product-image-placeholder{transform:scale(1.8)}
  .catalogue-return-card{margin-bottom:8px}
  table{min-width:640px}
}
