/* ED-Cockpit – gemeinsame Styles */
:root {
  --accent: #1a56db;
  --accent-dark: #1344b0;
  --accent-bg: #eff6ff;
  --dark: #1a1a1a;
  --mid: #555;
  --soft: #888;
  --light: #f7f7f7;
  --border: #e0e0e0;
  --white: #ffffff;
  --green: #15803d;
  --green-bg: #dcfce7;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --purple: #7e22ce;
  --purple-bg: #f3e8ff;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --header-h: 56px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 14px; color: var(--dark); background: var(--light);
}

/* ── HEADER ─────────────────────────────── */
header.app-header {
  position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
  background: var(--white); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; z-index: 100;
}
.header-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 1.5rem; width: 100%;
  display: flex; align-items: center; gap: 1.5rem;
}
.logo-area {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none; color: inherit; flex-shrink: 0;
}
.logo-icon {
  width: 28px; height: 28px; background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text { font-weight: 700; font-size: 15px; letter-spacing: -.3px; }
.logo-dot { color: var(--accent); }
.logo-divider { width: 1px; height: 24px; background: var(--border); }
.page-title { font-size: 13px; color: var(--mid); font-weight: 500; }

nav.main-nav { display: flex; gap: .25rem; margin-left: 1rem; flex: 1; }
nav.main-nav a {
  text-decoration: none; color: var(--mid); font-size: 13px; font-weight: 500;
  padding: .4rem .8rem; border-radius: var(--radius); transition: all .15s;
  display: flex; align-items: center; gap: .35rem;
}
nav.main-nav a:hover { background: var(--light); color: var(--dark); }
nav.main-nav a.active { background: var(--accent-bg); color: var(--accent); }
nav.main-nav a.disabled { opacity: .45; pointer-events: none; }
nav.main-nav a .badge {
  font-size: 9px; padding: 1px 5px; background: var(--mid); color: #fff;
  border-radius: 3px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}

.user-menu { position: relative; flex-shrink: 0; }
.user-btn {
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .6rem; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-family: inherit; font-size: 13px; color: var(--dark);
}
.user-btn:hover { background: var(--light); }
.user-avatar {
  width: 24px; height: 24px; background: var(--accent); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.user-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  min-width: 220px; padding: .35rem; display: none; z-index: 200;
}
.user-dropdown.open { display: block; }
.user-dropdown .item {
  display: block; padding: .5rem .75rem; font-size: 13px;
  color: var(--dark); text-decoration: none; border-radius: var(--radius); cursor: pointer;
}
.user-dropdown .item:hover { background: var(--light); }
.user-dropdown .item.danger:hover { background: var(--red-bg); color: var(--red); }
.user-dropdown .info {
  padding: .65rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem;
}
.user-dropdown .info .name { font-weight: 600; font-size: 13px; }
.user-dropdown .info .role {
  font-size: 11px; color: var(--mid); text-transform: uppercase; letter-spacing: .04em;
}
.user-dropdown .info .email-line { font-size: 11px; color: var(--soft); margin-top: .15rem; }

/* ── MAIN ───────────────────────────────── */
main.app-main { padding: calc(var(--header-h) + 1.5rem) 1.5rem 2rem; max-width: 1600px; margin: 0 auto; }

.page-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; gap: 1rem;
}
.page-head h1 { font-size: 22px; font-weight: 700; }
.page-head p { color: var(--mid); font-size: 13px; margin-top: .15rem; }
.page-head .actions { display: flex; gap: .5rem; }

/* ── CARDS ──────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.card-title {
  font-size: 13px; font-weight: 600; color: var(--mid);
  text-transform: uppercase; letter-spacing: .05em;
}
.card-action { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.card-action:hover { text-decoration: underline; }

.empty-state { text-align: center; padding: 1.5rem .5rem; color: var(--soft); font-size: 13px; }
.empty-state .icon { width: 36px; height: 36px; margin: 0 auto .5rem; color: var(--border); }

/* ── GRID ───────────────────────────────── */
.grid { display: grid; gap: 1rem; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .grid-cols-3, .grid-cols-2 { grid-template-columns: 1fr; }
  .grid-cols-4 { grid-template-columns: 1fr; }
}

/* ── BUTTONS ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .5rem .9rem; font-size: 13px; font-weight: 500;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; transition: all .15s; font-family: inherit;
  text-decoration: none; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--mid); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { background: var(--light); color: var(--dark); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: .3rem .6rem; font-size: 12px; }
.btn-icon {
  padding: .35rem; background: transparent; border: none; cursor: pointer;
  border-radius: var(--radius); color: var(--mid); transition: all .15s;
}
.btn-icon:hover { background: var(--light); color: var(--dark); }

/* ── FORMS ──────────────────────────────── */
.form-group { margin-bottom: 1rem; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--mid); text-transform: uppercase; letter-spacing: .04em; margin-bottom: .35rem; }
.label-help { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--soft); margin-left: .5rem; font-size: 11px; }
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"],
input[type="url"], input[type="search"],
textarea, select {
  width: 100%; padding: .55rem .75rem; font-size: 14px;
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s; font-family: inherit;
  background: var(--white); color: var(--dark);
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg);
}
textarea { resize: vertical; min-height: 80px; }

/* ── ALERTS ─────────────────────────────── */
.alert { padding: .65rem .8rem; border-radius: var(--radius); font-size: 13px; margin-bottom: 1rem; display: none; }
.alert.show { display: block; }
.alert-error { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: var(--green-bg); color: var(--green); border: 1px solid #bbf7d0; }
.alert-info { background: var(--accent-bg); color: var(--accent); border: 1px solid #c7d7fc; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }

/* ── BADGES / STATUS ────────────────────── */
.tag {
  display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  background: var(--light); color: var(--mid);
}
.tag-blue   { background: var(--accent-bg); color: var(--accent); }
.tag-green  { background: var(--green-bg);  color: var(--green); }
.tag-amber  { background: var(--amber-bg);  color: var(--amber); }
.tag-red    { background: var(--red-bg);    color: var(--red); }
.tag-purple { background: var(--purple-bg); color: var(--purple); }

/* ── MODAL ──────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white); border-radius: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.2);
  width: 100%; max-width: 700px; max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-large { max-width: 900px; }
.modal-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: .85rem 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: .5rem; background: var(--light);
}

/* ── LOADING ────────────────────────────── */
#app-loading { position: fixed; inset: 0; background: var(--light); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.spinner-lg { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #fff; border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TABLE ──────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--border); font-size: 13px; }
th { font-weight: 600; color: var(--mid); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; background: var(--light); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--light); cursor: pointer; }

/* ── UTILS ──────────────────────────────── */
.hidden { display: none !important; }
.text-mid { color: var(--mid); }
.text-soft { color: var(--soft); }
.text-sm { font-size: 12px; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.flex-1 { flex: 1; }
