/* =========================================================
   Alpha SD – Base Styles (theme-ready)
   ========================================================= */

:root {
  --bg-page: #39566d;
  --text-main: #101010;
  --bg-card: #eeeeee;
  --border-card: #dddddd;
  --btn-bg: #111111;
  --btn-text: #ffffff;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.4;
}

.container {
  max-width: 980px;
  margin: 28px auto;
  padding: 0 14px;
}

.logo {
  display: block;
  margin: 0 auto;
  border-radius: 30px;
  width: 380px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 14px;
  margin: 10px 0;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-weight: 600;
  margin-top: 10px;
  font-size: 13px;
}

input {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 7px;
  border: 1px solid var(--border-card);
  font-size: 13px;
}

input[type="date"] {
  padding: 7px 10px;
}

/* Select (einheitlich) */
.select {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 7px;
  border: 1px solid var(--border-card);
  font-size: 13px;
  background: #fff;
}

.select-compact {
  width: auto;
  padding: 6px 8px;
  margin-top: 0;
  font-size: 13px;
}

/* ---------- Buttons ---------- */

.btn {
  margin-top: 12px;
  padding: 8px 11px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 13px;
}

/* ---------- Admin Sticky Menu ---------- */

.admin-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #f9f9f9;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
}

.admin-nav-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.admin-nav-link {
  display: inline-block;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}

.admin-nav-link:hover {
  background: rgba(0,0,0,0.06);
}

.admin-nav-link.is-active {
  background: rgba(0,0,0,0.10);
}

/* ---------- App Sticky Menu (Admin + User) ---------- */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #f9f9f9;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
}

.app-nav-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.app-nav-link {
  display: inline-block;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}

.app-nav-link:hover {
  background: rgba(0,0,0,0.06);
}

.app-nav-link.is-active {
  background: rgba(0,0,0,0.10);
}

/* Dropdown */
.app-dropdown {
  position: relative;
  padding-bottom: 6px;
}

.app-dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #f9f9f9;
  min-width: 200px;
  box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
  padding: 8px;
  border-radius: 8px;
  z-index: 1100;
}

.app-dropdown:hover .app-dropdown-content {
  display: block;
}

.app-dropdown-item {
  display: block;
  padding: 8px 10px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
  white-space: nowrap;
}

.app-dropdown-item:hover {
  background: rgba(0,0,0,0.06);
}

/* Logout rechts */
.app-nav-spacer {
  flex: 1;
}

.app-logout-form {
  margin: 0;
}

.app-logout-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(0,0,0,0.08);
  cursor: pointer;
}

.app-logout-btn:hover {
  background: rgba(0,0,0,0.14);
}

/* ---------- Misc ---------- */

#pwForgotLink {
  font-size: 10px;
  text-decoration: none;
}

#pwForgotLink:hover {
  text-decoration: underline;
}

/* =========================================================
   Mitarbeiter-Tabelle (Zebra, korrekt auf td-Ebene)
   ========================================================= */

.zebra-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.zebra-table th a {
  color: #fefefe;
  text-decoration: none;
}
.zebra-table td a {
  color: #010101;
  text-decoration: none;
}
.zebra-table a:hover {
  color:chocolate;
  text-decoration: underline;
}

.zebra-table th {
    color: #fefefe;
    padding: 6px 8px;
    background-color: #555555;
}
.zebra-table td {
  padding: 10px 12px;
  vertical-align: middle;
  transition: background-color 0.12s ease-in-out;
}

.zebra-table thead th {
  border-bottom: 2px solid #e7eaf0;
  font-weight: 600;
}

/* Zebra-Layout – WICHTIG: auf td-Ebene */
.zebra-table tbody tr:nth-child(odd) td {
  background-color: #fff;
}

.zebra-table tbody tr:nth-child(even) td {
  background-color: #ddd;
}

.zebra-table tbody tr:hover td {
  background-color: #aaa;
}

/* Status Button */
.status-toggle {
  border: 0;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  color: #010101;
  background: transparent;
}

.status-toggle.is-active {
  outline: 2px solid #39566d;
}

.status-toggle.is-inactive {
  outline: 2px solid #666;
  opacity: 0.95;
}

/* Action Icons */
.icon-link img {
  display: inline-block;
  vertical-align: middle;
}

/* Toolbar über Tabellen (Titel + Suche + Aktionen) */
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.table-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.search-input {
  width: 320px;
  max-width: 100%;
  margin-top: 13px;
}
/* =========================================================
   Scrollbare Tabellen innerhalb Cards (mobil & desktop)
   ========================================================= */

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll table {
  min-width: 720px; /* ggf. anpassen */
}
/* ---------- Select (global) ---------- */
select {
  width: 100%;
  padding: 8px 10px;
  margin-top: 6px;
  border-radius: 7px;
  border: 1px solid var(--border-card);
  font-size: 13px;
  background: #fff;
}

/* ---------- Form Layout Helpers ---------- */
.form-section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

@media (max-width: 760px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Checkbox-Zeile etwas schöner */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.checkbox-row input[type="checkbox"] {
  width: auto;
  margin: 0;
}
/* =========================================================
   Widgets (4er-Leiste)
   ========================================================= */

.widget-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
  margin-bottom: 12px;
}

@media (max-width: 980px) {
  .widget-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 640px) {
  .widget-grid { grid-template-columns: 1fr; }
}

.widget {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(255,255,255,0.35);
}

.widget-icon img { display: block; }

.widget-body { line-height: 1.1; }

.widget-value {
  font-size: 30px;
  font-weight: 800;
}

.widget-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
}

.widget-title {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 8px;
}
/* ===== Vacation Year Calendar ===== */

.vacation-year-toolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.vacation-year-title{
  margin:0;
}
.vacation-year-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.vacation-legend{
  border-top:1px solid #bbb;
  margin-top:12px;
  padding-top:12px;
}
.vacation-legend-title{
  font-weight:700;
  margin-bottom:8px;
}
.vacation-legend-items{
  display:flex;
  flex-wrap:wrap;
  gap:10px 16px;
}
.vacation-legend-item{
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
}
.vacation-legend-hints{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Responsive: Vacation year grid */
.vacation-year-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
  margin-top:14px;
}

/* Tablet: 2 Spalten */
@media (max-width: 1100px){
  .vacation-year-grid{
    grid-template-columns:repeat(2, 1fr);
  }
}

/* Handy: 1 Spalte (alle Monate untereinander) */
@media (max-width: 700px){
  .vacation-year-grid{
    grid-template-columns:1fr;
  }
}

.vacation-month{
  border:1px solid #bbb;
  background:#fff;
  padding:8px;
}
.vacation-month-title{
  font-weight:700;
  margin-bottom:6px;
}

.vacation-month-weekdays{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:2px;
  font-size:12px;
  opacity:0.85;
  margin-bottom:4px;
}
.vacation-month-weekdays > div{
  text-align:center;
  padding:2px 0;
}

.vacation-month-grid{
  display:grid;
  grid-template-columns:repeat(7, 1fr);
  gap:2px;
}

.vacation-day{
  border:1px solid #ddd;
  min-height:46px;
  padding:4px;
  background:#fafafa;
  overflow:hidden;
}
.vacation-day.is-out{
  background:#f0f0f0;
  opacity:0.55;
}
.vacation-day.is-weekend{
  background:#f6f6f6;
}

.vacation-day.is-holiday{
  background:#fff3f3;
}
.vacation-day.is-company-off{
  background:#f3fff6;
}

.vacation-day-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:6px;
  font-size:12px;
}
.vacation-day-num{
  font-weight:700;
}

.vacation-day-flag{
  display:inline-block;
  font-size:11px;
  line-height:1;
  padding:2px 4px;
  border:1px solid #999;
  border-radius:4px;
  background:#fff;
}
.holiday-flag{
  border-color:#b33;
}
.company-flag{
  border-color:#3b7;
}

.vacation-day-body{
  margin-top:3px;
  display:flex;
  flex-direction:column;
  gap:2px;
}
.vacation-entry{
  display:flex;
  align-items:center;
  gap:4px;
  font-size:11px;
  white-space:nowrap;
}
.vacation-entry-name{
  overflow:hidden;
  text-overflow:ellipsis;
}

/* Pill (color marker) */
.vacation-pill{
  width:10px;
  height:10px;
  border-radius:999px;
  display:inline-block;
  border:1px solid rgba(0,0,0,0.25);
}

/* ===== 20 deterministic user colors (stable via user_id % 20) ===== */
:root{
  --uclr-0:  #1f77b4;
  --uclr-1:  #ff7f0e;
  --uclr-2:  #2ca02c;
  --uclr-3:  #d62728;
  --uclr-4:  #9467bd;
  --uclr-5:  #8c564b;
  --uclr-6:  #e377c2;
  --uclr-7:  #7f7f7f;
  --uclr-8:  #bcbd22;
  --uclr-9:  #17becf;

  --uclr-10: #0b5fa5;
  --uclr-11: #c95a00;
  --uclr-12: #1a7f2b;
  --uclr-13: #a61e1e;
  --uclr-14: #6b4aa6;
  --uclr-15: #6b3f33;
  --uclr-16: #b84fa1;
  --uclr-17: #555555;
  --uclr-18: #8f8f12;
  --uclr-19: #0f8a96;
}

.uclr-0  { background: var(--uclr-0); }
.uclr-1  { background: var(--uclr-1); }
.uclr-2  { background: var(--uclr-2); }
.uclr-3  { background: var(--uclr-3); }
.uclr-4  { background: var(--uclr-4); }
.uclr-5  { background: var(--uclr-5); }
.uclr-6  { background: var(--uclr-6); }
.uclr-7  { background: var(--uclr-7); }
.uclr-8  { background: var(--uclr-8); }
.uclr-9  { background: var(--uclr-9); }
.uclr-10 { background: var(--uclr-10); }
.uclr-11 { background: var(--uclr-11); }
.uclr-12 { background: var(--uclr-12); }
.uclr-13 { background: var(--uclr-13); }
.uclr-14 { background: var(--uclr-14); }
.uclr-15 { background: var(--uclr-15); }
.uclr-16 { background: var(--uclr-16); }
.uclr-17 { background: var(--uclr-17); }
.uclr-18 { background: var(--uclr-18); }
.uclr-19 { background: var(--uclr-19); }

/* ===== Print ===== */
@media print{
  .no-print,
  .app-nav,
  .app-logout-form,
  .vacation-year-actions{
    display:none !important;
  }

  .container{
    max-width:none;
  }

  .vacation-year-grid{
    grid-template-columns:repeat(3, 1fr);
    gap:8px;
  }

  .vacation-month{
    page-break-inside:avoid;
  }

  .vacation-day{
    min-height:38px;
  }

  .vacation-entry{
    font-size:10px;
  }
}
/* ===== Clock ===== */
.clock-wrap{
  margin-top:12px;
  padding:12px;
  border:1px solid #bbb;
  border-radius:10px;
  background:#fff;
}

.clock-digital{
  font-size:56px;
  font-weight:800;
  letter-spacing:1px;
  text-align:center;
  padding:14px 10px;
}

.clock-analog{
  display:flex;
  justify-content:center;
  padding:10px 0 6px 0;
}

.clock-face{
  width:300px;
  height:300px;
  border:5px solid #444;
  border-radius:999px;
  position:relative;
  background:#f7f7f7;
  box-shadow: 0px 0px 15px #333;
}

.hand{
  position:absolute;
  left:50%;
  top:50%;
  transform-origin: 50% 100%;
  transform: translateX(-50%) rotate(0deg);
  border-radius:6px;
}

.hand.hour{
  width:8px;
  height:65px;
  background:#222;
  margin-top:-65px;
}

.hand.minute{
  width:6px;
  height:85px;
  background:#333;
  margin-top:-85px;
}

.hand.second{
  width:2px;
  height:95px;
  background:#c00;
  margin-top:-95px;
}

.center-dot{
  position:absolute;
  left:50%;
  top:50%;
  width:12px;
  height:12px;
  background:#222;
  border-radius:999px;
  transform: translate(-50%, -50%);
}

.clock-status{
  margin-top:10px;
  text-align:center;
  font-weight:700;
}

.clock-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
  align-items:center;
}

.clock-summary{
  margin-top:18px;
  border-top:1px solid #bbb;
  padding-top:12px;
}

.clock-summary-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:10px;
}

.clock-summary-item{
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px;
  background:#fafafa;
}

.clock-summary-item .label{
  font-size:12px;
  opacity:0.8;
}

.clock-summary-item .value{
  font-size:22px;
  font-weight:800;
  margin-top:4px;
}
/* ===== Analog clock numbers ===== */

.clock-numbers{
  position:absolute;
  inset:0;
  pointer-events:none;
}

.clock-numbers span{
  position:absolute;
  width:24px;
  height:24px;
  text-align:center;
  font-size:14px;
  font-weight:700;
  color:#222;
  transform:translate(-50%, -50%);
}

/* Positionierung der Ziffern */
.clock-numbers span:nth-child(1)  { left:50%; top:10%; }   /* 12 */
.clock-numbers span:nth-child(2)  { left:68%; top:14%; }   /* 1  */
.clock-numbers span:nth-child(3)  { left:82%; top:28%; }   /* 2  */
.clock-numbers span:nth-child(4)  { left:88%; top:50%; }   /* 3  */
.clock-numbers span:nth-child(5)  { left:82%; top:72%; }   /* 4  */
.clock-numbers span:nth-child(6)  { left:68%; top:86%; }   /* 5  */
.clock-numbers span:nth-child(7)  { left:50%; top:92%; }   /* 6  */
.clock-numbers span:nth-child(8)  { left:32%; top:86%; }   /* 7  */
.clock-numbers span:nth-child(9)  { left:18%; top:72%; }   /* 8  */
.clock-numbers span:nth-child(10) { left:12%; top:50%; }   /* 9  */
.clock-numbers span:nth-child(11) { left:18%; top:28%; }   /* 10 */
.clock-numbers span:nth-child(12) { left:32%; top:14%; }   /* 11 */


/* ===== Hours summary ===== */
.hours-summary{
  margin-top:14px;
  border-top:1px solid #bbb;
  padding-top:12px;
}
.hours-summary-grid{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:10px;
}
.hours-summary-item{
  border:1px solid #ddd;
  border-radius:10px;
  padding:10px;
  background:#fafafa;
}
.hours-summary-item .label{
  font-size:12px;
  opacity:0.8;
}
.hours-summary-item .value{
  font-size:22px;
  font-weight:800;
  margin-top:4px;
}
.hours-summary-note{
  margin-top:8px;
  font-size:12px;
  opacity:0.7;
}

/* Print */
@media print{
  .no-print,
  .app-nav,
  .app-logout-form{
    display:none !important;
  }
  .container{ max-width:none; }
  .table-scroll{ overflow:visible; }
}
/* ===== Hours: User Meta ===== */
.hours-user-meta{
  margin-top:4px;
  margin-bottom:8px;
  font-size:13px;
  opacity:0.85;
}

@media print{
  .hours-user-meta{
    opacity:1;
  }
}
.text-negative {
  color: #b00020;
  font-weight: 600;
}
/* ===== Admin Worktime Calendar (Dienstplan) ===== */
.wtc-day{ position:relative; }

/* Dienst / Frei: Hintergrundfarben (nutzt vorhandene vacation-day Box) */
.wtc-day.wtc-work{ background:#f4c08a; }   /* orange */
.wtc-day.wtc-off{  background:#cfeecf; }   /* hellgr�n */

/* Wochenende: dunkler */
.wtc-day.is-weekend.wtc-work{ background:#e0a15f; }
.wtc-day.is-weekend.wtc-off{  background:#a7dca7; }

/* Toggle-Button im Feld: unauff�llig */
.wtc-toggle-btn{
  width:100%;
  padding:4px 6px;
  font-size:12px;
}

/* Legende: farbige Punkte */
.vacation-pill.wtc-legend-work{ background:#f4c08a; }
.vacation-pill.wtc-legend-off{  background:#cfeecf; }

/* Dienstplan: Urlaub (approved) */
.vacation-day.wtc-vacation { background: #f3b0b0; } /* hellrot */
.vacation-pill.wtc-legend-vac { background: #f3b0b0; }
.vacation-pill.wtc-pill-vac { background: rgba(255,255,255,0.65); }
