/* ============================================================
   main.css — Dashboard, Panels, Cards, Tabellen
   ============================================================ */

/* Main Panel */
.main-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 2rem 2.25rem;
   width: 100%; margin: 0 auto;
}
.main-panel h1,.main-panel h2 { text-align: center; margin-bottom: .5rem; }

/* Card Grid */
.card-grid { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.75rem; }

/* Collapsible Card */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); overflow: hidden; transition: border-color .2s;
}
.card:hover { border-color: var(--border-2); }

.card-header {
  background: var(--surface-2); padding: 1.1rem 1.5rem;
  cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: .75rem;
  user-select: none; transition: background .2s;
}
.card-header:hover { background: var(--surface-3); }
.card-header h4 { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-1); flex: 1; margin: 0; }
.card-header small { font-size: .85rem; color: var(--text-2); white-space: nowrap; }

.card-header span[id^="icon"] {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface-3); color: var(--text-2); font-size: .8rem;
  float: none !important; flex-shrink: 0;
  transition: transform .3s, background .2s, color .2s;
}
.card-header.open span[id^="icon"] {
  transform: rotate(180deg); background: rgba(0,160,221,.15); color: var(--brand);
}

.card-body { max-height: 0; overflow: hidden; transition: max-height .38s ease; }
.card-body.open { max-height: 600px; overflow: auto; }

.card-body table { width: 100%; border-collapse: collapse; }
.card-body th,.card-body td {
  padding: .9rem 1.5rem; text-align: left;
  border-bottom: 1px solid var(--border); font-size: .95rem;
}
.card-body th {
  font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--text-3);
  background: var(--surface-2); white-space: nowrap; width: 35%;
}
.card-body td { color: var(--text-2); }
.card-body tr:last-child th,.card-body tr:last-child td { border-bottom: none; }

/* Generic Table */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th {
  padding: .75rem 1.25rem; text-align: left;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); border-bottom: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.table td {
  padding: .95rem 1.25rem; border-bottom: 1px solid var(--border);
  color: var(--text-2); transition: background .15s;
}
.table tbody tr:hover td { background: var(--surface-2); color: var(--text-1); }
.table tbody tr:last-child td { border-bottom: none; }

/* Panel */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; margin-bottom: 1.1rem; }
.panel-header { padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.panel-header h2,.panel-header h3 { font-size: 1.05rem; margin: 0; }
.panel-body { padding: 1.5rem; }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: .25rem .75rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.badge-brand  { background: rgba(0,160,221,.15);  color: var(--brand); }
.badge-accent { background: rgba(245,158,11,.15); color: var(--accent); }
.badge-green  { background: rgba(34,211,165,.15); color: var(--green); }
.badge-red    { background: rgba(244,63,94,.15);  color: var(--red); }

/* Mobile stacked table */
@media (max-width: 580px) {
  .table thead { display: none; }
  .table tbody tr {
    display: flex; flex-direction: column; background: var(--surface-2);
    border-radius: var(--r-sm); margin-bottom: .6rem;
    border: 1px solid var(--border); padding: .9rem 1rem;
  }
  .table td { border: none; padding: .25rem 0; font-size: .9rem; }
  .table td::before {
    content: attr(data-label); display: block; font-size: .7rem;
    font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    color: var(--text-3); margin-bottom: .12rem;
  }
  .main-panel { padding: 1.25rem 1rem; border-radius: var(--r); }
}

/* ── Delete Confirm Dialog ── */
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.delete-confirm-box {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-top: 3px solid var(--red);
  border-radius: var(--r-lg);
  padding: 2rem 2.25rem;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  animation: modalFadeIn .22s ease forwards;
}

.delete-confirm-box h3 {
  font-size: 1.2rem;
  margin-bottom: .75rem;
  color: var(--text-1);
}

.delete-confirm-box p {
  color: var(--text-2);
  font-size: .95rem;
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.delete-confirm-box strong {
  color: var(--text-1);
}

.delete-confirm-actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.delete-confirm-actions form { flex: 1; }
.delete-confirm-actions form .user-edit-form-button {
  width: 100%;
  background: var(--red) !important;
  box-shadow: 0 4px 14px rgba(244,63,94,.3) !important;
}
.delete-confirm-actions form .user-edit-form-button:hover {
  box-shadow: 0 6px 20px rgba(244,63,94,.45) !important;
}

.delete-btn {
  background: rgba(244,63,94,.12) !important;
  color: var(--red) !important;
  border: 1px solid rgba(244,63,94,.25) !important;
  box-shadow: none !important;
}
.delete-btn:hover {
  background: rgba(244,63,94,.22) !important;
}
