/* ═══════════════════════════════════════════════════════════
   OKYU HRM – Aushilfe Planung Styles
   Admin tab + public page shared & specific styles
   ═══════════════════════════════════════════════════════════ */

/* ── Admin Page Layout ────────────────────────────────────── */
.aushilfe-page {
  padding: 0 0 40px;
}

.aushilfe-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.aushilfe-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 4px;
}

.aushilfe-subtitle {
  font-size: .85rem;
  color: var(--text-muted);
}

.aushilfe-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ── Month Navigation Bar ─────────────────────────────────── */
.aushilfe-nav-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.aushilfe-month-label {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}

.aushilfe-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: .82rem;
  color: var(--text-muted);
}

.aushilfe-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

.aushilfe-legend-dot.open   { background: var(--accent); }
.aushilfe-legend-dot.booked { background: var(--success); }

/* ── Stats Chips ──────────────────────────────────────────── */
.aushilfe-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.aushilfe-stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .85rem;
  color: var(--text-secondary);
}

/* ── Aushilfe Grid ────────────────────────────────────────── */
.aushilfe-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  /* Same formula as .subs-scroll-wrap */
  width: calc(100vw - var(--sidebar-w) - 64px);
  max-width: 100%;
}

@media (max-width: 768px) {
  .aushilfe-grid-wrap {
    width: calc(100vw - 32px);
  }
}

.ag-grid {
  display: grid;
  min-width: max-content;
}

/* Header row */
.ag-header {
  display: contents;
}

.ag-corner {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  border-bottom: 2px solid var(--border);
  padding: 10px 12px;
  position: sticky;
  left: 0;
  z-index: 2;
}

.ag-day-header {
  text-align: center;
  padding: 8px 4px;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
  min-width: 72px;
}

.ag-day-header.is-today {
  background: rgba(var(--accent-rgb), .12);
  border-bottom-color: var(--accent);
}

.ag-day-dow {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.ag-day-num {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
}

.ag-day-header.is-today .ag-day-num {
  color: var(--accent);
}

/* Body rows */
.ag-row {
  display: contents;
}

.ag-row-label {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  position: sticky;
  left: 0;
  z-index: 1;
}

/* Grid cells */
.ag-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px;
  cursor: pointer;
  transition: background .15s;
  min-height: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.ag-cell.empty {
  background: transparent;
  cursor: pointer;
}

.ag-cell.empty:hover {
  background: rgba(var(--accent-rgb), .05);
}

.ag-cell.empty .ag-cell-add {
  font-size: 1.2rem;
  color: var(--border);
  opacity: 0;
  transition: opacity .15s;
}

.ag-cell.empty:hover .ag-cell-add {
  opacity: 1;
  color: var(--accent);
}

.ag-cell.open {
  background: rgba(var(--accent-rgb), .06);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  margin: 3px;
}

.ag-cell.open:hover {
  background: rgba(var(--accent-rgb), .12);
}

.ag-cell.booked {
  background: rgba(var(--success-rgb), .07);
  border: 1px solid var(--success);
  border-radius: 8px;
  margin: 3px;
}

.ag-cell.booked:hover {
  background: rgba(var(--success-rgb), .14);
}

.ag-cell-time {
  font-size: .72rem;
  font-weight: 700;
  font-family: 'Space Mono', monospace;
  color: var(--accent);
}

.ag-cell.booked .ag-cell-time {
  color: var(--success);
}

.ag-cell-dept {
  font-size: .68rem;
  color: var(--text-muted);
}

.ag-cell-badge {
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 2px;
}

.ag-cell-badge.open   { background: rgba(var(--accent-rgb),.15); color: var(--accent); }
.ag-cell-badge.booked { background: rgba(var(--success-rgb),.15); color: var(--success); }

.ag-cell-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ag-cell-name {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Modal rows ───────────────────────────────────────────── */
.aushilfe-modal-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 10px;
}

.aushilfe-modal-row .ms {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-top: 2px;
  flex-shrink: 0;
}

.aushilfe-modal-label {
  font-size: .72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 2px;
}

.aushilfe-modal-val {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Mobile responsive (≤ 900px) ─────────────────────────── */

/* ── Settings Card ────────────────────────────────────────── */
.aushilfe-settings-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: rgba(var(--accent-rgb), .06);
  border: 1px solid rgba(var(--accent-rgb), .2);
  border-radius: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.aushilfe-settings-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.aushilfe-settings-label {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.aushilfe-settings-sub {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.aushilfe-settings-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ── Submissions Section ───────────────────────────────────── */
.aushilfe-subs-section {
  margin-top: 32px;
  border-top: 2px solid var(--border);
  padding-top: 24px;
}

.aushilfe-subs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.aushilfe-subs-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* Clickable table rows */
.sub-row {
  cursor: pointer;
  transition: background .15s;
}

.sub-row:hover td {
  background: rgba(var(--accent-rgb), .05) !important;
}

/* Horizontal scroll wrapper for submissions table */
.subs-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  /* width = viewport - sidebar - content padding */
  width: calc(100vw - var(--sidebar-w) - 64px);
  max-width: 100%;
}

@media (max-width: 768px) {
  .subs-scroll-wrap {
    width: calc(100vw - 32px);
  }
}

/* ── Mobile responsive (≤ 900px) ─────────────────────────── */
@media (max-width: 900px) {
  .aushilfe-header {
    flex-direction: column;
    gap: 12px;
  }
  .aushilfe-header-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .aushilfe-settings-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .aushilfe-stats {
    gap: 8px;
  }
  .aushilfe-stat-chip {
    padding: 6px 10px;
    font-size: .78rem;
  }
  .ag-cell {
    min-height: 56px;
  }
  .aushilfe-subs-header {
    flex-direction: column;
  }
}

