/* Artstone CRM — styled after artstone.ro (Clash Grotesk + Inter, charcoal & gold) */

@font-face {
  font-family: 'ClashGrotesk';
  src: url('fonts/ClashGrotesk-Variable.woff2') format('woff2');
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --primary: #1D1D1D;
  --bg: #F7F7F7;
  --surface: #FFFFFF;
  --text: #575757;
  --accent: #565455;
  --gold: #D5B471;
  --gold-soft: #F6EEDC;
  --divider: #1D1D1D14;
  --divider-strong: #1D1D1D24;
  --dark-divider: #FFFFFF14;
  --danger: #D9534F;
  --danger-soft: #FBEAEA;
  --success: #3E8E5E;
  --success-soft: #E7F3EC;
  --info: #4A6FA5;
  --info-soft: #E9EFF8;
  --font: 'Inter', system-ui, sans-serif;
  --display: 'ClashGrotesk', 'Inter', sans-serif;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px #1D1D1D0A, 0 8px 24px -12px #1D1D1D1F;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--font); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 500; color: var(--primary); line-height: 1.15; margin: 0; letter-spacing: -.01em; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
code { font: 500 12px/1 ui-monospace, monospace; background: var(--bg); color: var(--accent); padding: 4px 8px; border-radius: 6px; }
small { font-size: 13px; }
.muted { color: #8A8A8A; font-size: 13px; }
::selection { background: var(--gold); color: var(--primary); }
.icon { flex-shrink: 0; display: block; }

/* ---------- Layout ---------- */

.layout { display: flex; min-height: 100vh; }
.content { flex: 1; min-width: 0; padding: 40px 48px 64px; max-width: 1360px; }

.sidebar {
  position: sticky; top: 0; height: 100vh; width: 272px; flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px; padding: 28px 20px 20px;
  background: radial-gradient(120% 60% at 0% 0%, #2A2826 0%, transparent 60%), var(--primary);
  color: #BDBDBD;
}
.sidebar-logo { display: block; padding: 0 8px 28px; }
.sidebar-logo img { width: 100%; max-width: 190px; display: block; border-radius: 6px; }
.sidebar-label { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #6F6F6F; padding: 0 14px 8px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 100px; color: #BDBDBD; font-weight: 500;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.sidebar-nav a:hover { background: #FFFFFF0D; color: #fff; }
.sidebar-nav a.active { background: #FFFFFF14; color: #fff; }
.sidebar-nav a.active .icon { color: var(--gold); }
.nav-badge {
  margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--gold); border-radius: 100px; min-width: 22px; height: 22px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sidebar-site {
  margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  color: #BDBDBD; border: 1px solid var(--dark-divider); border-radius: 100px; font-size: 14px; font-weight: 500;
  transition: border-color .3s, color .3s;
}
.sidebar-site .icon:last-child { margin-left: auto; transition: transform .3s var(--ease); }
.sidebar-site:hover { color: #fff; border-color: var(--gold); }
.sidebar-site:hover .icon:last-child { transform: rotate(45deg); color: var(--gold); }
.sidebar-user { display: flex; align-items: center; gap: 12px; padding: 16px 6px 0; margin-top: 10px; border-top: 1px solid var(--dark-divider); }
.sidebar-user-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.sidebar-user-info strong { color: #fff; font-weight: 600; font-size: 14px; }
.sidebar-user-info span { font-size: 12px; color: #7D7D7D; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user form { margin-left: auto; }
.sidebar .icon-btn { color: #BDBDBD; border-color: var(--dark-divider); background: transparent; }
.sidebar .icon-btn:hover { color: var(--primary); background: var(--gold); border-color: var(--gold); }

/* ---------- Typography helpers ---------- */

.eyebrow {
  position: relative; display: inline-block; font-size: 13px; font-weight: 500; line-height: 1;
  color: var(--primary); border: 1px solid var(--divider-strong); border-radius: 40px;
  padding: 7px 16px 7px 30px; margin-bottom: 14px;
}
.eyebrow::before {
  content: ''; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--gold);
}
.eyebrow-light { color: #fff; border-color: #FFFFFF33; backdrop-filter: blur(6px); background: #FFFFFF0D; }
.lead { font-size: 16px; color: var(--text); margin: 12px 0 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.page-head > div:first-child { display: flex; flex-direction: column; align-items: flex-start; }
.page-head h1 { font-size: clamp(32px, 4vw, 48px); }
.page-head-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 18px; transition: gap .3s var(--ease), color .3s; }
.back-link:hover { color: var(--primary); gap: 10px; }

/* ---------- Buttons ---------- */

.btn {
  position: relative; z-index: 1; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px/1 var(--font); padding: 15px 24px; border-radius: 100px; border: 1px solid transparent;
  cursor: pointer; transition: all .4s var(--ease); white-space: nowrap;
}
.btn-block { width: 100%; }
.btn-small { padding: 10px 16px; font-size: 13px; }

/* The site's signature button: charcoal pill with a rotating gold arrow disc and a dark sweep on hover. */
.btn-default { background: var(--accent); color: #fff; padding: 16px 58px 16px 26px; }
.btn-default::before {
  content: ''; position: absolute; top: 50%; right: 6px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--gold) url('img/arrow-white.svg') center / 13px no-repeat;
  transform: translateY(-50%); transition: transform .4s var(--ease);
}
.btn-default::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 0; background: var(--primary);
  z-index: -1; transition: all .4s var(--ease);
}
.btn-default:hover::before { transform: translateY(-50%) rotate(45deg); }
.btn-default:hover::after { right: auto; left: 0; width: 100%; }
.btn-default.btn-block { justify-content: flex-start; }
.btn-default.btn-light::after { background: #fff; }
.btn-default.btn-light:hover { color: var(--primary); }

.btn-ghost { background: transparent; color: var(--primary); border-color: var(--divider-strong); }
.btn-ghost:hover { border-color: var(--primary); background: var(--surface); }
.btn-outline-light { background: #FFFFFF0D; color: #fff; border-color: #FFFFFF40; backdrop-filter: blur(6px); }
.btn-outline-light:hover { background: #fff; color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #B83F3B; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border-radius: 50%; border: 1px solid var(--divider-strong); background: var(--surface); color: var(--primary);
  cursor: pointer; transition: all .3s var(--ease);
}
.icon-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-text-danger {
  display: inline-flex; align-items: center; gap: 8px; background: none; border: none; padding: 8px 4px;
  font: 500 14px var(--font); color: var(--danger); cursor: pointer; opacity: .85;
}
.btn-text-danger:hover { opacity: 1; text-decoration: underline; }
.danger-link { margin-top: 16px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--primary); }
.link-arrow .icon { transition: transform .3s var(--ease); }
.link-arrow:hover .icon { transform: rotate(45deg); color: var(--gold); }

/* ---------- Panels ---------- */

.panel { background: var(--surface); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin-bottom: 24px; }
.panel-flush { padding: 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.panel-head > div { display: flex; flex-direction: column; align-items: flex-start; }
.panel-head .eyebrow { margin-bottom: 10px; }
.panel-head h2 { font-size: 24px; }

/* ---------- Hero (dashboard) ---------- */

.hero {
  position: relative; overflow: hidden; border-radius: 28px; margin-bottom: 24px; min-height: 300px;
  display: flex; align-items: flex-end; padding: 44px;
  background: url('img/hero.jpg') 70% 55% / cover no-repeat, var(--primary);
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, #1D1D1DF2 0%, #1D1D1DCC 38%, #1D1D1D33 70%, transparent 100%);
}
.hero-text { position: relative; max-width: 560px; }
.hero h1 { color: #fff; font-size: clamp(34px, 4.4vw, 56px); line-height: 1.05; }
.hero p { color: #D7D7D7; font-size: 17px; margin: 14px 0 26px; }
.hero p strong { color: var(--gold); font-weight: 600; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Stats ---------- */

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 24px; }
.stat {
  position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.stat::after {
  content: ''; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%;
  background: var(--gold-soft); opacity: 0; transition: opacity .4s var(--ease);
}
.stat:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -20px #1D1D1D40; }
.stat:hover::after { opacity: 1; }
.stat-icon {
  position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--primary); margin-bottom: 22px; transition: background .4s, color .4s;
}
.stat:hover .stat-icon { background: var(--primary); color: var(--gold); }
.stat-value { position: relative; z-index: 1; font: 500 44px/1 var(--display); color: var(--primary); }
.stat-label { position: relative; z-index: 1; font-size: 14px; margin-top: 8px; }

/* ---------- Dashboard grid ---------- */

.dash-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }

.mosaic { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.mosaic-item { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; display: block; }
.mosaic-item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.mosaic-item span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 8px; z-index: 2;
  font: 500 13px var(--display); color: #fff; background: linear-gradient(transparent, #1D1D1DCC);
  opacity: 0; transform: translateY(6px); transition: all .4s var(--ease);
}
.mosaic-item:hover img { transform: scale(1.08); }
.mosaic-item:hover span { opacity: 1; transform: none; }

.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bars a { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 32px; align-items: center; gap: 14px; padding: 8px 10px; border-radius: 10px; transition: background .3s; }
.bars a:hover { background: var(--bg); }
.bars-label { font-weight: 500; color: var(--primary); font-size: 14px; }
.bars-track { height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bars-fill { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.bars-value { text-align: right; font: 500 15px var(--display); color: var(--primary); }

/* ---------- Avatars & pills ---------- */

.avatar {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font: 600 15px var(--display); letter-spacing: .02em; background: var(--primary); color: var(--gold);
}
.avatar-new { background: var(--gold); color: var(--primary); }
.avatar-read, .avatar-replied, .avatar-archived { background: var(--bg); color: var(--accent); }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--accent); }
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.pill-new { background: var(--gold-soft); color: #9A7424; }
.pill-read { background: var(--info-soft); color: var(--info); }
.pill-replied { background: var(--success-soft); color: var(--success); }
.pill-archived { background: #EFEFEF; color: #8A8A8A; }

/* ---------- Messages ---------- */

.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-row a { position: relative; display: flex; gap: 16px; padding: 18px 20px; border-radius: 16px; transition: background .3s var(--ease); }
.msg-row + .msg-row a::before { content: ''; position: absolute; top: 0; left: 80px; right: 20px; height: 1px; background: var(--divider); }
.msg-row a:hover { background: var(--bg); }
.msg-row a:hover::before, .msg-row a:hover + * a::before { opacity: 0; }
.msg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.msg-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.msg-top strong { font: 500 17px var(--display); color: var(--primary); }
.msg-row.is-new .msg-top strong { font-weight: 600; }
.msg-time { font-size: 12px; color: #8A8A8A; white-space: nowrap; }
.msg-excerpt { color: var(--text); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.msg-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.msg-list.is-compact .msg-row a { padding: 14px 12px; }
.msg-list.is-compact .msg-row + .msg-row a::before { left: 72px; right: 12px; }
.msg-list.is-compact .msg-excerpt { -webkit-line-clamp: 1; }
.msg-list.is-compact .msg-meta .muted { display: none; }

.detail-grid, .editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.detail-side, .editor-side { position: sticky; top: 24px; }

.contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 28px; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--divider); min-width: 0; transition: border-color .3s, background .3s; }
a.contact-card:hover { border-color: var(--gold); background: #FFFDF8; }
.contact-card > span:last-child { display: flex; flex-direction: column; min-width: 0; font-weight: 500; color: var(--primary); font-size: 14px; overflow-wrap: anywhere; line-height: 1.35; }
.contact-card small { font-size: 12px; font-weight: 400; color: #8A8A8A; }
.contact-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center; color: var(--primary); flex-shrink: 0; }

.quote { position: relative; margin: 0; padding: 52px 32px 28px; border-radius: 18px; background: var(--bg); }
.quote-mark { position: absolute; top: -8px; left: 24px; font: 500 96px/1 var(--display); color: var(--gold); }
.quote blockquote { margin: 0; font-size: 17px; line-height: 1.75; color: var(--primary); white-space: pre-wrap; }
.quote figcaption { display: flex; align-items: center; gap: 12px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--divider); }
.quote figcaption > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.quote figcaption strong { color: var(--primary); font-weight: 600; }
.quote figcaption small { color: #8A8A8A; }

.segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 100px;
  border: 1px solid var(--divider-strong); font-weight: 500; font-size: 14px; color: var(--text); transition: all .3s var(--ease);
}
.segmented span::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .5; }
.segmented label:hover span { border-color: var(--primary); color: var(--primary); }
.segmented input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
.segmented input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.segmented input:checked + span::before { background: var(--gold); opacity: 1; }

/* ---------- Toolbar, filters, search ---------- */

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pills a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 100px;
  background: var(--surface); border: 1px solid var(--divider); color: var(--primary); font-weight: 500; font-size: 14px;
  transition: all .3s var(--ease);
}
.filter-pills a span { font-size: 12px; font-weight: 600; color: #8A8A8A; background: var(--bg); border-radius: 100px; padding: 2px 8px; transition: all .3s; }
.filter-pills a:hover { border-color: var(--primary); }
.filter-pills a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-pills a.active span { background: var(--gold); color: var(--primary); }

.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 18px; color: #8A8A8A; pointer-events: none; }
.search input[type=search] { width: 300px; max-width: 100%; padding: 13px 20px 13px 46px; border-radius: 100px; background: var(--surface); border: 1px solid var(--divider); }
.search input[type=search]:focus { border-color: var(--gold); }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
.pagination a { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface); border: 1px solid var(--divider); font-weight: 600; transition: all .3s; }
.pagination a:hover { border-color: var(--primary); }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Products ---------- */

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.product-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); padding: 10px 10px 16px; box-shadow: var(--shadow); transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 22px 44px -22px #1D1D1D55; }
.product-card-image { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--bg); }
.product-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease); }
.product-card:hover .product-card-image img { transform: scale(1.06); }
.product-card-noimg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #BDBDBD; }
.product-card-flag {
  position: absolute; top: 10px; left: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 100px; background: #1D1D1DCC; color: #fff; font-size: 12px; font-weight: 600; backdrop-filter: blur(6px);
}
.product-card.is-hidden .product-card-image img { filter: grayscale(1) brightness(.85); }
.product-card-body { padding: 16px 8px 0; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.product-card-body h3 { font-size: 20px; }
.product-card-actions { position: absolute; top: 20px; right: 20px; z-index: 3; display: flex; flex-direction: column; gap: 8px; opacity: 0; transform: translateX(6px); transition: all .35s var(--ease); }
.product-card:hover .product-card-actions, .product-card:focus-within .product-card-actions { opacity: 1; transform: none; }
.product-card-actions .icon-btn { box-shadow: 0 4px 14px -4px #1D1D1D40; border-color: transparent; }

/* The site's diagonal shine on hover */
.image-anime { position: relative; overflow: hidden; }
.image-anime::after {
  content: ''; position: absolute; width: 200%; height: 0; left: 50%; top: 50%; z-index: 1; pointer-events: none;
  background: #FFFFFF4D; transform: translate(-50%, -50%) rotate(-45deg);
}
.image-anime:hover::after { height: 250%; background: transparent; transition: all .6s linear; }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 22px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span:first-child { font-size: 14px; font-weight: 600; color: var(--primary); }
.field small { color: #8A8A8A; }
.field-narrow { max-width: 160px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: 500 15px/1.4 var(--font); color: var(--primary); background: var(--bg);
  border: 1px solid transparent; border-radius: 12px; padding: 15px 18px; outline: none;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
input::placeholder, textarea::placeholder { color: #A5A5A5; font-weight: 400; }
input:hover, select:hover, textarea:hover { border-color: var(--divider-strong); }
input:focus, select:focus, textarea:focus { background: var(--surface); border-color: var(--gold); box-shadow: 0 0 0 4px #D5B47126; }
textarea { resize: vertical; min-height: 96px; }
select {
  appearance: none; cursor: pointer; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231D1D1D' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border-radius: 16px; border: 1.5px dashed var(--divider-strong); background: var(--bg);
  cursor: pointer; transition: all .3s var(--ease);
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { color: var(--primary); font-weight: 600; }
.dropzone small { color: #8A8A8A; }
.dropzone-icon { width: 52px; height: 52px; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; color: var(--primary); margin-bottom: 6px; box-shadow: var(--shadow); transition: all .3s; }
.dropzone:hover, .dropzone.is-dragging { border-color: var(--gold); background: #FFFDF8; }
.dropzone:hover .dropzone-icon, .dropzone.is-dragging .dropzone-icon { background: var(--gold); color: var(--primary); }
.dropzone.has-file { border-style: solid; border-color: var(--gold); }

.advanced summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--accent); list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: '+'; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--divider-strong); font-size: 14px; }
.advanced[open] summary::before { content: '−'; }
.advanced .field { margin-top: 14px; }

.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--divider); }
.switch input { position: absolute; opacity: 0; }
.switch-track { position: relative; flex-shrink: 0; width: 46px; height: 26px; border-radius: 100px; background: #D9D9D9; transition: background .3s; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .3s var(--ease); }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(20px); background: var(--gold); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch > span:last-child { display: flex; flex-direction: column; line-height: 1.4; }
.switch strong { color: var(--primary); font-weight: 600; }
.switch small { color: #8A8A8A; }

.editor-actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.site-preview { text-align: center; }
.site-preview-image { margin: 4px 0 18px; aspect-ratio: 1; border-radius: 14px; background: var(--bg); display: flex; align-items: center; justify-content: center; }
.site-preview-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.site-preview-empty { color: #C4C4C4; }
.site-preview h3 { font-size: 22px; margin-bottom: 2px; }

/* ---------- Categories ---------- */

.category-list { display: flex; flex-direction: column; gap: 16px; }
.category-card {
  display: grid; grid-template-columns: 56px 168px minmax(0, 1fr) auto; align-items: center; gap: 24px;
  background: var(--surface); border-radius: var(--radius); padding: 16px 24px 16px 20px; box-shadow: var(--shadow);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.category-card:hover { transform: translateX(4px); box-shadow: 0 18px 40px -22px #1D1D1D55; }
.category-num { font: 500 34px var(--display); color: var(--gold); text-align: center; }
.category-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.category-thumbs img, .category-thumbs span { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--bg); display: block; }
.category-thumbs img:first-child, .category-thumbs span:first-child { grid-column: span 2; grid-row: span 2; border-radius: 12px; }
.category-body h3 { font-size: 24px; margin-bottom: 4px; }
.category-body h3 a:hover { color: var(--accent); }
.category-body p { margin: 0 0 10px; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.category-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.category-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- Drag & drop ordering ---------- */

.sort-hint { display: flex; align-items: center; gap: 8px; margin: -8px 0 20px; font-size: 13px; color: #8A8A8A; }
.toolbar .sort-hint { margin: 0; }

.drag-handle { cursor: grab; touch-action: none; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.product-card .drag-handle {
  position: absolute; top: 20px; left: 20px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #FFFFFFE6; color: var(--primary);
  box-shadow: 0 4px 14px -4px #1D1D1D40; backdrop-filter: blur(6px); transition: background .3s, color .3s;
}
.product-card .drag-handle:hover { background: var(--primary); color: var(--gold); }
.product-card:has(.drag-handle) .product-card-flag { left: auto; right: 10px; top: auto; bottom: 10px; }

.category-num.drag-handle { display: flex; align-items: center; justify-content: center; position: relative; height: 56px; border-radius: 14px; transition: background .3s; }
.category-num.drag-handle .icon { position: absolute; opacity: 0; color: var(--primary); transition: opacity .25s; }
.category-num.drag-handle [data-position] { transition: opacity .25s; }
.category-card:hover .category-num.drag-handle { background: var(--bg); }
.category-card:hover .category-num.drag-handle .icon { opacity: 1; }
.category-card:hover .category-num.drag-handle [data-position] { opacity: 0; }

/* SortableJS states */
.sortable-ghost { opacity: .35; }
.sortable-ghost.product-card, .sortable-ghost.category-card { box-shadow: none; outline: 2px dashed var(--gold); outline-offset: -2px; }
.sortable-chosen.sortable-drag, .sortable-fallback { box-shadow: 0 30px 60px -20px #1D1D1D66 !important; transform: rotate(1.5deg); }
.is-sorting .product-card-actions, .is-sorting .image-anime::after { display: none; }
.is-sorting .product-card:hover, .is-sorting .category-card:hover { transform: none; }

/* ---------- Subscribers ---------- */

.stats-2 { grid-template-columns: repeat(2, minmax(0, 320px)); }
.sub-list { list-style: none; margin: 0; padding: 0; }
.sub-row { display: flex; align-items: center; gap: 16px; padding: 14px 20px; border-radius: 16px; transition: background .3s; }
.sub-row + .sub-row { border-top: 1px solid var(--divider); }
.sub-row:hover { background: var(--bg); }
.sub-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.sub-main strong { font-weight: 600; color: var(--primary); overflow-wrap: anywhere; }
.sub-row .icon-btn { opacity: 0; transition: opacity .25s, background .3s, color .3s; }
.sub-row:hover .icon-btn, .sub-row:focus-within .icon-btn { opacity: 1; }
.sub-row .icon-btn:hover { background: var(--danger); border-color: var(--danger); }

/* ---------- Users ---------- */

.user-row .sub-main:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.user-row .icon-btn, .user-row .icon-btn:hover { opacity: 1; }
.user-row .icon-btn:hover { background: var(--primary); border-color: var(--primary); }
.user-row.is-inactive .avatar, .user-row.is-inactive .sub-main { opacity: .5; }
.user-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.user-login { font-size: 13px; min-width: 150px; text-align: right; }

.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-option { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 14px; border: 1px solid var(--divider-strong); cursor: pointer; transition: border-color .3s, background .3s, box-shadow .3s; }
.role-option input { margin: 3px 0 0; accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; }
.role-option > span { display: flex; flex-direction: column; gap: 4px; line-height: 1.45; }
.role-option strong { color: var(--primary); font-weight: 600; }
.role-option small { color: #8A8A8A; font-size: 13px; }
.role-option:hover { border-color: var(--primary); }
.role-option:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); box-shadow: 0 0 0 3px #D5B47126; }
.role-option:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.role-option:has(input:disabled):hover { border-color: var(--divider-strong); }
.role-note { margin: 14px 0 0; font-size: 13px; }

.panel-switch { background: var(--surface); box-shadow: var(--shadow); border: none; margin-bottom: 12px; }
.panel-switch:has(input:disabled) { cursor: not-allowed; opacity: .7; }
.user-facts { margin: 0 0 12px; padding: 18px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 12px; }
.user-facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.user-facts dt { color: #8A8A8A; }
.user-facts dd { margin: 0; color: var(--primary); font-weight: 500; text-align: right; }

.reveal-panel { border: 1px solid var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface) 70%); }
.reveal-panel p { margin: 0 0 16px; line-height: 1.6; }
.reveal-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 14px 14px 20px; border-radius: 14px; background: var(--surface); border: 1px dashed var(--gold); margin-bottom: 12px; }
.reveal-box code { flex: 1; min-width: 0; font-size: 20px; letter-spacing: .08em; background: none; color: var(--primary); padding: 0; overflow-wrap: anywhere; user-select: all; }
.reveal-box .btn.is-copied { border-color: var(--success); color: var(--success); }

/* ---------- Account ---------- */

.account-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.profile-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 28px; }
.profile-card .avatar { margin-bottom: 12px; }
.profile-card h2 { font-size: 26px; }
.profile-card .pill { margin-top: 10px; }
.mobile-only { display: none !important; }
.profile-card form { margin-top: 16px; }

/* ---------- Empty states ---------- */

.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 20px; }
.empty-icon { width: 68px; height: 68px; border-radius: 50%; background: var(--bg); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.empty-state h3 { font-size: 22px; }
.empty-state p { margin: 6px 0 20px; max-width: 360px; }

/* ---------- Toasts & dialog ---------- */

.toasts { position: fixed; top: 24px; right: 24px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px 14px 14px; border-radius: 100px;
  background: var(--primary); color: #fff; font-weight: 500; font-size: 14px; box-shadow: 0 18px 40px -12px #1D1D1D66;
  animation: toast-in .5s var(--ease) both; transition: opacity .4s, transform .4s var(--ease);
}
.toast.is-leaving { opacity: 0; transform: translateX(20px); }
.toast-icon { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.toast-success .toast-icon { background: var(--gold); color: var(--primary); }
.toast-error .toast-icon { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } }

.confirm-dialog { border: none; border-radius: 24px; padding: 0; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 40px 80px -20px #1D1D1D80; }
.confirm-dialog::backdrop { background: #1D1D1D8C; backdrop-filter: blur(4px); }
.confirm-dialog[open] { animation: dialog-in .35s var(--ease); }
.confirm-dialog form { padding: 32px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.confirm-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.confirm-dialog h3 { font-size: 26px; }
.confirm-dialog p { margin: 8px 0 24px; }
.confirm-actions { display: flex; gap: 10px; width: 100%; }
.confirm-actions .btn { flex: 1; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }

/* ---------- Login ---------- */

.content-bare { min-height: 100vh; }
.login { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-visual {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; overflow: hidden;
  background: url('img/hero.jpg') 72% center / cover no-repeat, var(--primary);
}
.login-visual::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #1D1D1DB3 0%, #1D1D1D1A 40%, #1D1D1DE6 100%); }
.login-logo { position: relative; width: 210px; border-radius: 6px; }
.login-visual-text { position: relative; max-width: 520px; }
.login-visual h2 { color: #fff; font-size: clamp(32px, 3.4vw, 50px); line-height: 1.08; }
.login-visual p { color: #CFCFCF; font-size: 16px; margin: 16px 0 0; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; background: var(--bg); }
.login-form-wrap { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: flex-start; }
.login-form-wrap h1 { font-size: 44px; }
.login-form-wrap .lead { margin-bottom: 32px; }
.login-form-wrap .form { width: 100%; }
.login-form-wrap input { background: var(--surface); }

.error-page { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px 16px; }
.error-page h1 { font-size: clamp(36px, 5vw, 60px); }
.error-page .lead { margin-bottom: 28px; }

/* ---------- Responsive ---------- */

@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .detail-grid, .editor, .account-grid { grid-template-columns: 1fr; }
  .detail-side, .editor-side { position: static; }
  .category-card { grid-template-columns: 120px minmax(0, 1fr); }
  .category-num { display: none; }
  .category-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .category-card:has(.drag-handle) { grid-template-columns: 44px 120px minmax(0, 1fr); }
  .category-num.drag-handle { display: flex; height: 44px; background: var(--bg); }
  .category-num.drag-handle .icon { opacity: 1; }
  .category-num.drag-handle [data-position] { opacity: 0; }
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { position: sticky; z-index: 50; width: auto; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 12px 16px; overflow-x: auto; }
  .sidebar-logo { padding: 0; flex-shrink: 0; }
  .sidebar-logo img { width: 104px; }
  .sidebar-label, .sidebar-site, .sidebar-user-info { display: none; }
  .sidebar-nav { flex-direction: row; gap: 2px; }
  .sidebar-nav a { padding: 10px 12px; }
  .sidebar-nav a span { display: none; }
  .nav-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; font-size: 10px; padding: 0 5px; }
  .sidebar-user { display: none; }
  .mobile-only { display: flex !important; }
  .filter-pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .filter-pills a { flex-shrink: 0; }
  .content { padding: 24px 16px 48px; }
  .hero { padding: 28px; min-height: 260px; }
  .hero::before { background: linear-gradient(180deg, #1D1D1D66 0%, #1D1D1DE6 70%); }
  .login { grid-template-columns: 1fr; }
  .login-visual { min-height: 240px; padding: 28px; }
  .login-visual-text p { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .search, .search input[type=search] { width: 100%; }
  .panel { padding: 20px; }
}

@media (max-width: 520px) {
  .sidebar { padding: 10px 12px; }
  .sidebar-logo img { width: 84px; }
  .sidebar-nav a { padding: 9px 8px; }
  .role-options { grid-template-columns: 1fr; }
  .user-row { flex-wrap: wrap; }
  .user-meta { width: 100%; justify-content: flex-start; padding-left: 60px; }
  .user-login { min-width: 0; text-align: left; }
  .user-row > .icon-btn { position: absolute; right: 20px; }
  .user-row { position: relative; }
  .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 18px; }
  .stat-value { font-size: 34px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card-body h3 { font-size: 16px; }
  .product-card-actions { opacity: 1; transform: none; top: 16px; right: 16px; }
  .mosaic { grid-template-columns: repeat(3, 1fr); }
  .stats-2 { grid-template-columns: 1fr 1fr; }
  .sub-row .icon-btn { opacity: 1; }
  .product-card .drag-handle { top: 16px; left: 16px; }
  .msg-row a { padding: 14px 10px; gap: 12px; }
  .msg-row + .msg-row a::before { left: 66px; right: 10px; }
  .category-card, .category-card:has(.drag-handle) { position: relative; grid-template-columns: 1fr; padding: 16px; }
  .category-num.drag-handle { position: absolute; top: 24px; left: 24px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; background: #FFFFFFE6; box-shadow: 0 4px 14px -4px #1D1D1D40; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
