/* Purple-Palette nach Vorlage "Glowing Buttons" (Yasir Ekinci) */
:root {
  --bg:      #101220;   /* Corbeau - fast schwarz-lila */
  --panel:   #231D40;   /* Throat - dunkel-lila */
  --panel2:  #3D296A;   /* Her Highness - mittel-lila */
  --text:    #e2e8f0;
  --muted:   #a89bc4;
  --accent:       #B485D9;  /* Lavender Blossom */
  --accent-hover: #8459BB;  /* Lusty Lavender */
  --ok:   #22c55e;
  --warn: #f59e0b;
  --bad:  #ef4444;
  --border: #3D296A;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at top, #231D40 0%, #101220 60%); }
.login-card { background: var(--panel); padding: 32px; border-radius: 16px; width: 340px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 12px 40px rgba(180,133,217,.15), 0 0 0 1px rgba(180,133,217,.1); }
.login-card h1 { margin: 0 0 8px; font-size: 1.3em; text-align: center; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: .85em; color: var(--muted); }
.login-card input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--text); font-size: 1em;
  transition: border-color .15s, box-shadow .15s; }
.login-card input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180,133,217,.2); }
.login-card button { margin-top: 6px; padding: 11px; border: none; border-radius: 8px;
  background: var(--accent); color: var(--bg); font-weight: 700; cursor: pointer;
  transition: background .15s, transform .1s; }
.login-card button:hover { background: var(--accent-hover); color: white; }
.login-card button:active { transform: translateY(1px); }
.msg { color: var(--bad); font-size: .85em; min-height: 1.2em; text-align: center; margin: 0; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--border); }
.topbar h1 { font-size: 1.1em; margin: 0; }
.topbar button { background: transparent; border: 1px solid var(--border); color: var(--muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer; transition: all .15s; }
.topbar button:hover { color: var(--accent); border-color: var(--accent); }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }
h2.section { font-size: .85em; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 28px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px; position: relative;
  transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(180,133,217,.2); }
.card a.card-link { color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.card-head { display: flex; align-items: center; gap: 10px; }
.card-icon { width: 28px; height: 28px; flex-shrink: 0; color: var(--accent); }
.card-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.card-title { font-weight: 600; }
.card-subtitle { color: var(--muted); font-size: .82em; }
.card-status { font-size: .75em; padding: 2px 8px; border-radius: 999px; display: inline-block;
  width: fit-content; }
.status-active { background: rgba(34,197,94,.15); color: var(--ok); }
.status-inactive { background: rgba(239,68,68,.15); color: var(--bad); }
.status-unknown { background: rgba(168,155,196,.15); color: var(--muted); }
.status-warn { background: rgba(245,158,11,.15); color: var(--warn); cursor: help; }

.card-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.card-actions button { font-size: .78em; padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--panel2); color: var(--text); cursor: pointer;
  transition: all .15s; }
.card-actions button:hover { border-color: var(--accent); color: var(--accent); }
.card-actions button.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.card-actions button.primary:hover { background: var(--accent-hover); color: white; }
.card-edit-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.card-edit-tools button { background: var(--panel2); border: 1px solid var(--border);
  color: var(--muted); width: 24px; height: 24px; border-radius: 6px; cursor: pointer; font-size: .8em;
  transition: all .15s; }
.card-edit-tools button:hover { color: var(--accent); border-color: var(--accent); }

.add-card-btn { border: 2px dashed var(--border); background: transparent; color: var(--muted);
  border-radius: 14px; min-height: 100px; cursor: pointer; font-size: 1em; transition: all .15s; }
.add-card-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(180,133,217,.05); }

.modal-bg { position: fixed; inset: 0; background: rgba(16,18,32,.85); display: flex;
  align-items: center; justify-content: center; z-index: 50; backdrop-filter: blur(4px); }
.modal { background: var(--panel); border-radius: 14px; padding: 24px; width: 360px;
  display: flex; flex-direction: column; gap: 12px; max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(180,133,217,.15); }
.modal h3 { margin: 0; }
.modal label { display: flex; flex-direction: column; gap: 4px; font-size: .85em; color: var(--muted); }
.modal input, .modal select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--text); transition: border-color .15s; }
.modal input:focus, .modal select:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180,133,217,.15); }
.icon-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.icon-choice { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--panel2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--muted); transition: all .15s; }
.icon-choice svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.icon-choice:hover { color: var(--accent); border-color: var(--accent); }
.icon-choice.selected { border-color: var(--accent); color: var(--accent); background: rgba(180,133,217,.15); }
.modal-buttons { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.modal-buttons button { padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; transition: all .15s; }
.modal-buttons .cancel { background: var(--panel2); color: var(--text); }
.modal-buttons .cancel:hover { border: 1px solid var(--accent); color: var(--accent); }
.modal-buttons .save { background: var(--accent); color: var(--bg); font-weight: 600; }
.modal-buttons .save:hover { background: var(--accent-hover); color: white; }
.modal .msg { color: var(--bad); font-size: .82em; margin: 0; min-height: 1.2em; }
.modal .totp-hint { font-size: .78em; color: var(--muted); }

/* Reauth-Info-Block für Firewall-Stufen */
.reauth-details {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: .82em;
  color: var(--muted);
  max-height: 240px;
  overflow-y: auto;
}
.reauth-details .stage-name {
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 6px;
  font-size: 1.05em;
}
.reauth-details p { margin: 0 0 8px; line-height: 1.4; }
.reauth-details ul { margin: 0; padding-left: 18px; line-height: 1.5; }
.reauth-details li { margin: 2px 0; }

/* Backup-Liste */
.modal-wide { width: 640px; max-width: 90vw; }
.backup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85em;
}
.backup-table th, .backup-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.backup-table th { color: var(--muted); font-weight: 500; }
.backup-table td.muted { color: var(--muted); text-align: center; }
