/* =============================================================================
   YHAL Admin CMS — Stylesheet
   Yellow House Art Licensing
   ============================================================================= */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --accent:        #E8B84B;
  --accent-dark:   #C99C32;
  --accent-light:  #FDF3D9;
  --sidebar-bg:    #1e2030;
  --sidebar-hover: #272b40;
  --sidebar-w:     240px;
  --topbar-h:      60px;
  --content-bg:    #f4f5f7;
  --card-bg:       #ffffff;
  --text:          #2d3142;
  --text-muted:    #6e7490;
  --border:        #e2e5ed;
  --shadow:        0 2px 12px rgba(0,0,0,.07);
  --radius:        8px;
  --success:       #27ae60;
  --danger:        #e74c3c;
  --warning:       #f39c12;
  --info:          #2980b9;
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body { font-family: var(--font); font-size: 14px; color: var(--text);
       background: var(--content-bg); line-height: 1.5; }
a { color: var(--accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.5rem; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.layout {
  display: block;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--topbar-h);
  padding: 0 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sidebar-logo img {
  max-height: 32px;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.sidebar-logo .logo-text {
  color: var(--accent);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: .02em;
}

.sidebar-nav {
  flex: 1;
  padding: .75rem 0;
}

.nav-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: 1.25rem 1.25rem .4rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1.25rem;
  color: rgba(255,255,255,.65);
  font-size: .875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(232,184,75,.12);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: .8;
}

.nav-item.active svg { opacity: 1; }

.nav-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: .68em;
  font-weight: 700;
  padding: 1px 6px;
  vertical-align: middle;
  margin-left: 4px;
  line-height: 1.5;
}

.nav-divider {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: .5rem 0;
}

.sidebar-bottom {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem;
  border-radius: var(--radius);
}

.sidebar-user-avatar {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; color: var(--sidebar-bg);
  flex-shrink: 0;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name  { font-size: .8rem; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role  { font-size: .7rem; color: rgba(255,255,255,.4); }

.sidebar-logout {
  display: block;
  margin-top: .5rem;
  padding: .45rem .75rem;
  background: rgba(255,255,255,.06);
  border-radius: 5px;
  color: rgba(255,255,255,.5);
  font-size: .78rem;
  text-align: center;
  transition: background .15s, color .15s;
}

.sidebar-logout:hover { background: var(--danger); color: #fff; text-decoration: none; }

/* ── Main content ────────────────────────────────────────────────────────────── */
.main {
  margin-left: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  min-height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: .75rem 1.5rem .85rem;
  position: sticky; top: 0;
  z-index: 50;
}

.topbar-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  color: var(--text);
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
}

.header-brand:hover { text-decoration: none; color: var(--text); }

.header-brand img {
  max-height: 70px;
  width: auto;
}

.header-user-meta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .28rem .55rem;
  border-radius: 999px;
  background: #f7f8fb;
  border: 1px solid var(--border);
}

.header-user-name {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
}

.header-user-role {
  display: inline-flex;
  align-items: center;
  padding: .1rem .45rem;
  border-radius: 999px;
  border: 1px solid #e7eaf1;
  background: #f6f8fb;
  font-size: .68rem;
  font-weight: 500;
  color: #8a91a7;
  letter-spacing: .01em;
}

.header-nav {
  width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem;
  padding-top: .2rem;
}

.header-nav .nav-item {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .42rem .78rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all .15s;
}

.header-nav .nav-item:hover {
  color: var(--text);
  border-color: var(--border);
  background: #fafbfd;
  text-decoration: none;
}

.header-nav .nav-item.active {
  color: #7a5c00;
  border-color: #efd898;
  background: var(--accent-light);
}

/* ── Nav dropdown group ─────────────────────────────────────────────────────── */
.nav-group {
  position: relative;
  display: inline-flex;
}

.nav-group-trigger {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.nav-group-trigger .nav-caret {
  display: inline-block;
  width: 0; height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4.5px solid currentColor;
  opacity: .55;
  margin-left: 1px;
  transition: transform .15s;
}

.nav-group:hover .nav-caret,
.nav-group:focus-within .nav-caret,
.nav-group.is-open .nav-caret {
  transform: rotate(180deg);
  opacity: .8;
}

.nav-group-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  z-index: 200;
  padding: 4px 0 .3rem;
  white-space: nowrap;
  transition: opacity .15s, visibility .15s;
  /* Extend hover area upward so mouse travel from trigger never hits a gap */
  margin-top: -2px;
}

.nav-group:focus-within .nav-group-menu,
.nav-group.is-open .nav-group-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.nav-group-menu a {
  display: block;
  padding: .45rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .12s, color .12s;
}

.nav-group-menu a:hover {
  background: var(--accent-light);
  color: #7a5c00;
}

.nav-group-menu a.active {
  color: #7a5c00;
  background: var(--accent-light);
}

.topbar-meta {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: .55rem;
}

.topbar-left h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-left .breadcrumb {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 1px;
}

.topbar-left .breadcrumb a { color: var(--text-muted); }
.topbar-left .breadcrumb a:hover { color: var(--accent-dark); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.content {
  flex: 1;
  padding: 1.75rem;
}

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.card-header h2, .card-header h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
}

.card-body {
  padding: 1.25rem;
}

.card-footer {
  padding: .85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #fafbfc;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ── Buttons ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border: none;
  border-radius: 6px;
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, box-shadow .15s, opacity .15s;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary   { background: var(--accent); color: var(--sidebar-bg); }
.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary { background: #eef0f5; color: var(--text); }
.btn-secondary:hover { background: #e2e5ed; }

.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #219a52; }

.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d68910; }

.btn-ghost     { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: #f0f0f0; }

.btn-sm { padding: .3rem .7rem; font-size: .8rem; }
.btn-xs { padding: .18rem .55rem; font-size: .75rem; }
.btn-lg { padding: .7rem 1.5rem; font-size: .95rem; }
.btn-full { width: 100%; justify-content: center; }

/* ── Sub-nav tab strip (filter tabs on list pages) ─────────────────────────── */
.sub-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}
.sub-nav-item {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.sub-nav-item:hover { color: var(--text); text-decoration: none; }
.sub-nav-item.active { color: var(--accent); border-bottom-color: var(--accent); }
.sub-nav-count {
  background: var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: .7em;
  font-weight: 700;
  padding: 1px 7px;
  line-height: 1.5;
}

/* ── Forms ──────────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: .35rem;
}

.form-label .req { color: var(--danger); margin-left: 2px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: .25rem; }

.form-control {
  width: 100%;
  padding: .55rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: var(--font);
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,184,75,.18);
}

.form-control:disabled { background: #f8f8f8; cursor: not-allowed; opacity: .7; }

textarea.form-control { resize: vertical; min-height: 90px; }
select.form-control { appearance: none; 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='%236e7490' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; padding-right: 2rem; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-error { font-size: .78rem; color: var(--danger); margin-top: .3rem; }
.form-control.is-invalid { border-color: var(--danger); }

/* ── Alerts / Flash messages ─────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: 6px;
  font-size: .88rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  animation: fadeIn .25s ease;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info    { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }
.alert .close  { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 1.1rem; line-height: 1; color: inherit; opacity: .6; padding: 0; }
.alert .close:hover { opacity: 1; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ── Table ──────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .86rem;
}

.tbl th {
  text-align: left;
  padding: .65rem 1rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  background: #fafbfc;
  white-space: nowrap;
}

.tbl td {
  padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: #fafafa; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl .actions a, .tbl .actions button {
  color: var(--text-muted);
  background: none; border: none; cursor: pointer;
  font-size: .82rem; padding: .2rem .4rem; border-radius: 4px;
  transition: color .15s, background .15s;
  text-decoration: none;
}
.tbl .actions a:hover { color: var(--accent-dark); text-decoration: none; }
.tbl .actions .del:hover { color: var(--danger); }
.tbl .cb-col { width: 40px; }

/* ── Badges ─────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .55rem;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-muted   { background: #e9ecef; color: #6c757d; }
.badge-info    { background: #d1ecf1; color: #0c5460; }
.badge-accent  { background: var(--accent-light); color: #7a5c00; }
.badge-danger  { background: #f8d7da; color: #721c24; }

/* ── Artwork grid / thumbnails ───────────────────────────────────────────────── */
.artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.artwork-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .15s;
  position: relative;
}

.artwork-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.artwork-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.artwork-thumb {
  aspect-ratio: 1;
  background: #f0f0f0;
  overflow: hidden;
  position: relative;
}

.artwork-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.artwork-cb {
  position: absolute;
  top: 8px; left: 8px;
  width: 20px; height: 20px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 2;
  accent-color: var(--accent);
}

/* Larger, easier-to-tap checkbox on artwork cards */
.artwork-checkbox {
  position: absolute;
  top: 0; left: 0;
  width: 52px; height: 52px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.artwork-thumb::before {
  content: '';
  position: absolute;
  top: 9px; left: 9px;
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 2.5px solid rgba(255,255,255,.9);
  background: rgba(0,0,0,.32);
  box-shadow: 0 1px 5px rgba(0,0,0,.3);
  pointer-events: none;
  z-index: 2;
  transition: background .12s, border-color .12s;
}

.artwork-thumb:has(.artwork-checkbox:checked)::before {
  background: var(--accent);
  border-color: var(--accent);
}

/* Checkmark tick — centred inside the 28×28 box at top:9 left:9 */
.artwork-thumb::after {
  content: '';
  position: absolute;
  top: 16px; left: 18px;
  width: 8px; height: 14px;
  border: 3px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translate(-1px, -2px);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity .12s;
}

.artwork-thumb:has(.artwork-checkbox:checked)::after {
  opacity: 1;
}

.artwork-info {
  padding: .6rem .75rem;
}

.artwork-ref  { font-size: .7rem; color: var(--text-muted); font-weight: 600; letter-spacing: .04em; }
.artwork-title { font-size: .82rem; font-weight: 600; color: var(--text); line-height: 1.3; margin: .2rem 0 .35rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.artwork-artist { font-size: .75rem; color: var(--text-muted); }

.artwork-kw-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: .35rem;
}

.artwork-kw-tag {
  display: inline-block;
  font-size: .66rem;
  font-weight: 600;
  background: var(--accent-light);
  color: #7a5c00;
  border-radius: 20px;
  padding: 1px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 120px;
}

.artwork-kw-text {
  margin-top: .35rem;
  font-size: .72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.artwork-actions {
  display: flex;
  gap: .4rem;
  padding: 0 .75rem .65rem;
}

.artwork-actions a,
.artwork-actions button {
  flex: 1;
  text-align: center;
  padding: .3rem .5rem;
  font-size: .75rem;
  border-radius: 4px;
  background: #f4f5f7;
  color: var(--text-muted);
  transition: background .15s, color .15s;
  border: none;
  cursor: pointer;
}

.artwork-actions .inline-form {
  flex: 1;
  display: flex;
}

.artwork-actions a:hover,
.artwork-actions button:hover { background: var(--accent-light); color: var(--accent-dark); text-decoration: none; }

.artwork-actions button.del:hover { background: #fdeceb; color: var(--danger); }

/* ── Filters bar ─────────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.filters .form-group { margin-bottom: 0; min-width: 150px; flex: 1; }
.filters .form-control { font-size: .84rem; }
.filters .btn { height: 36px; align-self: flex-end; }

/* ── Library toolbar ─────────────────────────────────────────────────────────── */
.library-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: .75rem;
}

.library-toolbar .result-count {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Bulk action bar ─────────────────────────────────────────────────────────── */
.bulk-bar {
  position: fixed;
  bottom: -80px;
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.75rem;
  z-index: 200;
  transition: bottom .25s cubic-bezier(.25,.8,.25,1);
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
  flex-wrap: wrap;
}

.bulk-bar.visible { bottom: 0; }

.bulk-bar .bulk-count {
  font-weight: 700;
  color: var(--accent);
  font-size: .9rem;
  white-space: nowrap;
}

.bulk-bar .bulk-actions {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.bulk-bar .bulk-sep {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,.15);
}

.bulk-bar .deselect {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,.45);
  cursor: pointer;
  font-size: .82rem;
  padding: .3rem;
  transition: color .15s;
}

.bulk-bar .deselect:hover { color: #fff; }

/* ── Upload area ─────────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  text-align: center;
  padding: 3rem 2rem;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone svg { width: 48px; height: 48px; color: var(--text-muted); margin: 0 auto .75rem; }
.drop-zone p   { color: var(--text-muted); font-size: .92rem; }
.drop-zone strong { color: var(--accent-dark); }

/* Upload queue */
.upload-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.upload-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  gap: 0;
  overflow: hidden;
}

.upload-card-preview {
  width: 120px;
  min-height: 120px;
  flex-shrink: 0;
  background: #f0f0f0;
  position: relative;
  overflow: hidden;
}

.upload-card-preview img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.upload-card-preview .remove-btn {
  position: absolute;
  top: 5px; right: 5px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: .8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}

.upload-card-preview .remove-btn:hover { background: var(--danger); }

.upload-card-fields {
  flex: 1;
  padding: .85rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.upload-card-fields .form-group { margin-bottom: 0; }
.upload-card-fields .form-control { font-size: .82rem; padding: .4rem .65rem; }
.upload-card-fields .form-label  { font-size: .76rem; margin-bottom: .2rem; }

.upload-file-info { font-size: .72rem; color: var(--text-muted); margin-top: auto; padding-top: .3rem; }

.upload-global-bar {
  background: var(--accent-light);
  border: 1px solid #f0d890;
  border-radius: var(--radius);
  padding: .85rem 1.25rem;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.upload-global-bar .form-group { margin-bottom: 0; min-width: 180px; }
.upload-global-bar .form-label { font-size: .78rem; }

.upload-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: .3rem;
}

.upload-progress-bar .bar {
  height: 100%;
  background: var(--success);
  width: 0;
  transition: width .3s;
}

/* ── Keyword chips ───────────────────────────────────────────────────────────── */
.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: var(--accent-light);
  color: #7a5c00;
  border-radius: 20px;
  padding: .2rem .65rem;
  font-size: .77rem;
  font-weight: 600;
}

.kw-chip .kw-remove {
  background: none; border: none; cursor: pointer;
  color: inherit; opacity: .6; padding: 0; line-height: 1; font-size: .85rem;
}

.kw-chip .kw-remove:hover { opacity: 1; }

.kw-category-section { margin-bottom: 1.25rem; }
.kw-category-title {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text-muted);
  margin-bottom: .5rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  opacity: 0; visibility: hidden;
  transition: opacity .2s, visibility .2s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
  width: 90%; max-width: 620px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  transform: translateY(-12px);
  transition: transform .2s;
}

.modal-overlay.open .modal { transform: none; }

.modal-header {
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 1.3rem; line-height: 1; padding: .2rem;
}

.modal-close:hover { color: var(--danger); }

.modal-body {
  flex: 1; overflow-y: auto; padding: 1.25rem 1.5rem;
}

.modal-footer {
  padding: .85rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; gap: .75rem; justify-content: flex-end;
}

/* Keyword modal specific */
.kw-modal-search {
  margin-bottom: 1rem;
}

.kw-modal-group { margin-bottom: 1rem; }

.kw-modal-group-title {
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding-bottom: .4rem; margin-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

.kw-checkbox-list {
  display: flex; flex-wrap: wrap; gap: .35rem;
}

.kw-checkbox-label {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .65rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: .8rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}

.kw-checkbox-label:hover { border-color: var(--accent); }

.kw-checkbox-label input[type=checkbox] { accent-color: var(--accent); }
.kw-checkbox-label input[type=checkbox]:checked + span { color: var(--accent-dark); font-weight: 600; }
.kw-checkbox-label:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }

/* ── Pagination ─────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .35rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  justify-content: center;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px; height: 34px;
  padding: 0 .6rem;
  border-radius: 6px;
  font-size: .84rem;
  font-weight: 500;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}

.pagination a:hover { background: var(--accent-light); border-color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: var(--sidebar-bg); font-weight: 700; }
.pagination .dots { border: none; color: var(--text-muted); }

/* ── Stats / dashboard ───────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

.stat-card .stat-label {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-muted);
}

.stat-card .stat-value {
  font-size: 1.9rem; font-weight: 800; color: var(--text);
  line-height: 1.2; margin: .35rem 0 .25rem;
}

.stat-card .stat-sub { font-size: .78rem; color: var(--text-muted); }
.stat-card .stat-icon { float: right; margin-top: -4px; }
.stat-card .stat-icon svg { width: 32px; height: 32px; color: var(--accent); opacity: .6; }

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 2.5rem 2.25rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo img { max-height: 45px; margin: 0 auto .75rem; }
.login-logo p   { font-size: .82rem; color: var(--text-muted); }

/* ── Utilities ───────────────────────────────────────────────────────────────── */
.hidden       { display: none !important; }
.text-muted   { color: var(--text-muted); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-accent  { color: var(--accent-dark); }
.text-sm      { font-size: .82rem; }
.text-xs      { font-size: .74rem; }
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.fw-bold      { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.d-flex   { display: flex; }
.gap-1    { gap: .5rem; }
.gap-2    { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1   { flex: 1; }

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state svg { width: 56px; height: 56px; margin: 0 auto .75rem; opacity: .35; }
.empty-state h3  { font-size: 1rem; margin-bottom: .4rem; color: var(--text); }
.empty-state p   { font-size: .88rem; }

.page-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* Artist quick-add inline */
.quick-add-link {
  font-size: .78rem;
  color: var(--accent-dark);
  margin-top: .3rem;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  cursor: pointer;
  background: none; border: none; padding: 0;
  font-family: var(--font);
}

.quick-add-link:hover { text-decoration: underline; color: var(--accent-dark); }

/* Range artwork grid in manage view */
.range-artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem;
}

.range-artwork-item {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.range-artwork-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }

.range-artwork-remove {
  position: absolute;
  top: 4px; right: 4px;
  background: rgba(0,0,0,.55);
  border: none; border-radius: 50%;
  width: 22px; height: 22px;
  color: #fff; font-size: .8rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  text-decoration: none;
}

.range-artwork-remove:hover { background: var(--danger); }

/* ── Scrollbar (webkit) ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.25); }

.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); }
