/* Personio-inspiriert: Glass Dark — ruhig, klar, HR-Portal */
:root {
  --bg: #0c1018;
  --bg-elevated: #121a26;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --card: var(--glass);
  --border: rgba(255, 255, 255, 0.12);
  --fg: #f1f5f9;
  --muted: #94a3b8;
  --accent: #00c896;
  --accent-dark: #009e78;
  --accent-soft: rgba(0, 200, 150, 0.18);
  --acc1: var(--accent);
  --acc2: #00e0a8;
  --sky: var(--accent);
  --link: #5eead4;
  --input-bg: rgba(8, 12, 20, 0.65);
  --input-border: rgba(255, 255, 255, 0.14);
  --row-border: rgba(255, 255, 255, 0.08);
  --danger: #f87171;
  --success: #34d399;
  --radius: 16px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  --nav-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(0, 200, 150, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(56, 189, 248, 0.08), transparent 50%),
    var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.page-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
}

body.app-portal {
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Glass-Karten (Personio-Stil) */
.card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.container {
  width: min(1100px, 94vw);
  margin: 30px auto;
  padding-bottom: 40px;
}

.container.wide {
  width: min(1200px, 94vw);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(1200px, 94vw);
  margin: 0 auto 14px;
  padding: 14px 0 0;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(18px, 3.5vw, 22px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.topbar nav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.topbar .who {
  color: var(--muted);
  font-size: 13px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1.page-title {
  margin: 0 0 10px;
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 800;
}

.sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  margin-right: 10px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}

label {
  font-size: 13px;
  color: #cbd5e1;
  display: block;
  margin: 10px 0 6px;
}

label:first-of-type {
  margin-top: 0;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--fg);
  outline: none;
  font-size: 15px;
}

textarea {
  min-height: 80px;
  resize: vertical;
  margin-bottom: 4px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover {
  filter: brightness(1.05);
}
.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn-primary,
.btn.btn-primary {
  background: var(--accent);
  color: #042f24;
  box-shadow: 0 8px 24px rgba(0, 200, 150, 0.28);
}
.btn-primary:hover,
.btn.btn-primary:hover {
  background: var(--acc2);
}

.btn-ghost {
  background: #0b0f16;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 700;
}
.btn-ghost:hover {
  color: var(--fg);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-success {
  background: #10b981;
  color: #0a0a0a;
  font-weight: 800;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  font-weight: 800;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
  border: 1px solid var(--border);
  font-weight: 700;
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.22);
}

.topbar .btn,
nav .btn {
  width: auto;
  padding: 10px 14px;
}

table .btn {
  width: auto;
  padding: 8px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  margin-top: 6px;
}

/* Tabs (Admin) – wie Portal */
.tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #0b0f16;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
}

.tab.active {
  background: var(--accent);
  color: #042f24;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 200, 150, 0.25);
}

.section {
  display: none;
}
.section.active {
  display: block;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 10px;
  border-bottom: 1px solid var(--row-border);
}

th {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.badge-admin {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #f59e0b;
  color: #000;
}

.badge-employee {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #10b981;
  color: #000;
}

.badge-off {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #ef4444;
  color: #fff;
}

.msg {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.msg-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
.msg-info {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #bae6fd;
}
.msg-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

.login-card {
  width: min(460px, 94vw);
  margin: 0 auto;
}

.hint-below {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 18px;
  max-width: min(460px, 94vw);
  line-height: 1.5;
}

.hint-below code {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: #cbd5e1;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
.pulse-dot.off {
  background: var(--muted);
  animation: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(1.12);
  }
}

.clock-big {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 8px 0 14px;
  color: var(--fg);
}

.flex {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.muted {
  color: var(--muted);
}

/* Kalender */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 12px;
}
.cal-head {
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  padding: 6px 2px;
}
.cal-cell {
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  background: rgba(11, 15, 22, 0.6);
}
.cal-cell.cal-cell-day {
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(14, 165, 233, 0.28);
  touch-action: manipulation;
  user-select: none;
}
.cal-cell.cal-cell-day:active {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.45);
}
.cal-cell.cal-cell-day:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}
.cal-nav-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-nav-title {
  flex: 1 1 140px;
  min-width: 0;
}
.cal-cell.out {
  opacity: 0.35;
}
.cal-cell-num {
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 4px;
}
.cal-cell-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-line {
  border-radius: 4px;
  padding: 1px 4px;
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-line.shift {
  background: rgba(14, 165, 233, 0.25);
  color: #bae6fd;
}
.cal-line.vac {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
.cal-line.sick {
  background: rgba(244, 63, 94, 0.2);
  color: #fda4af;
}
.cal-line.time {
  background: rgba(251, 191, 36, 0.2);
  color: #fde68a;
}
.cal-line.oth {
  background: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}
.cal-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}
.cal-d-shift {
  background: #0ea5e9;
}
.cal-d-vac {
  background: #10b981;
}
.cal-d-sick {
  background: #f43f5e;
}
.cal-d-time {
  background: #fbbf24;
}

.cal-day-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(0, 0, 0, 0.55);
  touch-action: none;
}

.cal-day-sheet {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 401;
  max-height: min(78vh, 520px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #121826;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
}

.cal-day-sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.cal-day-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  padding-right: 8px;
}

.cal-day-sheet-close {
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 12px;
}

.cal-day-sheet-body {
  font-size: 14px;
  line-height: 1.45;
}

.cal-sheet-h {
  font-weight: 700;
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

.cal-sheet-h:first-child {
  margin-top: 0;
}

.cal-sheet-ul {
  margin: 0;
  padding-left: 1.2rem;
}

.cal-day-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 4px;
}

body.cal-sheet-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .cal-grid {
    gap: 6px;
    font-size: 13px;
  }

  .cal-cell {
    min-height: 86px;
    padding: 6px 5px;
  }

  .cal-cell-num {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .cal-line {
    font-size: 11px;
    padding: 5px 5px;
    line-height: 1.3;
    white-space: normal;
    word-break: break-word;
  }

  .cal-head {
    font-size: 11px;
    padding: 8px 2px;
  }
}

body:not(.is-admin) .tab-admin {
  display: none !important;
}
body:not(.is-admin) #sec-shifts {
  display: none !important;
}
body:not(.is-admin) #calUserWrap {
  display: none !important;
}
body:not(.is-admin) #absTargetWrap {
  display: none !important;
}
body:not(.is-admin) .abs-admin-col {
  display: none !important;
}

/* Stempel-Tab: Time-Butler-ähnliches Dashboard im Portal-Look */
.tb-dash {
  margin-bottom: 8px;
}
.tb-head {
  margin-bottom: 14px;
}
.tb-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.tb-tagline {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  max-width: 62rem;
}
.tb-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 880px) {
  .tb-grid {
    grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.12fr);
  }
}
.tb-clock-card .tb-live-clock {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.35rem, 7.5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-top: 4px;
  background: linear-gradient(120deg, #f8fafc 0%, #94a3b8 45%, #7dd3fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .tb-clock-card .tb-live-clock {
    color: var(--fg);
  }
}
.tb-live-date {
  margin-top: 10px;
  font-size: 14px;
}
.tb-status-text {
  font-size: clamp(15px, 2.8vw, 17px);
  font-weight: 700;
  color: var(--fg);
}
.tb-big-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 6px;
}
.tb-big-actions .btn-tb {
  min-height: 56px;
  font-size: 16px;
  border-radius: 16px;
}
.tb-pause-row .btn-tb-sec {
  flex: 1 1 140px;
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
}

/* —— Personio-Layout: App-Shell —— */
.login-card {
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.login-brand {
  text-align: center;
  margin-bottom: 8px;
}

.login-brand .logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
  border: 1px solid rgba(0, 200, 150, 0.35);
}

body.app-portal .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px clamp(16px, 3vw, 28px);
  background: rgba(12, 16, 24, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

body.app-portal .topbar h1 {
  font-size: 1.05rem;
  font-weight: 700;
}

body.app-portal .container.wide {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 16px clamp(16px, 3vw, 28px) 24px;
}

body.app-portal #roleTabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  margin: 0;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(12, 16, 24, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 6px;
  justify-content: flex-start;
}

body.app-portal #roleTabs::-webkit-scrollbar {
  display: none;
}

body.app-portal #roleTabs .tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
  border-radius: 12px;
}

body.app-portal .tb-tagline {
  display: none;
}

body.app-portal .tb-eyebrow {
  color: var(--accent);
  letter-spacing: 0.06em;
}

@media (min-width: 960px) {
  body.app-portal {
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    padding-bottom: 0;
  }

  body.app-portal .topbar {
    grid-column: 1 / -1;
  }

  body.app-portal #roleTabs {
    position: sticky;
    top: 72px;
    align-self: start;
    grid-column: 1;
    grid-row: 2;
    flex-direction: column;
    align-items: stretch;
    height: fit-content;
    max-height: calc(100vh - 88px);
    margin: 0 0 0 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(18px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  body.app-portal #roleTabs .tab {
    width: 100%;
    text-align: left;
    justify-content: flex-start;
  }

  body.app-portal .container.wide {
    grid-column: 2;
    grid-row: 2;
  }
}
