/*
 * sk8info Modern Design System
 * Drop-in replacement for the old table-based border image frames.
 *
 * Usage:
 *   Replace all <table border>/<img bdr_*> frame includes with:
 *     <div class="sk8-card"> ... </div>
 *
 *   Replace old hdr_bg.png button style with class="sk8-btn"
 *   Replace old inline table cells with class="sk8-table"
 *   Replace the title include with <header class="sk8-header">
 */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,400&display=swap');

/* ─── Reset & tokens ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --rink:       #1a5c2a;  /* Skate Australia green */
  --rink-dark:  #0d2e14;  /* deep forest green */
  --ice:        #f5f0d8;  /* warm gold tint */
  --ice-mid:    #c9a227;  /* gold */
  --ice-light:  #faf7e8;  /* pale gold */
  --blade:      #e2ca7a;  /* light gold */
  --white:      #ffffff;

  --text-main:  #0d2314;
  --text-muted: #3d6648;
  --text-light: #7aaa88;

  --border:     rgba(26, 92, 42, 0.13);
  --border-mid: rgba(26, 92, 42, 0.22);

  --status-ok:      #1a7a50;
  --status-ok-bg:   #e2f5ec;
  --status-warn:    #8a5c00;
  --status-warn-bg: #fff8e1;
  --status-err:     #b83225;
  --status-err-bg:  #fdecea;
  --status-pend:    #1a5fa0;
  --status-pend-bg: #e3f0fc;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 4px rgba(26,92,42,0.08);
  --shadow-md: 0 4px 16px rgba(26,92,42,0.1);

  --font-heading: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --sidebar-w: 240px;
}

html, body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
  background: #f2f5ef;
  min-height: 100vh;
}

/* ─── Layout shell ───────────────────────────────────────── */
.sk8-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ─── Header / Title bar ─────────────────────────────────── */
.sk8-header {
  grid-column: 1 / -1;
  background: var(--rink-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
  height: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.sk8-header__brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: var(--white);
  text-decoration: none;
}

.sk8-header__brand span { color: var(--ice-mid); }

.sk8-header__divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.12);
}

.sk8-header__user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--blade);
}

.sk8-header__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(160,216,240,0.2);
  border: 1px solid rgba(160,216,240,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ice-mid);
  flex-shrink: 0;
}

.sk8-header__date {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-light);
  letter-spacing: 0.01em;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.sk8-sidebar {
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sk8-sidebar__label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-light);
  padding: 0 1.25rem;
  margin: 1rem 0 0.25rem;
}

.sk8-sidebar form { display: block; width: 100%; }

.sk8-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
  width: 100%;
  background: none;
  border-top: none;
  border-right: none;
  border-bottom: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
}

.sk8-nav-link:hover {
  background: var(--ice-light);
  color: var(--rink);
}

.sk8-nav-link.active {
  background: var(--ice-light);
  color: var(--rink);
  border-left-color: var(--ice-mid);
  font-weight: 500;
}

.sk8-nav-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.65;
}

.sk8-nav-link.active svg,
.sk8-nav-link:hover svg { opacity: 1; }

/* ─── Main content area ──────────────────────────────────── */
.sk8-main {
  padding: 2rem;
  overflow-y: auto;
}

/* ─── Card (replaces old border-image frame tables) ──────── */
.sk8-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.sk8-card__title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--rink);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
}

/* ─── Filters bar ────────────────────────────────────────── */
.sk8-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.sk8-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.sk8-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ─── Form controls ──────────────────────────────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-main);
  background: var(--ice-light);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  border-color: var(--ice-mid);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

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='%233d6648'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 2rem;
}

/* ─── Buttons ────────────────────────────────────────────── */
.sk8-btn,
input[type="submit"].sk8-btn {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.5rem 1.2rem;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.sk8-btn:active { transform: scale(0.97); }

/* Primary */
.sk8-btn,
.sk8-btn--primary {
  background: var(--rink);
  color: var(--white);
  border-color: var(--rink);
}
.sk8-btn:hover,
.sk8-btn--primary:hover {
  background: #0c4d87;
  box-shadow: var(--shadow-sm);
}

/* Secondary */
.sk8-btn--secondary {
  background: var(--ice-light);
  color: var(--rink);
  border-color: var(--border-mid);
}
.sk8-btn--secondary:hover {
  background: var(--blade);
}

/* Danger */
.sk8-btn--danger {
  background: var(--status-err-bg);
  color: var(--status-err);
  border-color: rgba(184, 50, 37, 0.2);
}
.sk8-btn--danger:hover { background: #fbd6d4; }

/* Button row */
.sk8-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 1rem;
}

/* ─── Data table ─────────────────────────────────────────── */
.sk8-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.sk8-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.sk8-table th {
  background: #eef4ec;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.sk8-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  vertical-align: middle;
}

.sk8-table tr:last-child td { border-bottom: none; }
.sk8-table tr:hover td { background: #f6faf4; }

/* ─── Status badges ──────────────────────────────────────── */
.sk8-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.6;
}

.sk8-badge--approved { background: var(--status-ok-bg);   color: var(--status-ok); }
.sk8-badge--pending  { background: var(--status-pend-bg); color: var(--status-pend); }
.sk8-badge--denied   { background: var(--status-err-bg);  color: var(--status-err); }
.sk8-badge--updated  { background: var(--status-warn-bg); color: var(--status-warn); }
.sk8-badge--inactive { background: #f0f2f5; color: #5a6877; }

/* ─── Expiry date colouring ──────────────────────────────── */
.sk8-exp--expired  { color: var(--status-err);  font-weight: 500; }
.sk8-exp--expiring { color: var(--status-warn); font-weight: 500; }
.sk8-exp--ok       { color: var(--status-ok); }
.sk8-exp--pending  { color: var(--status-pend); font-style: italic; }

/* ─── Accreditation grid ─────────────────────────────────── */
.sk8-accred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.sk8-accred-item {
  background: var(--ice-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}

.sk8-accred-item__label {
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sk8-accred-item__date {
  font-size: 0.9rem;
  font-weight: 500;
}

/* ─── Form layout ────────────────────────────────────────── */
.sk8-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 16px;
}

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

.sk8-form-field label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Alert / error boxes ────────────────────────────────── */
.sk8-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.sk8-alert--error   { background: var(--status-err-bg);  color: var(--status-err);  border: 1px solid rgba(184,50,37,0.2); }
.sk8-alert--success { background: var(--status-ok-bg);   color: var(--status-ok);   border: 1px solid rgba(26,122,80,0.2); }
.sk8-alert--info    { background: var(--status-pend-bg); color: var(--status-pend); border: 1px solid rgba(26,95,160,0.2); }

/* ─── Section heading ────────────────────────────────────── */
.sk8-section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--rink);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}

/* ─── Helper ─────────────────────────────────────────────── */
.sk8-muted { color: var(--text-muted); }
.sk8-small { font-size: 0.82rem; }
.sk8-center { text-align: center; }
.sk8-mt { margin-top: 1rem; }

/* ─── Print ──────────────────────────────────────────────── */
@media print {
  .sk8-sidebar, .sk8-header { display: none; }
  .sk8-main { padding: 0; }
  .sk8-card { box-shadow: none; border: 1px solid #ccc; }
}

/* ─── Mobile nav drawer ──────────────────────────────────── */
.sk8-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: var(--white);
  flex-shrink: 0;
}
.sk8-hamburger svg { display: block; }

.sk8-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
}
.sk8-drawer-overlay.open { display: block; }

.sk8-drawer {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--white);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
  overflow-y: auto;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}
.sk8-drawer.open { transform: translateX(0); }

.sk8-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.sk8-drawer__brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.03em;
  color: var(--rink-dark);
  text-decoration: none;
}
.sk8-drawer__brand span { color: var(--ice-mid); }

.sk8-drawer__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* prevent horizontal overflow */
  html, body { overflow-x: hidden; max-width: 100vw; }

  .sk8-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  /* sidebar hidden on mobile — use drawer instead */
  .sk8-sidebar { display: none; }

  /* header: show hamburger, hide date on small screens */
  .sk8-hamburger { display: flex; align-items: center; }
  .sk8-header__date { display: none; }
  .sk8-header { gap: 0.75rem; padding: 0 1rem; }
  .sk8-header__user span { display: none; } /* hide name/state/privs, keep avatar */

  .sk8-main { padding: 0.875rem; overflow-x: hidden; }
  .sk8-card { padding: 0.875rem; }
  .sk8-card__title { font-size: 0.92rem; }

  .sk8-filters { flex-direction: column; }
  .sk8-filter-group { min-width: 0; width: 100%; }

  .sk8-accred-grid { grid-template-columns: 1fr 1fr; }
  .sk8-form-grid { grid-template-columns: 1fr; }

  /* tables scroll horizontally inside their wrapper */
  .sk8-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .sk8-table { min-width: 480px; }

  /* btn rows wrap nicely */
  .sk8-btn-row { flex-wrap: wrap; }
  .sk8-btn { font-size: 0.85rem; padding: 0.45rem 1rem; }
}

@media (max-width: 400px) {
  .sk8-accred-grid { grid-template-columns: 1fr; }
  .sk8-section-title { font-size: 1.1rem; }
}

/* ─── Login page ─────────────────────────────────────────── */
.sk8-login-bg {
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 105%, #1a6b30 0%, transparent 55%),
    radial-gradient(ellipse 90% 70% at 50% -10%, #0d2e14 0%, transparent 50%),
    linear-gradient(180deg, #0a1a0d 0%, #122b18 45%, #1a4022 100%);
}
.sk8-login-bg::before {
  content:''; position:absolute; inset:0;
  background-image:
    repeating-linear-gradient(90deg,  transparent 0, transparent 119px, rgba(255,255,255,.025) 119px, rgba(255,255,255,.025) 120px),
    repeating-linear-gradient(180deg, transparent 0, transparent 89px,  rgba(255,255,255,.02) 89px,  rgba(255,255,255,.02) 90px);
}
.sk8-login-page {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem 1.25rem; gap: 1.5rem;
}
.sk8-login-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  animation: sk8up .55s ease both;
}
.sk8-login-brand {
  font-family: var(--font-heading);
  font-weight: 800; font-size: 2rem;
  letter-spacing: -.04em; color: var(--white); line-height: 1;
}
.sk8-login-brand span { color: var(--ice-mid); }
.sk8-login-card {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  padding: 2.25rem 2.5rem;
  width: 100%; max-width: 400px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: sk8up .6s .05s ease both;
}
@keyframes sk8up {
  from { opacity:0; transform: translateY(20px); }
  to   { opacity:1; transform: translateY(0); }
}
.sk8-login-title {
  font-family: var(--font-heading);
  font-weight: 700; font-size: 1.15rem;
  letter-spacing: -.02em; color: var(--white);
  margin-bottom: 1.5rem;
}
.sk8-login-title small {
  display: block; font-family: var(--font-body);
  font-weight: 400; font-size: .8rem;
  color: var(--text-light); letter-spacing: 0; margin-top: 3px;
}
.sk8-login-alert {
  background: rgba(184,50,37,.15);
  border: 1px solid rgba(184,50,37,.3);
  color: #ffb0a8; border-radius: 8px;
  padding: .6rem .9rem; font-size: .85rem;
  margin-bottom: 1.25rem;
  display: flex; gap: 8px; align-items: flex-start;
}
.sk8-login-field {
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 1rem;
}
.sk8-login-field label {
  font-size: .75rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-light);
}
.sk8-login-field input {
  font-family: var(--font-body); font-size: .93rem;
  color: var(--white);
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; padding: .6rem .85rem;
  outline: none; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.sk8-login-field input::placeholder { color: rgba(255,255,255,.3); }
.sk8-login-field input:focus {
  border-color: var(--ice-mid);
  box-shadow: 0 0 0 3px rgba(201,162,39,.2);
}
.sk8-pw-wrap { position: relative; }
.sk8-pw-wrap input { padding-right: 2.8rem; }
.sk8-pw-toggle {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--text-light); display: flex; align-items: center;
}
.sk8-pw-toggle:hover { color: var(--ice-mid); }
.sk8-pw-toggle svg { width: 16px; height: 16px; }
.sk8-login-btn-row { display: flex; gap: 8px; margin-top: 1.5rem; }
.sk8-login-btn {
  font-family: var(--font-body); font-size: .9rem; font-weight: 500;
  padding: .6rem 1.4rem; border-radius: 100px;
  background: var(--ice-mid); color: var(--rink-dark);
  border: 1px solid var(--ice-mid); cursor: pointer;
  flex: 1; justify-content: center;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, box-shadow .15s;
}
.sk8-login-btn:hover { background: #dbb83a; box-shadow: 0 2px 12px rgba(201,162,39,.35); }
.sk8-login-foot { font-size: .75rem; color: rgba(255,255,255,.25); letter-spacing: .02em; }

/* ─── Button size modifier ───────────────────────────────── */
.sk8-btn--sm { padding: .35rem .85rem; font-size: .8rem; }

/* ─── Music download links ───────────────────────────────── */
.sk8-music-link {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--rink); text-decoration: none; font-size: .92rem;
  padding: .4rem .6rem; border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.sk8-music-link:hover { background: var(--ice-light); color: var(--rink); text-decoration: underline; }
.sk8-music-link svg { color: var(--ice-mid); flex-shrink: 0; }
