/* App Manager – Basis-Layout (AMP-18).
   Design an die Fuhrpark-App angelehnt: App-Shell mit Kopfzeile und Sidebar,
   Navy-Akzent. Bewusst schlank gehalten; wächst mit den Funktionsbereichen. */

:root {
  --accent: #1F3B63;
  --accent-soft: #e7edf6;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e2e5ea;
  --text: #1f2937;
  --muted: #6b7280;
  --sidebar-w: 248px;
  --header-h: 58px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ---------- App-Shell ---------- */
.app-shell {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

.app-header {
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.app-header .brand { display: flex; align-items: center; gap: 12px; }
.app-header .title { font-weight: 700; font-size: 1.05rem; letter-spacing: .2px; }
.app-header .user { display: flex; align-items: center; gap: 10px; }
.app-header .user .meta { text-align: right; line-height: 1.15; }
.app-header .user .meta .n { font-size: .85rem; font-weight: 600; }
.app-header .user .meta .r { font-size: .72rem; opacity: .8; }
.app-header .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
}

.hamburger {
  background: transparent; border: 0; cursor: pointer;
  width: 30px; height: 30px; padding: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
}
.hamburger span { display: block; height: 2px; background: #fff; border-radius: 2px; }

/* ---------- Body: Sidebar + Inhalt ---------- */
.app-body {
  grid-row: 2;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}
.app-shell.collapsed .app-body { grid-template-columns: 0 1fr; }
.app-shell.collapsed .sidebar { display: none; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 12px 10px;
  min-height: calc(100vh - var(--header-h));
}
.sidebar .items { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.menu-row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--text); text-decoration: none;
  font-size: .9rem;
}
.menu-row .ico { display: flex; width: 18px; justify-content: center; color: var(--muted); }
.menu-row:hover { background: var(--accent-soft); }
.menu-row.active { background: var(--accent); color: #fff; }
.menu-row.active .ico { color: #fff; }

.menu-row.disabled {
  color: var(--muted); cursor: default;
}
.menu-row.disabled:hover { background: transparent; }
.menu-row .bald {
  margin-left: auto;
  font-size: .62rem; text-transform: uppercase; letter-spacing: .04em;
  background: var(--accent-soft); color: var(--accent);
  padding: 1px 7px; border-radius: 999px;
}

.sidebar .cap {
  font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); padding: 12px 12px 4px;
}
.sidebar .foot { color: var(--muted); font-size: .72rem; padding: 10px 12px 2px; }

/* ---------- Inhalt ---------- */
.content { padding: 24px 28px; }
.page-title { font-size: 1.35rem; font-weight: 700; margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 20px; }

.card-soft {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 24px;
  box-shadow: 0 6px 24px rgba(0,0,0,.04);
}

/* ---------- Flash-Meldungen ---------- */
.msg-strip { padding: 10px 18px; font-size: .88rem; }
.msg-strip.success { background: #e7f6ec; color: #1b5e33; }
.msg-strip.warning { background: #fef6e0; color: #8a5b00; }
.msg-strip.danger  { background: #fdecec; color: #a12626; }
.msg-strip.info    { background: var(--accent-soft); color: var(--accent); }

/* ---------- Auth / Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 34px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 10px 34px rgba(0,0,0,.07);
}
.login-card h1 { font-size: 1.4rem; margin: 0 0 4px; color: var(--accent); }
.login-card .sub { color: var(--muted); font-size: .9rem; margin: 0 0 20px; }
.login-card .field { display: block; margin-bottom: 14px; }
.login-card .field > span { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; }
.login-card .control {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; font-size: .95rem; background: #fff;
}
.login-card .control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.login-card .checkbox { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.btn-accent {
  width: 100%; border: 0; border-radius: 9px; cursor: pointer;
  background: var(--accent); color: #fff; padding: 11px 16px;
  font-size: .95rem; font-weight: 600;
}
.btn-accent:hover { filter: brightness(1.08); }

/* ---------- KPI-Karten (Management-Portal, AMP-33) ---------- */
.kpi {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.04); height: 100%;
}
.kpi .zahl { font-size: 1.8rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.kpi .label { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* Aktivitäts-Liste */
.akt-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.akt-item:last-child { border-bottom: 0; }
.akt-item .zeit { color: var(--muted); font-size: .75rem; white-space: nowrap; min-width: 108px; }
.akt-item .txt { font-size: .88rem; }
.akt-item .who { color: var(--muted); font-size: .75rem; }

/* ---------- App-Store-Kacheln (AMP-27) ---------- */
.app-tile {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; height: 100%; display: flex; flex-direction: column;
  box-shadow: 0 6px 24px rgba(0,0,0,.04);
  transition: box-shadow .15s, transform .15s;
}
.app-tile:hover { box-shadow: 0 10px 30px rgba(0,0,0,.10); transform: translateY(-2px); }
.app-tile-img {
  position: relative; height: 170px; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.app-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.app-tile-ph { font-size: 2.4rem; font-weight: 800; color: var(--accent); opacity: .55; }
.app-tile-status { position: absolute; top: 10px; right: 10px; }
.app-tile-body { padding: 16px 18px; display: flex; flex-direction: column; flex: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .app-body { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: var(--header-h); left: 0; bottom: 0;
    width: var(--sidebar-w); z-index: 15;
  }
  .app-shell:not(.collapsed) .sidebar { box-shadow: 0 8px 30px rgba(0,0,0,.18); }
  .app-shell.collapsed .sidebar { display: none; }
  .app-header .user .meta { display: none; }
}
