/* ELISSAR SIGNAGE CONTROL CENTER – Elissar-Designsprache (Petrol #0E4A4F / Gold #B8923F) */
:root {
  --petrol: #0E4A4F; --petrol-dark: #08343a; --petrol-deep: #062529; --gold: #B8923F; --gold-light: #d8b46a; --cream: #F5EFE3;
  --bg: #f3f1ec; --card: #ffffff; --ink: #1c2426; --muted: #6b7678; --line: #e3ded4;
  --ok: #2e9e6b; --warn: #d9a13b; --bad: #d64b3a; --info: #2f7fb5;
  --radius: 14px; --shadow: 0 4px 18px rgba(14,74,79,.08);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--bg); color: var(--ink); font-size: 15px; display: flex; min-height: 100vh; }
a { color: var(--petrol); }
b, strong { font-weight: 700; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: 30px; margin: 0 0 4px; letter-spacing: .01em; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 8px; color: var(--petrol); text-transform: uppercase; letter-spacing: .08em; }
.sub { color: var(--muted); margin: 0 0 22px; }

/* ---- Navigation */
nav { width: 250px; background: linear-gradient(180deg, var(--petrol) 0%, var(--petrol-deep) 100%); color: var(--cream); display: flex; flex-direction: column; flex-shrink: 0; position: sticky; top: 0; height: 100vh; }
nav .brand { padding: 26px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
nav .brand .logo { font-family: Georgia, serif; font-size: 22px; letter-spacing: .3em; text-indent: .3em; }
nav .brand .logo small { display: block; font-family: "Segoe UI", system-ui, sans-serif; font-size: 9.5px; letter-spacing: .2em; text-indent: 0; white-space: nowrap; color: var(--gold); margin-top: 4px; }
nav ul { list-style: none; margin: 10px 0; padding: 0; flex: 1; overflow: auto; }
nav li a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; color: rgba(245,239,227,.78); text-decoration: none; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; border-left: 3px solid transparent; }
nav li a:hover { background: rgba(255,255,255,.05); color: #fff; }
nav li a.active { background: rgba(184,146,63,.16); color: #fff; border-left-color: var(--gold); }
nav li a .ico { width: 20px; text-align: center; opacity: .9; }
nav li a .tag { font-size: 9px; padding: 1px 6px; letter-spacing: .05em; }
nav li.sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 22px; }
nav .foot { padding: 14px 22px; font-size: 12px; color: rgba(245,239,227,.55); border-top: 1px solid rgba(255,255,255,.08); }
nav .foot .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-right: 6px; }
nav .foot .dot.off { background: var(--bad); }
.burger { display: none; }

/* ---- Inhalt */
main { flex: 1; padding: 30px 36px 60px; min-width: 0; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid.kpi { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kpi .card { margin: 0; padding: 16px 18px; }
.kpi .n { font-size: 34px; font-weight: 700; color: var(--petrol); line-height: 1.1; }
.kpi .n.ok { color: var(--ok); } .kpi .n.bad { color: var(--bad); } .kpi .n.gold { color: var(--gold); }
.kpi .l { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }

/* ---- Screen-Kacheln */
.loc-block { margin-bottom: 22px; }
.loc-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; }
.loc-head h2 { margin: 0; font-family: Georgia, serif; font-weight: 400; font-size: 20px; letter-spacing: .06em; }
.loc-head .cnt { color: var(--muted); font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; cursor: pointer; border-top: 4px solid var(--ok); transition: transform .12s; position: relative; }
.tile:hover { transform: translateY(-2px); }
.tile.off { border-top-color: var(--bad); }
.tile .id { font-weight: 700; font-size: 17px; letter-spacing: .04em; display: flex; align-items: center; justify-content: space-between; }
.tile .name { color: var(--muted); font-size: 13px; margin: 2px 0 10px; }
.tile .now { font-size: 13px; line-height: 1.45; }
.tile .now b { color: var(--petrol); }
.tile .next { font-size: 12px; color: var(--muted); margin-top: 6px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(46,158,107,.18); }
.status.off { color: var(--bad); } .status.off::before { background: var(--bad); box-shadow: 0 0 0 3px rgba(214,75,58,.18); }
.status.on { color: var(--ok); }

/* ---- Buttons & Formulare */
button, .btn { font: inherit; border: 1px solid var(--petrol); background: var(--petrol); color: #fff; padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1.2; }
button:hover, .btn:hover { background: var(--petrol-dark); }
button.sec, .btn.sec { background: #fff; color: var(--petrol); }
button.sec:hover, .btn.sec:hover { background: #eef4f4; }
button.gold, .btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
button.gold:hover { background: #a3802f; }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.danger:hover { background: #fdf0ee; }
button.alert { background: var(--bad); border-color: var(--bad); }
button.sm, .btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
button.icon { padding: 5px 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; text-transform: uppercase; letter-spacing: .05em; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea { font: inherit; width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(14,74,79,.25); border-color: var(--petrol); }
textarea { min-height: 120px; font-family: Consolas, monospace; font-size: 13px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.row > div { min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; font-size: 14px; margin: 4px 6px 4px 0; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); }
.check.on { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.check input { display: none; }
.day { min-width: 46px; justify-content: center; }
.help { font-size: 12px; color: var(--muted); margin-top: 4px; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---- Tabellen */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:hover td { background: #faf8f4; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; background: #e9f0f0; color: var(--petrol); margin: 1px 3px 1px 0; }
.tag.gold { background: rgba(184,146,63,.15); color: #8b6d2a; }
.tag.red { background: rgba(214,75,58,.12); color: var(--bad); }
.tag.green { background: rgba(46,158,107,.14); color: #237a52; }
.tag.grey { background: #eee; color: #666; }
.prio-1 { background: #e9f0f0; color: var(--petrol); } .prio-2 { background: rgba(217,161,59,.18); color: #8a6417; } .prio-3 { background: rgba(214,75,58,.14); color: var(--bad); } .prio-4 { background: var(--bad); color: #fff; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }

/* ---- Media Grid */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; cursor: pointer; }
.media .thumb { aspect-ratio: 16 / 9; background: #0c2f33 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 34px; position: relative; }
.media .thumb video, .media .thumb img, .media .thumb iframe { width: 100%; height: 100%; object-fit: cover; border: 0; pointer-events: none; }
.media .thumb .type { position: absolute; left: 8px; top: 8px; font-size: 11px; background: rgba(0,0,0,.55); padding: 2px 7px; border-radius: 6px; letter-spacing: .06em; }
.media .meta { padding: 10px 12px; }
.media .meta .n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.media .meta .c { font-size: 12px; color: var(--muted); }
.media.selected { outline: 3px solid var(--gold); }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted); background: #fff; }
.drop.over { border-color: var(--gold); background: rgba(184,146,63,.06); }
.cats { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cats button { padding: 5px 12px; font-size: 13px; }

/* ---- Playlist-Editor */
.pl-items { list-style: none; margin: 0; padding: 0; }
.pl-items li { display: grid; grid-template-columns: 34px 90px 1fr 110px 130px auto; gap: 12px; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.pl-items li .th .type { display: none; }
.pl-items li .th { width: 90px; height: 50px; background: #0c2f33 center/cover; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #fff; }
.pl-items li .pos { font-weight: 700; color: var(--muted); text-align: center; }
.pl-items li input[type=number] { width: 90px; padding: 6px 8px; }
.pl-items li.drag { opacity: .4; }

/* ---- Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(6,37,41,.55); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 100; }
.modal { background: var(--card); border-radius: 18px; width: min(880px, 100%); padding: 26px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(1100px, 100%); }
.modal h2 { font-family: Georgia, serif; font-weight: 400; font-size: 24px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.preview-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }

/* ---- Toast */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--petrol-deep); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.3); opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 200; }
#toast.show { opacity: 1; }
#toast.err { background: var(--bad); }

/* ---- Kalender-ähnliche Timeline (Screen-Ansicht) */
.timeline { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: #eee; margin-top: 6px; }
.timeline div { font-size: 11px; color: #fff; padding: 0 6px; line-height: 26px; white-space: nowrap; overflow: hidden; }

@media (max-width: 900px) {
  body { flex-direction: column; }
  nav { width: 100%; height: auto; position: relative; }
  nav ul { display: none; }
  nav.open ul { display: block; }
  .burger { display: block; position: absolute; right: 16px; top: 22px; background: transparent; border: 1px solid rgba(255,255,255,.3); }
  main { padding: 20px 16px 50px; }
  .pl-items li { grid-template-columns: 30px 70px 1fr; }
}
