* {
  box-sizing: border-box;
}
:root {
  --bg: #ffffff;
  --card: #f8f9fa;
  --ink: #2d3748;
  --ink-2: #718096;
  --brand: #65b32e;
  --ok: #19c37d;
  --warn: #ffb020;
  --new: #8b5cf6;
  --locked: #a0aec0;

  /* Additional utility colors for consistency */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --input-bg: #ffffff;
  --switch-bg: #edf2f7;
  --text-muted: #718096;
  --grid-gap: 16px;
  --radius: 12px;

  /* Consistent shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 4px 18px rgba(0, 0, 0, 0.25);
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: var(--bg);
  color: var(--ink);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}
/* iOS-style switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--switch-bg);
  border: 1px solid var(--border);
  transition: 0.2s;
  border-radius: 999px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: #ffffff;
  border-radius: 50%;
  transition: 0.2s;
}
input:checked + .slider {
  background-color: var(--brand);
  border-color: var(--brand);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
h1 {
  margin: 0;
  font-size: 20px;
}
.muted {
  color: var(--ink-2);
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.actions button {
  margin-left: 8px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.actions button:hover {
  border-color: var(--border);
  background: #f1f5f9;
}

/* Header app action buttons (calendar & notifications) */
#app-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-btn {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-light);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s ease;
  margin-left: 0 !important; /* Override general button margin */
}

.header-btn:hover {
  background: #f1f5f9;
  border-color: var(--border);
  transform: translateY(-1px);
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  border: 2px solid var(--bg);
}

#progress-wrap {
  padding: 16px 20px;
}
#progress-label {
  margin-bottom: 6px;
  font-size: 14px;
}
#progress-bar {
  width: 100%;
  height: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
#progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--ok));
  transition: width 0.4s ease;
}
#badges {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
}

main {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  padding: 0 20px 20px;
}
#legend {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
#sidebar-actions button,
#sidebar-actions select {
  margin: 2px 0;
}
details#filters-panel {
  margin-bottom: 12px;
}
details#filters-panel > summary::-webkit-details-marker {
  display: none;
}
details#filters-panel > summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  transform: rotate(90deg);
  transition: transform 0.15s ease;
}
details#filters-panel[open] > summary::before {
  transform: rotate(90deg);
}
#legend ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}
#legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.available {
  background: var(--brand);
}
.dot.locked {
  background: var(--locked);
}
.dot.done {
  background: var(--ok);
}
.dot.new {
  background: var(--new);
}

#flow {
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 20px; /* consistent spacing */
  overflow: auto;
  padding-bottom: 10px;
}
.phase {
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 20px; /* spacing between tasks */
}
.phase h2 {
  font-size: 14px;
  margin: 0 0 8px 0;
  color: var(--ink-2);
  letter-spacing: 0.3px;
}
.col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.card {
  background: var(--card);
  border: 1px solid #222837;
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  width: 350px; /* fixed task width */
}

/* Reminder card variant */
.card.reminder {
  border: 1px solid #ffffff;
}

/* Reminders section heading spacing */
.reminders-wrap h3 {
  margin: 0 0 4px;
}

/* Abgaben drawer (documents overview) */
#abgaben-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(780px, 100%);
  background: var(--card);
  border-left: 1px solid var(--border-light);
  z-index: 1400;
  box-shadow: var(--shadow-lg);
  padding: 20px;
  overflow-y: auto;
  display: none;
}
#abgaben-drawer[aria-hidden="false"] {
  display: block;
}
#abgaben-drawer h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
#abgaben-content table.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#abgaben-content table.simple-table th,
#abgaben-content table.simple-table td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}
#abgaben-content table.simple-table th {
  background: var(--input-bg);
  position: sticky;
  top: 0;
  z-index: 1;
  font-weight: 600;
  color: var(--ink);
}
/* Row state coloring */
#abgaben-drawer tr.due-soon td {
  background: rgba(255, 176, 32, 0.1);
  border-color: var(--warn);
}
#abgaben-drawer tr.due-critical td {
  background: rgba(255, 176, 32, 0.2);
  border-color: var(--warn);
}
#abgaben-drawer tr.done td {
  opacity: 0.6;
  background: rgba(25, 195, 125, 0.1);
}

/* Close button for Abgaben drawer */
#abgaben-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
#abgaben-close:hover {
  background: var(--border);
  color: var(--ink);
}

/* Style task links in Abgabe tables as buttons */
#abgaben-content table.simple-table a {
  display: inline-block;
  padding: 4px 8px;
  background: var(--brand);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  transition: all 0.2s ease;
}

#abgaben-content table.simple-table a:hover {
  background: color-mix(in srgb, var(--brand) 80%, white);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#abgaben-content table.simple-table a:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.card:hover {
  transform: translateY(-1px);
  border-color: #2e3651;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
}
.card .title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-2);
}
.card .tags {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
/* Selected card (clicked): green border + light grey shadow */
.card.selected-highlight {
  border-color: var(--ok) !important;
  box-shadow: 0 4px 25px rgba(77, 165, 26, 0.8) !important;
}
.tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
}
.card.locked {
  opacity: 0.6;
}
.card.available {
  border-color: #2e3a66;
}
.card.done {
  border-color: #1a5c41;
  background: linear-gradient(180deg, #162026, #151a22);
}
/* New tasks: handled via emoji overlay; no special border */

/* Alarm clock overlay for due-date urgent tasks */
.card .corner-icons {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}
.card .alarm-icon {
  font-size: 24px; /* doubled */
  line-height: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2a3146;
  border-radius: 50%;
  padding: 8px; /* increased to match size */
  pointer-events: none; /* don't interfere with clicks/drag */
}

/* New task overlay (bottom-left) */
.card .new-icon {
  font-size: 24px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2a3146;
  border-radius: 50%;
  padding: 8px;
  pointer-events: none; /* don't interfere with clicks/drag */
}

/* Todo notification overlay */
.card .todo-icon {
  font-size: 24px;
  line-height: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid #2a3146;
  border-radius: 50%;
  padding: 8px;
  pointer-events: none; /* don't interfere with clicks/drag */
}

.status {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 11px;
  padding: 3px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink);
  background: #ffffff;
}
/* Urgent tasks: indicated by alarm icon only; no red border */

/* Dependency highlight while drawer open */
.card.dep-highlight {
  /*outline: 2px solid var(--ok);
  outline-offset: 0;*/
  /* Light green fill overlay without changing layout or original background */
  box-shadow: 0 8px 25px rgba(238, 13, 13, 0.8);
}
.status.locked {
  background: #f7fafc;
  border-color: var(--locked);
  color: var(--locked);
}
.status.available {
  background: #f0fff4;
  border-color: var(--brand);
  color: var(--brand);
}
.status.done {
  background: #f0fdfa;
  border-color: var(--ok);
  color: var(--ok);
}
.status.new {
  background: #faf5ff;
  border-color: var(--new);
  color: var(--new);
}

/* Generic drawer styles for calendar and notifications */
.drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40; /* above sticky header */
}
.drawer[aria-hidden="false"] {
  display: block;
}
.drawer .drawer-content {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(600px, 100%);
  background: var(--card);
  border-left: 1px solid var(--border);
  padding: 18px;
  overflow: auto;
}

.drawer .drawer-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink-2);
  color: var(--bg);
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer .drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.drawer .drawer-header h2 {
  margin: 0;
  font-size: 18px;
}
.drawer .drawer-body {
  margin-bottom: 20px;
}

#drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40; /* above sticky header */
}
#drawer[aria-hidden="false"] {
  display: block;
}
#drawer-content {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(780px, 100%);
  background: var(--card);
  border-left: 1px solid #222837;
  padding: 18px;
  overflow: auto;
}
#drawer-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
#drawer h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid #2a3146;
  padding-bottom: 12px;
}

/* Consistent drawer form styling */
#drawer .form-group {
  margin-bottom: 16px;
}

#drawer .form-group:last-child {
  margin-bottom: 0;
}

/* Unified button spacing in drawers */
#drawer .button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #2a3146;
}

/* =====================
   UNIFIED STYLING IMPROVEMENTS
   - Form elements: consistent styling and focus states
   - Panels/Drawers: unified background and spacing
   - Typography: consistent font sizes and line heights
   - Borders: consistent border colors throughout
   ===================== */

/* Enhanced form element styling with focus states */
textarea,
input[type="text"],
input[type="url"],
input[type="date"],
input[type="email"],
input[type="password"],
input[type="search"],
input[list],
input:not([type]),
select {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Unified focus states for all form elements */
textarea:focus,
input[type="text"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[list]:focus,
input:not([type]):focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 162, 255, 0.1);
}

/* Consistent label styling */
label {
  display: block;
  margin: 12px 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

/* Unified Panel and Section Styling */
.panel,
.task-section,
.minutes-section,
.project-section,
.reminder-section,
.form-section {
  background: var(--card);
  border-radius: 12px;
  border: 1px solid #2a3146;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Unified section headers */
.section-header,
.panel h2,
.panel h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid #2a3146;
  padding-bottom: 8px;
}

/* Unified Typography and Spacing */
.text-small {
  font-size: 12px;
  line-height: 1.4;
}

.text-tiny {
  font-size: 10px;
  line-height: 1.3;
}

.text-meta {
  font-size: 11px;
  color: #a0a9b8;
  line-height: 1.3;
}

/* Consistent spacing utilities */
.spacing-sm {
  margin-bottom: 8px;
}
.spacing-md {
  margin-bottom: 16px;
}
.spacing-lg {
  margin-bottom: 24px;
}

/* Form row spacing */
.form-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.form-row > * {
  flex: 1;
}

/* Button size utilities for consistency */
.btn-sm {
  padding: 6px 10px !important;
  font-size: 13px;
}

.btn-md {
  padding: 8px 12px !important;
  font-size: 14px;
}

.btn-lg {
  padding: 12px 16px !important;
  font-size: 14px;
}

/* Consistent border radius for all interactive elements */
.rounded-sm {
  border-radius: 4px;
}
.rounded-md {
  border-radius: 8px;
}
.rounded-lg {
  border-radius: 12px;
}

.docs {
  margin-top: 10px;
}
.docs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#doc-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.doc-item {
  display: flex;
  gap: 8px;
  align-items: center;
}
.doc-item input {
  flex: 1;
}
.doc-item button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.res-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.res-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}
.res-item input {
  flex: 1;
}
.res-item > div {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.res-item button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}
.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}
.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-actions select {
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
}
.drawer-actions button {
  background: var(--brand);
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}
footer {
  padding: 10px 20px;
  border-top: 1px solid #222837;
  color: var(--ink-2);
}

/* Project Management Drawer */
#proj-drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}
#proj-drawer[aria-hidden="false"] {
  display: block;
}
#proj-content {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(780px, 100%);
  background: var(--card);
  border-left: 1px solid #222837;
  padding: 18px;
  overflow: auto;
}
#proj-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.proj-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.danger {
  background: #7a1a1a !important;
  border: 1px solid #a32525 !important;
  color: #fff !important;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  z-index: 50;
}

.deps-wrap {
  margin: 10px 0 6px 0;
  border-top: 1px dashed #2a3146;
  padding-top: 10px;
}
.deps-list {
  list-style: none;
  padding: 0;
  margin: 6px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dep-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
}
.dep-status {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.dep-status.ok {
  background: var(--card);
}
.dep-status.missing {
  background: var(--card);
}
.dep-title {
  flex: 1;
  font-size: 13px;
}
.dep-actions button {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
}
.chips {
  display: flex;
  gap: 5px; /* consistent spacing */
  flex-wrap: wrap;
  margin-top: 6px;
}
.chip {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--ink);
}

/* Minutes Drawer */
#minutes-drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}
#minutes-drawer[aria-hidden="false"] {
  display: block;
}
#minutes-content {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(960px, 100%);
  background: var(--card);
  border-left: 1px solid #222837;
  padding: 18px;
  overflow: auto;
}
#minutes-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
#minutes-content h2 {
  margin: 8px 0 8px;
}
#minutes-text {
  width: 100%;
  min-height: 50vh;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #2a3146;
  background: #0f121a;
  color: var(--ink);
}

/* My Tasks Drawer */
#mytasks-drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}
#mytasks-drawer[aria-hidden="false"] {
  display: block;
}
#mytasks-content {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  /* Shrink to content up to viewport limit */
  width: fit-content;
  max-width: 95vw;
  background: var(--card);
  border-left: 1px solid #222837;
  padding: 18px;
  overflow: auto;
}
#mytasks-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #2a3146;
  background: #0f121a;
  color: var(--ink);
  cursor: pointer;
}

/* LP filtering + layout */
.lp-filter-box label {
  display: block;
  font-size: 13px;
  margin: 4px 0;
}
.lp-section {
  margin-bottom: 28px;
}
.lp-section h2 {
  font-size: 16px;
  margin: 0 0 8px 4px;
  color: var(--ink);
}
.lp-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 1fr);
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 8px;
}

/* Update: LP sections stacked vertically, Gewerke inside each LP as horizontal row */
.lp-section {
  margin-bottom: 40px;
}
.lp-row {
  display: flex;
  flex-direction: row;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 8px;
}

/* New stacked LP layout: each LP block full width */
.lp-block {
  width: 100%;
}
.lp-sections {
  width: 100%;
  overflow-x: auto;
  padding-bottom: 6px;
}
.lp-sections::-webkit-scrollbar {
  height: 10px;
}
.lp-sections::-webkit-scrollbar-track {
  background: var(--bg);
}
.lp-sections::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
}
.gewerk-col {
  flex: 0 0 360px;
}

/* Ensure cards inside fixed-width columns maintain width */
.gewerk-col .card {
  width: 350px;
}

/* Fix kanban-cards background to match dark theme */
.kanban-cards {
  background: var(--bg) !important;
  padding: 8px !important;
  border-radius: 8px !important;
  border: 1px dashed var(--border) !important;
  min-height: 120px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  min-width: 380px !important;
}

/* Fix H3 styling in Kanban view */
.lp-section h3,
.gewerk-col h3,
.kanban-section h3 {
  color: var(--ink) !important;
  background: var(--card) !important;
  margin: 0 0 8px 0 !important;
  padding: 8px 12px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

/* Fix export-controls background */
.export-controls {
  background: var(--card) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  padding: 12px !important;
  margin-bottom: 15px !important;
}

.export-controls label {
  color: var(--ink) !important;
}

/* Override any inline styles for export controls selects and inputs */
.export-controls select,
.export-controls input {
  background: var(--input-bg) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  border-radius: 4px !important;
  padding: 6px 8px !important;
}

.export-controls button {
  background: var(--brand) !important;
  color: white !important;
  border: none !important;
  padding: 6px 12px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
}

.export-controls button:hover {
  background: color-mix(in srgb, var(--brand) 80%, white) !important;
}

/* =====================
   UI Unification (Cosmetics)
   - Buttons: make all look like the save button
   - Select dropdowns: match input#task-section styling
   ===================== */

/* Primary button look (exclude round close buttons) */
button:not(#drawer-close):not(#proj-close):not(#minutes-close) {
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.2s ease;
}
button:not(#drawer-close):not(#proj-close):not(#minutes-close):hover {
  filter: brightness(1.05);
  box-shadow: 0 2px 12px rgba(106, 162, 255, 0.25);
}
button:not(#drawer-close):not(#proj-close):not(#minutes-close):active {
  transform: translateY(1px);
}

/* Ensure previously special-cased buttons inherit the unified look */
.actions button,
#sidebar-actions button,
.docs-head button,
.doc-item button,
.res-item button,
.dep-actions button,
.drawer-actions button {
  background: var(--brand);
  border: 1px solid transparent;
  color: #fff;
}

/* Destructive buttons stay red */
.danger {
  background: #7a1a1a !important;
  border: 1px solid #a32525 !important;
  color: #fff !important;
}

/* Dropdowns: match the input look (like #task-section) */
select {
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
}
/* Keep drawer select padding consistent */
.drawer-actions select {
  padding: 10px;
}

/* Required Documents table */
table.reqdoc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
table.reqdoc-table th,
table.reqdoc-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #2a3146;
}
table.reqdoc-table thead th {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

/* --- Reminder Creation Overlay Drawer --- */
#reminder-create-drawer[aria-hidden="true"] {
  display: none;
}
#reminder-create-drawer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  z-index: 4000;
}
#reminder-create-drawer .overlay-inner {
  background: var(--card);
  border: 1px solid #2a3146;
  padding: 20px;
  width: 420px;
  max-width: 94vw;
  border-radius: 12px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
#reminder-create-drawer textarea {
  background: #0f121a;
  color: var(--ink);
  border: 1px solid #2a3146;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#reminder-create-drawer textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 162, 255, 0.1);
}
#reminder-create-drawer select,
#reminder-create-drawer input[type="date"] {
  background: var(--input-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#reminder-create-drawer select:focus,
#reminder-create-drawer input[type="date"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 162, 255, 0.1);
}

/* ============ Notification Settings Modal ============ */

.notification-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  color: var(--ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--ink);
  background: var(--border-light);
}

.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.notification-list {
  margin: 20px 0;
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.notification-info h4 {
  margin: 0 0 4px 0;
  color: var(--ink);
  font-size: 16px;
}

.notification-info p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
}

.notification-toggle {
  flex-shrink: 0;
}

/* iOS-style Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--switch-bg);
  transition: 0.3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: var(--ink-2);
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--brand);
}

input:checked + .slider:before {
  transform: translateX(22px);
  background-color: white;
}

input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Admin Settings */
.admin-section {
  margin: 30px 0;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-section h3 {
  margin: 0 0 20px 0;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}

.smtp-config {
  display: grid;
  gap: 16px;
}

.smtp-config .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.smtp-config label {
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

.smtp-config .required {
  color: var(--warn);
  font-weight: bold;
}

.smtp-config .optional {
  color: var(--ink-2);
  font-weight: normal;
  font-style: italic;
  font-size: 12px;
}

.smtp-config .help-text {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-style: italic;
}

.smtp-config input[type="text"],
.smtp-config input[type="email"],
.smtp-config input[type="password"],
.smtp-config input[type="number"] {
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
}

.smtp-config input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(101, 179, 46, 0.1);
}

.smtp-config input[type="checkbox"] {
  margin-right: 8px;
}

/* Email Testing Styles */
.email-testing {
  display: grid;
  gap: 16px;
}

.email-testing .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.email-testing label {
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

.email-testing input[type="email"],
.email-testing select {
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
}

.email-testing input:focus,
.email-testing select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(101, 179, 46, 0.1);
}

.email-testing select option {
  background: var(--card);
  color: var(--ink);
}

.template-list {
  margin-top: 20px;
}

.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.template-info h4 {
  margin: 0 0 4px 0;
  color: var(--ink);
  font-size: 16px;
}

.template-info p {
  margin: 0 0 4px 0;
  color: var(--ink-2);
  font-size: 14px;
}

.template-status {
  font-size: 12px !important;
}

.template-status .configured {
  color: var(--ok);
}

.template-status .not-configured {
  color: var(--warn);
}

.template-actions {
  flex-shrink: 0;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .notification-item,
  .template-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .notification-toggle,
  .template-actions {
    align-self: flex-end;
  }

  .smtp-config {
    grid-template-columns: 1fr;
  }
}

/* ============ Notification Drawer (Right Side) ============ */

#notifications-drawer {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40; /* above sticky header */
}

#notifications-drawer[aria-hidden="false"] {
  display: block;
}

#notifications-content {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: min(700px, 100%);
  background: var(--card);
  border-left: 1px solid #222837;
  padding: 18px;
  overflow: auto;
}

#notifications-close {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #2a3146;
  background: #0f121a;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#notifications-close:hover {
  background: var(--border);
}

#notifications-drawer h2 {
  margin: 0 0 20px 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid #2a3146;
  padding-bottom: 12px;
}

/* Template Editor Modal Styles */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.template-editor-content {
  width: 90vw;
  max-width: 1000px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--border);
  transform: scale(1.05);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  justify-content: flex-end;
}

/* Template Info */
.template-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.readonly-input {
  background: var(--locked) !important;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Editor Tabs */
.editor-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.editor-tab-btn {
  padding: 12px 16px;
  background: transparent;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
}

.editor-tab-btn:hover {
  background: var(--input-bg);
  color: var(--ink);
}

.editor-tab-btn.active {
  background: var(--brand);
  color: white;
}

.editor-tab-content {
  display: none;
}

.editor-tab-content.active {
  display: block;
}

/* Editor Toolbar */
.editor-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  background: var(--input-bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.editor-toolbar button {
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
}

.editor-toolbar button:hover {
  background: var(--brand);
  color: white;
}

/* Form Elements in Editor */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(101, 179, 46, 0.1);
}

.help-text {
  display: block;
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 12px;
  font-style: italic;
}

/* Variables Reference */
.variables-reference {
  background: var(--input-bg);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border);
}

.variables-reference h4 {
  margin: 0 0 12px 0;
  color: var(--brand);
  font-size: 16px;
}

.variables-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.variable-item {
  padding: 8px 12px;
  background: var(--card);
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.variable-item:hover {
  background: var(--brand);
  color: white;
  transform: translateY(-1px);
}

.variable-name {
  font-family: "Courier New", monospace;
  font-weight: bold;
  color: var(--brand);
}

.variable-item:hover .variable-name {
  color: white;
}

.variable-description {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
}

.variable-item:hover .variable-description {
  color: rgba(255, 255, 255, 0.8);
}

.sample-data {
  margin-top: 20px;
}

.sample-data pre {
  background: var(--card);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 12px;
  overflow-x: auto;
  max-height: 200px;
  overflow-y: auto;
}

/* Preview Styles */
.preview-container {
  background: var(--input-bg);
  border-radius: 8px;
  padding: 20px;
  border: 1px solid var(--border);
}

.preview-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.preview-subject,
.preview-html {
  margin-bottom: 20px;
}

.preview-subject h4,
.preview-html h4 {
  margin: 0 0 8px 0;
  color: var(--brand);
  font-size: 14px;
}

.preview-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  min-height: 40px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .template-editor-content {
    width: 95vw;
    max-height: 95vh;
  }

  .template-info {
    grid-template-columns: 1fr;
  }

  .editor-tabs {
    flex-wrap: wrap;
  }

  .editor-toolbar {
    justify-content: center;
  }

  .variables-list {
    grid-template-columns: 1fr;
  }

  .modal-footer {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* === Calendar Drawer Styles === */

#calendar-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 500px;
  height: 100%;
  background: var(--card);
  border-left: 1px solid var(--border);
  transition: right 0.3s ease;
  z-index: 1000;
  overflow-y: auto;
}

#calendar-drawer[aria-hidden="false"] {
  right: 0;
}

#calendar-content {
  padding: 20px;
  position: relative;
  height: 100%;
}

#calendar-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  color: var(--ink-2);
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
}

#calendar-close:hover {
  color: var(--ink);
}

#calendar-drawer h2 {
  margin: 0 0 24px 0;
  color: var(--brand);
  font-size: 20px;
  padding-right: 40px;
}

.calendar-section {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-light);
}

.calendar-section:last-child {
  border-bottom: none;
}

.calendar-section h3 {
  color: var(--ink);
  font-size: 16px;
  margin: 0 0 12px 0;
}

.calendar-section h4 {
  color: var(--ink-2);
  font-size: 14px;
  margin: 16px 0 8px 0;
}

.calendar-url-section {
  margin: 16px 0;
}

.calendar-url-section label {
  display: block;
  color: var(--ink-2);
  font-size: 14px;
  margin-bottom: 8px;
}

.url-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

#calendar-url {
  flex: 1;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 11px;
  word-break: break-all;
}

.btn-copy {
  padding: 10px 12px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: var(--brand);
  color: white;
}

.calendar-instructions {
  margin-top: 20px;
}

.instruction-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.instruction-tab {
  padding: 8px 16px;
  background: var(--border);
  border: none;
  border-radius: 6px 6px 0 0;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.instruction-tab.active {
  background: var(--brand);
  color: white;
}

.instruction-tab:hover:not(.active) {
  background: var(--border-light);
  color: var(--ink);
}

.instruction-content {
  display: none;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 0 6px 6px 6px;
  padding: 16px;
}

.instruction-content.active {
  display: block;
}

.instruction-content ol {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-2);
}

.instruction-content li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.instruction-content strong {
  color: var(--ink);
}

.calendar-events {
  max-height: 300px;
  overflow-y: auto;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
}

.calendar-event-date {
  background: var(--brand);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
  text-align: center;
}

.calendar-event-info {
  flex: 1;
}

.calendar-event-title {
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
}

.calendar-event-details {
  color: var(--ink-2);
  font-size: 12px;
}

.calendar-event-type {
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.calendar-event-type.task {
  background: var(--brand);
  color: white;
}

.calendar-event-type.document {
  background: var(--warn);
  color: var(--bg);
}

.calendar-event-type.reminder {
  background: var(--new);
  color: white;
}

/* Responsive calendar drawer */
@media (max-width: 768px) {
  #calendar-drawer {
    width: 100%;
    right: -100%;
  }

  .url-input-group {
    flex-direction: column;
  }

  #calendar-url {
    width: 100%;
  }

  .instruction-tabs {
    flex-wrap: wrap;
  }
}

/* Additional Calendar Drawer Styles */
.calendar-controls {
  margin: 16px 0;
}

.calendar-controls .btn {
  margin-right: 8px;
}

.calendar-url-section {
  margin: 20px 0;
}

.url-input-group {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.url-input-group input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
}

.instruction-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.instruction-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.instruction-tab.active {
  background: var(--bg);
  border-bottom-color: var(--bg);
}

.instruction-content {
  display: none;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 4px;
  background: var(--bg);
}

.instruction-content.active {
  display: block;
}

/* Notification Drawer Styles */
.notification-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.tab-btn.active {
  background: var(--bg);
  border-bottom-color: var(--bg);
}

.tab-content {
  display: none;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 0 4px 4px 4px;
  background: var(--bg);
}

.tab-content.active {
  display: block;
}

.notification-preferences {
  margin: 16px 0;
}

.empty-state {
  text-align: center;
  color: var(--ink-2);
  padding: 40px 20px;
  font-style: italic;
}

/* Calendar Events Preview */
.calendar-events {
  max-height: 300px;
  overflow-y: auto;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.event-date {
  font-size: 12px;
  color: var(--ink-2);
  min-width: 80px;
  font-family: monospace;
}

.event-title {
  flex: 1;
  font-size: 14px;
}

/* Notification Settings */
.notification-setting {
  margin: 12px 0;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.notification-setting:last-child {
  border-bottom: none;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.setting-label input[type="checkbox"] {
  margin: 0;
}

.setting-label span {
  flex: 1;
}

/* Email Template Items */
.template-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  margin: 12px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  gap: 16px;
}

.template-info {
  flex: 1;
}

.template-info h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--ink);
}

.template-info p {
  margin: 0 0 4px 0;
  font-size: 14px;
}

.template-info small {
  font-size: 12px;
  color: var(--ink-2);
  font-style: italic;
}

.template-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.template-actions .btn {
  padding: 6px 12px;
  font-size: 12px;
}

/* Notification Items for the new module */
.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-info h4 {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: var(--ink);
}

.notification-info p {
  margin: 0;
  font-size: 12px;
  color: var(--ink-2);
}

.notification-toggle {
  flex-shrink: 0;
}

/* Template status indicators */
.template-status {
  font-size: 12px;
  margin-top: 4px;
}

.template-status .configured {
  color: var(--ok);
  font-weight: 500;
}

.template-status .not-configured {
  color: var(--warn);
  font-weight: 500;
}

/* Calendar URL Section */
.calendar-url-section {
  margin: 20px 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.calendar-url-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

/* Calendar Preview Section */
.calendar-preview {
  margin: 20px 0;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.calendar-preview h4 {
  margin: 0 0 12px 0;
  font-size: 16px;
}
