/* styles.css */

/* =============== */
/* Base / Reset    */
/* =============== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #111827;
  background: #f6f7fb;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
input, select, textarea { font: inherit; }

:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
  --radius: 14px;

  --primary: #1f2937;       /* neutral dark */
  --primary-2: #111827;
  --accent: #2563eb;        /* blue */
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #f59e0b;
}

/* =============== */
/* Layout          */
/* =============== */
#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.2px;
}
.logo span {
  display: inline-block;
  padding: 2px 8px;
  margin-right: 8px;
  border-radius: 999px;
  background: #eaf0ff;
  color: #1d4ed8;
  font-weight: 800;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  padding: 16px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  height: calc(100vh - 120px);
  position: sticky;
  top: 76px;
  overflow: auto;
}

.content {
  min-width: 0;
}

#view-container {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  min-height: calc(100vh - 120px);
}

/* =============== */
/* Navigation      */
/* =============== */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-item {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-item:hover {
  background: #f3f4f6;
}

.nav-item.active {
  background: #eef2ff;
  color: #1d4ed8;
  font-weight: 700;
}

.nav-badge {
  font-size: 12px;
  color: var(--muted);
  background: #f3f4f6;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

/* =============== */
/* Footer          */
/* =============== */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.env-label {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff7ed;
  color: #9a3412;
  font-weight: 700;
}

/* =============== */
/* Typography      */
/* =============== */
h1 { font-size: 20px; margin: 0 0 8px; }
h2 { font-size: 16px; margin: 18px 0 10px; }
p { margin: 0 0 10px; color: var(--muted); }
.small { font-size: 12px; color: var(--muted); }

/* =============== */
/* Buttons         */
/* =============== */
.btn {
  border: 1px solid var(--border);
  background: var(--panel);
  padding: 8px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.02s ease, background 0.15s ease;
}

.btn:hover { background: #f9fafb; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: #1d4ed8;
  color: #fff;
}
.btn-primary:hover { filter: brightness(0.98); }

.btn-secondary {
  background: #f3f4f6;
}

.btn-danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}

/* =============== */
/* Cards / Toolbar */
/* =============== */
.card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin: 12px 0;
}

.toolbar-left, .toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* =============== */
/* Forms           */
/* =============== */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 860px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
  }
  #view-container { min-height: auto; }
  .field-row { grid-template-columns: 1fr; }
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  outline: none;
}

.input:focus, select:focus, textarea:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59,130,246,0.15);
}

/* =============== */
/* Tables          */
/* =============== */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  color: var(--muted);
  background: #fafafa;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td { background: #fbfdff; }

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #f3f4f6;
  color: var(--primary);
}

.status.success { background: #dcfce7; border-color: #bbf7d0; color: #14532d; }
.status.warning { background: #ffedd5; border-color: #fed7aa; color: #7c2d12; }
.status.danger  { background: #fee2e2; border-color: #fecaca; color: #7f1d1d; }

/* =============== */
/* Toast / Banner  */
/* =============== */
.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  min-width: 260px;
}

.toast .title {
  font-weight: 700;
  margin-bottom: 4px;
}
.toast .msg {
  color: var(--muted);
  font-size: 13px;
}

.noscript-warning {
  margin: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #fed7aa;
  background: #ffedd5;
  color: #7c2d12;
}

/* =========================================================
   Mitarbeiter-App – Zusatzdienste / Bewerbungen / Nachrichten
   ========================================================= */

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.tab-btn {
    padding: 0.6rem 1.2rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: #555;
    cursor: pointer;
}

.tab-btn:hover {
    color: #111;
}

.tab-btn.active {
    color: #111;
    border-bottom-color: #2563eb; /* Admin-Akzent */
}

/* ---------- Panels ---------- */
.panel {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

.panel-sub {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.panel h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.panel h3 {
    margin-top: 0;
    font-size: 1rem;
}

/* ---------- Forms ---------- */
.form {
    max-width: 720px;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.form-row label {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #374151;
}

.form-row input,
.form-row textarea,
.select {
    padding: 0.55rem 0.6rem;
    font-size: 0.9rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
}

.form-row input:focus,
.form-row textarea:focus,
.select:focus {
    outline: none;
    border-color: #2563eb;
}

.form-actions {
    margin-top: 1rem;
}

.hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6b7280;
}

/* ---------- Tables ---------- */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 0.55rem 0.6rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.table th {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
}

.table tr:hover td {
    background: #f9fafb;
}

/* ---------- Buttons (Erweiterung) ---------- */
.btn-sm {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.btn-danger {
    background: #dc2626;
    color: #ffffff;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

/* ---------- Empty / Placeholder States ---------- */
.table-placeholder,
.panel p {
    font-size: 0.9rem;
    color: #6b7280;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .tabs {
        flex-wrap: wrap;
    }

    .form {
        max-width: 100%;
    }

    .table {
        font-size: 0.85rem;
    }
}
