/* ── GREMAC Connect – Shared Styles ── */
:root {
  --t:    #058b8c;
  --bg:   #1a1c1b;
  --gray: #6b716f;
  --run:  #22c55e;
  --err:  #ef4444;
  --over: #e97f1f;
  --card: #282a29;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: sans-serif; }
body { background: var(--bg); color: white; min-height: 100vh; }

/* ── SIDEBAR ── */
#sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 9999;
  width: 290px; background: var(--card); border-right: 2px solid var(--t);
  display: flex; flex-direction: column;
  transform: translateX(-100%); transition: transform .35s cubic-bezier(.16,1,.3,1);
}
#sidebar.open { transform: translateX(0); }
.sb-head { padding: 36px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sb-logo { font-size: 20px; font-weight: 900; color: var(--t); }
.sb-user { font-size: 11px; opacity: .5; margin-top: 4px; }
.sb-close { position: absolute; top: 14px; right: 14px; font-size: 26px; cursor: pointer; padding: 8px; }
.sb-item {
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.05);
  font-weight: 700; text-transform: uppercase; font-size: 13px;
  cursor: pointer; text-decoration: none; color: white; display: block;
}
.sb-item:active, .sb-item.active { background: var(--t); }
.sb-item.danger { color: var(--err); }
.sb-foot { margin-top: auto; padding: 20px; font-size: 10px; opacity: .3; }

/* ── HEADER ── */
header {
  padding: 16px; display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 100;
  border-bottom: 1px solid #222;
}
#btn-menu {
  width: 60px; height: 60px; background: var(--t); border: 3px solid white;
  border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.hdr-info { flex: 1; }
.hdr-info h1 { font-size: 22px; font-weight: 900; color: var(--t); }
.hdr-info .role-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 4px;
  background: #333; display: inline-block; margin-top: 2px;
}
.hdr-right { text-align: right; }

/* ── PAGE CONTENT ── */
.page { padding: 16px; }
.back-btn {
  display: flex; align-items: center; gap: 8px; padding: 14px 0;
  color: var(--t); font-weight: 700; cursor: pointer; font-size: 14px;
  text-decoration: none;
}
.section-title {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  opacity: .5; margin-bottom: 12px; letter-spacing: .1em;
}

/* ── MACHINE CARDS ── */
.machine-card {
  background: var(--card); border-radius: 18px; padding: 18px;
  margin-bottom: 12px; border-left: 4px solid var(--t);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  text-decoration: none; color: white;
}
.machine-card:active { background: #333; }
.mc-name { font-size: 16px; font-weight: 800; }
.mc-serial { font-size: 11px; opacity: .5; margin-top: 2px; }
.mc-role { font-size: 10px; padding: 2px 8px; border-radius: 4px; }
.role-admin    { background: #1e3a5f; color: #60a5fa; }
.role-service  { background: #1e3a5f; color: #60a5fa; }
.role-dealer   { background: #1a3a1a; color: var(--run); }
.role-operator { background: #2d1f00; color: var(--over); }
.role-viewer   { background: #2a2a2a; color: #aaa; }
.mc-arrow { font-size: 20px; opacity: .4; }

/* ── COCKPIT TILES ── */
.tile {
  background: var(--gray); border-radius: 20px; padding: 16px;
  border-bottom: 6px solid var(--t); margin-bottom: 12px;
}
.tile-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tile-name { font-size: 14px; font-weight: 800; text-transform: uppercase; }
.tile-status { font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 4px; background: rgba(0,0,0,.25); }
.tile-body { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; }
.metrics { display: flex; flex-direction: column; gap: 3px; }
.m-row { display: flex; align-items: baseline; gap: 7px; }
.m-lbl { font-size: 9px; text-transform: uppercase; opacity: .6; font-weight: 700; width: 38px; }
.m-val { font-size: 28px; font-weight: 900; }
.m-unit { font-size: 12px; opacity: .6; }
.ctrl { display: flex; gap: 7px; }
.btn-ctrl {
  width: 52px; height: 52px; border-radius: 12px; background: #444; border: none;
  color: white; font-size: 24px; font-weight: 900; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none; box-shadow: 0 4px 0 #222; -webkit-tap-highlight-color: transparent;
}
.btn-ctrl:active { transform: translateY(2px); box-shadow: 0 2px 0 #222; background: var(--t); }

/* ── PROGRAMME ── */
.presets {
  background: #111; border-radius: 18px; padding: 16px;
  border: 1px solid #333; margin-top: 12px;
}
.pr-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pr-title { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--t); }
.pr-save { background: var(--gray); color: white; border: none; padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 11px; cursor: pointer; }
.pr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pr-btn { background: #333; border: none; color: white; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 12px; cursor: pointer; text-align: center; }
.pr-btn:active { background: var(--t); }

/* ── DIAGNOSE ── */
.info-box {
  background: #111; padding: 16px; border-radius: 18px;
  border: 2px solid var(--t); margin-bottom: 14px;
}
.info-box-title { font-size: 12px; font-weight: 900; margin-bottom: 10px; }
.diag-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-bottom: 12px; }
.diag-box {
  height: 26px; background: #222; border: 1px solid #444;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; border-radius: 3px;
}
.diag-on { background: var(--t); border-color: white; color: white; }

/* ── NETZWERK ── */
.net-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.net-item { background: #222; padding: 12px; border-radius: 10px; border: 1px solid #333; }
.net-label { font-size: 9px; text-transform: uppercase; opacity: .6; font-weight: 700; margin-bottom: 4px; }
.net-val { font-size: 16px; font-weight: 900; color: var(--t); }

/* ── LOGIN ── */
#login-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 20px;
}
.login-box {
  background: var(--card); border-radius: 24px; padding: 40px 30px;
  width: 100%; max-width: 380px; border-top: 4px solid var(--t);
}
.login-logo { font-size: 28px; font-weight: 900; color: var(--t); margin-bottom: 4px; }
.login-sub { font-size: 11px; opacity: .5; text-transform: uppercase; letter-spacing: .2em; margin-bottom: 30px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 11px; font-weight: 700; opacity: .6; text-transform: uppercase; margin-bottom: 6px; }
.field input {
  width: 100%; background: #1a1c1b; border: 1px solid #444;
  border-radius: 10px; padding: 14px; color: white; font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--t); }
.btn-login {
  width: 100%; background: var(--t); color: white; border: none;
  border-radius: 12px; padding: 16px; font-size: 16px; font-weight: 900;
  cursor: pointer; margin-top: 8px;
}
.login-err { color: var(--err); font-size: 13px; margin-top: 12px; text-align: center; }

/* ── ADMIN ── */
.admin-card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.admin-card h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; color: var(--t); margin-bottom: 12px; }
.user-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #333; }
.user-row:last-child { border: none; }
.admin-input { width: 100%; background: #1a1c1b; border: 1px solid #444; border-radius: 8px; padding: 10px; color: white; font-size: 13px; margin-bottom: 8px; }
.btn-action { background: var(--over); color: white; border: none; padding: 10px 16px; border-radius: 9px; font-weight: 700; font-size: 12px; cursor: pointer; width: 100%; }

/* ── STATUS PILL ── */
#status-pill { font-size: 11px; color: var(--t); }
.no-items { text-align: center; padding: 40px 20px; opacity: .5; }
