/* =======================================================
   Espressissimo Mitarbeiterportal – v4 (responsive, clean)
   Branding: Gold #F2B100, Rot #C61A17
   ======================================================= */

:root{
  --brand-gold:#F2B100;
  --brand-red:#C61A17;
  --bg:#f5f6f8;
  --card:#ffffff;
  --text:#222;
  --muted:#666;
  --border:#e9e9ee;
  --shadow:0 6px 20px rgba(30, 33, 41, .07);
  --shadow-sm:0 2px 8px rgba(30, 33, 41, .06);
  --radius:16px;
  --container:1120px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Inter', Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.55;
}

/* ===== Layout Container (zentriert) ===== */
.container{
  max-width:var(--container);
  margin:0 auto;
  padding:18px 20px;
}

/* ===== Header / Top-Navigation ===== */
.header{
  background:#fff;
  border-bottom:1px solid var(--border);
  position:sticky; top:0; z-index:10;
}
.header .inner{
  max-width:var(--container); margin:0 auto; padding:10px 20px;
  display:flex; align-items:center; justify-content:space-between;
}
.brand{font-weight:700; color:var(--brand-red); font-size:18px;}
.nav a{
  margin-left:18px; color:#2a2a2a; text-decoration:none; font-weight:500;
  padding:6px 10px; border-radius:10px; border:1px solid transparent;
}
.nav a:hover{color:var(--brand-red); background:#fff3f2; border-color:#ffe1e0;}
.nav a.active{color:#000; background:#fff4d6; border-color:#ffe6a8; font-weight:800;}

/* ===== Login-Status Box (zentriert) ===== */
.login-status {
  margin: 16px auto 0;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  color: #333;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}
.login-label { font-weight: 500; color: var(--muted); }
.login-user  { font-weight: 700; color: var(--brand-red); }

/* ===== Hero ===== */
.portal-hero{padding:22px 20px 0;}
.portal-hero .hero-inner{
  max-width:var(--container);
  margin:0 auto;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px 24px;
  display:flex; align-items:center; gap:22px; position:relative;
}
.portal-hero .hero-inner::before{
  content:""; position:absolute; left:0; top:0; right:0; height:6px;
  background:linear-gradient(90deg, var(--brand-gold), #ffd15a);
  border-top-left-radius:var(--radius); border-top-right-radius:var(--radius);
}
.portal-hero .brand-mark{
  max-height:56px;
  background:#fff;
  border-radius:12px;
  padding:6px 10px;
  box-shadow:var(--shadow-sm);
}
.portal-hero h1{margin:0; font-size:28px; font-weight:800; letter-spacing:.2px;}
.portal-hero .subtitle{margin:6px 0 0; font-size:16px; color:#3a3a3a;}

/* ===== KPI Strip ===== */
.kpi-grid{
  max-width:var(--container); margin:16px auto 6px; padding:0 20px;
  display:grid; gap:16px; grid-template-columns:repeat(3, minmax(240px,1fr));
}
.kpi{
  background:var(--card); border:1px solid var(--border); border-radius:14px;
  box-shadow:var(--shadow-sm); padding:14px 16px; min-height:86px;
}
.kpi-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:4px;}
.kpi-label{font-size:13px; color:#444; font-weight:700;}
.kpi-chip{ font-size:12px; padding:2px 10px; border-radius:999px; color:#fff; background:var(--brand-red); }
.kpi-chip-soft{background:var(--brand-gold); color:#fff;}
.kpi-value{font-size:26px; font-weight:800; margin-top:2px;}

/* ===== Cards ===== */
.card-grid{
  display:grid; gap:22px; margin:22px auto; max-width:var(--container); padding:0 20px;
  grid-template-columns:repeat(auto-fill, minmax(320px,1fr));
}
/* Support .cards Container (Planning/Admin) */
.cards{
  display:grid; gap:22px; margin:22px auto; max-width:var(--container); padding:0 20px;
  grid-template-columns:repeat(auto-fill, minmax(320px,1fr));
}
@media (max-width:740px){
  .card-grid, .cards{grid-template-columns:1fr;}
}
.card{
  background:var(--card); border:1px solid var(--border);
  border-radius:var(--radius); padding:20px 22px; box-shadow:var(--shadow-sm);
  display:flex; flex-direction:column; min-height:120px;
}
.card-head{display:flex; align-items:center; gap:12px; margin-bottom:12px;}
.card-emoji{font-size:22px;}
.card h3{margin:0; font-size:18px; font-weight:800;}
.card p{margin:6px 0 0; font-size:14px; color:#3d3d3d}
.card.notice{ border-left:4px solid var(--brand-gold); }

/* Link-Karte (volle Fläche) */
.card-link{
  text-decoration:none; color:inherit; position:relative; isolation:isolate;
  outline:none; transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}
.card-hover:hover{
  transform:translateY(-3px);
  box-shadow:var(--shadow);
  border-color:rgba(198,26,23,.22);
}
.card-link:focus-visible{
  box-shadow:0 0 0 4px rgba(198,26,23,.18), var(--shadow);
  border-color:rgba(198,26,23,.35);
}
.card-cta{margin-top:auto; padding-top:10px; font-size:14px;}

/* ===== Generic Grid / Utilities ===== */
.grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:18px; }
.inline{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.flex{display:flex;} .flex-1{flex:1} .mr-6{margin-right:6px}
.muted{color:var(--muted); font-size:12px;}

/* ===== Lists & News ===== */
.list{margin:0; padding:0; list-style:none;}
.list-compact .list-item{display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px solid #f1f1f4; font-size:14px;}
.list .list-item{display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:1px dashed #eee; font-size:14px;}
.list-meta{font-size:12px; color:#555; margin-left:auto; white-space:nowrap;}
.news-list{display:flex; flex-direction:column; gap:12px;}
.news-item{border-bottom:1px solid #f1f1f4; padding-bottom:8px;}
.news-title{font-size:15px; margin:0 0 2px; font-weight:800;}
.news-meta{font-size:12px; margin-bottom:4px;}
.news-teaser{font-size:14px; color:#444; margin:0;}

/* ===== Chips (Routinen) ===== */
.chip-list{display:flex; flex-wrap:wrap; gap:8px; margin:6px 0;}
.chip{
  background:#f7f7f9; border:1px solid #ececf3; border-radius:999px;
  padding:7px 12px; font-size:13px; font-weight:700;
}
.chip-badge{
  margin-left:8px; padding:2px 8px; border-radius:10px; font-size:11px;
  color:#fff; background:var(--brand-gold);
}

/* ===== Badges & dots ===== */
.badge{
  display:inline-block; padding:2px 10px; border-radius:10px;
  font-size:12px; font-weight:800; background:var(--brand-red); color:#fff;
}
.badge-soft{background:var(--brand-gold); color:#fff;}
.badge.auto{ background:#eef4ff; color:#0a48a3; border:1px solid #dce8ff; padding:2px 8px; }
.dot{display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--brand-red);}

/* ===== Tables ===== */
.table-wrap{overflow-x:auto;}
.table{width:100%; border-collapse:collapse; font-size:14px;}
.table th,.table td{padding:8px; border-bottom:1px solid #f1f1f4; text-align:left;}
/* Fallback für nackte <table> */
table{width:100%; border-collapse:collapse; font-size:14px;}
th,td{padding:8px 10px; border-bottom:1px solid #f1f1f4; text-align:left;}

/* ===== Forms & Buttons ===== */
input,select,textarea,button{
  width:100%; padding:12px; margin:8px 0 14px;
  border:1px solid #ddd; border-radius:10px; background:#fff; font-size:14px;
}
button{
  cursor:pointer; background:var(--brand-red); color:#fff; border:none; font-weight:800;
  transition:background .15s ease, transform .12s ease;
}
button:hover{background:#a21512;}
button:active{transform:translateY(1px);}

/* ===== Planning visuals ===== */
.room { display:flex; border:2px solid var(--border); border-radius: var(--radius); overflow:hidden; background:#fff; }
.segment { flex:1; padding:24px; min-height:160px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
.front { border-right:2px solid var(--border); }
.red   { background:#ffeaea; }
.yellow{ background:#fff6d6; }
.green { background:#eaffea; }
.warn  { display:inline-flex; align-items:center; gap:6px; font-weight:600; color:#b94a48; margin-left:8px; }
.tri   { width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:14px solid #e67; }
.assign{ background:#fff; border:1px solid var(--border); border-radius:8px; padding:12px; }

/* ===== Footer ===== */
.portal-footer{
  margin:26px auto 40px; padding:20px; text-align:center;
  font-size:13px; color:#666; border-top:1px solid var(--border);
  max-width:var(--container);
}
.portal-footer .brand-favicon{height:22px; vertical-align:middle; margin-right:8px;}

/* ===== Responsive ===== */
@media (max-width:1024px){
  :root{ --container:960px; }
  .portal-hero .brand-mark{max-height:52px;}
}
@media (max-width:820px){
  :root{ --container:720px; }
  .portal-hero .hero-inner{padding:18px 20px;}
  .portal-hero h1{font-size:24px;}
  .kpi-grid{grid-template-columns:repeat(3, 1fr);}
}
@media (max-width:640px){
  :root{ --container:560px; }
  .portal-hero{padding:16px 14px 0;}
  .portal-hero .hero-inner{gap:14px; padding:16px 16px;}
  .portal-hero .brand-mark{max-height:44px; padding:6px 8px;}
  .portal-hero h1{font-size:21px;}
  .portal-hero .subtitle{font-size:14px;}
  .kpi-grid{ padding:0 14px; grid-template-columns:1fr 1fr; gap:12px; }
  .card-grid, .cards{padding:0 14px; gap:16px;}
  .card{padding:16px 16px;}
  .card h3{font-size:16px;}
  .room{flex-direction:column;}
  .front{border-right:none; border-bottom:2px solid var(--border);}
}

/* === Fix: erzwinge zentrierte maximale Breite überall ============ */
.container,
.header .inner,
.portal-hero .hero-inner,
.kpi-grid,
.card-grid,
.cards,
.portal-footer {
  max-width: var(--container) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
.card-grid, .cards {
  width: 100%;
  padding-left: 20px;
  padding-right: 20px;
}
/* Falls ein <h1> mal außerhalb des .container steht (z.B. Profil-Seite) */
body > h1 {
  max-width: var(--container);
  margin: 18px auto 10px;
  padding: 0 20px;
}
