/* ═══════════════════════════════════════════════════════
   ADMIRALS BOWLING — ADMIN PANEL STYLES
   Brand: #5E1725 (maroon) | #3B3B3B (charcoal) | #EDEDED (light)
   ═══════════════════════════════════════════════════════ */

:root {
  --maroon:       #5E1725;
  --maroon-dark:  #4a1020;
  --maroon-light: rgba(94,23,37,0.08);
  --charcoal:     #3B3B3B;
  --charcoal-dk:  #2a2a2a;
  --ash:          #EDEDED;
  --ash-dk:       #e0e0e0;
  --white:        #FFFFFF;
  --border:       rgba(94,23,37,0.2);
  --border-light: rgba(0,0,0,0.08);
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg:    0 8px 28px rgba(0,0,0,0.15);
  --radius:       8px;
  --radius-sm:    4px;
  --radius-lg:    12px;
  --font:         'Alata', sans-serif;
  --transition:   0.18s ease;
}

*, *::before, *::after { box-sizing: border-box; }

/* ── LAYOUT OVERRIDES ── */
body { background: #f0ecea; }

#wrapper {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0 !important;
  min-height: 100vh;
}

#main {
  border-radius: 0 !important;
  min-height: 100vh;
  width: 100%;
  max-width: 100% !important;
  background: #f0ecea;
  display: block !important;
}

#main > .inner {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  --spacing: 0 !important;
}

/* ── ADMIN TOP BAR ── */
.adm-topbar {
  background: var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.adm-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.adm-topbar-brand img { height: 32px; width: auto; }

.adm-topbar-brand span {
  color: var(--white);
  font-family: var(--font);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.85;
}

.adm-topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.adm-topbar-nav a {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-family: var(--font);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.adm-topbar-nav a:hover,
.adm-topbar-nav a.active {
  color: var(--white);
  background: rgba(255,255,255,0.1);
}

.adm-topbar-nav a.adm-logout {
  color: rgba(255,150,150,0.8);
  margin-left: 0.5rem;
  border: 1px solid rgba(255,150,150,0.3);
}

.adm-topbar-nav a.adm-logout:hover {
  background: rgba(255,100,100,0.15);
  color: #ff9999;
}

/* ── PAGE BODY ── */
.adm-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── PAGE HEADER ── */
.adm-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.adm-page-title {
  font-family: var(--font);
  font-size: 1.5rem;
  color: var(--charcoal);
  font-weight: 400;
  margin: 0;
}

/* ── SECTION CARD ── */
.adm-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.adm-card-header {
  background: var(--maroon);
  color: var(--white);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.adm-card-header h3 {
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
  opacity: 0.95;
}

.adm-card-body {
  padding: 1.25rem;
}

/* ── ADD FORM (collapsible) ── */
.adm-add-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--maroon);
  color: var(--white);
  border: none;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.adm-add-toggle:hover { background: var(--maroon-dark); color: var(--white); }
.adm-add-toggle svg { width: 14px; height: 14px; fill: currentColor; }

.adm-collapse {
  display: none;
  animation: slideDown 0.2s ease;
}
.adm-collapse.open { display: block; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── FORM GRID ── */
.adm-form { display: block; }

.adm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
}
.adm-form-grid .adm-field-full { grid-column: 1 / -1; }

.adm-field { display: flex; flex-direction: column; gap: 0.3rem; }

.adm-field label {
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--charcoal);
  opacity: 0.7;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.adm-field input[type="text"],
.adm-field input[type="email"],
.adm-field input[type="url"],
.adm-field input[type="date"],
.adm-field input[type="time"],
.adm-field input[type="number"],
.adm-field input[type="password"],
.adm-field select,
.adm-field textarea {
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--charcoal);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
  appearance: none;
}

.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus {
  border-color: var(--maroon);
  box-shadow: 0 0 0 3px var(--maroon-light);
}

.adm-field textarea { height: 7rem; resize: vertical; line-height: 1.5; }

.adm-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%235E1725'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

.adm-field input[type="file"] {
  font-family: var(--font);
  font-size: 0.85rem;
  color: var(--charcoal);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  background: var(--maroon-light);
  cursor: pointer;
  width: 100%;
}

.adm-field-hint {
  font-size: 0.75rem;
  color: var(--charcoal);
  opacity: 0.55;
  margin-top: 0.15rem;
}

/* ── BUTTONS ── */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}
.adm-btn svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }

.adm-btn-primary  { background: var(--maroon); color: var(--white); }
.adm-btn-primary:hover { background: var(--maroon-dark); color: var(--white); }

.adm-btn-secondary { background: var(--charcoal); color: var(--white); }
.adm-btn-secondary:hover { background: var(--charcoal-dk); color: var(--white); }

.adm-btn-ghost {
  background: transparent;
  color: var(--charcoal);
  border: 1.5px solid var(--ash-dk);
}
.adm-btn-ghost:hover { background: var(--ash); border-color: var(--charcoal); }

.adm-btn-danger { background: #c0392b; color: var(--white); }
.adm-btn-danger:hover { background: #a93226; color: var(--white); }

.adm-btn-danger-ghost {
  background: transparent;
  color: #c0392b;
  border: 1.5px solid rgba(192,57,43,0.3);
}
.adm-btn-danger-ghost:hover { background: rgba(192,57,43,0.08); }

.adm-btn-sm { padding: 0.3rem 0.6rem; font-size: 0.78rem; }

.adm-form-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-top: 0.75rem;
  margin-top: 0.5rem;
  border-top: 1px solid var(--ash-dk);
  flex-wrap: wrap;
}

/* ── DATA TABLE ── */
.adm-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font);
  font-size: 0.875rem;
}

.adm-table thead th {
  background: var(--ash);
  color: var(--charcoal);
  font-weight: 400;
  text-align: left;
  padding: 0.65rem 0.9rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}

.adm-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.adm-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }

.adm-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition);
}
.adm-table tbody tr:last-child { border-bottom: none; }
.adm-table tbody tr:hover { background: rgba(94,23,37,0.03); }
.adm-table tbody tr.selected { background: rgba(94,23,37,0.07); }

.adm-table td {
  padding: 0.6rem 0.9rem;
  color: var(--charcoal);
  vertical-align: middle;
}

.adm-table td.adm-td-actions {
  white-space: nowrap;
  text-align: right;
}

.adm-table td.adm-td-check { width: 36px; padding-right: 0; }

/* ── CHECKBOXES ── */
.adm-check {
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--maroon);
}

/* ── BADGE / TYPE TAG ── */
.adm-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-family: var(--font);
  font-weight: 400;
  white-space: nowrap;
}
.adm-badge-general    { background: #e8f4fd; color: #2980b9; }
.adm-badge-tournament { background: #fef9e7; color: #d68910; }
.adm-badge-practice   { background: #eafaf1; color: #1e8449; }
.adm-badge-match      { background: #fdf2f8; color: #8e44ad; }
.adm-badge-default    { background: var(--ash); color: var(--charcoal); }
.adm-badge-student    { background: #e8f4fd; color: #2980b9; }
.adm-badge-coach      { background: #fef9e7; color: #d68910; }

/* ── BULK ACTION BAR ── */
.adm-bulk-bar {
  display: none;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--charcoal);
  color: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-family: var(--font);
  font-size: 0.85rem;
  animation: slideDown 0.15s ease;
}
.adm-bulk-bar.active { display: flex; }
.adm-bulk-bar span { flex: 1; opacity: 0.85; }

/* ── INLINE EDIT ROW ── */
.adm-edit-row { display: none; }
.adm-edit-row.open { display: table-row; }

.adm-edit-panel {
  background: var(--maroon-light);
  border-top: 2px solid var(--maroon);
  padding: 1.25rem;
}

/* ── THUMBNAIL ── */
.adm-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  vertical-align: middle;
}

.adm-thumb-sm {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  vertical-align: middle;
}

/* ── MEDIA GRID (existing images in edit panel) ── */
.adm-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.adm-media-item {
  position: relative;
  display: inline-block;
}

.adm-media-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  display: block;
}

.adm-media-item video {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  display: block;
  background: #000;
}

.adm-media-del {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  background: #c0392b;
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background var(--transition);
}
.adm-media-del:hover { background: #a93226; }

/* ── NOTICE/MESSAGE ── */
.adm-notice {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.adm-notice-success { background: #eafaf1; color: #1e8449; border-color: #27ae60; }
.adm-notice-error   { background: #fdedec; color: #c0392b; border-color: #e74c3c; }
.adm-notice-info    { background: #eaf4fd; color: #2471a3; border-color: #2980b9; }

/* ── DASHBOARD WIDGETS ── */
.adm-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.adm-stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.adm-stat-num {
  font-family: var(--font);
  font-size: 2rem;
  color: var(--maroon);
  line-height: 1;
}
.adm-stat-label {
  font-family: var(--font);
  font-size: 0.78rem;
  color: var(--charcoal);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.3rem;
}

.adm-dash-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.adm-dash-link {
  background: var(--maroon);
  color: var(--white) !important;
  text-decoration: none;
  padding: 1rem;
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--font);
  font-size: 0.88rem;
  transition: background var(--transition), transform var(--transition);
  display: block;
}
.adm-dash-link:hover {
  background: var(--maroon-dark);
  transform: translateY(-1px);
  color: var(--white) !important;
}
.adm-dash-link.alt {
  background: var(--charcoal);
}
.adm-dash-link.alt:hover { background: var(--charcoal-dk); }

/* ── UPLOAD PREVIEW ── */
.adm-file-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.adm-file-preview .preview-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── SELECT-ALL HEADER CHECK ── */
th .adm-check { display: block; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .adm-topbar-nav a { padding: 0.3rem 0.5rem; font-size: 0.76rem; }
  .adm-topbar-brand span { display: none; }
  .adm-form-grid { grid-template-columns: 1fr; }
  .adm-form-grid .adm-field-full { grid-column: 1; }
  .adm-table thead { display: none; }
  .adm-table tr { display: block; padding: 0.75rem; border-bottom: 2px solid var(--border-light); }
  .adm-table td { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; border: none; }
  .adm-table td::before {
    content: attr(data-label);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.5;
    min-width: 80px;
  }
  .adm-table td.adm-td-actions { justify-content: flex-end; }
  .adm-table td.adm-td-check { display: none; }
  .adm-body { padding: 1rem; }
}
