:root {
  --bg: #000000;
  --card: #10182a;
  --card-border: #223258;
  --text: #f4f6fa;
  --muted: #93a1bf;
  --accent: #0d4aa1;
  --accent-hover: #1558bc;
  --danger: #e05555;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* .hidden lives inline in index.html's <head> — it must apply even if this
   file never loads. Don't redefine it here. */

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: var(--radius);
}

input, textarea {
  font-family: inherit;
  font-size: 16px; /* avoid iOS zoom-on-focus */
  background: #0a0e18;
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  width: 100%;
}

input:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.9rem;
  color: var(--muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
}
.checkbox-label input { width: auto; }

/* PIN screen */
#pin-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.pin-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%;
  max-width: 320px;
  text-align: center;
}

.pin-card h1 { font-size: 1.4rem; margin: 0 0 8px; letter-spacing: 0.02em; }

#pin-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 1.4rem;
  margin: 16px 0;
}

.primary-btn {
  background: var(--accent);
  color: white;
  padding: 14px 18px;
  font-size: 1rem;
  font-weight: 700;
  width: 100%;
}
.primary-btn:hover { background: var(--accent-hover); }

.secondary-btn {
  background: #1c2740;
  color: var(--text);
  padding: 14px 18px;
  font-size: 1rem;
  width: 100%;
}

.link-btn {
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: underline;
  padding: 4px;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-top: 10px;
}

/* App shell */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--card-border);
  background: var(--card);
  position: sticky;
  top: 0;
  z-index: 5;
}

header h1 {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.3;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.add-btn {
  width: auto;
  white-space: nowrap;
  padding: 12px 16px;
}

.toolbar .secondary-btn {
  width: auto;
  white-space: nowrap;
  padding: 12px 16px;
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.event-main { min-width: 0; }

.event-date {
  font-size: 0.85rem;
  color: var(--accent-hover);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.event-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-top: 2px;
  word-break: break-word;
}

.event-time {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.event-notes {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 30px 10px;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 10;
}

.modal-content {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

@media (min-width: 560px) {
  .modal { align-items: center; }
  .modal-content { border-radius: var(--radius); }
}

.modal-content h2 { margin-top: 0; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

/* Print view is built from the same data but kept out of the screen layout
   entirely, so screen and print never fight over the same DOM styling. */
.print-only {
  display: none;
}

@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  main {
    max-width: none;
    padding: 0;
  }

  .print-only {
    display: block;
  }

  .print-title {
    font-size: 1.3rem;
    margin: 0 0 16px;
  }

  .print-table {
    width: 100%;
    border-collapse: collapse;
  }

  .print-table th,
  .print-table td {
    border: 1px solid #999999;
    padding: 8px 10px;
    text-align: left;
    font-size: 0.9rem;
  }

  .print-table th {
    background: #eeeeee;
  }
}
