/* ============================================================
   FC Baumaschinen — App Styles
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@600;700&family=Barlow:wght@400;500;600&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:    #06471e;
  --lime:     #a1c804;
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-700: #374151;
  --gray-900: #111827;
  --red:      #dc2626;
  --radius:   10px;
  --shadow:   0 1px 4px rgba(0,0,0,.08);
  --sidebar:  240px;
}

body { font-family: 'Barlow', sans-serif; background: var(--gray-50); color: var(--gray-900); min-height: 100vh; }
a { color: var(--green); text-decoration: none; }

/* ─── Auth pages ─────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: #ffffff; }
.auth-box  { width: 100%; max-width: 420px; }

/* Wordmark */
.auth-wordmark { text-align: center; margin-bottom: 36px; }
.auth-wordmark-fc  { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 700; letter-spacing: 10px; color: var(--gray-900); line-height: 1; text-transform: uppercase; }
.auth-wordmark-sub { font-family: 'Barlow Condensed', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: 5px; color: var(--gray-400); margin-top: 4px; }

/* Heading + sub */
.auth-heading { font-family: 'Barlow', sans-serif; font-size: 26px; font-weight: 400; text-align: center; margin-bottom: 8px; color: var(--gray-900); }
.auth-sub { color: var(--gray-400); font-size: 14px; text-align: center; margin-bottom: 28px; }

/* Field labels (uppercase above input) */
.auth-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.9px; color: var(--gray-700); margin-bottom: 6px; }

/* Auth-specific input style — filled, pill-ish, no visible border */
.auth-box input[type="email"],
.auth-box input[type="password"],
.auth-box input[type="text"],
.auth-box input[type="tel"] {
  background: #eef1f6; border: 1.5px solid transparent;
  border-radius: 12px; padding: 13px 16px; font-size: 16px;
  transition: border-color .15s, background .15s;
}
.auth-box input[type="email"]:focus,
.auth-box input[type="password"]:focus,
.auth-box input[type="text"]:focus,
.auth-box input[type="tel"]:focus { background: #fff; border-color: var(--green); outline: none; }
.auth-box .pass-wrap input { padding-right: 50px; }

/* Password wrapper with eye toggle */
.pass-wrap { position: relative; }
.pass-wrap input { padding-right: 44px; }
.pass-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--gray-400); display: flex; align-items: center; line-height: 1;
}
.pass-toggle:hover { color: var(--gray-700); }

/* Remember me */
.auth-remember { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; margin-bottom: 24px; }
.auth-checkbox {
  width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0;
  border: 1.5px solid var(--gray-400); background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s, border-color .12s;
}
.auth-checkbox.checked { background: var(--green); border-color: var(--green); }
.auth-checkbox svg { display: none; }
.auth-checkbox.checked svg { display: block; }
.auth-remember-text { font-size: 14px; color: var(--gray-700); font-weight: 500; }
.auth-remember-hint { font-size: 13px; color: var(--gray-400); }

/* Bottom links row */
.auth-links { display: flex; justify-content: space-between; align-items: center; margin-top: 22px; }
.auth-link { font-size: 13px; color: var(--gray-700); text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; padding: 0; }
.auth-link:hover { text-decoration: underline; }
.auth-link-accent { color: var(--green); font-weight: 600; }
.auth-link-center { text-align: center; margin-top: 22px; font-size: 13px; color: var(--gray-400); }
.auth-link-center a { color: var(--green); font-weight: 600; text-decoration: none; }
.auth-link-center a:hover { text-decoration: underline; }

/* Success state */
.auth-success-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--lime); display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; }

/* Legacy (keep for non-auth pages) */
.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 32px; text-decoration: none; }
.logo-mark { width: 36px; height: 36px; background: var(--green); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-dot  { width: 12px; height: 12px; background: var(--lime); border-radius: 50%; }
.logo span { font-family: 'Barlow Condensed', sans-serif; font-size: 18px; font-weight: 700; color: var(--green); }

h1 { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 700; margin-bottom: 6px; }
.sub { color: var(--gray-400); font-size: 14px; margin-bottom: 28px; }

/* ─── Forms ──────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--gray-200);
  border-radius: var(--radius); font-size: 14px; font-family: inherit;
  background: #fff; color: var(--gray-900); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); }
textarea { resize: vertical; min-height: 80px; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--radius); font-size: 14px;
  font-weight: 600; font-family: inherit; cursor: pointer; border: none;
  text-decoration: none; transition: opacity .15s;
}
.btn:hover { opacity: .88; }
.btn-primary { background: var(--green); color: #fff; width: 100%; }
.btn-outline  { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-lime { background: var(--lime); color: var(--green); }
.btn-auth { border-radius: 99px; font-family: 'Barlow', sans-serif; font-size: 16px; font-weight: 700; height: 52px; width: 100%; letter-spacing: .2px; }

/* ─── Alerts ─────────────────────────────────────────────── */
.error   { display: none; background: #fef2f2; border: 1px solid #fecaca; color: var(--red); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.success { display: none; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }

.banner-warning {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px; font-size: 14px; color: #78350f;
}
.banner-warning a { color: #92400e; font-weight: 600; }

/* ─── Sidebar layout ─────────────────────────────────────── */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); background: var(--green);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 20; overflow-y: auto; overflow-x: visible;
  transition: width .22s ease;
}

/* Collapsed state */
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .sidebar-logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-logout-text { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; padding: 16px 8px; }
.sidebar.collapsed .sidebar-logo img { height: 28px; padding: 3px 5px; }
.sidebar.collapsed .sidebar-nav { padding: 16px 10px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; gap: 0; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 8px 0; }
.sidebar.collapsed .sidebar-logout { justify-content: center; padding: 10px; border-radius: 50%; width: 40px; height: 40px; margin: 0 auto; }
.sidebar.collapsed .sidebar-bottom { padding: 12px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.sidebar-toggle {
  position: absolute; top: 20px; right: -14px;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 1.5px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 21; box-shadow: 0 2px 6px rgba(0,0,0,.12);
  transition: transform .22s ease;
  color: var(--green);
}
.sidebar.collapsed .sidebar-toggle { transform: rotate(180deg); right: -14px; }

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 16px 16px; text-decoration: none; flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,.1); position: relative;
}
.sidebar-logo img { height: 36px; width: auto; object-fit: contain; flex-shrink: 0; border-radius: 6px; background: #fff; padding: 4px 8px; }
.sidebar-logo .logo-mark { background: rgba(255,255,255,.15); flex-shrink: 0; }
.sidebar-logo .logo-dot  { background: var(--lime); }
.sidebar-logo-text { color: #fff; font-family: 'Barlow Condensed', sans-serif; font-size: 15px; font-weight: 700; line-height: 1.2; white-space: nowrap; }

.sidebar-nav { flex: 1; padding: 16px 12px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: rgba(255,255,255,.65);
  text-decoration: none; margin-bottom: 2px; transition: all .15s;
  white-space: nowrap;
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.15); color: #fff; font-weight: 600; }
.nav-badge {
  margin-left: auto; background: var(--lime); color: var(--green);
  font-size: 11px; font-weight: 700; border-radius: 99px;
  padding: 1px 7px; min-width: 20px; text-align: center;
}

.sidebar-bottom { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,.1); flex-shrink: 0; }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 8px; }
.sidebar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--lime); color: var(--green);
  font-size: 12px; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,.45); }
.sidebar-logout {
  display: flex; align-items: center; gap: 8px;
  width: 100%; background: transparent; border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.65); border-radius: 8px; padding: 8px 12px;
  font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer;
  transition: all .15s;
}
.sidebar-logout:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ─── Main content ───────────────────────────────────────── */
.main-content { margin-left: var(--sidebar); flex: 1; padding: 40px 48px; min-width: 0; transition: margin-left .22s ease; }
.sidebar.collapsed ~ .main-content,
.main-content.expanded { margin-left: 64px; }

.page-label { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gray-400); margin-bottom: 6px; }
.page-title { font-family: 'Barlow Condensed', sans-serif; font-size: 36px; font-weight: 700; line-height: 1.1; }
.page-sub   { color: var(--gray-400); font-size: 14px; margin-top: 6px; }
.page-header { margin-bottom: 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-header-left { min-width: 0; }

/* ─── Cards ──────────────────────────────────────────────── */
.card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 24px; margin-bottom: 16px; }
.card-green { background: var(--green); color: #fff; border-color: var(--green); }
.card-green .clabel { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; color: var(--lime); margin-bottom: 8px; }
.card-green h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.card-green .dates { font-size: 13px; opacity: .65; }

/* ─── Stats ──────────────────────────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 20px; }
.stat-value { font-family: 'Barlow Condensed', sans-serif; font-size: 34px; font-weight: 700; color: var(--green); line-height: 1; }
.stat-label { font-size: 13px; color: var(--gray-400); margin-top: 4px; }

/* ─── Section ────────────────────────────────────────────── */
.section-head { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--gray-400); margin-bottom: 12px; margin-top: 32px; }

/* ─── Table ──────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 16px; background: var(--gray-50); border-bottom: 1px solid var(--gray-200); font-size: 11px; font-weight: 700; color: var(--gray-400); text-transform: uppercase; letter-spacing: .5px; }
td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ─── Badges ─────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 11px; font-weight: 600; }
.badge-pending   { background: #fef3c7; color: #92400e; }
.badge-approved  { background: #d1fae5; color: #065f46; }
.badge-active    { background: #dbeafe; color: #1e40af; }
.badge-rejected  { background: #fee2e2; color: #991b1b; }
.badge-completed { background: var(--gray-100); color: var(--gray-700); }

/* ─── Grid / Tile ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }

.tile {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 20px; text-align: center; cursor: pointer; text-decoration: none;
  color: var(--gray-900); transition: box-shadow .15s, border-color .15s; display: block;
}
.tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); border-color: var(--gray-400); }
.tile .icon  { font-size: 24px; margin-bottom: 8px; }
.tile .label { font-size: 13px; font-weight: 600; }

/* ─── Machine catalog ────────────────────────────────────── */
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.machine-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; overflow: hidden; transition: box-shadow .15s, transform .15s; display: flex; flex-direction: column; height: 100%; }
.machine-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.machine-card-img { height: 150px; background: var(--gray-50); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--gray-100); flex-shrink: 0; }
.machine-card-img img { max-height: 130px; max-width: 85%; object-fit: contain; }
.machine-card-body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.machine-card-body > .btn { margin-top: auto; }
.machine-card-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; line-height: 1.3; }
.machine-card-cat  { font-size: 12px; color: var(--gray-400); margin-bottom: 8px; }
.machine-card-desc {
  font-size: 12.5px; color: var(--gray-700); line-height: 1.5; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.avail-row { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.avail-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.avail-dot.yes { background: #22c55e; }
.avail-dot.no  { background: #ef4444; }
.avail-dot.soon{ background: #f59e0b; }

/* ─── Logbook ────────────────────────────────────────────── */
.logbook-entry {
  border: 1px solid var(--gray-200); border-radius: 10px; padding: 16px 20px;
  margin-bottom: 10px; background: #fff;
}
.logbook-entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.logbook-date  { font-weight: 700; font-size: 14px; }
.logbook-hours { font-size: 12px; color: var(--gray-400); background: var(--gray-100); padding: 2px 8px; border-radius: 99px; }
.logbook-notes { font-size: 14px; color: var(--gray-700); line-height: 1.5; }
.logbook-by    { font-size: 11px; color: var(--gray-400); margin-top: 8px; }

/* ─── Profile doc upload ─────────────────────────────────── */
.doc-slot {
  border: 2px dashed var(--gray-200); border-radius: 10px; padding: 20px;
  text-align: center; color: var(--gray-400); font-size: 13px; margin-bottom: 12px;
  cursor: pointer; transition: border-color .15s;
}
.doc-slot:hover { border-color: var(--green); color: var(--green); }
.doc-slot input[type=file] { display: none; }

/* ─── Misc ───────────────────────────────────────────────── */
.link { color: var(--green); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; }
.divider { height: 1px; background: var(--gray-200); margin: 20px 0; }
.loading { text-align: center; padding: 40px; color: var(--gray-400); font-size: 14px; }
.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-400); }
.empty-state .icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
.empty-state strong { display: block; font-size: 15px; color: var(--gray-700); margin-bottom: 4px; }

/* ─── Print (PDF export) ─────────────────────────────────── */
@media print {
  .sidebar, .sidebar-bottom, .page-header .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0; padding: 0; }
  body { background: #fff; }
}

/* ─── Mobile ─────────────────────────────────────────────── */
/* Navigation bleibt auf allen Bildschirmgrößen die Sidebar (kein
   separates Bottom-Nav) — auf schmalen Screens startet sie
   eingeklappt (s. renderSidebar in app.js), lässt sich aber jederzeit
   über den Ein-/Ausklapp-Button wieder aufklappen. */
@media (max-width: 768px) {
  .main-content { padding: 20px 16px 40px; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .machine-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ── Pre-Launch ──────────────────────────────────────────── */
.prelaunch-card {
  background: #f0f9e6; border: 1.5px solid #06471e;
  border-radius: 12px; padding: 28px 32px; margin-bottom: 28px;
}
.prelaunch-card-title {
  font-family: 'Barlow Condensed', sans-serif; font-size: 22px;
  font-weight: 700; color: #06471e; margin-bottom: 6px;
}
.prelaunch-card-sub { font-size: 14px; color: #16a34a; margin-bottom: 20px; }
.prelaunch-steps {
  display: flex; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--gray-200); margin-bottom: 20px;
}
.prelaunch-step {
  flex: 1; padding: 10px 8px; font-size: 11.5px; font-weight: 700;
  text-align: center; color: var(--gray-400); background: #fff;
  border-right: 1px solid var(--gray-200); text-transform: uppercase;
  letter-spacing: .03em;
}
.prelaunch-step:last-child { border-right: none; }
.prelaunch-step.done { background: #f0f9e6; color: #16a34a; }
.prelaunch-step.current { background: #06471e; color: #fff; }
.prelaunch-info-card {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 18px 22px; margin-bottom: 24px;
  font-size: 14px; color: var(--gray-600); line-height: 1.6;
}
.prelaunch-info-card strong { color: var(--gray-900); }

@media (max-width: 480px) {
  .machine-grid { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .auth-box { padding: 28px 20px; }
  .prelaunch-card { padding: 20px; }
  .prelaunch-step { font-size: 10px; padding: 8px 4px; }
}
