/* ========== Base Reset ========== */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

:root{
  --bg: #f9f9f9;
  --text: #333;
  --heading: #2c3e50;
  --link: #2980b9;
  --link-hover: #3498db;
  --panel-bg: #fff;
  --panel-shadow: 0 0 5px #ccc;
  --border: #e6e6e6;
  --muted: #666;
  --accent: #2980b9;
}

/* ========== Layout ========== */
body{
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);

  /* Center everything site-wide, no HTML changes needed */
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 16px;
}

/* widen on large displays */
@media (min-width: 1440px){ body{ max-width: 1320px; } }
@media (min-width: 1680px){ body{ max-width: 1440px; } }

h2, h3{
  color: var(--heading);
  margin-top: 0;
}

a{ color: var(--link); text-decoration: none; }
a:hover{ text-decoration: underline; color: var(--link-hover); }

/* ========== Panels / Cards ========== */
.panel,
.card{
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  border-radius: 6px;
  padding: 15px 20px;
  margin: 15px 0 25px;
}

/* ========== Meta / Badges / Titles ========== */
.meta{ color: #666; font-size: .95rem; margin-bottom: 10px; }

.badge{
  display: inline-block;
  padding: 2px 8px;
  font-size: .85rem;
  border-radius: 999px;
  background: #eef3ff;
  border: 1px solid #d7e3ff;
  color: #285eac;
  vertical-align: middle;
}

.section-title{
  font-size: 1.1rem;
  color: var(--heading);
  margin: 0 0 10px 0;
  font-weight: bold;
}

.divider{ height:1px; background: var(--border); margin:12px 0 18px; border:0; }

/* ========== Tables ========== */
table{
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  box-shadow: var(--panel-shadow);
  border-radius: 6px;
  overflow: hidden;
}

th, td{
  padding: 10px;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

th{
  background-color: var(--accent);
  color: #fff;
}

tr:hover{ background-color: #f1f1f1; }

/* Table responsiveness (smaller paddings on narrow screens) */
@media (max-width: 720px){
  th, td{ padding: 8px; }
  table{ font-size: .95rem; }
}

/* Utility cells often used in admin pages */
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
td.small { font-size: .92rem; vertical-align: top; }

/* ========== Forms & Inputs ========== */
.stacked label{
  display: block;
  margin-bottom: 12px;
  font-weight: bold;
  color: var(--heading);
}
.stacked input[type="text"],
.stacked textarea{ margin-top: 6px; }

.form-row{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px){
  .form-row--two{ grid-template-columns: 1fr 1fr; }
}

label.form-label{
  font-weight: bold;
  color: var(--heading);
  display: block;
  margin-bottom: 6px;
}

.helper-text{ color: #666; font-size: .9rem; margin-top: 4px; }

/* unified input look */
input[type="text"].input,
input[type="password"].input,
input[type="email"].input,
input[type="number"].input,
input[type="datetime-local"].input,
textarea.input,
select.input{
  width: 100%;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
  background: #fff;
}

/* File input tweak */
input[type="file"].file-input{
  display:block;
  margin-top:6px;
  font-size:.95rem;
}

/* ========== Buttons / Actions ========== */
.actions{ display:flex; gap:10px; margin-top:8px; flex-wrap: wrap; }
button,
.button{
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  font-size: 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background .2s ease;
  display: inline-block;
  text-align: center;
  line-height: 1.2;
}
button:hover,
.button:hover{ background: var(--link-hover); }

/* disabled pager buttons (added by some pages) */
.pager a.button[disabled]{ pointer-events:none; opacity:.5; }

/* ========== Messages ========== */
.msg{
  padding: 10px 12px;
  border-radius: 4px;
  margin: 10px 0 15px;
  font-size: .95rem;
  background: #eef3ff;
  color: #1f4b99;
  border: 1px solid #d7e3ff;
}
.msg.success{
  background:#e9f7ef; color:#1e7e34; border:1px solid #c7eed8;
}
.msg.error{
  background:#fdecea; color:#a71d2a; border:1px solid #f5c6cb;
}

/* ========== Tags / Badges used in events ========== */
.tag{
  display:inline-block;
  padding:0 6px;
  border-radius:10px;
  background:#e8f1ff;
  color:#1f4b99;
  font-size:11px;
  line-height:18px;
  margin-left:6px;
}
.tag--you{ background:#eaf9ef; color:#167c36; font-weight:600; }
.tag--npc{ background:#f3f0ff; color:#5a39a2; }

/* “+N” compact burst badge for grouped events */
.count-badge{
  display:inline-block;
  margin-left:6px;
  padding:0 6px;
  border-radius:10px;
  background:#eef3fa;
  color:#2c3e50;
  font-size:12px;
  line-height:18px;
}

/* small note under tables */
.table-note{ font-size:12px; color:#6b7b8a; margin:6px 0 0; }

/* ========== Ticket & Comment Blocks ========== */
.ticket-description,
.comment{
  background:#fff;
  padding:15px;
  border-radius:5px;
  box-shadow: 0 0 3px #ccc;
  margin-bottom:15px;
}

/* comment attachments (from ticket_view.php) */
.comment-files img{
  border:1px solid #ccc;
  border-radius:4px;
  max-width:200px;
  max-height:200px;
  margin:5px;
}
.comment-files a{ margin-right:10px; display:inline-block; }

/* ========== Map bits (admin_stats.php) ========== */
#mapwrap{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:8px;
  padding:10px;
}
canvas#evmap{ width:100%; height:100%; display:block; }
.legend{ display:flex; gap:10px; flex-wrap:wrap; margin-top:6px; }
.legend span{ display:inline-flex; align-items:center; gap:6px; }
.dot{ width:10px; height:10px; border-radius:50%; display:inline-block; }

/* ========== Loader Overlay (used by signup/login) ========== */
.page-loader{
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.8);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(2px);
}
.page-loader.hidden{ display: none; }
.page-loader .spinner{
  width: 56px; height: 56px;
  border: 6px solid #e6eef6;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .9s linear infinite;
  box-shadow: 0 0 5px rgba(0,0,0,.05) inset;
}
.page-loader .loading-text{
  margin-top: 12px;
  font-weight: 600; color: var(--heading);
  letter-spacing: .3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

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