/* ==========================================================================
   Wochenplaner - Righetti Partner Group Corporate Identity Stylesheet
   ========================================================================== */

:root {
  /* Official Righetti Partner Group Brand Identity Palette */
  --primarycolor: #041b2b;          /* Deep Navy Blue */
  --darkgrey: #899196;              /* Slate Steel Grey */
  --lightgrey: #f1ece5;             /* Warm Sand Light Background */
  --midgrey: #e5ddcf;               /* Soft Parchment Container Background */
  --black: #041b2b;
  --white: #ffffff;

  /* Theme System Mapped to Righetti Partner Corporate Palette */
  --bg-primary: #f1ece5;            /* Warm Sand Light Background */
  --bg-secondary: #e5ddcf;          /* Soft Parchment Container & Sidebar Background */
  --bg-card: #ffffff;               /* Crisp White Cards & Modals */
  --bg-card-hover: #f7f3ec;         /* Subtle Cream Card Hover State */
  --bg-glass: #041b2b;              /* Deep Navy Header Background */
  
  --border-color: #d8cebe;          /* Elegant Warm Border Divider */
  --border-active: #041b2b;         /* High-Contrast Navy Focus Outline */

  --text-main: #041b2b;             /* Crisp Deep Navy Blue Primary Text */
  --text-muted: #5c6870;            /* Muted Slate Subtitles & Labels */
  --text-dim: #899196;              /* Dim Slate Grey Hints */

  --accent-primary: #041b2b;        /* Corporate Deep Navy Accent */
  --accent-primary-hover: #0a2d46;  /* Deep Navy Hover */
  --accent-secondary: #004d7a;      /* Steel Blue Sub-Accent */
  --accent-success: #059669;        /* Forest Emerald Green */
  --accent-warning: #d97706;        /* Warm Amber Orange */
  --accent-danger: #dc2626;         /* Crimson Red */

  --font-family: "DIN Next LT Pro", "Barlow", "DIN 1451 Mittelschrift", 'Space Grotesk', Helvetica, Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-sm: 0 1px 3px rgba(4, 27, 43, 0.08);
  --shadow-md: 0 4px 12px rgba(4, 27, 43, 0.10);
  --shadow-lg: 0 10px 25px rgba(4, 27, 43, 0.15);
  --shadow-glow: 0 0 15px rgba(4, 27, 43, 0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  letter-spacing: 0.03em;
}

button, input, select, textarea, table, th, td, h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family) !important;
  letter-spacing: 0.03em;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.5;
  letter-spacing: 0.03em;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

/* HIGH CONTRAST SELECT & OPTION STYLING FOR BOTH LIGHT AND DARK THEMES */
select, .select-field, select.table-inline-input, select.gantt-inline-input, select.status-pulldown {
  background-color: #ffffff !important;
  color: #041b2b !important;
  border: 1px solid #d8cebe !important;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  cursor: pointer;
}

select option, .select-field option, select.table-inline-input option, select.gantt-inline-input option, select.status-pulldown option {
  background-color: #ffffff !important;
  color: #041b2b !important;
  padding: 6px 10px;
}

/* Date Picker Input Styling */
input[type="date"].date-picker-input {
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.8);
  opacity: 0.8;
  transition: opacity 0.15s ease;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-hover));
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-main);
  border-color: var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}
.btn-icon {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

/* Header (Visible Overflow for Popups) */
.app-header {
  min-height: 56px;
  height: 56px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: relative;
  z-index: 1000 !important;
  flex-wrap: nowrap !important;
  gap: 8px;
  overflow: visible !important;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  max-width: 400px;
}
.brand-title {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Week & Date Navigator */
.week-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-secondary);
  padding: 3px 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.week-title {
  font-weight: 700;
  font-size: 0.78rem;
  min-width: 170px;
  text-align: center;
  white-space: nowrap;
}

/* Zoom / View Switcher Bar */
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-secondary);
  padding: 3px 6px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.zoom-btn {
  padding: 3px 9px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.zoom-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}
.zoom-btn.active {
  background: var(--accent-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  overflow: visible !important;
}

/* Icon-Only Header Controls (No Text) */
#userBadgeContainer {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: nowrap !important;
  flex-shrink: 0 !important;
  white-space: nowrap !important;
  position: relative;
  overflow: visible !important;
}

.header-icon-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 1rem;
}
.header-icon-select-wrapper:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: scale(1.06);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
}

.header-icon-select {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
  z-index: 2;
  border-radius: 50%;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  user-select: none;
  padding: 0;
}
.header-icon-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: scale(1.06);
}

.user-avatar-icon-btn {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: var(--shadow-sm);
}
.user-avatar-icon-btn:hover {
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}

.user-dropdown-container {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  overflow: visible !important;
}

/* User Dropdown Menu Popover (Clean Text, No Emoji Symbols) */
.user-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 999999 !important;
  display: none;
  flex-direction: column;
  padding: 6px 0;
  backdrop-filter: blur(16px);
}
.user-dropdown-menu.show {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dropdown-item {
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-main);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  width: 100%;
  font-weight: 500;
  transition: background-color 0.15s ease;
  display: flex;
  align-items: center;
}
.dropdown-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent-primary);
}
.dropdown-item.text-danger {
  color: #f87171;
}
.dropdown-item.text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* Dynamic Resizable Split-Pane Main Layout (Standard 30% / 70% Ratio) */
.app-container {
  display: grid;
  grid-template-columns: 30% 8px calc(70% - 8px);
  flex: 1;
  height: calc(100vh - 56px);
  max-height: calc(100vh - 56px);
  overflow: hidden;
  position: relative;
}

/* Splitter Bar */
.layout-splitter {
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  cursor: col-resize;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  z-index: 50;
}
.layout-splitter:hover, .layout-splitter.is-dragging {
  background: var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}
.splitter-grip {
  width: 3px;
  height: 36px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

/* Sidebar Panel */
.sidebar {
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.active-preset {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.sidebar-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-task-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.sidebar-task-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md);
}
.sidebar-day-header {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-md);
  margin-top: 8px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-day-header.today-highlight-header {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(245, 158, 11, 0.2));
  border-color: var(--accent-warning);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.day-header-cell, .gcal-day-cell, .gantt-timeline-cell {
  cursor: pointer;
  user-select: none;
}

.date-header-drag-selected {
  background: rgba(99, 102, 241, 0.35) !important;
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6) !important;
}

/* Sections Cards */
.section-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
  backdrop-filter: blur(10px);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.section-title {
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-info { color: #38bdf8; }
.badge-important { color: #f59e0b; }
.badge-emergency { color: #ef4444; }

/* Risk Badges */
.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
}
.risk-badge.risk-klein {
  background: rgba(16, 185, 129, 0.25);
  border: 1px solid #10b981;
  color: #34d399;
}
.risk-badge.risk-mittel {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  color: #fbbf24;
}
.risk-badge.risk-gross {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  color: #f87171;
}

/* Item Cards in Sidebar */
.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}
.task-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.task-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}
.task-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  word-break: break-word;
}

/* Form Inputs */
.input-field, .select-field, .textarea-field {
  width: 100%;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
}
.input-field:focus, .select-field:focus, .textarea-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Calendar Main Area */
.calendar-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: var(--bg-primary);
  position: relative;
  user-select: none;
}

.calendar-header-row {
  display: grid;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.view-day .calendar-header-row,
.view-day .calendar-body {
  grid-template-columns: 70px 1fr;
  min-width: 100%;
}

.view-1week .calendar-header-row,
.view-1week .calendar-body {
  grid-template-columns: 55px repeat(7, 1fr);
  min-width: 450px;
}

.view-2weeks .calendar-header-row,
.view-2weeks .calendar-body {
  grid-template-columns: 50px repeat(14, 1fr);
  min-width: 850px;
}

.time-corner {
  padding: 8px 2px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  border-right: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-header-cell {
  padding: 6px 2px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}
.day-header-cell:last-child {
  border-right: none;
}
.day-header-cell.is-today {
  background: rgba(99, 102, 241, 0.12);
  border-bottom: 2px solid var(--accent-primary);
}
.day-header-cell.is-weekend {
  background-color: #d8cebe !important;
}

/* Weekend Shading Rules for Day Columns & Month Cells */
.day-column.is-weekend {
  background-color: #e6dfd3 !important;
}
.gcal-month-header-cell.is-weekend {
  background-color: #d8cebe !important;
}
.gcal-day-cell.is-weekend {
  background-color: #e6dfd3 !important;
}
.gcal-day-cell.is-weekend.other-month {
  background-color: #dbd3c5 !important;
}

.day-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.day-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Daily Goal Input */
.daily-goal-box {
  width: 100%;
  margin-top: 2px;
}
.daily-goal-input {
  width: 100%;
  padding: 2px 4px;
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.daily-goal-input:focus {
  border-style: solid;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* Calendar Grid Body */
.calendar-body {
  flex: 1;
  display: grid;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.time-scale-col {
  border-right: 1px solid var(--border-color);
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.time-slot-label {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.time-slot-label.half-hour {
  color: var(--text-dim);
  font-size: 0.6rem;
  font-weight: 400;
}

.day-column {
  border-right: 1px solid var(--border-color);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.day-column:last-child {
  border-right: none;
}
.day-column.is-today {
  background-color: rgba(99, 102, 241, 0.03);
}

/* Drop Slot & Click-and-Drag Highlight */
.drop-slot {
  flex: 1;
  min-height: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease;
  position: relative;
  cursor: pointer;
  user-select: none;
}
.drop-slot:nth-child(even) {
  border-bottom: 1px solid var(--border-color);
}
.drop-slot:hover {
  background: rgba(99, 102, 241, 0.12) !important;
}
.drop-slot:hover::after {
  content: "+ Neue Tätigkeit";
  position: absolute;
  inset: 1px;
  background: rgba(99, 102, 241, 0.28);
  border: 1.5px dashed var(--accent-primary);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(3px);
  z-index: 5;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

/* Click & Drag Time Selection Highlight */
.drop-slot.slot-drag-selected {
  background: rgba(99, 102, 241, 0.45) !important;
  border-left: 3px solid var(--accent-primary) !important;
  box-shadow: inset 0 0 12px rgba(99, 102, 241, 0.5);
  z-index: 6;
}
.drop-slot.slot-drag-selected::after {
  content: attr(data-drag-label) !important;
  position: absolute;
  inset: 1px;
  background: rgba(99, 102, 241, 0.6);
  border: 1.5px solid #ffffff;
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  backdrop-filter: blur(4px);
  z-index: 7;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.6);
}

.drop-slot.drag-over {
  background: rgba(99, 102, 241, 0.35) !important;
  outline: 2px dashed var(--accent-primary);
  outline-offset: -2px;
}

/* Scheduled Item Card & Interactive Resizing */
.scheduled-item {
  position: absolute;
  border-radius: var(--radius-sm);
  padding: 0;
  font-size: 0.72rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  z-index: 10;
  overflow: visible !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.scheduled-item:hover {
  z-index: 30;
  box-shadow: var(--shadow-md);
}

.resize-handle {
  position: absolute;
  left: 0;
  right: 0;
  height: 8px;
  z-index: 40;
  cursor: ns-resize;
  background: transparent;
  transition: background 0.15s ease, height 0.15s ease;
}

.resize-handle-top {
  top: -3px;
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
}

.resize-handle-bottom {
  bottom: -3px;
  border-bottom-left-radius: 4px;
  border-bottom-right-radius: 4px;
}

.scheduled-item:hover .resize-handle {
  background: rgba(255, 255, 255, 0.35);
}

.resize-handle:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  height: 10px;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.scheduled-item.status-done, .task-card.status-done {
  opacity: 0.65;
  cursor: not-allowed !important;
  border-style: solid;
}
.scheduled-item.status-done .item-line-1 {
  text-decoration: line-through;
}

.item-line-1 {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to right, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  margin-bottom: 2px;
}

.item-line-2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 2px;
}

.item-btn {
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  border-radius: 3px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: background-color 0.15s ease;
}
.item-btn:hover {
  background: rgba(239, 68, 68, 0.9);
}

.item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: auto;
  white-space: nowrap;
  overflow: hidden;
}

/* Google Calendar Style Month View */
.gcal-month-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 12px;
  background: var(--bg-primary);
  overflow: hidden;
  box-sizing: border-box;
}

.gcal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: 32px repeat(5, 1fr);
  gap: 2px;
  background: var(--border-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex: 1;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.gcal-month-header-cell {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gcal-day-cell {
  background: var(--bg-secondary);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  position: relative;
  overflow-y: auto;
}
.gcal-day-cell:hover {
  background: var(--bg-card-hover);
}
.gcal-day-cell.is-today {
  background: rgba(99, 102, 241, 0.08);
}
.gcal-day-cell.other-month {
  opacity: 0.45;
  background: rgba(15, 23, 42, 0.5);
}

.gcal-day-add-badge {
  opacity: 0;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}
.gcal-day-cell:hover .gcal-day-add-badge {
  opacity: 1;
  transform: scale(1.1);
}

.gcal-day-number {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.gcal-day-cell.is-today .gcal-day-number-badge {
  background: var(--accent-primary);
  color: #ffffff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.gcal-event-bar {
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, filter 0.12s ease;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.gcal-event-bar:hover {
  transform: scale(1.02);
  filter: brightness(1.15);
}
.gcal-event-bar.status-done {
  text-decoration: line-through;
  opacity: 0.65;
}

/* Dynamic GANTT Chart View */
.gantt-view-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 12px;
  background: var(--bg-primary);
  overflow: hidden;
  box-sizing: border-box;
}

.gantt-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.gantt-filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gantt-filter-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Dynamic GANTT Chart View - Maximum High Contrast & Crisp Typography */
.gantt-table-wrapper {
  flex: 1;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.gantt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--text-main);
}

.gantt-table th {
  background: #041b2b !important;
  color: #ffffff !important;
  padding: 10px 12px;
  border-bottom: 1px solid #002844;
  border-right: 1px solid #002844;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 20;
  text-align: left;
}

.gantt-table tr:nth-child(even) td {
  background: #f8f5f0;
}

.gantt-table tr:nth-child(odd) td {
  background: #ffffff;
}

.gantt-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  vertical-align: middle;
  color: var(--text-main);
  font-weight: 600;
}

.gantt-row-num {
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  width: 36px;
}

.gantt-task-num {
  font-weight: 800;
  color: #ffffff;
  font-size: 0.78rem;
  background: #041b2b;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

.gantt-inline-input {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.78rem;
  padding: 4px 6px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease;
}
.gantt-inline-input:focus {
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 2px rgba(4, 27, 43, 0.2);
}
.gantt-inline-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* GANTT Dot (Punkt) & Multi-Tier Date Header Styling */
.gantt-day-th {
  text-align: center;
  padding: 4px 2px !important;
  min-width: 32px;
  width: 32px;
  max-width: 36px;
  background: #041b2b !important;
  color: #ffffff !important;
  border-right: 1px solid #002844;
  border-bottom: 1px solid #002844;
  cursor: pointer;
  user-select: none;
}

.gantt-day-th.is-weekend {
  background: #d8cebe !important;
  color: var(--text-main) !important;
}

.gantt-day-th.is-today {
  background: #004d7a !important;
  color: #ffffff !important;
}

.gantt-day-cell {
  text-align: center;
  vertical-align: middle;
  padding: 4px !important;
  min-width: 32px;
  width: 32px;
  max-width: 36px;
  height: 36px;
  position: relative;
  cursor: pointer;
}

.gantt-day-cell.is-weekend {
  background-color: #e6dfd3 !important;
}

.gantt-day-cell:hover {
  background-color: rgba(4, 27, 43, 0.08) !important;
}

.gantt-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.25);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.gantt-dot:hover {
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(4, 27, 43, 0.5);
  z-index: 50;
}

.gantt-dot.status-done {
  opacity: 0.65;
}

/* Milestone Rhombus (Raute ◆) & Phase Bar (Balken ▬) Styling */
.gantt-rhombus {
  width: 14px;
  height: 14px;
  transform: rotate(45deg);
  margin: 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}
.gantt-rhombus:hover {
  transform: rotate(45deg) scale(1.4);
  box-shadow: 0 0 10px rgba(4, 27, 43, 0.6);
  z-index: 50;
}

.gantt-phase-bar {
  height: 22px;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 6px;
  white-space: nowrap;
  overflow: visible;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  position: relative;
  z-index: 10;
  margin-left: -5px;
  margin-right: -5px;
  width: calc(100% + 10px);
  border-top: 1px solid rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  border-radius: 0 !important;
}

.gantt-phase-bar.phase-start {
  border-radius: 0 !important;
  border-left: 1px solid rgba(0,0,0,0.2);
  margin-left: 2px;
  width: calc(100% + 3px);
  padding-left: 8px;
}

.gantt-phase-bar.phase-end {
  border-radius: 0 !important;
  border-right: 1px solid rgba(0,0,0,0.2);
  margin-right: 2px;
  width: calc(100% + 3px);
}

.gantt-phase-bar.phase-middle {
  border-radius: 0 !important;
}

.gantt-phase-bar.phase-single {
  border-radius: 0 !important;
  border: 1px solid rgba(0,0,0,0.2);
  margin-left: 2px;
  margin-right: 2px;
  width: calc(100% - 4px);
}

.gantt-phase-bar:hover {
  transform: scaleY(1.15);
  box-shadow: 0 2px 8px rgba(4, 27, 43, 0.4);
  z-index: 40;
}

.gantt-phase-resize-start,
.gantt-phase-resize-end {
  width: 8px;
  height: 100%;
  position: absolute;
  top: 0;
  z-index: 25;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.3);
  transition: background-color 0.15s ease;
  border-radius: 0 !important;
}

.gantt-phase-resize-start {
  left: 0;
  border-radius: 0 !important;
}

.gantt-phase-resize-end {
  right: 0;
  border-radius: 0 !important;
}

.gantt-phase-resize-start:hover,
.gantt-phase-resize-end:hover {
  background: rgba(255, 255, 255, 0.7);
}

.gantt-phase-label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 100%;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  padding: 0 4px;
}

.gantt-phase-label:active {
  cursor: grabbing;
}

/* Header GANTT Banner Area & Inline Milestones for Week, 2-Week & Month Views */
.header-inline-rhombus {
  display: inline-block;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  margin-left: 6px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.3);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.header-inline-rhombus:hover {
  transform: rotate(45deg) scale(1.4);
}

/* Swiss Flight Style Dual Range Calendar Picker */
.swiss-picker-container {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: 0 4px 14px rgba(4, 27, 43, 0.06);
}

.swiss-picker-header-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #041b2b;
  color: #ffffff;
  border-radius: 8px;
  margin-bottom: 12px;
}

.swiss-picker-badge {
  display: flex;
  flex-direction: column;
}

.swiss-picker-badge-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
}

.swiss-picker-badge-val {
  font-size: 0.92rem;
  font-weight: 700;
}

.swiss-presets-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.swiss-preset-btn {
  font-size: 0.72rem;
  padding: 4px 10px;
  border: 1px solid var(--border-color, #cbd5e1);
  background: var(--card-bg, #ffffff);
  color: var(--text-main, #041b2b);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}

.swiss-preset-btn:hover {
  background: #041b2b;
  color: #ffffff;
  border-color: #041b2b;
}

.swiss-calendars-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .swiss-calendars-wrapper {
    grid-template-columns: 1fr;
  }
}

.swiss-month-card {
  display: flex;
  flex-direction: column;
}

.swiss-month-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main, #041b2b);
  margin-bottom: 8px;
  padding: 0 4px;
}

.swiss-month-nav-btn {
  background: none;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 700;
}

.swiss-month-nav-btn:hover {
  background: #041b2b;
  color: #ffffff;
}

.swiss-grid-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  margin-bottom: 6px;
}

.swiss-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.swiss-day-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.1s ease;
}

.swiss-day-cell:hover {
  background-color: rgba(4, 27, 43, 0.12);
}

.swiss-day-cell.other-month {
  opacity: 0.25;
}

.swiss-day-cell.is-start {
  background: #041b2b !important;
  color: #ffffff !important;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  font-weight: 800;
}

.swiss-day-cell.is-end {
  background: #041b2b !important;
  color: #ffffff !important;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  font-weight: 800;
}

.swiss-day-cell.is-start.is-end {
  border-radius: 6px !important;
}

.swiss-day-cell.is-in-range {
  background: rgba(4, 27, 43, 0.14) !important;
  color: #041b2b !important;
  border-radius: 0 !important;
}

.swiss-day-cell.is-hover-range {
  background: rgba(4, 27, 43, 0.08) !important;
  border-radius: 0 !important;
}

.header-gantt-banner-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-top: 4px;
  padding: 2px 0;
}

.header-gantt-phase-bar {
  height: 18px;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  margin-left: -3px;
  margin-right: -3px;
  width: calc(100% + 6px);
  position: relative;
  z-index: 5;
  border-top: 1px solid rgba(0,0,0,0.15);
  border-bottom: 1px solid rgba(0,0,0,0.15);
  border-radius: 0 !important;
}

.header-gantt-phase-bar.phase-start {
  border-radius: 0 !important;
  border-left: 1px solid rgba(0,0,0,0.2);
  margin-left: 2px;
  width: calc(100% + 1px);
}

.header-gantt-phase-bar.phase-end {
  border-radius: 0 !important;
  border-right: 1px solid rgba(0,0,0,0.2);
  margin-right: 2px;
  width: calc(100% + 1px);
}

.header-gantt-phase-bar.phase-middle {
  border-radius: 0 !important;
}

.header-gantt-phase-bar.phase-single {
  border-radius: 0 !important;
  border: 1px solid rgba(0,0,0,0.2);
  margin-left: 2px;
  margin-right: 2px;
  width: calc(100% - 4px);
}

.header-gantt-phase-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
}

.gantt-add-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: #041b2b;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  opacity: 0.25;
  transition: opacity 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
  margin-left: 6px;
  vertical-align: middle;
}

tr:hover .gantt-add-row-btn {
  opacity: 1;
}

.gantt-add-row-btn:hover {
  transform: scale(1.25);
  background: #004d7a;
}

/* Vertical Drag & Drop Row Reordering */
.gantt-draggable-row {
  cursor: grab;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.gantt-draggable-row:active {
  cursor: grabbing;
}

.gantt-draggable-row.is-dragging-row {
  opacity: 0.45;
  background: rgba(4, 27, 43, 0.15) !important;
}

.gantt-draggable-row.drag-over-row {
  border-top: 3px solid #041b2b !important;
  background: rgba(4, 27, 43, 0.08) !important;
}

.drag-handle-grip {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 4px;
  cursor: grab;
  user-select: none;
  font-weight: 800;
}

.gantt-add-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px dashed var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 800;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  user-select: none;
}
.gantt-timeline-cell:hover .gantt-add-badge {
  background: #ffffff;
  color: #041b2b;
  border-style: solid;
  transform: scale(1.2);
}

.gantt-bar {
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #ffffff !important;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(4, 27, 43, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  padding: 0 8px;
  user-select: none;
  gap: 6px;
  overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.gantt-bar:hover {
  transform: scale(1.02);
  filter: brightness(1.15);
}
.gantt-bar.status-done {
  opacity: 0.65;
  cursor: not-allowed;
}
.gantt-bar-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

/* Admin Modal Tabs Navigation */
.admin-nav-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.admin-nav-tab {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.admin-nav-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}
.admin-nav-tab.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

/* Admin Team, Companies & Projects List View Styling - Fullscreen Max-Width */
.admin-team-modal-lg {
  max-width: 98vw !important;
  width: 96% !important;
  max-height: 92vh;
  overflow-y: auto;
  padding: 22px !important;
  margin: auto;
}

.admin-section-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

/* 16 Standard Color Palette Swatches for Companies */
.color-swatch-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.color-swatch-chips-grid {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.color-swatch-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.color-swatch-chip:hover {
  transform: scale(1.25);
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.color-swatch-chip.is-selected {
  border-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--accent-primary), 0 0 8px rgba(0,0,0,0.6);
}

.custom-color-area-box {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* Dual Attachment Upload & Documentation Sections */
.attachments-main-wrapper {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

.attachment-section-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.attachment-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
}

.attachment-upload-box {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  margin-bottom: 10px;
}
.attachment-upload-box.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
}

.attachment-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-item-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  transition: border-color 0.15s ease;
}
.attachment-item-card:hover {
  border-color: var(--accent-primary);
}

.attachment-thumbnail-box {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.attachment-thumbnail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.attachment-icon-badge {
  font-size: 1.4rem;
}

.attachment-info-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.attachment-original-name {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.attachment-meta-info {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.attachment-actions-box {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Fullscreen Document & Image Annotation Suite */
.fullscreen-annotation-overlay {
  z-index: 20000 !important;
  background: rgba(15, 23, 42, 0.96) !important;
  backdrop-filter: blur(12px);
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
}

.annotation-app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
}

.annotation-toolbar {
  height: 56px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.annotation-file-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  min-width: 0;
}
.annotation-file-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: normal;
}

.annotation-tools-group {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.annotation-tool-btn {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  cursor: pointer;
}
.annotation-tool-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(99,102,241,0.4);
}

.annotation-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.annotation-color-palette {
  display: flex;
  align-items: center;
  gap: 6px;
}

.annotation-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.annotation-color-dot:hover {
  transform: scale(1.2);
}
.annotation-color-dot.is-active {
  border-color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--accent-primary), 0 0 8px rgba(0,0,0,0.6);
}

.annotation-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fullscreen-close-btn {
  font-size: 1.2rem;
  padding: 4px 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
}

.annotation-workspace {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #090d16;
  position: relative;
}

.annotation-canvas-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

#annotationCanvas {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  cursor: crosshair;
  background: #ffffff;
  display: block;
}

/* Drag & Drop Person Assignment Board for Projects */
.project-assignment-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.assignment-column {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 12px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.assignment-column.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.3);
}

.assignment-column-header {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-main);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.assignment-cards-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 380px;
  padding: 4px;
}

.drag-person-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: grab;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.drag-person-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.drag-person-card:active {
  cursor: grabbing;
}
.drag-person-card.is-assigned {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
  border-color: rgba(99, 102, 241, 0.4);
}

.drag-person-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.drag-person-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.drag-person-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
}
.drag-person-company {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.admin-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  margin-bottom: 10px;
}

.admin-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.admin-list-table th {
  background: rgba(0, 0, 0, 0.4);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  color: var(--text-muted);
  text-align: left;
}

.admin-list-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.table-inline-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 4px 8px;
  outline: none;
  font-family: inherit;
  transition: all 0.15s ease;
}
.table-inline-input:hover {
  border-color: var(--border-color);
}
.table-inline-input:focus {
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.45);
}

.color-picker-dot {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  vertical-align: middle;
}

.count-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.add-inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}

/* Compact Activity Edit / Create Modal Styles */
.compact-edit-modal {
  max-width: 580px !important;
  width: 92% !important;
  padding: 18px !important;
}

.input-field-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-main);
  padding: 4px 6px;
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
}
.input-field-title:focus {
  border-bottom-color: var(--accent-primary);
}

.compact-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input-group-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 10px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.input-group-icon:focus-within {
  border-color: var(--accent-primary);
  background: rgba(0, 0, 0, 0.35);
}
.input-group-icon .icon-label {
  font-size: 1.1rem;
  user-select: none;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.input-group-icon .input-field,
.input-group-icon .select-field,
.input-group-icon .textarea-field {
  border: none !important;
  background: transparent !important;
  padding: 4px 0 !important;
  box-shadow: none !important;
}

.checklist-input-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.substep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.substep-row.done {
  opacity: 0.6;
  text-decoration: line-through;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 88vh !important;
  overflow-y: auto !important;
  padding: 24px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  margin: auto;
}

.compact-edit-modal {
  max-width: 760px !important;
  width: 95% !important;
  max-height: 88vh !important;
  overflow-y: auto !important;
  padding: 22px !important;
}
.modal-overlay.active .modal-card {
  transform: translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}
.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.close-btn:hover {
  color: var(--text-main);
}

@media (max-width: 900px) {
  .compact-form-grid, .modal-grid-2col {
    grid-template-columns: 1fr;
  }
}

/* Mobile Sidebar Toggle & Off-Canvas Drawer */
.mobile-sidebar-toggle {
  display: none;
  font-size: 0.8rem;
  padding: 6px 10px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Touch & Cross-Browser Mobile Optimizations */
* {
  -webkit-tap-highlight-color: transparent;
}

.calendar-body, .calendar-view, .gantt-table-wrapper, .sidebar-content {
  -webkit-overflow-scrolling: touch;
}

/* Tablets (max-width: 1024px) */
@media (max-width: 1024px) {
  .app-header {
    padding: 8px 12px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .brand-title {
    font-size: 1rem;
  }
  .zoom-controls {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }
  .week-nav {
    order: 2;
  }
  .header-actions {
    order: 1;
    margin-left: auto;
  }
}

/* Smartphones & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
  }
  .sidebar-backdrop {
    display: block;
  }

  .app-container {
    display: flex !important;
    flex-direction: column !important;
    position: relative;
  }

  .layout-splitter {
    display: none !important;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 85%;
    max-width: 380px;
    z-index: 999;
    background: var(--bg-secondary);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .calendar-view {
    width: 100% !important;
    flex: 1;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .compact-form-grid, .modal-grid-2col {
    grid-template-columns: 1fr !important;
  }

  .modal-card {
    width: 95% !important;
    max-height: 92vh !important;
    overflow-y: auto;
    padding: 16px !important;
    margin: auto;
  }

  .gantt-filter-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
  }
  .gantt-filter-group {
    width: 100%;
  }

  .day-header-cell {
    min-width: 75px;
  }
  .day-column {
    min-width: 75px;
  }
  
  .scheduled-item {
    font-size: 0.65rem;
    padding: 2px 4px;
  }

  .user-badge-name {
    display: none;
  }
}

/* Tagesansicht (Day View) & Direkt-Bearbeitung Styling */
.day-view-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  overflow-y: auto;
  gap: 16px;
  background: var(--bg-primary);
}

.day-view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.day-view-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.day-edit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.day-edit-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-lg);
}

.day-edit-card.status-done {
  opacity: 0.78;
  background: rgba(16, 185, 129, 0.04);
}

.day-card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-task-title {
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  background: rgba(0,0,0,0.15) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  color: var(--text-main) !important;
  flex: 1;
}

.inline-task-title:focus {
  border-color: var(--accent-primary) !important;
  background: rgba(99, 102, 241, 0.1) !important;
  outline: none;
}

/* Schwarz/Weiss Copy Button für Aufgaben */
.task-copy-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
  flex-shrink: 0;
  margin-left: 4px;
}

.task-copy-btn:hover {
  background: #041b2b;
  border-color: #38bdf8;
  color: #38bdf8;
  transform: scale(1.12);
}
