/* ===== TOKENS ===== */
:root {
  /* Base */
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #261f74;
  --surface-3: #f8fafc;
  /* Borders */
  --border: #2e323c;
  --border-light: #3a3f4a;

  /* Text */
  /* --text: #36416f; */
  --text-muted: #36416f;
  --text-dim: #36416f;
  --text-titel: #f8fafc;

  /* Accent (Canva-style purple/blue) */
  --accent: #6c5ce7;
  --accent-hover: #5a4bd1;
  --accent-dim: rgba(108, 92, 231, 0.12);
  --accent-border: rgba(108, 92, 231, 0.35);

  /* States */
  --danger: #ff5c5c;
  --success: #22c55e;

  /* Radius */
  --radius: 8px;
  --radius-lg: 14px;

  /* Typography */
  --mono: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --display: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";

  /* Shadows (very important for Canva feel) */
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.2);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.25);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.35);

  /* Glass effect */
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.06);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  min-height: 100vh;
  line-height: 1.5;
}

/* ===== UTILS ===== */
.hidden { display: none !important; }

/* ===== HEADER ===== */
.app-header {
  color: var(--text-titel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: #0e0e0f;
  font-family: var(--display);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.app-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--text);
}

/* ===== BUTTONS ===== */
.btn-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-title);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color 0.15s, color 0.15s;
}
.btn-settings:hover { border-color: var(--border-light); color: var(--text); }

.btn-primary {
  padding: 9px 18px;
  background: var(--accent);
  color: #0e0e0f;
  border: none;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  transition: opacity 0.15s, transform 0.1s;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--surface-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
.btn-secondary:hover { background: var(--surface-3); color: var(--text); }

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.15s, border-color 0.15s;
}
.btn-back:hover { color: var(--text); border-color: var(--border-light); }

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}
.btn-icon:hover { color: var(--text); background: var(--surface-3); }

/* ===== MAIN ===== */
.app-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 28px 64px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.breadcrumb-event {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.breadcrumb-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.breadcrumb-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== EVENTS GRID ===== */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
  position: relative;
  overflow: hidden;
}
.event-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
}
.event-card:hover { background: var(--surface-3); border-color: var(--border-light); transform: translateY(-2px); }
.event-card:hover::before { opacity: 1; }

.event-card-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.event-card-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.event-card-date {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
}

.event-card-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-family: var(--mono);
  margin-top: 4px;
}
.event-card-status.open { color: #6aff6a; }
.event-card-status.closed { color: var(--text-dim); }
.event-card-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.event-card-arrow {
  position: absolute;
  bottom: 16px; right: 16px;
  color: var(--text-dim);
  font-size: 18px;
  transition: color 0.15s, transform 0.15s;
}
.event-card:hover .event-card-arrow { color: var(--accent); transform: translateX(3px); }

/* ===== PRICE GROUPS ===== */
.price-group {
  margin-bottom: 32px;
}

.price-group-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.price-group-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.price-group-count {
  font-size: 11px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.persons-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.person-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  display: flex;
  flex-direction: column;
  gap: 4px;
    position: relative;
  overflow: hidden;
}
.person-card:hover { background: var(--surface-2); border-color: var(--accent-border); }

.person-card-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.person-card-email {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== PERSON DETAIL ===== */
.person-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 500px) {
  .person-fields { grid-template-columns: 1fr; }
}

.person-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.person-field-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.person-field-value {
  font-size: 13px;
  color: var(--text);
  font-family: var(--mono);
  word-break: break-word;
}

.person-field-value.accent {
  color: var(--accent);
  font-weight: 500;
}

.person-field.full-width {
  grid-column: 1 / -1;
}

/* ===== MODALS ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.15s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  animation: slide-up 0.18s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide { max-width: 620px; }

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

.modal-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  padding: 14px 20px 18px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.field-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 6px;
}

.text-input {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.text-input:focus { border-color: var(--accent-border); }
.text-input::placeholder { color: var(--text-dim); }

.modal-hint {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  line-height: 1.6;
}
.modal-hint code {
  color: var(--accent);
  font-family: var(--mono);
}

/* ===== STATES ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon { font-size: 40px; margin-bottom: 8px; }

.empty-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}

.empty-sub {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 340px;
  line-height: 1.6;
  margin-bottom: 8px;
}

.loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-state {
  text-align: center;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.error-icon { font-size: 32px; color: var(--danger); }

.error-msg {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 380px;
  line-height: 1.6;
  font-family: var(--mono);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .app-header { padding: 12px 16px; }
  .app-main { padding: 20px 16px 48px; }
  .events-grid { grid-template-columns: 1fr; }
  .persons-list { grid-template-columns: 1fr 1fr; }
}
