/* ============================================================
   Gerüstbau Grumbt – Shared Stylesheet
   Gilt für: gcloud_new, fuhrpark_new, zeiterfassung_new, portal_new
   Farben: Navy #15407a, Weiß, Barlow Condensed
   Kein Orange in primären UI-Elementen
   ============================================================ */

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

/* ── CSS VARIABLEN ─────────────────────────────────────────── */
:root {
  /* Primärfarben */
  --blue:      #15407a;
  --blue-m:    #1a549e;
  --blue-l:    #e8f0fb;
  --blue-xl:   #f0f5fc;

  /* Status */
  --green:     #16a34a;
  --green-l:   #dcfce7;
  --yellow:    #d97706;
  --yellow-l:  #fefce8;
  --red:       #dc2626;
  --red-l:     #fee2e2;

  /* Grautöne */
  --gray-50:   #f8fafc;
  --gray-100:  #f1f5f9;
  --gray-200:  #e2e8f0;
  --gray-300:  #cbd5e1;
  --gray-400:  #94a3b8;
  --gray-500:  #64748b;
  --gray-700:  #334155;
  --gray-900:  #0f172a;
  --white:     #ffffff;

  /* Effekte */
  --shadow:    0 1px 4px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);
  --radius:    10px;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: 'Barlow', sans-serif;
  background: #dde5f0;
  color: var(--gray-900);
  font-size: 16px;
}
a { color: inherit; text-decoration: none; }

/* ── LAYOUT ────────────────────────────────────────────────── */
.app-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.app-main  { flex: 1; padding: 20px; max-width: 1300px; margin: 0 auto; width: 100%; }

/* ── HEADER ────────────────────────────────────────────────── */
.app-header {
  background: var(--blue);
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(21,64,122,.35);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .5px;
}
.logo-icon {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}

/* Header Navigation */
.header-nav { display: flex; gap: 4px; }
.header-nav a {
  color: rgba(255,255,255,.75);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: all .15s;
}
.header-nav a:hover,
.header-nav a.active {
  background: rgba(255,255,255,.18);
  color: white;
}

/* Header Rechts */
.header-right { display: flex; align-items: center; gap: 12px; }
.sync-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.15);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: white;
}
.sync-dot {
  width: 7px;
  height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

.avatar {
  width: 34px;
  height: 34px;
  background: rgba(255,255,255,.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: white;
  border: 2px solid rgba(255,255,255,.4);
  cursor: pointer;
}

/* ── FLASH MESSAGES ────────────────────────────────────────── */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.flash-success { background: var(--green-l); color: var(--green);  border: 1px solid #86efac; }
.flash-error   { background: var(--red-l);   color: var(--red);    border: 1px solid #fca5a5; }
.flash-warning { background: var(--yellow-l);color: var(--yellow); border: 1px solid #fde68a; }

/* ── PAGE TITLE ────────────────────────────────────────────── */
.page-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-title-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ── CARDS ─────────────────────────────────────────────────── */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 14px;
  color: var(--gray-700);
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-body { padding: 18px; }

/* ── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-green  { background: var(--green-l);  color: var(--green);  }
.badge-yellow { background: var(--yellow-l); color: var(--yellow); }
.badge-red    { background: var(--red-l);    color: var(--red);    }
.badge-blue   { background: var(--blue-l);   color: var(--blue);   }
.badge-gray   { background: var(--gray-100); color: var(--gray-500); }

/* ── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary  { background: var(--blue);  color: white; }
.btn-primary:hover { background: var(--blue-m); }
.btn-success  { background: var(--green); color: white; }
.btn-success:hover { background: #15803d; }
.btn-danger   { background: var(--red);   color: white; }
.btn-danger:hover  { background: #b91c1c; }
.btn-ghost {
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-sm    { padding: 8px 14px;   font-size: 13px; }
.btn-lg    { padding: 14px 26px;  font-size: 16px; }
.btn-block { width: 100%; justify-content: center; }

/* ── FORMULARE ─────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-control {
  padding: 13px 16px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  color: var(--gray-900);
  background: white;
  transition: border .15s, box-shadow .15s;
  width: 100%;
  -webkit-appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21,64,122,.10);
}
.input-wrap { position: relative; }
.input-wrap .unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-400);
}
.input-wrap .form-control { padding-right: 44px; }

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr;       gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr;   gap: 12px; }
.form-grid-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }

/* ── TABELLEN ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--gray-200); font-size: 14px; }
th {
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--gray-500);
  background: var(--gray-50);
}
tr:hover td { background: var(--blue-xl); }

/* ── ALERTS ────────────────────────────────────────────────── */
.alert {
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
.alert-warn    { background: var(--yellow-l); color: #92400e; border: 1px solid #fde68a; }
.alert-danger  { background: var(--red-l);    color: #991b1b; border: 1px solid #fca5a5; }
.alert-info    { background: var(--blue-l);   color: var(--blue); border: 1px solid #bfdbfe; }
.alert-success { background: var(--green-l);  color: var(--green); border: 1px solid #86efac; }

/* ── STATUS AMPEL ──────────────────────────────────────────── */
.status-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-green  { background: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.status-yellow { background: var(--yellow); box-shadow: 0 0 0 3px var(--yellow-l); }
.status-red    { background: var(--red);   box-shadow: 0 0 0 3px var(--red-l); }

/* ── TOGGLE / CHECKBOX ─────────────────────────────────────── */
.toggle-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.toggle-wrap input[type=checkbox] {
  width: 20px; height: 20px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}
.toggle-wrap label { font-size: 14px; font-weight: 500; cursor: pointer; }

/* ── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-200);
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-body   { padding: 20px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--gray-200); display: flex; gap: 8px; justify-content: flex-end; }
.modal-close  { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-400); line-height: 1; }
.modal-close:hover { color: var(--gray-900); }

/* ── STAT KACHELN (Dashboard) ──────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card .stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--gray-400);
}
.stat-card .stat-value {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
}
.stat-card .stat-sub {
  font-size: 12px;
  color: var(--gray-400);
}

/* ── EMPTY STATE ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--gray-400);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state .empty-title { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 800; color: var(--gray-500); margin-bottom: 6px; }
.empty-state .empty-sub   { font-size: 14px; }

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 { grid-template-columns: 1fr; }
  .app-main    { padding: 12px; }
  .btn-lg      { padding: 13px 20px; font-size: 15px; }
  .header-nav  { display: none; }
  .stat-grid   { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .logo span  { display: none; }
  .sync-pill  { display: none; }
  .stat-grid  { grid-template-columns: 1fr; }
}

/* ── MODAL ──────────────────────────────────────────────── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px;opacity:0;pointer-events:none;transition:opacity .2s;}
.modal-overlay.open{opacity:1;pointer-events:all;}
.modal{background:white;border-radius:var(--radius);box-shadow:var(--shadow-md);width:100%;max-width:500px;border-top:5px solid var(--blue);overflow:hidden;}
.modal-header{padding:16px 20px;font-weight:700;font-size:16px;color:var(--gray-900);border-bottom:1px solid var(--gray-200);display:flex;align-items:center;justify-content:space-between;}
.modal-close{background:none;border:none;font-size:18px;cursor:pointer;color:var(--gray-400);line-height:1;padding:0;}
.modal-close:hover{color:var(--gray-900);}
.modal-body{padding:20px;}
.modal-footer{padding:14px 20px;border-top:1px solid var(--gray-200);display:flex;gap:8px;justify-content:flex-end;}

/* ── STATUS LIGHTS ──────────────────────────────────────── */
.status-light{width:12px;height:12px;border-radius:50%;flex-shrink:0;}
.status-red{background:var(--red);box-shadow:0 0 6px rgba(220,38,38,.5);}
.status-yellow{background:var(--yellow);box-shadow:0 0 6px rgba(217,119,6,.4);}
.status-green{background:var(--green);box-shadow:0 0 6px rgba(22,163,74,.4);}

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state{text-align:center;padding:60px 20px;color:var(--gray-400);}
.empty-icon{font-size:48px;margin-bottom:12px;}
.empty-title{font-size:18px;font-weight:700;color:var(--gray-700);margin-bottom:6px;}
.empty-sub{font-size:14px;}
