@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=Space+Grotesk:wght@400;500;600&display=swap");

:root {
  --bg: #0f1115;
  --bg-soft: #141923;
  --card: #171c24;
  --text: #e7eaf0;
  --muted: #9aa3b2;
  --accent: #e04b3f;
  --accent-2: #ff6a5e;
  --warning: #e0621c;
  --warning-2: #f07a2c;
  --border: #2a313d;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --radius: 14px;
  --radius-sm: 10px;
  --input: #10141b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", "Manrope", sans-serif;
  background: radial-gradient(900px 600px at 15% -10%, rgba(224, 75, 63, 0.12), transparent 60%),
              radial-gradient(1000px 700px at 100% 0%, rgba(255, 106, 94, 0.08), transparent 55%),
              #0b0d12;
  color: var(--text);
  font-size: 19px;
  line-height: 1.6;
}

h1,
h2,
h3 {
  font-weight: 600;
}

.card h3 {
  margin-top: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-2);
}

.container {
  max-width: 1680px;
  width: min(1680px, 98vw);
  margin: 0 auto;
  padding: 34px 24px 72px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-break {
  flex-basis: 100%;
  height: 0;
}

.logo-link {
  display: inline-flex;
  text-decoration: none;
}

.logo-link:hover {
  opacity: 0.9;
}

.logo {
  height: 78px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
}

.brand-title {
  margin: 0;
  font-size: 36px;
  letter-spacing: 0.4px;
}

.page-title {
  margin: 4px 0 0;
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 22px;
}

.nav a {
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  transition: all 0.2s ease;
}

.nav a.active,
.nav a:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 75, 63, 0.18);
  transform: translateY(-1px);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card + .card {
  margin-top: 18px;
}

/* User-Ansicht: Bankdaten dezent platzieren */
.bank-info {
  padding: 18px;
}

.bank-info .bank-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.bank-info .bank-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.field {
  min-width: 0;
  overflow: hidden;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.grid-1 {
  grid-template-columns: 1fr;
}

.grid.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid > .field {
  min-width: 0;
}

input,
select {
  width: 100%;
  min-height: 56px;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  font-size: 19px;
  line-height: 1.2;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  max-width: 100%;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--text);
  text-transform: none;
  letter-spacing: normal;
}

.checkbox input {
  width: 20px;
  height: 20px;
  margin: 0;
  min-height: auto;
}

.deleted-row {
  opacity: 0.65;
}

select {
  height: 56px;
}

input[type="date"] {
  text-align: left;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(224, 75, 63, 0.2);
}

.input-sm {
  max-width: 240px;
}

button {
  min-height: 56px;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-2);
  box-shadow: 0 10px 24px rgba(224, 75, 63, 0.35);
}

button.secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

button.secondary:hover {
  border-color: var(--accent);
  color: var(--text);
}

button.warning {
  background: rgba(224, 98, 28, 0.16);
  border: 1px solid rgba(224, 98, 28, 0.55);
  color: #ffd3b0;
  box-shadow: none;
}

button.warning:hover {
  background: rgba(224, 98, 28, 0.32);
  border-color: rgba(224, 98, 28, 0.8);
}

button.danger {
  background: rgba(255, 106, 94, 0.15);
  border: 1px solid rgba(255, 106, 94, 0.4);
  color: #ffd7d3;
  box-shadow: none;
}

button.danger:hover {
  background: rgba(255, 106, 94, 0.3);
  border-color: rgba(255, 106, 94, 0.7);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
}

.btn.secondary {
  background: transparent;
}

.btn.warning {
  background: rgba(224, 98, 28, 0.12);
  border-color: rgba(224, 98, 28, 0.55);
  color: #ffd3b0;
}

.btn.warning:hover {
  background: rgba(224, 98, 28, 0.26);
  border-color: rgba(224, 98, 28, 0.8);
}

.btn.danger {
  background: rgba(255, 106, 94, 0.12);
  border-color: rgba(255, 106, 94, 0.5);
  color: #ffd7d3;
}

.btn.danger:hover {
  background: rgba(255, 106, 94, 0.28);
  border-color: rgba(255, 106, 94, 0.8);
}

.row-actions form {
  display: inline;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th,
.table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  background: #121723;
}

.table tr:nth-child(even) {
  background: #131926;
}

.table tbody tr:hover {
  background: #1c2230;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--muted);
}

.remember input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.pagination .actions {
  margin-top: 0;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.inline form {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

/* Userverwaltung: Actions als 2-zeiliges Grid (Desktop) */
.user-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "tag tag tag"
    "pass passsave reset"
    ". save del";
  gap: 8px;
  width: 100%;
  align-items: center;
}

.user-actions .tag {
  grid-area: tag;
  justify-self: center;
}

.user-actions input,
.user-actions button {
  width: 100%;
}

.user-actions .user-pass-input {
  grid-area: pass;
}

.user-actions .user-pass-save {
  grid-area: passsave;
}

.user-actions .user-pass-reset {
  grid-area: reset;
}

.user-actions .user-save {
  grid-area: save;
}

.user-actions .user-delete {
  grid-area: del;
}

.msg {
  margin: 10px 0;
}

.msg.success {
  color: #7adf9a;
}

.msg.error {
  color: #ff7b6d;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(224, 75, 63, 0.18);
  border: 1px solid rgba(224, 75, 63, 0.4);
  color: #ffd7d3;
  margin-left: 6px;
}

.muted {
  color: var(--muted);
}

.app-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  opacity: 0.75;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logo {
    height: 70px;
  }

  .brand-title {
    font-size: 34px;
  }

  .page-title {
    font-size: 24px;
  }
}

@media (max-width: 860px) {
  .container {
    max-width: none;
    width: 100%;
    padding: 24px 14px 60px;
  }

  .app-header {
    align-items: flex-start;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .container {
    padding: 14px 8px 36px;
  }

  input,
  select {
    min-height: 42px;
    font-size: 14px;
    padding: 8px 10px;
  }

  select {
    height: 42px;
  }

  button {
    min-height: 42px;
    font-size: 14px;
    padding: 8px 10px;
  }

  .bank-info .bank-details {
    font-size: 13px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .grid.grid-2,
  .grid.grid-3 {
    grid-template-columns: 1fr;
  }

  .input-sm {
    max-width: 100%;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .actions .btn,
  .actions button {
    width: 100%;
    justify-content: center;
  }

  .inline {
    flex-direction: column;
    align-items: stretch;
  }

  .inline form {
    width: 100%;
  }

  .inline form input,
  .inline form select,
  .inline form button {
    width: 100%;
  }

  .inline.inline-actions {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  .inline.inline-actions form {
    width: auto;
    flex: 0 1 auto;
  }

  .inline.inline-actions form button {
    width: auto;
  }

  .inline.mobile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    gap: 8px;
    width: 100%;
  }

.inline.mobile-actions form {
  width: 100%;
}

.inline.mobile-actions form button {
  width: 100%;
}

  .action-center {
    justify-items: center;
    align-items: center;
  }

  .user-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "tag tag"
      "pass passsave"
      "reset reset"
      "save del";
  }

  .user-action-form {
    display: none;
  }

  .nav a {
    flex: 1 1 100%;
    text-align: center;
  }

  .logo {
    height: 44px;
  }

  .brand-title {
    font-size: 21px;
  }

  .page-title {
    font-size: 16px;
  }

  .subtitle {
    font-size: 10px;
  }

  .card {
    padding: 12px;
    overflow: hidden;
  }
}

@media (max-width: 720px) {
  .table thead {
    display: none;
  }

  .table,
  .table tbody,
  .table tr,
  .table td {
    display: block;
    width: 100%;
  }

  .table tr {
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #121723;
  }

  .table td {
    border: none;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    font-size: 15px;
  }

  .table td::before {
    content: attr(data-label);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
  }

  .table td:last-child {
    border-bottom: none;
  }

  .table td.empty {
    display: block;
    text-align: center;
  }
}
