/* ==========================================================================
   Energy Works — Admin Theme
   Matches the public landing page: deep navy background, gold accents,
   Cinzel for display type, Lato for body copy.
   ========================================================================== */

:root{
  --navy-deep:   #0a0f2e;   /* page background */
  --navy-panel:  #0d1b4b;   /* sidebar / topbar / raised panels */
  --navy-glass:  rgba(255,255,255,0.03);
  --gold:        #c9a84c;
  --gold-light:  #e2c76b;
  --gold-line:   rgba(201,168,76,0.18);
  --gold-line-soft: rgba(201,168,76,0.08);
  --cream:       #f5f0e8;
  --muted:       #b8b0a0;
  --danger:      #f87171;
  --success:     #9be3ae;
  --pending:     #f6d78b;
  --radius:      6px;
  --sidebar-w:   260px;
}

*{ box-sizing: border-box; }

html, body{
  margin: 0;
  min-height: 100%;
  background: var(--navy-deep);
  color: var(--cream);
  font-family: 'Lato', Arial, sans-serif;
  font-weight: 300;
}

body{
  position: relative;
}

/* soft ambient glow, echoes the hero background on the landing page */
body::before{
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(201,168,76,.07), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(201,168,76,.04), transparent 45%);
}

h1, h2, h3{
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  letter-spacing: .02em;
  margin: 0;
}

a{ color: inherit; text-decoration: none; }
.muted{ color: var(--muted); }
.gold{ color: var(--gold-light); }

/* ---------- App shell ---------- */
.ew-app{
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
}

/* sidebar.js injects markup into this node — keep it out of the flex flow
   so the <aside> behaves as a direct flex child of .ew-app */
#ew-sidebar-root{
  display: contents;
}

/* ---------- Sidebar ---------- */
.ew-sidebar{
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--navy-panel);
  border-right: 1px solid var(--gold-line-soft);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.ew-brand{
  color: var(--gold);
  font-family: 'Cinzel', Georgia, serif;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .04em;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ew-nav{
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.ew-nav a{
  color: var(--muted);
  font-size: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border-left: 2px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ew-nav a:hover{
  color: var(--cream);
  background: rgba(255,255,255,0.03);
}

.ew-nav a.active{
  color: var(--gold-light);
  background: rgba(201,168,76,.08);
  border-left-color: var(--gold);
}

.ew-sidebar-footer{
  border-top: 1px solid var(--gold-line-soft);
  padding-top: 16px;
  margin-top: 16px;
}

.ew-admin-email{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  word-break: break-all;
}

.ew-logout{
  width: 100%;
  background: transparent;
  border: 1px solid var(--gold-line);
  color: var(--muted);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-family: 'Lato', Arial, sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}

.ew-logout:hover{
  border-color: var(--gold);
  color: var(--gold-light);
}

/* mobile toggle button (hidden on desktop) */
.ew-menu-btn{
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  background: var(--navy-panel);
  border: 1px solid var(--gold-line);
  color: var(--gold-light);
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 18px;
  cursor: pointer;
}

.ew-sidebar-backdrop{
  display: none;
}

/* ---------- Main content ---------- */
.ew-main{
  flex: 1;
  min-width: 0;
  padding: 40px 44px;
  position: relative;
  z-index: 1;
}

.ew-page-head{
  margin-bottom: 8px;
}

.ew-page-sub{
  color: var(--muted);
  margin: 8px 0 28px;
}

/* ---------- Cards / panels ---------- */
.ew-card{
  background: var(--navy-glass);
  border: 1px solid var(--gold-line);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
  border-radius: var(--radius);
  padding: 24px;
}

.ew-grid{ display: grid; gap: 20px; }
.ew-stats{ grid-template-columns: repeat(4, 1fr); }
.ew-cards{ grid-template-columns: repeat(4, 1fr); }

.ew-stat-label{
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 12px;
}

.ew-stat-value{
  font-family: 'Cinzel', Georgia, serif;
  font-size: 30px;
  color: var(--gold-light);
}

/* ---------- Forms ---------- */
input, select, textarea{
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--gold-line);
  color: var(--cream);
  padding: 11px 13px;
  border-radius: var(--radius);
  outline: none;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 14px;
}

input::placeholder{ color: var(--muted); }
input:focus, select:focus, textarea:focus{ border-color: var(--gold-light); }

label{ font-size: 13px; }

/* ---------- Buttons ---------- */
button, .btn{
  border: 0;
  border-radius: var(--radius);
  padding: 10px 18px;
  cursor: pointer;
  font-family: 'Lato', Arial, sans-serif;
  font-size: 14px;
  transition: opacity .15s ease, border-color .15s ease;
}

.btn-gold{
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #17140d;
  font-weight: 700;
}
.btn-gold:hover{ opacity: .9; }

.btn-ghost{
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--gold-line);
}
.btn-ghost:hover{ border-color: var(--gold-light); color: var(--gold-light); }

/* ---------- Tables ---------- */
table{ width: 100%; border-collapse: collapse; }
th, td{
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--gold-line-soft);
}
th{
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
td{ font-size: 14px; }
.right{ text-align: right; }

/* ---------- Badges ---------- */
.badge{
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(201,168,76,.15);
  font-size: 11px;
  letter-spacing: .02em;
}
.badge.confirmed, .badge.paid{ color: var(--success); background: rgba(155,227,174,.12); }
.badge.cancelled{ color: var(--danger); background: rgba(248,113,113,.12); }
.badge.pending{ color: var(--pending); background: rgba(246,215,139,.12); }

/* ---------- Layout helpers ---------- */
.row{ display: flex; gap: 12px; align-items: center; }
.between{ justify-content: space-between; }
.wrap{ flex-wrap: wrap; }
.mb{ margin-bottom: 24px; }
.mb8{ margin-bottom: 8px; }
.mt{ margin-top: 20px; }
.table-wrap{ overflow: auto; }

/* ---------- Modal ---------- */
.modal{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 50;
}
.modal-box{ max-width: 720px; width: 100%; padding: 24px; max-height: 80vh; overflow: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .ew-stats, .ew-cards{ grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px){
  .ew-menu-btn{ display: block; }

  .ew-sidebar{
    position: fixed;
    left: 0; top: 0;
    transform: translateX(-100%);
    transition: transform .2s ease;
    z-index: 41;
    box-shadow: 20px 0 60px rgba(0,0,0,.4);
  }
  .ew-sidebar.open{ transform: translateX(0); }

  .ew-sidebar-backdrop{
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 39;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .ew-sidebar-backdrop.open{ opacity: 1; pointer-events: auto; }

  .ew-main{ padding: 84px 20px 40px; }
}

@media (max-width: 600px){
  .ew-stats, .ew-cards{ grid-template-columns: 1fr; }
  table{ min-width: 760px; }
}
