/* ============================================
   Draig Goch BC - Admin Panel Styles
   ============================================ */

:root {
  --red:       #C8102E;
  --red-dark:  #8B0A1F;
  --bg:        #f4f4f5;
  --surface:   #ffffff;
  --border:    #e4e4e7;
  --text:      #18181b;
  --text-mute: #71717a;
  --green:     #16a34a;
  --amber:     #d97706;
  --danger:    #dc2626;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--red); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ===== LAYOUT ===== */
.admin-wrapper {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0a0a0a;
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  padding: 1.2rem 1.5rem;
  border-bottom: 2px solid var(--red);
  display: flex;
  align-items: center;
  gap: .7rem;
}
.sidebar-brand img { width: 32px; height: 32px; }
.sidebar-brand span {
  font-weight: 600;
  letter-spacing: 1px;
  font-size: .9rem;
}
.sidebar-section {
  color: #666;
  font-size: .7rem;
  letter-spacing: 1.5px;
  padding: 1rem 1.5rem .5rem;
  text-transform: uppercase;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1.5rem;
  color: #ccc;
  font-size: .9rem;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.sidebar a:hover { background: #1a1a1a; color: #fff; }
.sidebar a.active {
  background: #1a1a1a;
  color: #fff;
  border-left-color: var(--red);
}
.sidebar a svg {
  width: 18px; height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.sidebar-user {
  padding: 1rem 1.5rem;
  border-top: 1px solid #222;
  margin-top: 1rem;
}
.sidebar-user small { color: #666; font-size: .75rem; display: block; }
.sidebar-user strong { color: #fff; font-size: .85rem; }
.sidebar-user button {
  margin-top: .5rem;
  background: transparent;
  border: 1px solid #333;
  color: #ccc;
  padding: .4rem .8rem;
  border-radius: 4px;
  font-size: .8rem;
  cursor: pointer;
  width: 100%;
}
.sidebar-user button:hover { background: var(--red); border-color: var(--red); color: #fff; }
.badge-count {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  padding: 1px 8px;
  border-radius: 999px;
}

/* ===== MAIN ===== */
.main {
  padding: 2rem;
  overflow-x: hidden;
}
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.main-header h1 {
  font-size: 1.6rem;
  font-weight: 600;
}
.main-header .subtitle { color: var(--text-mute); font-size: .9rem; margin-top: .2rem; }

/* ===== CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem;
}
.stat-card .label {
  color: var(--text-mute);
  font-size: .75rem;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.stat-card .value {
  font-size: 1.8rem;
  font-weight: 600;
  margin-top: .3rem;
}
.stat-card.alert {
  background: #fef2f2;
  border-color: #fecaca;
}
.stat-card.alert .label,
.stat-card.alert .value { color: var(--danger); }

.surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.surface-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.surface-header h2 { font-size: 1.1rem; font-weight: 600; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  transition: all .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }

/* ===== TABLES ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
.table th {
  text-align: left;
  padding: .7rem .8rem;
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-mute);
  border-bottom: 1px solid var(--border);
}
.table td {
  padding: .8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:hover { background: var(--bg); }
.table .actions {
  display: flex; gap: .3rem; justify-content: flex-end;
}
.table img.thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

.pill {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .3px;
}
.pill-new      { background: #fef2f2; color: var(--danger); }
.pill-contacted{ background: #fef3c7; color: var(--amber); }
.pill-booked   { background: #dbeafe; color: #1d4ed8; }
.pill-attended { background: #dcfce7; color: var(--green); }
.pill-active   { background: #dcfce7; color: var(--green); }
.pill-inactive { background: #f3f4f6; color: var(--text-mute); }
.pill-win      { background: #dcfce7; color: var(--green); }
.pill-loss     { background: #fef2f2; color: var(--danger); }
.pill-draw     { background: #fef3c7; color: var(--amber); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  margin-bottom: .35rem;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .55rem .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .9rem;
  font-family: inherit;
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(200,16,46,.1);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-actions {
  display: flex; gap: .5rem; justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.checkbox-row input[type="checkbox"] { width: auto; }

/* ===== LOGIN PAGE ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a url('../images/logo.png') center / 400px no-repeat;
  padding: 2rem;
}
.login-wrap::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.85);
}
.login-card {
  position: relative;
  background: #fff;
  padding: 2.5rem;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 30px 60px rgba(0,0,0,.5);
}
.login-card .logo {
  text-align: center;
  margin-bottom: 1.5rem;
}
.login-card .logo img { width: 70px; margin: 0 auto .8rem; }
.login-card h1 {
  text-align: center;
  font-size: 1.3rem;
  margin-bottom: .3rem;
}
.login-card .subtitle {
  text-align: center;
  color: var(--text-mute);
  font-size: .85rem;
  margin-bottom: 1.5rem;
}
.login-card .btn-primary { width: 100%; justify-content: center; padding: .8rem; }

/* ===== MODAL ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border-radius: 10px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 600; }
.modal-header button {
  background: none; border: none;
  font-size: 1.5rem;
  color: var(--text-mute);
  cursor: pointer;
}
.modal-body { padding: 1.5rem; }

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-mute);
}

.toast {
  position: fixed;
  top: 1.5rem; right: 1.5rem;
  background: var(--text);
  color: #fff;
  padding: .8rem 1.2rem;
  border-radius: 6px;
  font-size: .85rem;
  z-index: 9999;
  animation: slideIn .25s;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--green); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 800px) {
  .admin-wrapper { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .form-row { grid-template-columns: 1fr; }
  .main { padding: 1rem; }
}
