:root{
  --bg: #070b12;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.12);
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.72);
  --muted2: rgba(255,255,255,0.55);
  --shadow: 0 18px 60px rgba(0,0,0,0.55);
  --radius: 18px;
}

/* ==========================
   Base / Reset
   ========================== */
*{ box-sizing:border-box; }

html{
  min-height: 100%;
  background:
    radial-gradient(1200px 700px at 10% 10%, rgba(0,188,212,0.18), transparent 55%),
    radial-gradient(900px 600px at 85% 25%, rgba(76,175,80,0.16), transparent 55%),
    radial-gradient(800px 700px at 40% 110%, rgba(255,193,7,0.10), transparent 55%),
    linear-gradient(180deg, #060912, #05070c 60%, #04060a);
  background-repeat: no-repeat;
  background-size: cover;
  overflow-x: hidden;
}

body{
  min-height: 100%;
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: transparent;
  overflow-x: hidden;
}

/* Links (global) */
a{ color:inherit; text-decoration:none; }
a:hover{ text-decoration:underline; } /* keep as-is for now */

/* ==========================
   Header / Nav
   ========================== */
header{
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(5,8,14,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.head{
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 18px;
  display:flex;
  align-items:center;
  gap: 16px;
  min-width: 0;
}

.brand{ display:flex; align-items:center; flex:0 0 auto; }

.brandLogo{
  height: 44px;
  width: auto;
  display:block;
  object-fit:contain;
  filter: drop-shadow(0 0 10px rgba(120,255,210,0.12));
}

.navToggle{
  display:none;
  background: transparent;
  border: 0;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text);
  flex: 0 0 auto;
}
.navToggle:hover{ background: rgba(255,255,255,0.06); }

.navToggleIcon{
  display:inline-block;
  width: 22px;
  height: 2px;
  background: currentColor;
  position: relative;
  border-radius: 999px;
}
.navToggleIcon::before,
.navToggleIcon::after{
  content:"";
  position:absolute;
  left:0;
  width:22px;
  height:2px;
  background: currentColor;
  border-radius: 999px;
}
.navToggleIcon::before{ top:-7px; }
.navToggleIcon::after{ top: 7px; }

.primaryNav{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  margin-left: 12px;
  flex-wrap: nowrap;
}

.navlink{
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 10px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
  border: 1px solid transparent;
}
.navlink:hover{
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  text-decoration:none;
}
.navlink.active{
  color: rgba(255,255,255,0.92);
  background: rgba(0,188,212,0.10);
  border-color: rgba(0,188,212,0.22);
  text-decoration:none;
}

.adminlink{
  font-size: 12px;
  color: rgba(255,255,255,0.60);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.adminlink:hover{
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.85);
  text-decoration:none;
}
.adminlink.active{
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.90);
  text-decoration:none;
}

.adminTools{
  margin-left: auto;
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.switcher{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
}
.switcherLabel{
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.switcher select{
  background: rgba(0,0,0,0.22);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 8px 10px;
  outline: none;
}

/* ==========================
   Layout
   ========================== */
.admin-wrap{
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 18px 64px;
  min-width: 0;
}

.admin-wrap,
main{
  max-width: 100%;
  overflow-x: hidden;
}

.top-bar{ margin-bottom: 14px; }


/* ==========================
   Buttons
   ========================== */
.admin-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
  text-decoration:none;
}
.admin-btn:hover{
  background: rgba(255,255,255,0.10);
  text-decoration:none;
}

/* Normalize button vs link sizing */
.admin-btn,
button.admin-btn{
  font: inherit;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}
button.admin-btn{
  background: rgba(255,255,255,0.06);
}

/* ==========================
   Tables (modern table component)
   ========================== */

.tableWrap{
  border-radius: 22px;
  overflow: hidden;                 /* modern container look */
  border: 1px solid rgba(255,255,255,0.10);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(0,0,0,0.18));
  box-shadow: 0 18px 60px rgba(0,0,0,0.35);
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

/* Inner table stays scrollable on desktop if needed */
.tableWrap{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tableWrap > table{
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
}

/* Header */
.tableWrap thead th{
  text-align: left;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: none;
  color: rgba(255,255,255,0.78);
  padding: 14px 16px;
  background: rgba(0,0,0,0.22);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  white-space: nowrap;
}

/* Cells */
.tableWrap tbody td{
  padding: 16px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Last row no border */
.tableWrap tbody tr:last-child td{
  border-bottom: none;
}

/* Row hover */
@media (hover:hover){
  .tableWrap tbody tr:hover td{
    background: rgba(255,255,255,0.03);
  }
}

/* Don’t let long filenames blow layout */
.tableWrap td{
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.tableWrap a{
  max-width: 100%;
  display: inline-block;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* First column breathing room (fix pill hugging edge) */
.tableWrap th:first-child,
.tableWrap td:first-child{
  padding-left: 20px;
}

/* Actions column: keep tight + tidy */
.tableWrap th.actions,
.tableWrap td.actions,
.tableWrap th:last-child,
.tableWrap td:last-child{
  width: 1%;
  white-space: nowrap;
  padding-right: 20px;
}

/* Force action buttons onto one line on desktop */
@media (min-width: 701px){
  .tableWrap .actionBtns{
    display: inline-flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    align-items: center;
    white-space: nowrap !important;
  }
  .tableWrap .actionBtns form{
    display: inline !important;
    margin: 0 !important;
  }
  .tableWrap .actionBtns .admin-btn{
    flex: 0 0 auto !important;
    padding: 8px 12px;
  }

  /* Hide the dropdown on desktop */
  td.actions .actionsMenu{ display:none !important; }
}

/* ==========================
   Mobile (<=700px): tables become cards
   ========================== */
@media (max-width: 700px){

  .tableWrap{
    overflow-x: hidden;
    overflow-y: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .tableWrap table,
  .tableWrap thead,
  .tableWrap tbody,
  .tableWrap th,
  .tableWrap td,
  .tableWrap tr{
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .tableWrap thead{ display: none; }

  .tableWrap tbody tr{
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.20));
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 22px;
    padding: 12px 14px;
    margin: 14px 0;
    box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  }

  .tableWrap tbody td{
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 10px 0;
    border: none;
    white-space: normal;
  }

  .tableWrap tbody td::before{
    content: attr(data-label);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
  }

  /* Mobile actions: dropdown only */
  td.actions .actionBtns{ display:none !important; }
  td.actions .actionsMenu{ display:block !important; }
}


/* ==========================
   Mobile nav trigger (<=980px)
   ========================== */
@media (max-width: 980px){
  .brandLogo{ height: 36px; }
  .navToggle{ display:inline-flex; }

  .primaryNav{
    display:none;
    position:absolute;
    left:12px;
    right:12px;
    top: calc(100% + 10px);
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(5, 8, 14, 0.92);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    z-index: 999;
  }

  .primaryNav.isOpen{ display:flex; }

  .adminTools{
    gap: 8px;
    flex-wrap: wrap;
  }

  header{ position: relative; }
}

/* ==========================
   Mobile (<=700px): tables become cards + header stacks
   ========================== */
@media (max-width: 700px){

  /* Top bar stacks */
  .top-bar{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 16px;
  }
  .top-actions{ width: 100%; }
  .top-actions .admin-btn{
    flex: 1;
    justify-content: center;
  }

  .filter{
    width: 100%;
    justify-content: space-between;
  }
  .filter select{
    flex: 1;
    min-width: 0;
  }

  /* Table -> cards */
  .tableWrap{
    overflow-x: hidden;
    overflow-y: visible;
    background: transparent;
    border: none;
    width: 100%;
    max-width: 100%;
  }

  .tableWrap table,
  .tableWrap thead,
  .tableWrap tbody,
  .tableWrap th,
  .tableWrap td,
  .tableWrap tr{
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .tableWrap thead{ display: none; }

  .tableWrap tbody tr{
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    padding: 10px 12px;
    margin: 12px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  }

  .tableWrap tbody td{
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
    padding: 8px 0;
    border: none;
    white-space: normal;
  }

  .tableWrap tbody td::before{
    content: attr(data-label);
    color: rgba(255,255,255,0.55);
    font-size: 12px;
  }

  /* Actions: dropdown only */
  td.actions .actionBtns{ display: none !important; }
  td.actions .actionsMenu{ display: block !important; }

  /* Header stacks: put tools on new row */
  .head{
    padding: 12px;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
  }

  .navToggle{ order: 1; }
  .brand{ order: 2; }

  .brandLogo{ height: 40px; }

  .adminTools{
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    gap: 10px;
  }

  .switcher{
    width: 100%;
    justify-content: space-between;
  }

  .switcherLabel{ display: none; }

  .switcher select{
    width: 100%;
    max-width: none;
  }

  .adminlink{
    padding: 8px 10px;
  }
}

/* .top-bar{ margin-bottom: 14px !important; } */


