/* ============================================================
   ENERGY GYM — Styles globaux
   Black & Yellow · Bebas Neue · DM Sans
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@400;500;700&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --bg: #0A0A0A;
  --bg-2: #121212;
  --card: #161616;
  --card-hover: #1C1C1C;
  --border: #262626;
  --border-soft: #1F1F1F;
  --text: #F5F5F5;
  --text-2: #A3A3A3;
  --text-3: #737373;
  --accent: #FACC15;
  --accent-2: #EAB308;
  --green: #22C55E;
  --amber: #F59E0B;
  --red: #EF4444;
  --blue: #60A5FA;
  --pink: #EC4899;
  --purple: #8B5CF6;
  --orange: #F97316;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.display { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.02em; }
.mono    { font-family: 'JetBrains Mono', monospace; }

/* scrollbars */
*::-webkit-scrollbar         { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb   { background: #333; border-radius: 4px; }
*::-webkit-scrollbar-track   { background: transparent; }

/* grid background accent */
.grid-bg {
  background-image:
    radial-gradient(circle at 20% 0%,  rgba(250, 204, 21, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 80% 100%, rgba(250, 204, 21, 0.03) 0%, transparent 50%);
}

/* animations */
@keyframes pulseBolt {
  0%,100% { opacity: 1; transform: scale(1); }
  50%     { opacity: .6; transform: scale(.95); }
}
.pulse-bolt { animation: pulseBolt 2s ease-in-out infinite; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease-out; }

/* =================== LAYOUT =================== */

.app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-bolt {
  background: var(--accent);
  color: #000;
  padding: 6px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0.02em;
}
.brand-name .yellow { color: var(--accent); }
.brand-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-3);
  margin-top: 2px;
}

.nav { padding: 12px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 2px;
  margin-bottom: 4px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: all 0.15s;
}
.nav a:hover { background: var(--card); color: var(--text); }
.nav a.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}
.nav .icon {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center;
}

.user-box {
  padding: 12px;
  border-top: 1px solid var(--border);
}
.user-meta {
  padding: 8px 12px;
  margin-bottom: 8px;
}
.user-meta .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
}
.user-meta .value {
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 14px;
  color: var(--text-3);
  text-decoration: none;
  transition: all 0.15s;
}
.logout:hover { color: var(--red); background: rgba(239,68,68,0.05); }

.main {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
}
.content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px;
}

/* mobile sidebar toggle */
@media (max-width: 768px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .nav { display: none; padding: 8px; }
  .sidebar.open .nav { display: block; }
  .sidebar .user-box { display: none; }
  .sidebar.open .user-box { display: block; }
  .nav-toggle { display: flex !important; }
  .content { padding: 16px; }
}
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 4px;
}

/* =================== PAGE HEADING =================== */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.page-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-3);
}
.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  line-height: 1;
  margin-top: 4px;
}
.page-title .yellow { color: var(--accent); }
.page-subtitle {
  font-size: 14px;
  color: var(--text-2);
  margin-top: 4px;
}

/* =================== CARDS =================== */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px;
}
.card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  color: var(--accent);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card.dashed { border-style: dashed; }

.grid       { display: grid; gap: 16px; }
.grid-2     { grid-template-columns: repeat(2, 1fr); }
.grid-3     { grid-template-columns: repeat(3, 1fr); }
.grid-4     { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* =================== KPI CARDS =================== */

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 20px;
}
.kpi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.kpi-icon {
  padding: 8px;
  border-radius: 2px;
  background: var(--bg);
  display: inline-flex;
}
.kpi-icon.green  { color: var(--green);  }
.kpi-icon.red    { color: var(--red);    }
.kpi-icon.amber  { color: var(--amber);  }
.kpi-icon.yellow { color: var(--accent); }
.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.kpi-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  line-height: 1;
  color: var(--text);
  margin-bottom: 4px;
}
.kpi-sub { font-size: 12px; color: var(--text-3); }

.counter-box {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg);
}
.counter-box.accent { border-color: rgba(250,204,21,0.3); background: rgba(250,204,21,0.05); }
.counter-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-3);
}
.counter-box.accent .counter-label { color: var(--accent); }
.counter-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 36px;
  line-height: 1;
  margin-top: 4px;
  color: var(--text);
}
.counter-box.accent .counter-value { color: var(--accent); }

/* =================== BADGES =================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid;
  font-weight: 500;
}
.badge-sm { font-size: 10px; padding: 1px 6px; }
.badge-green  { background: rgba(34,197,94,0.1);   color: var(--green);  border-color: rgba(34,197,94,0.3); }
.badge-red    { background: rgba(239,68,68,0.1);   color: var(--red);    border-color: rgba(239,68,68,0.3); }
.badge-amber  { background: rgba(245,158,11,0.1);  color: var(--amber);  border-color: rgba(245,158,11,0.3); }
.badge-blue   { background: rgba(96,165,250,0.1);  color: var(--blue);   border-color: rgba(96,165,250,0.3); }
.badge-zinc   { background: rgba(113,113,122,0.1); color: var(--text-3); border-color: rgba(113,113,122,0.3); }
.badge-yellow { background: rgba(250,204,21,0.1);  color: var(--accent); border-color: rgba(250,204,21,0.4); }

/* =================== BUTTONS =================== */

.btn {
  background: var(--accent);
  color: #000;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.05em;
  font-size: 17px;
  padding: 10px 18px;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover  { background: #FFDC2E; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.full   { width: 100%; justify-content: center; }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 13px;
  padding: 9px 14px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost.danger:hover { border-color: var(--red); color: var(--red); }
.btn-ghost.sm { padding: 6px 10px; font-size: 12px; }

/* =================== FORMS =================== */

.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 4px;
}
.input, .select, textarea.input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 2px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); }
.input.mono { font-family: 'JetBrains Mono', monospace; }
.input-prefix { position: relative; }
.input-prefix .prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.input-prefix .input { padding-left: 36px; }
.input-suffix { position: relative; }
.input-suffix .suffix {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 12px;
  pointer-events: none;
}
.input-suffix .input { padding-right: 40px; }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3A3A3' stroke-width='2'%3e%3cpath d='m6 9 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  padding-right: 32px;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

/* tab toggle */
.tab-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
}
.tab-toggle button, .tab-toggle a {
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
}
.tab-toggle button:hover, .tab-toggle a:hover { color: var(--text); }
.tab-toggle button.active, .tab-toggle a.active {
  background: var(--accent);
  color: #000;
  font-weight: 700;
}

/* =================== TABLES =================== */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.data thead tr {
  border-bottom: 1px solid var(--border);
}
table.data th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  font-weight: 500;
  padding: 8px 12px;
  white-space: nowrap;
}
table.data th.right { text-align: right; }
table.data tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s;
}
table.data tbody tr:hover { background: var(--card-hover); }
table.data tbody tr.clickable { cursor: pointer; }
table.data td {
  padding: 12px;
  vertical-align: middle;
}
table.data td.right { text-align: right; }
table.data td.yellow { color: var(--accent); }

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-3);
  font-size: 14px;
}
.empty-state.bordered {
  border: 1px dashed var(--border);
  border-radius: 2px;
}

/* =================== CLIENT / LIST ITEMS =================== */

.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 2px;
  margin-bottom: 4px;
  transition: border-color 0.15s;
  text-decoration: none;
  color: var(--text);
}
.list-item:hover { border-color: rgba(250,204,21,0.4); }
.list-item.amber:hover { border-color: rgba(245,158,11,0.4); }
.list-item.red:hover   { border-color: rgba(239,68,68,0.4); }

.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-weight: 500; font-size: 14px; }
.list-item-sub {
  font-size: 12px;
  color: var(--text-3);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}
.list-item-right { text-align: right; font-size: 12px; }
.list-item-right .primary { color: var(--accent); }
.list-item-right .primary.amber { color: var(--amber); }
.list-item-right .primary.red   { color: var(--red); }
.list-item-right .meta { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* =================== MODALS =================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 2px;
  width: 100%;
  max-width: 720px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-lg { max-width: 960px; }
.modal-sm { max-width: 480px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  margin: 0;
}
.modal-head .close {
  background: transparent;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 18px;
}
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* =================== FLASH MESSAGES =================== */

.flash {
  padding: 12px 16px;
  border-radius: 2px;
  margin-bottom: 16px;
  font-size: 14px;
  border: 1px solid;
}
.flash-success { background: rgba(34,197,94,0.1);   color: var(--green); border-color: rgba(34,197,94,0.3); }
.flash-error   { background: rgba(239,68,68,0.1);   color: var(--red);   border-color: rgba(239,68,68,0.3); }
.flash-info    { background: rgba(96,165,250,0.1);  color: var(--blue);  border-color: rgba(96,165,250,0.3); }
.flash-warn    { background: rgba(245,158,11,0.1);  color: var(--amber); border-color: rgba(245,158,11,0.3); }

/* =================== MISC =================== */
.text-muted  { color: var(--text-3); }
.text-yellow { color: var(--accent); }
.text-green  { color: var(--green); }
.text-amber  { color: var(--amber); }
.text-red    { color: var(--red); }
.text-sm     { font-size: 12px; }
.text-xs     { font-size: 11px; }
.text-right  { text-align: right; }
.text-center { text-align: center; }
.uppercase   { text-transform: uppercase; letter-spacing: 0.1em; }
.flex        { display: flex; }
.flex-wrap   { flex-wrap: wrap; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1       { gap: 4px; }
.gap-2       { gap: 8px; }
.gap-3       { gap: 12px; }
.gap-4       { gap: 16px; }
.mt-1        { margin-top: 4px; }
.mt-2        { margin-top: 8px; }
.mt-3        { margin-top: 12px; }
.mt-4        { margin-top: 16px; }
.mt-6        { margin-top: 24px; }
.mb-2        { margin-bottom: 8px; }
.mb-3        { margin-bottom: 12px; }
.mb-4        { margin-bottom: 16px; }
.mb-6        { margin-bottom: 24px; }
.w-full      { width: 100%; }

/* large action button for worker */
.big-action {
  display: block;
  padding: 32px;
  border: 2px solid var(--accent);
  background: rgba(250,204,21,0.1);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.2s;
}
.big-action:hover { background: rgba(250,204,21,0.2); }
.big-action .title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  color: var(--accent);
  margin-bottom: 4px;
}
.big-action .sub { font-size: 14px; color: var(--text-2); }

/* gender select tiles */
.tile-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.tile {
  padding: 12px 4px;
  border: 1px solid var(--border);
  border-radius: 2px;
  text-align: center;
  cursor: pointer;
  background: transparent;
  color: var(--text-2);
  transition: all 0.15s;
}
.tile:hover { border-color: rgba(250,204,21,0.4); }
.tile.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 700;
}
.tile .big {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  line-height: 1;
}
.tile .small {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* login screen */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
}
.login-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 2;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}
.login-logo .bolt {
  background: var(--accent);
  color: #000;
  padding: 8px;
  border-radius: 2px;
  display: inline-flex;
}
.login-logo .name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  line-height: 1;
}
.login-logo .yellow { color: var(--accent); }
.login-logo .sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--text-3);
  margin-top: 4px;
}

.role-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  margin-bottom: 12px;
  text-decoration: none;
  font-family: inherit;
}
.role-btn:hover { border-color: rgba(250,204,21,0.5); background: rgba(250,204,21,0.05); }
.role-btn .role-icon {
  padding: 12px;
  border-radius: 2px;
  display: flex;
}
.role-btn .role-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
}
.role-btn .role-sub { font-size: 12px; color: var(--text-3); }

.pin-input {
  text-align: center;
  font-size: 28px !important;
  font-family: 'JetBrains Mono', monospace !important;
  letter-spacing: 0.4em;
  padding: 16px !important;
}

/* receipt printable */
@media print {
  body { background: white; color: black; }
  .sidebar, .page-head button, .btn, .btn-ghost { display: none !important; }
  .content { padding: 0; }
  .card { border: 1px solid #ccc; background: white; color: black; }
}
