/* ============================================================
   Sovereign IT – Demo Pages Stylesheet
   ============================================================ */

/* ── Demo Page Layout ──────────────────────────────────────── */
.demo-page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a4a7a 100%);
  padding: 6rem 0 3rem;
  margin-top: 64px;
}
.demo-page-hero h1 { color: var(--white); font-size: clamp(1.6rem, 3vw, 2.3rem); margin-bottom: .6rem; }
.demo-page-hero p { color: rgba(255,255,255,.78); font-size: 1rem; max-width: 660px; margin-bottom: 0; }

.demo-live-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(37,99,235,.25); color: #93c5fd;
  border: 1px solid rgba(37,99,235,.4);
  font-size: .75rem; font-weight: 700; padding: .3rem .8rem;
  border-radius: 20px; margin-bottom: .9rem; letter-spacing: .06em;
  text-transform: uppercase;
}
.demo-live-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: #60a5fa; display: inline-block;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.75); }
}

.demo-back-link {
  display: inline-flex; align-items: center; gap: .4rem;
  color: rgba(255,255,255,.65); font-size: .85rem; text-decoration: none;
  margin-bottom: 1.25rem; transition: color .18s;
}
.demo-back-link:hover { color: var(--white); }
.demo-back-link svg { width: 16px; height: 16px; }

/* ── Main Demo Container ────────────────────────────────────── */
.demo-container {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
}
.demo-section {
  padding: 2.5rem 0 3rem;
}

/* ── KPI Cards ──────────────────────────────────────────────── */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem;
  margin-bottom: 2rem;
}
.kpi-card {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
  padding: 1.5rem; position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: var(--accent);
}
.kpi-card.green::before  { background: #16a34a; }
.kpi-card.orange::before { background: #ea580c; }
.kpi-card.purple::before { background: #7c3aed; }
.kpi-label {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gray-400); margin-bottom: .4rem;
}
.kpi-value {
  font-size: 1.85rem; font-weight: 800; color: var(--navy); line-height: 1.1;
}
.kpi-sub {
  font-size: .8rem; color: var(--gray-400); margin-top: .25rem;
}
.kpi-change {
  display: inline-flex; align-items: center; gap: .2rem;
  font-size: .78rem; font-weight: 600; margin-top: .3rem;
  padding: .15rem .5rem; border-radius: 12px;
}
.kpi-change.up   { background: #f0fdf4; color: #16a34a; }
.kpi-change.down { background: #fef2f2; color: #dc2626; }

/* ── Data Table Panel ───────────────────────────────────────── */
.dt-panel {
  background: var(--white); border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.dt-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-200);
  gap: 1rem; flex-wrap: wrap;
}
.dt-toolbar-left {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; flex: 1;
}
.dt-toolbar h3 {
  font-size: 1rem; font-weight: 700; color: var(--navy); white-space: nowrap;
}
.dt-search {
  position: relative; flex: 1; min-width: 200px; max-width: 320px;
}
.dt-search input {
  width: 100%; padding: .5rem .75rem .5rem 2.2rem;
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: .875rem; font-family: inherit; color: var(--gray-800);
  background: var(--gray-50); transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.dt-search input:focus {
  border-color: var(--accent); background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.dt-search-icon {
  position: absolute; left: .6rem; top: 50%; transform: translateY(-50%);
  color: var(--gray-400); pointer-events: none;
}
.dt-filter {
  padding: .5rem .75rem; border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: .875rem; font-family: inherit;
  color: var(--gray-800); background: var(--gray-50);
  cursor: pointer; outline: none; transition: border-color .18s;
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .6rem center;
  padding-right: 1.8rem;
}
.dt-filter:focus { border-color: var(--accent); }

.dt-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem 1rem; border-radius: 8px; font-size: .875rem;
  font-weight: 600; font-family: inherit; cursor: pointer;
  border: none; transition: var(--transition); white-space: nowrap;
}
.dt-btn-primary { background: var(--accent); color: var(--white); }
.dt-btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.dt-btn-ghost {
  background: transparent; color: var(--gray-600);
  border: 1.5px solid var(--gray-200);
}
.dt-btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--light-blue); }
.dt-btn-sm { padding: .3rem .65rem; font-size: .8rem; }
.dt-btn-danger { background: #fef2f2; color: #dc2626; border: 1.5px solid #fecaca; }
.dt-btn-danger:hover { background: #dc2626; color: var(--white); }

/* ── Table ──────────────────────────────────────────────────── */
.dt-wrapper { overflow-x: auto; }
.dt-table {
  width: 100%; border-collapse: collapse; font-size: .875rem;
  min-width: 600px;
}
.dt-table thead tr { background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
.dt-table thead th {
  padding: .75rem 1rem; text-align: left; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--gray-600);
  white-space: nowrap; user-select: none;
}
.dt-table thead th.sortable { cursor: pointer; }
.dt-table thead th.sortable:hover { color: var(--accent); }
.dt-table thead th .sort-arrow { margin-left: .3rem; opacity: .4; font-size: .75rem; }
.dt-table thead th.sort-asc .sort-arrow,
.dt-table thead th.sort-desc .sort-arrow { opacity: 1; color: var(--accent); }
.dt-table thead th.sort-asc  .sort-arrow::after { content: ' ↑'; }
.dt-table thead th.sort-desc .sort-arrow::after { content: ' ↓'; }
.dt-table thead th:not(.sort-asc):not(.sort-desc) .sort-arrow::after { content: ' ↕'; }

.dt-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .1s;
}
.dt-table tbody tr:hover { background: #f8faff; }
.dt-table tbody tr:last-child { border-bottom: none; }
.dt-table td { padding: .75rem 1rem; color: var(--gray-800); vertical-align: middle; }
.dt-table td.muted { color: var(--gray-400); }
.dt-table td .actions { display: flex; gap: .4rem; }

/* Expandable row */
.dt-expand-row {
  display: none; background: var(--light-blue);
  border-bottom: 1px solid #bfdbfe;
}
.dt-expand-row.open { display: table-row; }
.dt-expand-row td { padding: .75rem 1.25rem; color: var(--gray-800); font-size: .85rem; line-height: 1.65; }
.dt-expand-btn { cursor: pointer; font-size: .85rem; color: var(--accent); background: none; border: none; font-family: inherit; padding: 0; }
.dt-expand-btn:hover { text-decoration: underline; }

/* ── Status Badges ──────────────────────────────────────────── */
.status-badge {
  display: inline-block; font-size: .75rem; font-weight: 700;
  padding: .22rem .7rem; border-radius: 20px; white-space: nowrap;
}
.s-aktiv, .s-abgeschlossen, .s-gelöst, .s-genehmigt {
  background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0;
}
.s-inaktiv, .s-archiviert, .s-geschlossen, .s-abgelehnt, .s-fehler {
  background: #fef2f2; color: #dc2626; border: 1px solid #fecaca;
}
.s-testphase, .s-entwurf, .s-läuft, .s-in-bearbeitung {
  background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa;
}
.s-offen, .s-neu {
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
}

/* Priority badges */
.p-hoch   { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.p-mittel { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.p-niedrig{ background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Quality stars */
.quality-stars { color: #f59e0b; font-size: .95rem; letter-spacing: .05rem; }

/* SLA indicator */
.sla-ok  { color: #16a34a; font-weight: 700; font-size: .8rem; }
.sla-due { color: #dc2626; font-weight: 700; font-size: .8rem; }

/* ── Pagination ─────────────────────────────────────────────── */
.dt-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.25rem; border-top: 1px solid var(--gray-200);
  flex-wrap: wrap; gap: .75rem;
}
.dt-info { font-size: .82rem; color: var(--gray-400); }
.dt-pagination { display: flex; gap: .4rem; align-items: center; }
.dt-page-btn {
  padding: .35rem .7rem; border: 1.5px solid var(--gray-200);
  border-radius: 7px; font-size: .8rem; font-weight: 600; cursor: pointer;
  background: var(--white); color: var(--gray-600); transition: var(--transition);
  font-family: inherit;
}
.dt-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.dt-page-btn.active { background: var(--accent); color: var(--white); border-color: var(--accent); }
.dt-page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── Empty State ────────────────────────────────────────────── */
.dt-empty {
  text-align: center; padding: 3rem 1rem; color: var(--gray-400);
}
.dt-empty svg { width: 48px; height: 48px; margin-bottom: 1rem; opacity: .4; }
.dt-empty p { font-size: .9rem; }

/* ── Loading skeleton ────────────────────────────────────────── */
.dt-loading { text-align: center; padding: 2.5rem 1rem; color: var(--gray-400); font-size: .9rem; }
.dt-skeleton { height: 44px; background: var(--gray-100); border-radius: 6px; margin-bottom: 2px; animation: shimmer 1.2s infinite; }
@keyframes shimmer {
  0%   { opacity: 1; }
  50%  { opacity: .5; }
  100% { opacity: 1; }
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,38,68,.7); z-index: 2000;
  align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,.3); width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  animation: modal-in .2s ease;
}
@keyframes modal-in {
  from { transform: scale(.95) translateY(-10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-header {
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 1.1rem; color: var(--navy); }
.modal-close {
  background: none; border: none; cursor: pointer; padding: .25rem;
  color: var(--gray-400); font-size: 1.3rem; line-height: 1;
  transition: color .18s;
}
.modal-close:hover { color: var(--navy); }
.modal-body { padding: 1.25rem 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: .75rem;
}

/* Form fields inside modal */
.mf-group { margin-bottom: 1rem; }
.mf-label { display: block; font-size: .83rem; font-weight: 600; color: var(--gray-800); margin-bottom: .35rem; }
.mf-input, .mf-select, .mf-textarea {
  width: 100%; padding: .55rem .85rem;
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  font-size: .875rem; font-family: inherit; color: var(--gray-800);
  background: var(--white); transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.mf-input:focus, .mf-select:focus, .mf-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.mf-select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center;
  padding-right: 2.2rem;
}
.mf-textarea { resize: vertical; min-height: 80px; }
.mf-row { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* ── Toast notifications ─────────────────────────────────────── */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 3000;
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none;
}
.toast {
  background: var(--navy); color: var(--white);
  padding: .75rem 1.25rem; border-radius: 10px; font-size: .875rem;
  font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,.25);
  pointer-events: auto; animation: toast-in .25s ease;
  display: flex; align-items: center; gap: .6rem; max-width: 320px;
}
.toast.success { background: #15803d; }
.toast.error   { background: #dc2626; }
.toast.info    { background: var(--accent); }
@keyframes toast-in {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.toast-out { animation: toast-out .25s ease forwards; }
@keyframes toast-out {
  to { transform: translateX(20px); opacity: 0; }
}

/* ── Demo CTA ───────────────────────────────────────────────── */
.demo-cta {
  background: linear-gradient(135deg, var(--navy), #1a4a7a);
  border-radius: var(--radius-lg); padding: 2.5rem;
  text-align: center; margin: 2rem 0 3rem;
}
.demo-cta h3 { color: var(--white); margin-bottom: .6rem; font-size: 1.3rem; }
.demo-cta p  { color: rgba(255,255,255,.75); margin-bottom: 1.5rem; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dt-toolbar { flex-direction: column; align-items: stretch; }
  .dt-toolbar-left { flex-direction: column; align-items: stretch; }
  .dt-search { max-width: 100%; }
  .mf-row { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
