/* ── VARIABLES ── */
:root {
  --bg: #F5F2EC;
  --bg2: #EEE9E0;
  --ink: #1A1714;
  --ink2: #4A453F;
  --ink3: #8C8680;
  --accent: #C8501A;
  --accent2: #E8C47A;
  --border: rgba(26,23,20,0.10);
  --border2: rgba(26,23,20,0.06);
  --white: #FDFBF8;
  --green: #28C940;
  --green-glow: rgba(40,201,64,0.25);
  --red: #E74C3C;
  --yellow: #F39C12;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;
  --mono: 'DM Mono', monospace;
  --r: 4px;
  --transition: 0.35s cubic-bezier(0.16,1,0.3,1);
}

[data-theme="dark"] {
  --bg: #161412;
  --bg2: #1E1B17;
  --ink: #F5F2EC;
  --ink2: #C8C2B8;
  --ink3: #7A746E;
  --accent: #D8602A;
  --accent2: #E8C47A;
  --border: rgba(245,242,236,0.10);
  --border2: rgba(245,242,236,0.06);
  --white: #24201C;
  --green: #3BD94F;
  --green-glow: rgba(59,217,79,0.25);
  --red: #FF6B6B;
  --yellow: #FFD93D;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 1;
}

/* ── LABEL ── */
.label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink3);
  padding: 5px 10px; border: 1px solid var(--border);
  border-radius: 2px; background: var(--bg2);
  transition: background 0.4s, border-color 0.4s, color 0.4s;
}
.label-dot {
  width: 5px; height: 5px; background: var(--accent);
  border-radius: 50%; display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--white);
  font-family: var(--sans); font-size: 15px; font-weight: 500;
  padding: 14px 28px; border-radius: var(--r); border: none;
  cursor: none; text-decoration: none;
  transition: background var(--transition), transform 0.2s;
  letter-spacing: 0.01em;
}
.btn-primary:hover { background: var(--accent); transform: translateY(-2px); }
.btn-primary.large { font-size: 16px; padding: 16px 40px; }
.btn-primary:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--ink2);
  font-family: var(--sans); font-size: 14px; font-weight: 400;
  padding: 12px 20px; border-radius: var(--r);
  border: 1px solid var(--border); cursor: none;
  text-decoration: none; transition: all 0.2s;
}
.btn-secondary:hover {
  color: var(--accent);
  border-color: rgba(200,80,26,0.3);
  background: rgba(200,80,26,0.04);
}

/* ── MODALS ── */
.dash-modal-overlay {
  position: fixed; inset: 0;
  z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,23,20,0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
  transition: background 0.45s ease, backdrop-filter 0.45s ease;
  padding: 20px;
}
.dash-modal-overlay.open {
  background: rgba(26,23,20,0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: all;
}
.dash-modal {
  width: min(520px, 100%);
  max-height: 90vh;
  background: var(--white);
  border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 32px 80px rgba(26,23,20,0.28);
  padding: 40px 40px 36px;
  position: relative;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  transform: scale(0.9) translateY(24px);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.34,1.28,0.64,1), opacity 0.4s ease, background 0.4s, border-color 0.4s;
}
.dash-modal::-webkit-scrollbar { display: none; }
.dash-modal-overlay.open .dash-modal {
  transform: scale(1) translateY(0); opacity: 1;
}
.dash-modal-wide { width: min(720px, 100%); }
.dash-modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 50%; cursor: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--ink2);
  transition: background 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.dash-modal-close:hover { background: var(--accent); color: white; transform: rotate(90deg); }
.dash-modal-header { margin-bottom: 28px; }
.dash-modal-header .label { margin-bottom: 14px; }
.dash-modal-title {
  font-family: var(--serif); font-size: 28px;
  line-height: 1.1; color: var(--ink); letter-spacing: -0.01em;
  transition: color 0.4s;
}
.dash-modal-title em { color: var(--accent); font-style: italic; }

/* ── FORMS ── */
.dash-modal-form { display: flex; flex-direction: column; gap: 18px; }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink3); display: flex; align-items: center; gap: 6px;
  transition: color 0.4s;
}
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--sans); font-size: 14px; font-weight: 400;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 12px 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.4s, color 0.4s;
  width: 100%; box-sizing: border-box;
}
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--ink3); opacity: 0.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,80,26,0.08);
}
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field select {
  cursor: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238C8680' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 36px;
}
.form-field-conditional { animation: slideDown 0.3s cubic-bezier(0.16,1,0.3,1); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.form-error {
  font-size: 12px; color: #c0392b; font-weight: 400;
  min-height: 18px; text-align: center; margin: 8px 0;
}
.form-actions-row {
  display: flex; gap: 12px; align-items: center; margin-top: 8px;
}
.submit-spinner { display: inline-flex; align-items: center; }

/* ── TOOLTIPS ── */
.tooltip-trigger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 50%;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  color: var(--ink3); cursor: help; position: relative; flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.tooltip-trigger:hover {
  background: var(--accent); border-color: var(--accent); color: white;
}
.tooltip-trigger::after {
  content: attr(data-tooltip); position: absolute;
  bottom: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) scale(0.95);
  width: 260px; background: var(--ink); color: var(--white);
  font-family: var(--sans); font-size: 12px; font-weight: 300;
  line-height: 1.5; padding: 10px 14px; border-radius: 6px;
  white-space: normal; z-index: 1000; pointer-events: none;
  opacity: 0; transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 8px 24px rgba(26,23,20,0.2);
}
.tooltip-trigger::before {
  content: ''; position: absolute; bottom: calc(100% + 4px);
  left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink);
  pointer-events: none; opacity: 0; transition: opacity 0.2s;
}
.tooltip-trigger:hover::after,
.tooltip-trigger:hover::before {
  opacity: 1; transform: translateX(-50%) scale(1);
}

/* ── FILE DROPZONE ── */
.file-dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: none;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-dropzone:hover,
.file-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(200,80,26,0.02);
}
.file-dropzone.dragover .file-text {
  color: var(--accent);
  font-weight: 500;
}
.file-dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: none;
  width: 100%; height: 100%;
}
.file-dropzone-secondary {
  background: var(--bg2);
  padding: 28px 20px;
  transition: background 0.4s;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-dropzone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  width: 100%;
}
.file-icon { font-size: 24px; margin-bottom: 4px; }
.file-text {
  font-size: 14px; color: var(--ink2); font-weight: 400;
  transition: color 0.4s;
}
.file-hint {
  font-size: 12px; color: var(--ink3); font-weight: 300;
  transition: color 0.4s;
}

/* ── FILE CHIPS ── */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  transition: background 0.4s, border-color 0.4s;
}
.file-chip-name {
  font-size: 13px; color: var(--ink); font-weight: 400;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: color 0.4s;
}
.file-chip-remove {
  width: 20px; height: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 50%; cursor: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink3); flex-shrink: 0;
  transition: all 0.2s;
}
.file-chip-remove:hover {
  background: var(--accent); color: white;
  border-color: var(--accent);
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: none;
  z-index: 99999;
  transition: all 0.4s cubic-bezier(0.34,1.28,0.64,1), background 0.4s, border-color 0.4s;
  overflow: hidden;
}
.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}
.theme-icon-sun, .theme-icon-moon {
  position: absolute;
  transition: transform 0.5s cubic-bezier(0.34,1.28,0.64,1), opacity 0.3s ease;
  color: var(--ink2);
}
.theme-icon-sun { transform: rotate(0deg) scale(1); opacity: 1; }
.theme-icon-moon { transform: rotate(-90deg) scale(0.5); opacity: 0; }
[data-theme="dark"] .theme-icon-sun { transform: rotate(90deg) scale(0.5); opacity: 0; }
[data-theme="dark"] .theme-icon-moon { transform: rotate(0deg) scale(1); opacity: 1; }

/* ── CUSTOM CURSOR ── */
#cursor-dot {
  position: fixed; top: 0; left: 0;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%; pointer-events: none;
  z-index: 400001;
  transform: translate(-50%, -50%);
  transition: transform 0.1s, width 0.2s, height 0.2s, opacity 0.2s;
}
#cursor-ring {
  position: fixed; top: 0; left: 0;
  width: 28px; height: 28px;
  border: 1px solid var(--accent);
  border-radius: 50%; pointer-events: none;
  z-index: 400000;
  transform: translate(-50%, -50%);
  transition: left 0.12s ease-out, top 0.12s ease-out, width 0.2s, height 0.2s, opacity 0.2s;
  opacity: 0.45;
}

/* ── TOAST ── */
.dash-toast, .admin-toast {
  position: fixed; bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: var(--white);
  padding: 14px 24px; border-radius: 8px;
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 400;
  box-shadow: 0 12px 40px rgba(26,23,20,0.2);
  z-index: 400000; opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), opacity 0.3s, background 0.4s;
  pointer-events: none;
}
.dash-toast.show, .admin-toast.show {
  transform: translateX(-50%) translateY(0); opacity: 1;
}
.dash-toast-icon, .admin-toast-icon {
  width: 20px; height: 20px; background: var(--accent);
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 11px; flex-shrink: 0;
}

/* ── EMPTY STATE BASE ── */
.empty-state {
  text-align: center; padding: 40px;
  color: var(--ink3); font-size: 14px; font-weight: 300;
  transition: color 0.4s;
}
.empty-icon {
  font-family: var(--mono); font-size: 24px;
  color: var(--border); display: block; margin-bottom: 12px;
}
.empty-text {
  font-family: var(--serif); font-size: 18px;
  color: var(--ink2); margin-bottom: 4px;
  transition: color 0.4s;
}
.empty-hint {
  font-size: 13px; color: var(--ink3); font-weight: 300;
  transition: color 0.4s;
}

/* ── LOADING ── */
.dash-loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px;
}
.dash-loading-spinner {
  width: 24px; height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CURSOR HIDE ── */
body { cursor: none; }
a, button, input, select, textarea, .tooltip-trigger, .theme-toggle,
.file-dropzone, .file-chip-remove, .dash-modal-close { cursor: none; }

/* ── IMAGE PREVIEW OVERLAY (shared: dashboard + admin) ── */
.img-preview-overlay {
  position: fixed; inset: 0; z-index: 300000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(26,23,20,0.85);
  backdrop-filter: blur(8px); padding: 20px;
}
.img-preview-box {
  max-width: min(900px, 90vw); max-height: 90vh;
  background: var(--white); border-radius: 12px;
  border: 1px solid var(--border); overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.3);
}
.img-preview-box img {
  width: 100%; height: auto; max-height: 70vh;
  object-fit: contain; display: block; background: var(--bg);
}
.img-preview-bar {
  padding: 14px 20px; background: var(--white);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.img-preview-name {
  font-family: var(--mono); font-size: 12px;
  color: var(--ink); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.img-preview-close {
  width: 32px; height: 32px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 50%;
  cursor: none; display: flex; align-items: center;
  justify-content: center; font-size: 14px; color: var(--ink2);
  transition: all 0.2s; flex-shrink: 0;
}
.img-preview-close:hover { background: var(--accent); color: white; }

/* Dark mode date input calendar icon */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}