/* =========================================================
   OPUS • Global Styles (Professional rewrite)
   - Keeps your existing class names working
   - Fixes "all buttons are full width" problem (schedule modal)
   - Adds consistent tokens, spacing, responsive behavior
========================================================= */

/* -------------------------
   Design Tokens
------------------------- */
:root{
  /* Core */
  --bg0: #070B14;
  --bg1: #0B1020;
  --bg2: #101B33;

  --surface: rgba(255,255,255,0.06);
  --surface2: rgba(255,255,255,0.09);
  --card: rgba(255,255,255,0.08);

  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.68);
  --muted2: rgba(255,255,255,0.55);

  --border: rgba(255,255,255,0.10);
  --border2: rgba(255,255,255,0.14);

  --shadow: 0 18px 60px rgba(0,0,0,.42);
  --shadow2: 0 10px 28px rgba(0,0,0,.32);

  /* Accents */
  --accent: rgba(255,255,255,0.92);
  --accentSoft: rgba(255,255,255,0.14);
  --danger: rgba(255, 120, 120, 0.95);
  --dangerSoft: rgba(255, 120, 120, 0.16);
  --ok: rgba(120, 255, 170, 0.95);
  --okSoft: rgba(120, 255, 170, 0.14);

  /* Radii */
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 10px;

  /* Sizing */
  --container: 1120px;
  --pad: 16px;

  /* Focus */
  --focus: 0 0 0 4px rgba(255,255,255,0.16);
}

/* -------------------------
   Base / Reset
------------------------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 20% 10%, rgba(160,170,255,0.25), transparent 60%),
    radial-gradient(900px 700px at 80% 25%, rgba(120,255,210,0.10), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1) 45%, var(--bg2));
}

a{ color: inherit; }
img{ max-width:100%; display:block; }

:where(a, button, input, select){
  -webkit-tap-highlight-color: transparent;
}

/* -------------------------
   Layout
------------------------- */
.center{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

.wrap{
  max-width: var(--container);
  margin: 24px auto;
  padding: 0 var(--pad);
}

/* -------------------------
   Topbar / Links
------------------------- */
.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.35));
  border-bottom: 1px solid var(--border);
  padding: 14px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.topbar > div:first-child{
  font-weight: 900;
  letter-spacing: .2px;
  opacity: .95;
}

.link{
  width:auto; /* important: do NOT force full width */
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border2);
  color: var(--text);
  text-decoration:none;
  font-weight: 800;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.link:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.22);
}
.link:active{ transform: translateY(1px); }
.link:focus{ outline:none; box-shadow: var(--focus); }

/* -------------------------
   Cards / Typography
------------------------- */
.card{
  width:100%;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow2);
  backdrop-filter: blur(12px);
}

.force-change-card{
  width: min(760px, 100%);
  max-width: 760px;
}

.logo{
  font-weight: 1000;
  letter-spacing: 3px;
  margin-bottom: 10px;
  opacity: .95;
}

h1{ margin:0 0 12px; font-size:20px; letter-spacing: .2px; }
h2{ margin: 0 0 14px; font-size: 22px; letter-spacing: .2px; }
h3{ margin: 0 0 10px; font-size: 16px; letter-spacing: .2px; }

.hint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* -------------------------
   Forms
------------------------- */
label{
  display:block;
  margin: 10px 0 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.78);
  font-weight: 800;
}

input, select{
  width:100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  outline: none;
}

input::placeholder{ color: rgba(255,255,255,0.45); }
input:focus, select:focus{
  box-shadow: var(--focus);
  border-color: rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.28);
}

/* IMPORTANT:
   Base button is NOT full width.
   Full width only for form submit buttons (login etc.)
*/
button{
  width:auto;
  margin:0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
}
button:hover{ background: rgba(255,255,255,0.14); }
button:active{ transform: translateY(1px); }
button:focus{ outline:none; box-shadow: var(--focus); }

/* Keep your forms looking same: */
form button[type="submit"]{
  width:100%;
  margin-top: 12px;
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.92);
  border: 1px solid rgba(255,255,255,0.85);
}
form button[type="submit"]:hover{
  background: rgba(255,255,255,0.98);
}

/* -------------------------
   Admin grid tiles
------------------------- */
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.tile{
  display:flex;
  align-items:center;
  justify-content:center;
  height: 112px;
  background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration:none;
  color: var(--text);
  font-weight: 900;
  box-shadow: var(--shadow2);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
  backdrop-filter: blur(12px);
}
.tile:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(255,255,255,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.07));
}

/* -------------------------
   Tables (legacy .table)
------------------------- */
.table{
  width:100%;
  border-collapse: collapse;
}
.table th, .table td{
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: left;
  font-size: 14px;
}
.table th{
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(255,255,255,0.06);
}

/* -------------------------
   Chips
------------------------- */
.chips{ display:flex; flex-wrap:wrap; gap:10px; }
.chip-form{ display:inline; }

.chip{
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(0,0,0,0.18);
  cursor: pointer;
  color: rgba(255,255,255,0.88);
  font-weight: 800;
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
.chip:hover{
  background: rgba(255,255,255,0.10);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.24);
}

/* -------------------------
   Students page split layout
------------------------- */
.split{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap: 18px;
  align-items:start;
}
@media (max-width: 900px){
  .split{ grid-template-columns: 1fr; }
}

/* -------------------------
   Accordion (animated)
------------------------- */
.accordion{
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow:hidden;
  background: rgba(255,255,255,0.06);
  margin-bottom: 10px;
  transition: box-shadow .22s ease, transform .22s ease, border-color .22s ease;
  backdrop-filter: blur(10px);
}
.accordion[open]{
  box-shadow: var(--shadow2);
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.22);
}

.accordion-summary{
  list-style:none;
  cursor:pointer;
  padding: 12px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-weight: 950;
  color: rgba(255,255,255,0.92);
}
.accordion-summary::-webkit-details-marker{ display:none; }

.accordion-body{
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(255,255,255,0.10);

  overflow:hidden;
  max-height: 0;
  opacity: 0;
  transition:
    max-height .35s cubic-bezier(.22,.61,.36,1),
    opacity .25s ease;
}
.accordion[open] .accordion-body{
  max-height: 800px;
  opacity: 1;
}

.badge{
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.92);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 950;
}

/* -------------------------
   Row actions + buttons (kept)
------------------------- */
.actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}

/* Your existing classes preserved */
.btn-delete,
.btn-edit,
.btn-save,
.btn-cancel{
  width:auto;
  margin:0;
  padding: 8px 12px;
  border-radius: 10px;
  cursor:pointer;
  font-weight: 950;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.10);
  color: var(--text);
}

.btn-edit{
  background: rgba(0,0,0,0.18);
  border-color: rgba(255,255,255,0.18);
}
.btn-edit:hover{ background: rgba(255,255,255,0.10); }

.btn-delete{
  border-color: rgba(255,120,120,0.28);
  background: rgba(255,120,120,0.10);
}
.btn-delete:hover{ background: rgba(255,120,120,0.16); }

.btn-save{
  background: rgba(255,255,255,0.92);
  color: rgba(0,0,0,0.92);
  border-color: rgba(255,255,255,0.85);
}
.btn-save:hover{ background: rgba(255,255,255,0.98); }

.btn-cancel{
  background: rgba(255,255,255,0.08);
}
.btn-cancel:hover{ background: rgba(255,255,255,0.12); }

/* Edit row form (students edit) */
.edit-row td{ background: rgba(255,255,255,0.04); }
.edit-form{ padding:10px; }
.edit-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 900px){
  .edit-grid{ grid-template-columns: 1fr; }
}
.edit-actions{
  margin-top: 10px;
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

/* -------------------------
   Legacy password section
------------------------- */
.password-header{
  display:flex;
  align-items:center;
  gap:8px;
}

.close-btn{
  display:none;
  width:36px;
  height:36px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  font-size:20px;
  cursor:pointer;
}

.password-card{
  display:none;
  margin-top:12px;
  opacity:0;
  transform: translateY(-8px);
  transition: all .25s ease;
}
.password-card.show{
  display:block;
  opacity:1;
  transform: translateY(0);
}
