/* ============================================================
   DE VATCHI — admin.css
   Studio dashboard: login, tabs, stat cards, chart, tables,
   product form modal.
   ============================================================ */

/* ---------- login ---------- */
.admin-login { min-height: calc(100vh - 72px); display: grid; place-items: center; }
.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .7);
  padding: 44px 38px 34px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow);
}
.login-mark { font-family: var(--serif); font-size: 56px; color: var(--red); line-height: 1; margin-bottom: 14px; }
.login-card h1 { font-size: 52px; margin-bottom: 24px; }
.login-card .full-button { margin-top: 6px; }
.login-hint { margin-top: 22px; font-size: 12px; color: var(--muted); text-align: center; }
.login-hint code { font-family: var(--mono); color: var(--red); background: rgba(101, 0, 0, .07); padding: 2px 6px; }

/* ---------- shell ---------- */
.admin { padding: 70px 0 60px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.admin-head h1 { font-size: clamp(44px, 6vw, 84px); }
.admin-actions { display: flex; gap: 12px; }
.admin-grid { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: start; }
.admin-tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 100px; }
.admin-tabs button {
  text-align: left; padding: 13px 16px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border-left: 2px solid var(--line);
  transition: color .25s, border-color .25s, background .25s;
}
.admin-tabs button:hover { color: var(--red); }
.admin-tabs button.active { color: var(--red); border-color: var(--red); background: rgba(101, 0, 0, .05); }

/* ---------- stat cards + chart ---------- */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .7); padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.stat-card span { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.stat-card strong { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 3.4vw, 52px); line-height: 1; color: var(--red); }
.stat-card em { font-style: normal; font-size: 11px; color: var(--muted); }

.admin-panels { display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .7); padding: 24px; }
.panel.wide { grid-column: 1 / -1; }
.panel h3 { font-size: 24px; margin-bottom: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h3 { margin-bottom: 0; }
.panel-head > div { display: flex; gap: 10px; }

.chart { display: flex; align-items: flex-end; gap: 12px; height: 240px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.bar i { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--red), var(--red-deep)); min-height: 6px; transition: height .8s var(--ease); }
.bar span { font-family: var(--mono); font-size: 9px; letter-spacing: .1em; color: var(--muted); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; font-family: var(--mono); font-weight: 500;
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line-strong);
}
.admin-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(101, 0, 0, .035); }
.cell-thumb img { width: 52px; height: 64px; object-fit: cover; }
.cell-name { font-family: var(--serif); font-size: 17px; line-height: 1.2; }
.cell-name em { display: block; font-family: var(--mono); font-style: normal; font-size: 10px; color: var(--muted); letter-spacing: .06em; }
.cell-actions { white-space: nowrap; }
.cell-actions .mini-btn { margin-left: 6px; }

.pill { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 5px 10px; border: 1px solid; }
.pill-processing { color: #8a6a00; border-color: rgba(138, 106, 0, .4); background: rgba(138, 106, 0, .07); }
.pill-shipped { color: #1d5a8a; border-color: rgba(29, 90, 138, .4); background: rgba(29, 90, 138, .07); }
.pill-delivered { color: #2e6b34; border-color: rgba(46, 107, 52, .4); background: rgba(46, 107, 52, .07); }
.pill-cancelled { color: #a3271f; border-color: rgba(163, 39, 31, .4); background: rgba(163, 39, 31, .07); }

/* ---------- controls ---------- */
.mini-btn {
  border: 1px solid var(--line-strong); padding: 8px 14px;
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--red);
  transition: background .25s, color .25s, border-color .25s;
}
.mini-btn:hover { background: var(--red); border-color: var(--red); color: var(--cream); }
.mini-btn.danger { color: #a3271f; border-color: rgba(163, 39, 31, .45); }
.mini-btn.danger:hover { background: #a3271f; border-color: #a3271f; color: var(--cream); }

.status-select {
  border: 1px solid var(--line-strong); background: transparent;
  padding: 8px 10px; font-size: 12px; color: var(--ink);
}
.status-select:focus { outline: none; border-color: var(--red); }

.check-line { display: flex; align-items: center; gap: 10px; font-size: 14px; margin: 6px 0 18px; cursor: pointer; }
.check-line input { width: 18px; height: 18px; accent-color: var(--red); }

.admin-form .field { margin-bottom: 16px; }
.admin-form .modal-actions { margin-top: 8px; }

@media (max-width: 1100px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-panels { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin-grid { grid-template-columns: 1fr; }
  .admin-tabs { flex-direction: row; position: static; overflow-x: auto; }
  .admin-tabs button { border-left: 0; border-bottom: 2px solid var(--line); white-space: nowrap; }
  .admin-tabs button.active { border-color: var(--red); }
}

/* ============================================================
   Admin v2 — cloud badge, image upload, sections editor
   ============================================================ */
.admin-cloud {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  border: 1px solid var(--line-strong); padding: 7px 12px; color: var(--muted);
}
.admin-cloud i { width: 8px; height: 8px; border-radius: 50%; }
.admin-cloud.online i { background: #2e6b34; }
.admin-cloud.offline i { background: #a3271f; }

/* image upload drop/stash */
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.upload-row img { width: 64px; height: 80px; object-fit: cover; border: 1px solid var(--line); }
.upload-label {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px dashed var(--line-strong); color: var(--muted);
  padding: 10px 16px; font-size: 12px; letter-spacing: .06em;
}
.upload-label:hover { color: var(--red); border-color: var(--red); }
.upload-label input[type="file"] { display: none; }

/* sections editor */
.sec-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.sec-card {
  border: 1px solid var(--line-strong); background: rgba(255, 253, 249, .7);
  padding: 22px 20px; display: flex; flex-direction: column; gap: 10px;
}
.sec-card .field { margin-bottom: 6px; }
.sec-card .field:last-child { margin-bottom: 0; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sec-head span:first-child { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.sec-head .mini-btn { padding: 6px 12px; font-size: 9px; }

@media (max-width: 1100px) {
  .sec-cards { grid-template-columns: 1fr; }
}
