/* ── Fonts ──────────────────────────────────────────────────────────── */
@font-face{font-family:'Visby';src:url('font/visby/VisbyThin.otf') format('opentype');font-weight:100;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyThin Italic.otf') format('opentype');font-weight:100;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyLight.otf') format('opentype');font-weight:300;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyLight Italic.otf') format('opentype');font-weight:300;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyRegular.otf') format('opentype');font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyItalic.otf') format('opentype');font-weight:400;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyMedium.otf') format('opentype');font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyMedium Italic.otf') format('opentype');font-weight:500;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbySemibold.otf') format('opentype');font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbySemibold Italic.otf') format('opentype');font-weight:600;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyBold.otf') format('opentype');font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyBold Italic.otf') format('opentype');font-weight:700;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyExtrabold.otf') format('opentype');font-weight:800;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyExtrabold Italic.otf') format('opentype');font-weight:800;font-style:italic;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyHeavy.otf') format('opentype');font-weight:900;font-style:normal;font-display:swap}
@font-face{font-family:'Visby';src:url('font/visby/VisbyHeavy Italic.otf') format('opentype');font-weight:900;font-style:italic;font-display:swap}
@font-face{font-family:'KindelSerif';src:url('font/kindelserif/KindelSerif_PersonalUse.otf') format('opentype');font-weight:400;font-style:normal;font-display:swap}

/* ── Design tokens (identical to main app) ─────────────────────────── */
:root{
  --cyan:#10d7e6;--cyan2:#36f2ff;--dark:#031522;
  --glass:rgba(0,35,51,.74);--line:rgba(170,240,250,.42);
  --text:#f7ffff;--muted:#d7f6f8;
  --sidebar-w:240px;
}

/* ── Reset & base ───────────────────────────────────────────────────── */
*{box-sizing:border-box}
html{scroll-behavior:smooth;background:#031522;overflow-x:hidden}
body{
  margin:0;min-height:100vh;color:var(--text);
  font-family:'Visby',Arial,Helvetica,sans-serif;line-height:1.45;
  background:
    radial-gradient(
      circle at 15% 10%,
      rgba(16, 215, 230, 0.22),
      transparent 33%
    ),
    radial-gradient(
      circle at 85% 85%,
      rgba(18, 88, 99, 0.32),
      transparent 38%
    ),
    linear-gradient(
      135deg,
      #031522 0%,
      #032a36 38%,
      #0a3a47 68%,
      #031522 100%
    );
  background-attachment:fixed;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
img{display:block;max-width:100%}

/* ── Glass card ─────────────────────────────────────────────────────── */
.glass{
  border:1px solid var(--line);border-radius:22px;
  background:linear-gradient(145deg,rgba(0,35,51,.78),rgba(8,105,122,.28));
  box-shadow:0 22px 70px rgba(0,0,0,.28);
  backdrop-filter:blur(16px);
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:10px;border:1px solid rgba(255,255,255,.24);border-radius:13px;
  background:linear-gradient(135deg,#25e2e9,#079aaa);
  color:#fff;font-weight:900;padding:14px 18px;cursor:pointer;
  box-shadow:0 14px 38px rgba(0,215,230,.18);font:inherit;
}

/* ── Form elements ──────────────────────────────────────────────────── */
form{display:grid;gap:14px}
label{display:grid;gap:7px;font-weight:800;color:#fff}
input,select,textarea{
  width:100%;border:1px solid rgba(170,240,250,.36);border-radius:12px;
  padding:14px;background:rgba(2,11,22,.54);color:#fff;font:inherit;
}

/* ── Alerts ─────────────────────────────────────────────────────────── */
.error{
  padding:12px 14px;border:1px solid rgba(255,130,130,.45);
  border-radius:12px;background:rgba(255,0,0,.13);color:#fff;
}
.success{
  padding:12px 14px;border:1px solid rgba(54,242,255,.45);
  border-radius:12px;background:rgba(16,215,230,.1);color:#fff;
}
.hint{color:var(--muted);font-size:.9rem}
.settings-section{margin-top:36px;padding-top:28px;border-top:1px solid rgba(170,240,250,.18)}
.settings-avatar-preview{width:80px;height:80px;border-radius:50%;object-fit:cover;border:2px solid rgba(170,240,250,.3)}
.settings-avatar-placeholder{width:80px;height:80px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#20e1ea,#078fa3);font-weight:900;font-size:2rem;color:#fff;flex-shrink:0}

/* ── Login page ─────────────────────────────────────────────────────── */
.login-page{display:grid;place-items:center;min-height:100vh;padding:26px}
.login-card{width:min(100%,450px);padding:30px}
.nav-toggle{display:none}
.nav-backdrop{display:none;position:fixed;inset:0;z-index:39;background:rgba(0,0,0,.55)}

/* ── Dashboard layout ───────────────────────────────────────────────── */
.dashboard-layout{
  display:grid;
  grid-template-columns:1fr;
  padding-left:var(--sidebar-w);
  min-height:100vh;
}

/* ── Sidebar ────────────────────────────────────────────────────────── */
.sidebar{
  position:fixed;top:0;left:0;width:var(--sidebar-w);height:100vh;overflow-y:auto;
  display:flex;flex-direction:column;gap:0;
  border-radius:0;border-top:none;border-bottom:none;border-left:none;
  padding:0;
}
.sidebar-brand{
  padding:22px 20px 16px;
  border-bottom:1px solid rgba(170,240,250,.18);
}
.sidebar-brand img{width:160px;height:auto}
.sidebar-app-name{
  display:block;margin-top:6px;
  color:var(--cyan2);text-transform:uppercase;
  letter-spacing:.16em;font-size:.74rem;font-weight:900;
}
.sidebar-user{
  display:grid;grid-template-columns:40px 1fr;gap:12px;
  align-items:center;padding:16px 20px;
  border-bottom:1px solid rgba(170,240,250,.12);
}
.sidebar-avatar{
  width:40px;height:40px;display:grid;place-items:center;
  border-radius:50%;background:linear-gradient(135deg,#20e1ea,#078fa3);
  font-weight:900;font-size:1.1rem;color:#fff;
}
.sidebar-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.sidebar-user b{display:block;font-size:.92rem}
.sidebar-user small{display:block;color:var(--muted);font-size:.78rem;margin-top:2px}

.sidebar-nav{padding:16px 12px 0;flex:1}
.sidebar-nav-label{
  margin:0 8px 8px;color:var(--cyan2);
  text-transform:uppercase;letter-spacing:.12em;font-size:.7rem;font-weight:900;
}
.sidebar-nav a{
  display:flex;align-items:center;gap:10px;
  border-radius:13px;padding:11px 12px;
  color:#ebfdff;font-weight:800;font-size:.92rem;
  border:1px solid transparent;margin-bottom:4px;
  transition:background .15s,border-color .15s;
}
.sidebar-nav a:hover{
  background:rgba(255,255,255,.075);
  border-color:rgba(170,240,250,.18);
}
.sidebar-nav a.active{
  background:linear-gradient(135deg,rgba(32,225,234,.22),rgba(7,143,163,.18));
  border-color:rgba(54,242,255,.45);
  color:#fff;
}
.nav-icon{font-size:1rem;opacity:.85}

.sidebar-footer{
  padding:16px 20px;
  border-top:1px solid rgba(170,240,250,.12);
  margin-top:auto;
}
.sidebar-logout{
  display:block;text-align:center;
  border:1px solid rgba(170,240,250,.28);
  border-radius:13px;padding:11px;
  background:rgba(255,255,255,.06);
  font-weight:900;font-size:.88rem;
  transition:background .15s;
}
.sidebar-logout:hover{background:rgba(255,255,255,.12)}

/* ── Main content ───────────────────────────────────────────────────── */
.main-content{
  overflow-y:auto;padding:48px 40px;min-height:100vh;
}
.main-inner{max-width:860px}
.main-inner:has(.page-split){max-width:none}
.main-inner:has(.dp-grid){max-width:none}
.main-title{
  font-family:'KindelSerif',Georgia,serif;font-size:2.8rem;
  line-height:1;margin:0 0 12px;color:#fff;
}
.main-title span{color:var(--cyan)}
.main-sub{color:var(--muted);font-size:1.05rem;margin:0}

/* ── Requests ───────────────────────────────────────────────────────── */
.badge{display:inline-block;padding:3px 10px;border-radius:8px;font-size:.82rem;font-weight:800}
.badge-pending {background:rgba(255,200,0,.18);border:1px solid rgba(255,200,0,.6);color:#ffe566}
.badge-accepted{background:rgba(16,215,230,.15);border:1px solid rgba(54,242,255,.55);color:var(--cyan2)}
.badge-rejected{background:rgba(255,60,60,.15);border:1px solid rgba(255,100,100,.55);color:#ff8080}

.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.monat-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.requests-table{width:100%;border-collapse:collapse;margin-top:20px}
.requests-table th{
  text-align:left;padding:10px 12px;color:var(--cyan2);
  font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;
  border-bottom:1px solid rgba(170,240,250,.2);font-weight:900;
}
.requests-table td{padding:12px;border-bottom:1px solid rgba(170,240,250,.08);vertical-align:middle}
.requests-table tr:hover td{background:rgba(255,255,255,.03)}

.type-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:24px 0 0}
.type-tab{
  padding:9px 18px;border-radius:11px;border:1px solid rgba(170,240,250,.22);
  background:rgba(255,255,255,.05);color:#ebfdff;font-weight:800;font-size:.9rem;
  cursor:pointer;transition:background .15s,border-color .15s;
}
.type-tab:hover{background:rgba(255,255,255,.1);border-color:rgba(170,240,250,.4)}
.type-tab.active{
  background:linear-gradient(135deg,rgba(32,225,234,.22),rgba(7,143,163,.18));
  border-color:rgba(54,242,255,.45);color:#fff;
}

.status-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:24px}
.status-tab{
  padding:8px 16px;border-radius:10px;border:1px solid rgba(170,240,250,.2);
  background:rgba(255,255,255,.05);color:#ebfdff;font-weight:800;font-size:.88rem;
  transition:background .15s,border-color .15s;
}
.status-tab:hover{background:rgba(255,255,255,.1)}
.status-tab.active{
  background:rgba(16,215,230,.18);border-color:rgba(54,242,255,.55);color:#fff;
}

.detail-card{padding:28px;margin-top:24px}
.detail-field{margin-bottom:16px}
.detail-field-label{font-size:.8rem;text-transform:uppercase;letter-spacing:.1em;color:var(--cyan2);font-weight:900;margin-bottom:4px}
.detail-field-value{color:#fff;font-size:.97rem}

.btn-danger{background:linear-gradient(135deg,#e94560,#a01a2e)}
.btn-ghost{background:transparent;border:1px solid rgba(170,240,250,.35);color:#cff;box-shadow:none}

/* ── Split layout (list left, form right) ───────────────────────────── */
.page-split{
  display:grid;
  grid-template-columns:1fr 400px;
  gap:32px;
  align-items:start;
  margin-top:28px;
}
.page-split-list h2{
  font-family:'KindelSerif',Georgia,serif;font-size:1.3rem;margin:0 0 16px;color:#fff;
}
.page-split-form h2{
  font-family:'KindelSerif',Georgia,serif;font-size:1.3rem;margin:0 0 20px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media(max-width:860px){
  /* Body-Offset für fixierten Header */
  body{padding-top:54px}
  .dashboard-layout{grid-template-columns:1fr;padding-left:0;width:100%;max-width:100%;overflow-x:hidden}

  /* Sidebar = fixierter kompakter Header, 54px hoch */
  .sidebar{
    position:fixed;top:0;left:0;right:0;z-index:40;
    height:54px;overflow:hidden;
    flex-direction:column;gap:0;
    border-radius:0;border-right:none;
    border-bottom:1px solid var(--line);
  }

  /* Brand-Zeile: Logo + Hamburger-Button */
  .sidebar-brand{
    display:flex;align-items:center;
    height:54px;flex-shrink:0;
    padding:0 14px;
    border-bottom:none;
  }
  .sidebar-brand img{width:80px}
  .sidebar-app-name{display:none}

  /* Hamburger-Button */
  .nav-toggle{
    display:flex;align-items:center;justify-content:center;
    margin-left:auto;flex-shrink:0;
    width:44px;height:44px;
    border:1px solid var(--line);border-radius:12px;
    background:rgba(255,255,255,.08);
    color:#fff;font-size:1.3rem;cursor:pointer;
    transition:background .15s;
  }
  .nav-toggle:hover{background:rgba(255,255,255,.15)}

  /* Nutzerblock + Nav + Footer: standardmäßig versteckt */
  .sidebar-user{display:none}
  .sidebar-nav{display:none;padding:12px 12px 0;flex-direction:column}
  .sidebar-nav-label{display:block}
  .sidebar-footer{display:none}
  .nav-label{display:inline}

  /* Geöffnet: Vollbild-Overlay */
  body.nav-open .sidebar{height:100vh;overflow-y:auto}
  body.nav-open .sidebar-user{display:grid}
  body.nav-open .sidebar-nav{display:flex}
  body.nav-open .sidebar-footer{display:block}
  body.nav-open .nav-backdrop{display:block}

  .main-content{padding:20px 16px;min-height:auto;width:100%;max-width:100%;overflow-x:hidden}
  .main-inner{width:100%;max-width:100%}
  .main-title{font-size:1.9rem}
  .page-split{grid-template-columns:1fr}
  .page-split-list,.page-split-form{min-width:0;width:100%}
  .page-split-form{order:-1}
  .requests-table,.users-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
}

/* ── Downloads page ─────────────────────────────────────────────────── */
.downloads-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:20px;margin-top:28px}
.download-card{padding:24px;display:flex;flex-direction:column;gap:14px}
.download-card-title{font-family:'KindelSerif',Georgia,serif;font-size:1.15rem;margin:0;color:#fff}
.download-card-desc{color:var(--muted);font-size:.92rem;margin:0;flex:1}
.download-btn{align-self:flex-start;padding:10px 18px;font-size:.9rem}

/* ── Downloads admin list ─────────────────────────────────────────────── */
.dl-sort-item{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:12px;border:1px solid rgba(170,240,250,.14);background:rgba(0,35,51,.44);margin-bottom:8px;cursor:grab;transition:background .15s}
.dl-sort-item:active{cursor:grabbing}
.dl-sort-item:hover{background:rgba(0,35,51,.7)}
.dl-sort-item.drag-over{border-color:rgba(54,242,255,.55);background:rgba(16,215,230,.08)}
.dl-drag-handle{color:var(--muted);font-size:1.2rem;user-select:none;flex-shrink:0;line-height:1}
.dl-item-info{flex:1;min-width:0}
.dl-item-title{font-weight:800;font-size:.93rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dl-item-filename{color:var(--muted);font-size:.8rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}

/* ── Dienstplan calendar ──────────────────────────────────────────────── */
.dp-ort{margin:0 0 20px;font-size:.95rem;color:var(--muted)}
.dp-ort strong{color:#ebfdff}
.dp-nav{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px;flex-wrap:wrap;gap:12px}
.dp-nav-title{font-family:'KindelSerif',Georgia,serif;font-size:1.6rem;color:#fff;margin:0}
.dp-nav-btn{padding:8px 18px;border-radius:10px;border:1px solid rgba(170,240,250,.3);background:rgba(255,255,255,.06);color:#ebfdff;font-weight:800;font-size:.88rem;cursor:pointer;text-decoration:none;transition:background .15s}
.dp-nav-btn:hover{background:rgba(255,255,255,.12)}
.dp-save-bar{display:flex;justify-content:flex-end;align-items:center;gap:16px;margin-bottom:20px}
.dp-grid-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
.dp-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;min-width:480px}
.dp-weekday{text-align:center;padding:8px 4px;color:var(--cyan2);font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;font-weight:900}
.dp-cell{min-height:80px;border-radius:12px;padding:8px;border:1px solid rgba(170,240,250,.14);background:rgba(0,35,51,.44);display:flex;flex-direction:column;gap:6px}
.dp-cell-empty{background:transparent;border-color:transparent;min-height:0}
.dp-cell-today{border-color:rgba(54,242,255,.55);background:rgba(16,215,230,.08)}
.dp-cell-frueh{background:rgba(54,242,100,.1);border-color:rgba(54,242,100,.38)}
.dp-cell-spaet{background:rgba(255,180,50,.1);border-color:rgba(255,180,50,.38)}
.dp-cell-nacht{background:rgba(130,80,255,.14);border-color:rgba(130,80,255,.42)}
.dp-day-num{font-size:.78rem;font-weight:900;color:var(--muted);line-height:1}
.dp-cell-today .dp-day-num{color:var(--cyan2)}
.dp-select{width:100%;border:1px solid rgba(170,240,250,.28);border-radius:8px;padding:5px 6px;background:rgba(2,11,22,.62);color:#fff;font:inherit;font-size:.8rem;cursor:pointer}
.dp-badge{display:block;padding:3px 8px;border-radius:7px;font-size:.75rem;font-weight:900;text-align:center;word-break:break-word}
.dp-badge-frueh{background:rgba(54,242,100,.15);border:1px solid rgba(54,242,100,.5);color:#6eff9a}
.dp-badge-spaet{background:rgba(255,180,50,.15);border:1px solid rgba(255,180,50,.5);color:#ffc84a}
.dp-badge-nacht{background:rgba(130,80,255,.18);border:1px solid rgba(130,80,255,.5);color:#b89cff}
.dp-overlay-urlaub{background:rgba(16,215,230,.18);border:1px solid rgba(54,242,255,.5);color:var(--cyan2)}
.dp-overlay-abwesenheit{background:rgba(255,200,0,.15);border:1px solid rgba(255,200,0,.5);color:#ffe566}
.dp-user-select-wrap{margin-bottom:28px}
.dp-user-select-wrap select{max-width:320px;border-radius:12px;padding:12px;font-weight:800}
.dp-free{font-size:.75rem;color:rgba(215,246,248,.35)}
@media(max-width:680px){
  .dp-grid{gap:3px}
  .dp-cell{min-height:60px;padding:5px}
  .dp-weekday{font-size:.62rem}
  .dp-day-num{font-size:.7rem}
  .dp-select{font-size:.72rem;padding:4px}
}
@media(max-width:480px){
  .monat-grid{grid-template-columns:1fr}
  .main-content{padding:18px 14px}
  .main-title{font-size:1.6rem}
  .btn-sm{padding:11px 13px}
  .detail-card{padding:16px}
  .modal-box{padding:20px 16px}
  .admin-tabs{flex-wrap:wrap;gap:6px;margin-bottom:20px}
  .admin-tab{padding:8px 14px;font-size:.82rem}
  .type-tab,.status-tab{padding:7px 12px;font-size:.82rem}
  .dp-cell{min-height:44px;padding:4px 3px}
  .dp-weekday{font-size:.58rem;padding:6px 2px}
  .dp-badge{font-size:.65rem;padding:2px 4px}
  .dp-select{font-size:.68rem;padding:3px 2px}
  .requests-table,.users-table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  .login-card{padding:22px 18px}
}
