/* JusticeDesk – Sidebar Hover Edition */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-body: #020617;
  --bg-card: rgba(15, 23, 42, 0.96);
  --border-subtle: rgba(148, 163, 184, 0.25);

  --accent: #38bdf8;
  --accent-strong: #0ea5e9;

  --accent-success: #4ade80;
  --accent-danger: #f97373;

  --text-main: #e5e7eb;
  --text-muted: #9ca3af;
  --text-soft: #6b7280;

  --radius-lg: 1.4rem;
  --radius-md: 0.9rem;
  --radius-pill: 999px;

  --shadow-strong: 0 26px 80px rgba(15, 23, 42, 0.95);
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.85);
}

@keyframes bg-shift {
  0% { background-position: 0% 0%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 0%; }
}

@keyframes glow-pulse {
  0%,100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, #0b1120 0, #020617 40%, #020617 70%, #000 100%),
    radial-gradient(circle at 0% 0%, rgba(56, 189, 248, 0.20), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.18), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(16, 185, 129, 0.20), transparent 55%);
  background-size: 220% 220%;
  animation: bg-shift 35s ease-in-out infinite;
  color: var(--text-main);
}

/* Layout */
.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  padding: 2rem 1.2rem;
}

.layout {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.4rem;
}

/* Collapsed: Sidebar schmal, Content breiter */
.layout.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

@media (max-width: 900px) {
  .app-shell {
    padding: 1.5rem 0.8rem;
  }
  .layout,
  .layout.sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Logo */
.logo-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(56,189,248,0.5);
  box-shadow: 0 10px 35px rgba(15,23,42,0.9);
}

.logo-mark-symbol {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e5e7eb, #0f172a);
  box-shadow: 0 0 16px rgba(56,189,248,0.8);
  position: relative;
}

.logo-mark-symbol::before,
.logo-mark-symbol::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  border: 1px solid rgba(56,189,248,0.9);
  opacity: 0.8;
}

.logo-mark-text-main {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.logo-mark-text-sub {
  font-size: 0.7rem;
  color: #9ca3af;
}

/* Sidebar */
.sidebar {
  border-radius: 1.4rem;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.22), rgba(15,23,42,0.98));
  border: 1px solid rgba(37,99,235,0.7);
  box-shadow: 0 26px 70px rgba(15,23,42,0.9);
  padding: 1rem 1rem 1.1rem;
  position: relative;
  overflow: hidden;
  transition:
    padding 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 210deg,
    rgba(56,189,248,0.0),
    rgba(56,189,248,0.5),
    rgba(56,189,248,0.0),
    rgba(37,99,235,0.6),
    rgba(56,189,248,0.0)
  );
  opacity: 0.55;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: glow-pulse 16s ease-in-out infinite;
}

.sidebar-inner { position: relative; }

.sidebar-user {
  margin-top: 0.8rem;
  padding: 0.6rem 0.7rem;
  border-radius: 0.9rem;
  background: rgba(15,23,42,0.9);
  border: 1px solid rgba(30,64,175,0.9);
}

.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.sidebar-user-meta {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.2rem;
}

/* Sidebar Nav */

.sidebar-nav {
  margin-top: 1rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(30,64,175,0.7);
}

.sidebar-section-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
  margin-bottom: 0.4rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  padding: 0.4rem 0.55rem;
  border-radius: 0.8rem;
  color: #d1d5db;
  text-decoration: none;
  margin-bottom: 0.15rem;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease,
    box-shadow 0.15s ease,
    color 0.12s ease;
}

.sidebar-link::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at left, rgba(56,189,248,0.4), transparent 60%);
  transition: opacity 0.2s ease;
}

.sidebar-link:hover::before { opacity: 1; }

.sidebar-link:hover {
  transform: translateY(-1px);
  border-color: rgba(56,189,248,0.6);
  box-shadow: 0 14px 35px rgba(15,23,42,0.9);
}

.sidebar-link-active {
  background: rgba(15,23,42,0.9);
  border-color: rgba(56,189,248,0.95);
  box-shadow: 0 18px 40px rgba(56,189,248,0.45);
}

.sidebar-link-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.7rem;
  background: rgba(15,23,42,0.95);
  border: 1px solid rgba(51,65,85,0.9);
  font-size: 0.9rem;
}

.sidebar-footer {
  margin-top: 1.2rem;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Logout Button */
.sidebar-logout { margin-top: 0.7rem; }

/* Collapsed-State: nur Icons, alles andere minimiert */

.layout.sidebar-collapsed .sidebar {
  padding: 0.9rem 0.45rem;
}

.layout.sidebar-collapsed .logo-mark-text-main,
.layout.sidebar-collapsed .logo-mark-text-sub,
.layout.sidebar-collapsed .sidebar-user-meta,
.layout.sidebar-collapsed .sidebar-section-label,
.layout.sidebar-collapsed .sidebar-footer {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.15s ease, max-height 0.15s ease;
}

.layout.sidebar-collapsed .sidebar-user-name {
  font-size: 0.78rem;
  white-space: nowrap;
}

.layout.sidebar-collapsed .sidebar-user {
  padding: 0.35rem;
  text-align: center;
}

.layout.sidebar-collapsed .sidebar-link {
  justify-content: center;
  padding: 0.35rem 0.3rem;
}

.layout.sidebar-collapsed .sidebar-link span:nth-child(2) {
  opacity: 0;
  width: 0;
  margin: 0;
  overflow: hidden;
  transition: opacity 0.15s ease, width 0.15s ease, margin 0.15s ease;
}

/* Card */

.card {
  width: 100%;
  background: linear-gradient(135deg, rgba(15,23,42,0.96), rgba(15,23,42,0.99));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-strong);
  padding: 1.3rem 1.4rem 1.4rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 160deg,
    rgba(56,189,248,0.0),
    rgba(56,189,248,0.45),
    rgba(56,189,248,0.0),
    rgba(37,99,235,0.45),
    rgba(56,189,248,0.0)
  );
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: glow-pulse 18s ease-in-out infinite;
}

.card-inner {
  position: relative;
  border-radius: calc(var(--radius-lg) - 0.4rem);
  background: radial-gradient(circle at top left, rgba(56,189,248,0.14), rgba(15,23,42,0.96));
  padding: 1.1rem 1.3rem 1.3rem;
}

/* Header */

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.7);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  padding: 0.18rem 0.7rem;
  border-radius: var(--radius-pill);
  background: radial-gradient(circle at left, rgba(56,189,248,0.35), rgba(15,23,42,0.98));
  border: 1px solid rgba(56, 189, 248, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-success);
  box-shadow: 0 0 10px rgba(34, 197, 94, 1);
}

.app-title {
  margin-top: 0.4rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.app-subtitle {
  margin-top: 0.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.meta-text {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: var(--radius-pill);
  padding: 0.42rem 1.05rem;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease,
    box-shadow 0.15s ease;
}

.btn-primary {
  background: radial-gradient(circle at top, var(--accent-strong), var(--accent));
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 0 12px 35px rgba(56, 189, 248, 0.45);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.6);
}

.btn-outline {
  border-color: rgba(148, 163, 184, 0.7);
  background: transparent;
}

.btn-outline:hover {
  border-color: rgba(209, 213, 219, 0.95);
  background: rgba(15, 23, 42, 0.9);
}

.btn-danger {
  border-color: rgba(248, 113, 113, 0.9);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.45);
}

.btn-xs {
  padding: 0.26rem 0.7rem;
  font-size: 0.74rem;
}

/* Inputs */

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}

.label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.input,
.select,
.textarea {
  width: 100%;
  border-radius: 0.7rem;
  border: 1px solid rgba(51, 65, 85, 1);
  padding: 0.45rem 0.7rem;
  font-size: 0.86rem;
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease,
    transform 0.05s ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.6);
  background: rgba(15, 23, 42, 0.98);
  transform: translateY(-0.5px);
}

.textarea {
  min-height: 90px;
  resize: vertical;
}

.input-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Tables */

.table-wrapper {
  margin-top: 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(31, 41, 55, 1);
  overflow: hidden;
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.15), rgba(15, 23, 42, 0.98));
  box-shadow: var(--shadow-soft);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.table thead {
  background: radial-gradient(circle at top, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.98));
}

.table th,
.table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(31, 41, 55, 0.95);
}

.table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.76);
}

.table tbody tr:hover {
  background: rgba(30, 64, 175, 0.35);
}

/* Tags */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
}

.tag-open { background: rgba(248, 113, 113, 0.16); color: #fecaca; }
.tag-done { background: rgba(34, 197, 94, 0.16); color: #bbf7d0; }
.tag-archive { background: rgba(148, 163, 184, 0.2); color: #e5e7eb; }
.tag-new { background: rgba(56, 189, 248, 0.18); color: #bae6fd; }
.tag-ok { background: rgba(34, 197, 94, 0.16); color: #bbf7d0; }
.tag-warning { background: rgba(245, 158, 11, 0.18); color: #fed7aa; }
.tag-expired {
  background: rgba(239, 68, 68, 0.25);
  color: #fecaca;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Dashboard */

.dashboard-grid {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}

.stat-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(31, 41, 55, 1);
  background: radial-gradient(circle at top, rgba(56,189,248,0.16), rgba(15,23,42,0.98));
  padding: 0.75rem 0.95rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(56,189,248,0.35), transparent 70%);
  opacity: 0.35;
  mix-blend-mode: screen;
  pointer-events: none;
}

.stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.11em;
}

.stat-value {
  margin-top: 0.3rem;
  font-size: 1.25rem;
  font-weight: 650;
}

.stat-sub {
  margin-top: 0.18rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* Footer */

.footer {
  margin-top: 1.1rem;
  font-size: 0.75rem;
  color: var(--text-soft);
  text-align: right;
}

/* LOGIN VIEW (gekürzt, aber schick) */

.login-wrapper {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.login-panel {
  position: relative;
  border-radius: 1.6rem;
  background: radial-gradient(circle at top left, rgba(56,189,248,0.18), rgba(15,23,42,0.98));
  border: 1px solid rgba(37,99,235,0.7);
  box-shadow: 0 30px 80px rgba(15,23,42,0.95);
  padding: 1.4rem 1.7rem 1.6rem;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: conic-gradient(
    from 180deg,
    rgba(56,189,248,0.0),
    rgba(56,189,248,0.5),
    rgba(56,189,248,0.0),
    rgba(37,99,235,0.6),
    rgba(56,189,248,0.0)
  );
  opacity: 0.55;
  mix-blend-mode: screen;
  pointer-events: none;
  animation: glow-pulse 14s ease-in-out infinite;
}

.login-panel-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.4rem;
  align-items: center;
}

@media (max-width: 900px) {
  .login-panel-inner {
    grid-template-columns: minmax(0, 1fr);
  }
}

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  padding: 0.18rem 0.7rem;
  border-radius: 999px;
  background: radial-gradient(circle at left, rgba(56,189,248,0.35), rgba(15,23,42,0.98));
  border: 1px solid rgba(56, 189, 248, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
}

.login-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34,197,94,1);
}

.login-headline {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0.4rem;
}

.login-subline {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: #9ca3af;
}

.login-bullets {
  margin-top: 0.8rem;
  font-size: 0.82rem;
  color: #9ca3af;
  padding-left: 1.1rem;
}

.login-bullets li {
  margin-bottom: 0.2rem;
}

.login-box {
  border-radius: 1.1rem;
  background: rgba(15,23,42,0.94);
  border: 1px solid rgba(148,163,184,0.45);
  padding: 1rem 1.2rem 1.1rem;
  box-shadow: 0 16px 40px rgba(15,23,42,0.9);
}

.login-label-small {
  font-size: 0.78rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.login-box-title {
  margin-top: 0.4rem;
  font-size: 0.98rem;
}

.login-box-text {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: #9ca3af;
}

.login-discord-btn { margin-top: 0.9rem; }

.login-discord-btn .btn-primary {
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
}

.login-legal {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.login-error {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  color: #fecaca;
  padding: 0.45rem 0.65rem;
  border-radius: 0.7rem;
  border: 1px solid rgba(248, 113, 113, 0.7);
  background: rgba(127, 29, 29, 0.4);
}
