@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@700&display=swap");

/* CSS Variables for easy theming */
:root {
  --primary-color: #1152d4;
  --primary-hover: #0b3a9e;
  --secondary-color: #047857;
  --secondary-hover: #035e44;
  --brand-gradient: linear-gradient(135deg, #1152d4, #047857);
  --weekend-bg: #e8e8e8;
  --selection-bg: #b3d4fc;
  --selection-start: #1152d4;
  --selection-end: #047857;
  --today-bg: #ffeb3b;
  --today-border: #ffc107;
  --border-color: #ddd;
  --text-color: #0d121b;
  --header-bg: #ffffff;
  --bg-color: #f6f6f8;
  --card-bg: #ffffff;
  --month-header-bg: #1152d4;
  --month-header-text: white;
  --empty-bg: #fafafa;
  --hover-bg: #e3f2fd;
  --tab-bg: #f0f0f0;
  --panel-width: 320px;
  /* Range colors for multiple ranges */
  --range-1-start: #4caf50;
  --range-1-end: #f44336;
  --range-1-bg: #b3d4fc;
  --range-2-start: #2196f3;
  --range-2-end: #ff9800;
  --range-2-bg: #bbdefb;
  --range-3-start: #9c27b0;
  --range-3-end: #ff5722;
  --range-3-bg: #e1bee7;
  --range-4-start: #009688;
  --range-4-end: #e91e63;
  --range-4-bg: #b2dfdb;
  --range-5-start: #673ab7;
  --range-5-end: #ffc107;
  --range-5-bg: #d1c4e9;
  --range-6-start: #00bcd4;
  --range-6-end: #795548;
  --range-6-bg: #b2ebf2;
  --range-7-start: #f44336;
  --range-7-end: #9c27b0;
  --range-7-bg: #ffcdd2;
  --range-8-start: #3f51b5;
  --range-8-end: #4caf50;
  --range-8-bg: #c5cae9;
  --range-9-start: #ff9800;
  --range-9-end: #607d8b;
  --range-9-bg: #ffe0b2;
}

/* Dark Mode Overrides */
.dark-mode {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #10b981;
  --secondary-hover: #059669;
  --brand-gradient: linear-gradient(135deg, #3b82f6, #10b981);
  --weekend-bg: #232936;
  --selection-bg: #1e3a5f;
  --today-bg: #635b1c;
  --today-border: #fbc02d;
  --border-color: #232936;
  --text-color: #f6f6f8;
  --header-bg: #161b28;
  --bg-color: #0b0f17;
  --card-bg: #161b28;
  --selection-start: #3b82f6;
  --selection-end: #10b981;
  --empty-bg: #161b28;
  --hover-bg: #1e293b;
  --tab-bg: #232936;
}

.dark-mode .tab-bar,
.dark-mode .secondary-header,
.dark-mode .range-panel,
.dark-mode .range-summary,
.dark-mode .range-panel-header,
.dark-mode .team-dropdown,
.dark-mode .btn-team-dropdown {
  background-color: var(--card-bg) !important;
  color: var(--text-color);
  border-color: var(--border-color);
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Manrope", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 700;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.4;
  transition:
    background-color 0.3s,
    color 0.3s;
}

/* Header */
header {
  background-color: var(--header-bg);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
}

.header-controls {
  display: flex;
  gap: 10px;
}

/* Tab Bar */
.tab-bar {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 16px;
  gap: 8px;
  position: sticky;
  top: 70px;
  z-index: 99;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-list {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab-list::-webkit-scrollbar {
  height: 4px;
}

.tab-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.tab-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: var(--tab-bg);
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  min-width: 100px;
  max-width: 200px;
  transition: background 0.2s;
  user-select: none;
}

.tab-item.active {
  background: var(--primary-color);
  color: white;
}

.tab-item:hover:not(.active) {
  background: var(--hover-bg);
}

.tab-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 500;
}

.tab-name-input {
  flex: 1;
  padding: 2px 4px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  width: 100px;
}

.tab-badge {
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-left: 6px;
  min-width: 18px;
  text-align: center;
}

.tab-item.active .tab-badge {
  background: rgba(255, 255, 255, 0.3);
}

.tab-close {
  opacity: 0;
  margin-left: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 2px;
  color: inherit;
  border-radius: 3px;
  transition:
    opacity 0.2s,
    background 0.2s;
}

.tab-item:hover .tab-close {
  opacity: 0.7;
}

.tab-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
}

.tab-item.active .tab-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.add-tab-btn,
.export-csv-btn,
.import-plans-btn,
.clear-all-btn,
.save-screenshot-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    filter 0.2s,
    background-color 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.add-tab-btn {
  font-size: 20px;
}

.export-csv-btn {
  font-size: 14px;
}

.clear-all-btn {
  background: #1a1a1a;
  font-size: 14px;
}

.dark-mode .clear-all-btn {
  background: #111827;
}

.save-screenshot-btn {
  font-size: 14px;
}

.add-tab-btn:hover,
.export-csv-btn:hover,
.import-plans-btn:hover,
.clear-all-btn:hover,
.save-screenshot-btn:hover {
  transform: scale(1.1);
}

.add-tab-btn:hover {
  background: var(--primary-hover);
}

.export-csv-btn:hover {
  background: #218838;
}

.clear-all-btn:hover {
  background: #c82333;
}

.btn-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tab-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 16px;
}

.btn-icon-circle:hover {
  background: var(--hover-bg);
  transform: scale(1.1);
}

.export-csv-btn:hover {
  background: #218838;
}

/* Tab drag and drop states */
.tab-item[draggable="true"] {
  cursor: grab;
}

.tab-item[draggable="true"]:active {
  cursor: grabbing;
}

.tab-item.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.tab-item.drag-over-left {
  border-left: 3px solid var(--primary-hover);
  margin-left: -3px;
}

.tab-item.drag-over-right {
  border-right: 3px solid var(--primary-hover);
  margin-right: -3px;
}

/* Range highlight animation when clicking on range panel item */
@keyframes range-pulse {
  0% {
    transform: scale(1);
    box-shadow: none;
  }

  25% {
    transform: scale(1.2);
    box-shadow: 0 0 12px 4px rgba(74, 144, 217, 0.7);
  }

  50% {
    transform: scale(1.05);
    box-shadow: 0 0 8px 2px rgba(74, 144, 217, 0.4);
  }

  75% {
    transform: scale(1.15);
    box-shadow: 0 0 10px 3px rgba(74, 144, 217, 0.6);
  }

  100% {
    transform: scale(1);
    box-shadow: none;
  }
}

.day.highlight-pulse {
  animation: range-pulse 0.8s ease-in-out;
  z-index: 10;
  position: relative;
}

/* Tab Context Menu */
.tab-context-menu {
  position: fixed;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 4px;
  z-index: 1000;
  display: none;
  min-width: 140px;
}

.tab-context-menu.visible {
  display: block;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.context-menu-item:hover {
  background: #f0f0f0;
}

.context-menu-item[data-action="delete"] {
  color: #dc3545;
}

.context-menu-item[data-action="delete"]:hover {
  background: #fee;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary.active {
  background-color: #2e7d32;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.4);
}

.btn-primary.active.selecting {
  background-color: #c62828;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.4);
  animation: pulse-cancel 1.2s ease-in-out infinite;
}

@keyframes pulse-cancel {

  0%,
  100% {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.4);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(220, 53, 69, 0.15);
  }
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--secondary-hover);
}

.btn-toggle {
  background-color: #28a745;
  color: white;
}

.btn-toggle:hover {
  background-color: #218838;
}

.btn-toggle.active {
  background-color: #28a745;
}

.btn-toggle:not(.active) {
  background-color: #6c757d;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  width: 100%;
}

.btn-danger:hover {
  background-color: #c82333;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}

/* Main Layout - Calendar left, Panel right */
.main-layout {
  display: flex;
  min-height: calc(100vh - 140px);
}

/* Calendar Container */
#calendarContainer {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 15px;
  padding: 15px;
  max-width: calc(100% - var(--panel-width));
}

/* Month Card */
.month {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.month h2 {
  background-color: transparent;
  /* Moved to wrapper */
  color: inherit;
  padding: 0;
  font-size: 1rem;
  text-align: left;
  /* Changed from center */
  flex-grow: 1;
}

/* Calendar Grid - 8 columns: week number + 7 days */
.calendar-grid {
  display: grid;
  grid-template-columns: 35px repeat(7, 1fr);
  gap: 1px;
  background-color: var(--border-color);
  padding: 1px;
}

/* Header cells */
.week-header,
.day-header {
  background-color: var(--header-bg);
  padding: 6px 3px;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-color);
  opacity: 0.7;
}

.week-header {
  font-size: 0.65rem;
  color: #888;
}

/* Week number cells */
.week-number {
  background-color: var(--tab-bg);
  padding: 6px 3px;
  text-align: center;
  font-size: 0.65rem;
  color: var(--text-color);
  opacity: 0.5;
  font-weight: 500;
}

/* Day cells */
.day {
  background-color: var(--card-bg);
  padding: 6px 3px;
  text-align: center;
  min-height: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem;
  position: relative;
}

.day:hover:not(.empty) {
  background-color: var(--hover-bg);
  transform: scale(1.05);
  z-index: 1;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.day.empty {
  background-color: var(--empty-bg);
  cursor: default;
}

.day.past-date {
  background-color: var(--empty-bg);
}

/* Weekend styling */
.day.weekend {
  background-color: var(--weekend-bg);
}

.day.weekend:hover:not(.empty) {
  background-color: #d0d0d0;
}

/* Today highlight */
.day.today {
  background-color: var(--today-bg);
  font-weight: bold;
  border: 2px solid var(--today-border);
}

/* Selection styling - base */
.day.selected {
  background-color: var(--selection-bg);
}

.day.selection-start {
  background-color: var(--selection-start);
  color: white;
  font-weight: bold;
  border-radius: 5px 0 0 5px;
}

.day.selection-end {
  background-color: var(--selection-end);
  color: white;
  font-weight: bold;
  border-radius: 0 5px 5px 0;
}

.day.selection-start.selection-end {
  border-radius: 5px;
}

/* Overlapping ranges styling */
.day.has-overlap {
  color: #333;
  font-weight: bold;
  position: relative;
}

.day.has-overlap.selection-start {
  border-radius: 5px 0 0 5px;
  box-shadow: inset 3px 0 0 0 #4caf50;
}

.day.has-overlap.selection-end {
  border-radius: 0 5px 5px 0;
  box-shadow: inset -3px 0 0 0 #f44336;
}

.day.has-overlap.selection-start.selection-end {
  border-radius: 5px;
  box-shadow:
    inset 3px 0 0 0 #4caf50,
    inset -3px 0 0 0 #f44336;
}

/* Multiple range colors */
.day.range-1 {
  background-color: var(--range-1-bg);
}

.day.range-1.selection-start {
  background-color: var(--range-1-start);
}

.day.range-1.selection-end {
  background-color: var(--range-1-end);
}

.day.range-2 {
  background-color: var(--range-2-bg);
}

.day.range-2.selection-start {
  background-color: var(--range-2-start);
}

.day.range-2.selection-end {
  background-color: var(--range-2-end);
}

.day.range-3 {
  background-color: var(--range-3-bg);
}

.day.range-3.selection-start {
  background-color: var(--range-3-start);
}

.day.range-3.selection-end {
  background-color: var(--range-3-end);
}

.day.range-4 {
  background-color: var(--range-4-bg);
}

.day.range-4.selection-start {
  background-color: var(--range-4-start);
}

.day.range-4.selection-end {
  background-color: var(--range-4-end);
}

.day.range-5 {
  background-color: var(--range-5-bg);
}

.day.range-5.selection-start {
  background-color: var(--range-5-start);
}

.day.range-5.selection-end {
  background-color: var(--range-5-end);
}

.day.range-6 {
  background-color: var(--range-6-bg);
}

.day.range-6.selection-start {
  background-color: var(--range-6-start);
}

.day.range-6.selection-end {
  background-color: var(--range-6-end);
}

.day.range-7 {
  background-color: var(--range-7-bg);
}

.day.range-7.selection-start {
  background-color: var(--range-7-start);
}

.day.range-7.selection-end {
  background-color: var(--range-7-end);
}

.day.range-8 {
  background-color: var(--range-8-bg);
}

.day.range-8.selection-start {
  background-color: var(--range-8-start);
}

.day.range-8.selection-end {
  background-color: var(--range-8-end);
}

.day.range-9 {
  background-color: var(--range-9-bg);
}

.day.range-9.selection-start {
  background-color: var(--range-9-start);
}

.day.range-9.selection-end {
  background-color: var(--range-9-end);
}

/* Range Panel */
.range-panel {
  width: var(--panel-width);
  background: var(--card-bg);
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
}

.range-panel-header {
  padding: 15px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.range-panel-header h2 {
  font-size: 1.1rem;
  color: var(--text-color);
}

.range-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.range-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #888;
}

.range-empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

.range-empty-state p {
  margin: 5px 0;
}

.range-empty-state .hint {
  font-size: 0.85rem;
  color: #aaa;
}

/* Individual Range Item */
.range-item {
  background: var(--tab-bg);
  border-radius: 8px;
  padding: 8px 12px 8px 24px;
  margin-bottom: 10px;
  position: relative;
  cursor: grab;
  transition:
    transform 0.2s,
    box-shadow 0.2s,
    opacity 0.2s;
}

.range-item:active {
  cursor: grabbing;
}

.range-item.selecting {
  background: var(--hover-bg);
}

/* Drag and drop states */
.range-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.range-item.drag-over {
  border-top: 3px solid var(--primary-color);
  margin-top: -3px;
}

.range-item.drag-over-bottom {
  border-bottom: 3px solid var(--primary-color);
  margin-bottom: 7px;
}

/* Drag handle */
.range-drag-handle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  font-size: 1rem;
  cursor: grab;
  padding: 4px;
  transition: color 0.2s;
}

.range-drag-handle:hover {
  color: #888;
}

.range-item:active .range-drag-handle {
  cursor: grabbing;
}

/* Clickable color band overlay */
.range-color-picker {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: pointer;
  border-radius: 8px 0 0 8px;
  transition: width 0.2s ease;
}

.range-color-picker:hover {
  width: 16px;
}

.range-color-picker::after {
  content: "🎨";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.6rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.range-color-picker:hover::after {
  opacity: 1;
}

/* Hidden color input */
.range-color-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.range-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.range-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.range-name:hover {
  background: var(--hover-bg);
}

.range-name-input {
  font-weight: 600;
  font-size: 0.95rem;
  padding: 2px 6px;
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  width: 150px;
}

.range-delete {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 5px;
  transition: color 0.2s;
}

.range-delete:hover {
  color: #dc3545;
}

.range-dates {
  font-size: 0.85rem;
  color: var(--text-color);
  opacity: 0.7;
  margin-bottom: 6px;
}

.range-dates.pending {
  color: #ff9800;
  font-style: italic;
}

.range-stats {
  display: flex;
  gap: 15px;
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.5;
}

.range-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Range Note styling */
.range-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-color);
}

.range-note-input {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.range-note-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

.range-note-input::placeholder {
  color: #aaa;
  font-style: italic;
}

/* Range Summary */
.range-summary {
  padding: 15px;
  background: var(--header-bg);
  border-top: 1px solid var(--border-color);
}

.range-summary.hidden {
  display: none;
}

.range-summary hr {
  display: none;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.9rem;
}

.summary-row span:last-child {
  font-weight: 600;
}

/* Legend */
.legend {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #555;
}

/* Clickable legend items for holiday toggle */
.legend-item[data-holiday-type] {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.legend-item[data-holiday-type]:hover {
  background-color: #e0e0e0;
}

.legend-item[data-holiday-type].disabled {
  opacity: 0.4;
  text-decoration: line-through;
}

.legend-item[data-holiday-type].disabled .legend-color {
  background-color: #ccc !important;
}

/* Small icon buttons for legend items - hidden until hover */
.btn-icon-small {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0;
  padding: 0;
  margin-left: 2px;
}

/* Show buttons when hovering over the legend item */
.legend-item:hover .btn-icon-small {
  opacity: 0.6;
}

.btn-icon-small:hover {
  opacity: 1 !important;
  background: var(--hover-bg);
  transform: scale(1.1);
}

/* Round Icon Buttons for Legend/Secondary Areas */
.btn-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    filter 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-icon-circle:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.btn-icon-circle.active {
  background: var(--brand-gradient) !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.btn-icon-small.delete-group:hover {
  background: #fee;
  border-color: #dc3545;
  color: #dc3545;
}

.btn-icon-small.edit-group:hover {
  background: #e3f2fd;
  border-color: var(--primary-color);
}

/* Hidden holidays when toggled off */
.day.holiday-hidden {
  background-color: white !important;
  color: var(--text-color) !important;
}

.day.holiday-hidden.weekend {
  background-color: var(--weekend-bg) !important;
}

.day.holiday-hidden.today {
  background-color: var(--today-bg) !important;
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-color.weekend {
  background-color: var(--weekend-bg);
}

.legend-color.holiday {
  background-color: var(--holiday-bg);
}

.legend-color.today {
  background-color: var(--today-bg);
  border: 2px solid var(--today-border);
}

.legend-color.schott-public {
  background-color: var(--schott-public-bg);
}

.legend-color.schott-penang {
  background-color: var(--schott-penang-bg);
}

.legend-color.schott-kedah {
  background-color: var(--schott-kedah-bg);
}

.legend-color.schott-replacement {
  background-color: var(--schott-replacement-bg);
}

/* Footer */
footer {
  text-align: center;
  padding: 15px;
  color: #666;
  background-color: var(--header-bg);
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

/* Print-friendly styles */
@media print {
  header {
    position: static;
    box-shadow: none;
  }

  .btn {
    display: none;
  }

  .range-panel {
    display: none;
  }

  .main-layout {
    display: block;
  }

  #calendarContainer {
    max-width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }

  .month {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  :root {
    --panel-width: 280px;
  }
}

@media (max-width: 992px) {
  .main-layout {
    flex-direction: column;
  }

  #calendarContainer {
    max-width: 100%;
  }

  .range-panel {
    width: 100%;
    height: auto;
    max-height: 300px;
    position: static;
    border-left: none;
    border-top: 2px solid var(--border-color);
  }
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  header h1 {
    font-size: 1.5rem;
  }

  #calendarContainer {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .legend {
    justify-content: center;
  }
}

/* Screenshot mode - hide interactive elements */
.screenshot-mode .range-delete,
.screenshot-mode footer,
.screenshot-mode .btn,
.screenshot-mode .range-panel-header .btn {
  display: none !important;
}

/* ============================================
   AUTHENTICATION STYLES
   ============================================ */

/* Auth Modal */
.auth-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
}

.auth-modal.visible {
  display: flex;
}

.auth-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.auth-content {
  position: relative;
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-header {
  text-align: center;
  position: relative;
  z-index: 200;
}

.auth-header h2 {
  font-size: 2rem;
  color: white;
  margin-bottom: 8px;
  font-weight: 700;
}

.auth-header p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 25px;
  border-bottom: 2px solid #eee;
}

.auth-tab {
  flex: 1;
  padding: 12px 20px;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.auth-tab:hover {
  color: var(--primary-color);
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Auth Forms */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form.hidden {
  display: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #444;
}

.form-group input,
.form-group textarea {
  padding: 12px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 0.8rem;
  color: #888;
  margin-top: 4px;
}

/* Auth Buttons */
.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 8px;
}

.auth-link {
  text-align: center;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
  margin-top: 8px;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-info {
  color: #666;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 16px;
}

/* Auth Errors & Success */
.auth-error {
  background: #fee;
  color: #c00;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

.auth-success {
  background: #efe;
  color: #070;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  text-align: center;
}

/* Hide auth-required content */
body.auth-required header,
body.auth-required .secondary-header,
body.auth-required .tab-bar,
body.auth-required .main-layout,
body.auth-required footer {
  display: none;
}

/* Authentication Decoration */
.auth-decoration {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 100;
  pointer-events: none;
}

.swiss-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  z-index: 101;
}

.dark-mode .swiss-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

.auth-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: 102;
}

.blob-1 {
  top: -20%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--primary-color);
  opacity: 0.2;
}

.blob-2 {
  bottom: -20%;
  right: -10%;
  width: 50vw;
  height: 50vw;
  background: var(--secondary-color);
  opacity: 0.2;
}

.auth-modal .auth-content {
  z-index: 200;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.dark-mode .auth-modal .auth-content {
  background: rgba(22, 27, 40, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   LOADING OVERLAY
   ============================================ */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-overlay.hidden {
  display: none;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  margin-top: 16px;
  color: #666;
  font-size: 1rem;
}

/* ============================================
   HEADER LAYOUT (NEW)
   ============================================ */

header {
  background-color: var(--header-bg);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
}

.header-left h1 {
  font-size: 1.5rem;
  color: var(--primary-color);
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 15px;
}

.app-logo {
  height: 32px;
  width: auto;
  transition: transform 0.3s ease;
}

.logo-wrapper:hover .app-logo {
  transform: scale(1.1);
}

.auth-logo {
  height: 64px;
  width: auto;
  margin-bottom: 20px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Secondary Header */
.secondary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================
   USER PROFILE
   ============================================ */

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-profile.hidden {
  display: none;
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#userDisplayName {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-color);
}

.user-email {
  font-size: 0.75rem;
  color: #888;
}

/* Settings Button - Large gear icon */
.btn-settings {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.3s ease;
  line-height: 1;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-settings:hover {
  background: var(--brand-gradient);
  color: white;
  transform: rotate(45deg);
}

/* ============================================
   TEAM SELECTOR DROPDOWN
   ============================================ */

.team-selector {
  position: relative;
}

.team-selector.hidden {
  display: none;
}

.btn-team-dropdown {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 200px;
}

.btn-team-dropdown:hover {
  border-color: var(--primary-color);
  background: var(--hover-bg);
}

#currentTeamIcon {
  font-size: 1.1rem;
}

#currentTeamName {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  font-size: 0.7rem;
  color: #888;
  transition: transform 0.2s;
}

.team-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  min-width: 260px;
  z-index: 200;
  overflow: hidden;
}

.team-dropdown.hidden {
  display: none;
}

.team-dropdown-section {
  padding: 8px 0;
}

.team-dropdown-header {
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
}

.team-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(17, 82, 212, 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dark-mode .team-icon-wrapper {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  /* Lighter blue for dark mode */
}

.team-icon-wrapper.small {
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
}

.team-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s;
  position: relative;
}

.team-option:hover {
  background: var(--hover-bg);
}

.team-option.active {
  background: rgba(17, 82, 212, 0.05);
  border-left-color: var(--primary-color);
}

.dark-mode .team-option.active {
  background: #1f304c;
}

.team-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.team-name {
  font-weight: 500;
  color: var(--text-color);
  transition: color 0.2s;
}

.team-option.active .team-name {
  color: var(--primary-color);
  font-weight: 600;
}

.dark-mode .team-option.active .team-name {
  color: white;
}

.team-check {
  font-size: 1.1rem;
  color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.2s;
}

.team-option.active .team-check {
  opacity: 1;
}

.team-actions {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-color);
  font-weight: 500;
  transition: background 0.2s;
  text-align: left;
}

.dropdown-action:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
}

.dropdown-action .material-symbols-outlined {
  font-size: 1.2rem;
  color: #888;
}

.dropdown-action:hover .material-symbols-outlined {
  color: var(--primary-color);
}

.team-dropdown-footer {
  border-top: 1px solid var(--border-color);
  background: var(--hover-bg);
  padding: 8px;
}

.btn-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
  transition: color 0.2s;
}

.btn-footer:hover {
  color: var(--text-color);
}

.btn-footer .material-symbols-outlined {
  font-size: 1rem;
}

.dropdown-action:hover {
  background: rgba(74, 144, 217, 0.1);
}

/* ============================================
   MODALS (TEAM MODALS)
   ============================================ */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Team info modal should be above settings modal */
#teamInfoModal {
  z-index: 1100;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.3rem;
  color: var(--text-color);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.modal-close:hover {
  background: #f0f0f0;
  color: #333;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

/* Team Info Modal */
.team-info-section {
  margin-bottom: 16px;
}

.team-info-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.team-info-section p {
  font-size: 1rem;
  color: var(--text-color);
}

.team-id-display {
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-id-display code {
  flex: 1;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.9rem;
  word-break: break-all;
}

.team-members-list {
  max-height: 150px;
  overflow-y: auto;
}

.team-member {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #eee;
}

.member-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.member-role {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  font-weight: 700;
}

.member-contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.member-email {
  font-size: 0.85rem;
  color: #666;
  font-family: monospace;
}

.member-role.owner {
  background: #e3f2fd;
  color: #1976d2;
}

.member-role.member {
  background: #f1f3f5;
  color: #495057;
}

.team-owner-actions {
  margin-top: 16px;
}

.team-owner-actions.hidden {
  display: none;
}

/* Invite Form Styles */
.invite-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.invite-email-input {
  flex: 1;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 0.95rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.invite-email-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.invite-email-input::placeholder {
  color: #aaa;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

/* User Settings Styles */
.settings-section {
  margin-bottom: 24px;
}

.settings-section h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
  margin: 0;
  flex: 1;
}

.settings-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.section-desc {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 12px;
}

.input-readonly {
  background-color: #f5f5f5;
  color: #555;
  border-color: #ddd;
  cursor: default;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
}

.settings-team-item {
  background: #f9f9f9;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.team-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.team-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-manage-gear {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-manage-gear:hover {
  background: rgba(0, 0, 0, 0.05);
  transform: rotate(45deg);
}

.team-sub {
  font-size: 0.75rem;
  color: #888;
}

.team-creds {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  background: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #eee;
}

.cred-label {
  color: #888;
  font-size: 0.75rem;
  font-weight: 600;
}

.cred-row code {
  font-family: monospace;
  color: #333;
  user-select: all;
  background: #f0f0f0;
  padding: 1px 4px;
  border-radius: 3px;
}

.blur-text {
  filter: blur(4px);
  cursor: pointer;
  transition: filter 0.2s;
  user-select: none;
}

.blur-text:hover {
  filter: blur(0px);
}

.btn-icon,
.btn-icon-small {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.btn-icon:hover,
.btn-icon-small:hover {
  background: #f0f0f0;
}

.btn-icon-small {
  font-size: 0.9rem;
  padding: 2px 4px;
}

.btn-icon-circle {
  background: white;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  margin-left: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-icon-circle:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

/* Custom Holiday Group Legend Styles */
.legend-item.custom-group {
  position: relative;
  padding-right: 24px;
}

.legend-item.custom-group .delete-group {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s;
  background: none;
  border: none;
  color: #ff5252;
  font-size: 1.1rem;
  padding: 0 4px;
}

.legend-item.custom-group:hover .delete-group {
  opacity: 1;
}

.legend-item.custom-group .delete-group:hover {
  transform: translateY(-50%) scale(1.2);
  color: #f44336;
}

.btn-lighter-grey {
  background-color: #e0e0e0;
  color: #333;
  border: 1px solid #ccc;
  font-weight: 600;
}

.btn-lighter-grey:hover {
  background-color: #d0d0d0;
}

.color-picker-container {
  position: relative;
  display: flex;
  align-items: center;
}

.color-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  border-radius: 8px;
  background-color: #ffeb3b;
  /* Fallback */
  border: 1px solid #e0e0e0;
  cursor: pointer;
  font-size: 1.2rem;
  color: #333;
  transition: transform 0.2s;
  background-image: linear-gradient(rgba(255, 255, 255, 0.1),
      rgba(0, 0, 0, 0.1));
}

.color-preview:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#holidayGroupColor {
  opacity: 0;
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 36px;
  cursor: pointer;
}

/* Multi-entry Holiday Group CSS */
.modal-large {
  max-width: 700px;
  width: 90%;
}

.flex-1 {
  flex: 1;
}

.flex-2 {
  flex: 2;
}

.holiday-entries-container {
  margin-top: 20px;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 15px;
  background: #fdfdfd;
}

.entries-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.entries-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #555;
}

#holidayEntriesList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 5px;
}

.holiday-entry-row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: white;
  padding: 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.entry-field {
  flex: 1;
}

.entry-field.flex-2 {
  flex: 2;
}

.holiday-entry-row input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
}

.btn-remove-entry {
  background: #ffeded;
  color: #d32f2f;
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}

.btn-remove-entry:hover {
  background: #d32f2f;
  color: white;
}

.settings-empty {
  text-align: center;
  padding: 20px;
  color: #999;
  font-style: italic;
  font-size: 0.9rem;
}

.settings-empty.error {
  color: #d32f2f;
}

/* Screenshot Mode Overrides - Fixes html2canvas issues */
body.screenshot-mode {
  overflow: visible !important;
  height: auto !important;
}

body.screenshot-mode .main-layout {
  height: auto !important;
  min-height: auto !important;
  display: grid !important;
  /* Restore grid layout */
  grid-template-columns: 3fr 1fr !important;
  /* Force sidebar to be side-by-side */
  gap: 20px !important;
  width: 1400px !important;
  /* Wider to accommodate side-by-side */
  margin: 0 auto !important;
  padding: 20px !important;
}

body.screenshot-mode #calendarContainer {
  max-width: none !important;
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 15px !important;
}

body.screenshot-mode .range-panel {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  position: static !important;
  width: auto !important;
  /* Auto width for grid cell */
  border-left: 1px solid var(--border-color) !important;
  border-top: none !important;
  display: block !important;
}

body.screenshot-mode .range-list {
  max-height: none !important;
  overflow: visible !important;
}

body.screenshot-mode header,
body.screenshot-mode .tab-bar,
body.screenshot-mode .secondary-header {
  position: static !important;
  width: 1400px !important;
  margin: 0 auto !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* Hide non-essential interactions during screenshot */
body.screenshot-mode .btn,
body.screenshot-mode .btn-icon,
body.screenshot-mode .header-controls,
body.screenshot-mode .add-tab-btn,
body.screenshot-mode .tab-context-menu,
body.screenshot-mode .range-delete,
body.screenshot-mode .tab-close,
body.screenshot-mode .range-drag-handle,
body.screenshot-mode .modal {
  display: none !important;
}

/* BUT ensure specific info elements remain */
body.screenshot-mode .team-selector,
body.screenshot-mode .btn-team-dropdown {
  display: inline-flex !important;
  /* Keep team name visible */
}

/* Remove fancy shadow/borders from team dropdown for cleaner print look */
body.screenshot-mode .btn-team-dropdown {
  border: 1px solid #ddd !important;
  background: #fff !important;
  box-shadow: none !important;
}

body.screenshot-mode .dropdown-arrow {
  display: none !important;
  /* Hide arrow, just text */
}

body.screenshot-mode .user-profile {
  display: flex !important;
}

/* Ensure notes are visible as text */
body.screenshot-mode .range-note-input {
  /* We can't easily replace input with text, so just hide for now or style it flat */
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  display: block !important;
}

/* User Presence List */
.user-presence-list {
  display: flex;
  margin-left: 15px;
  gap: 5px;
}

.presence-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  border: 2px solid var(--header-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  cursor: help;
  transition: transform 0.2s;
}

.presence-avatar:hover {
  transform: translateY(-2px);
  z-index: 10;
}

/* Activity Sidebar */
.activity-sidebar {
  width: 280px;
  background-color: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  transition:
    transform 0.3s ease,
    width 0.3s ease;
  z-index: 100;
  position: relative;
}

.activity-sidebar.hidden {
  transform: translateX(-100%);
  width: 0;
  overflow: hidden;
  border-right: none;
}

.sidebar-header {
  padding: 15px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.btn-close-sidebar {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.5;
}

.activity-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.activity-item {
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  animation: fadeIn 0.3s ease;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-user {
  font-weight: bold;
  color: var(--primary-color);
}

.activity-action {
  color: var(--text-color);
}

.activity-target {
  font-style: italic;
  font-weight: 500;
}

.activity-time {
  display: block;
  font-size: 0.7rem;
  color: var(--text-color);
  opacity: 0.5;
  margin-top: 4px;
}

.activity-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-color);
  opacity: 0.4;
  font-style: italic;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Edit Mode Styling */
.day.editing {
  outline: 2px solid var(--primary-color);
  box-shadow: 0 0 10px rgba(var(--primary-color), 0.5);
  animation: pulse 1s infinite alternate;
}

.btn-edit-range {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px;
  margin-right: 4px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.btn-edit-range:hover {
  opacity: 1;
}

.range-item.editing {
  border: 2px solid var(--primary-color);
  transform: scale(1.02);
}

@keyframes pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.03);
  }
}

/* Dark mode specific button tweaks */
.dark-mode .btn-secondary {
  background-color: #333;
  border-color: #444;
}

.dark-mode .btn-secondary:hover {
  background-color: #444;
}

.dark-mode .btn-lighter-grey {
  background-color: #2a2a2a;
  color: #ccc;
  border-color: #444;
}

.dark-mode .btn-lighter-grey:hover {
  background-color: #333;
}

.dark-mode .team-option {
  background: transparent;
  color: #e0e0e0;
}

.dark-mode .team-option:hover {
  background: #333;
}

.dark-mode .team-option.active {
  background: var(--primary-color);
  color: white;
}

.dark-mode .tab-item {
  background: #2a2a2a;
}

.dark-mode .tab-item.active {
  background: var(--primary-color);
}

.dark-mode .tab-item:hover:not(.active) {
  background: #333;
}

.dark-mode .modal-content {
  background: var(--card-bg);
  color: var(--text-color);
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
  background-color: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

.dark-mode .flatpickr-calendar {
  background: #1e1e1e !important;
  border-color: #333 !important;
  color: #e0e0e0 !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5) !important;
}

.dark-mode .flatpickr-day {
  color: #e0e0e0 !important;
}

.dark-mode .flatpickr-day:hover {
  background: #333 !important;
}

.dark-mode .flatpickr-months .flatpickr-month,
.dark-mode .flatpickr-weekdays,
.dark-mode span.flatpickr-weekday {
  background: #1e1e1e !important;
  color: #e0e0e0 !important;
  fill: #e0e0e0 !important;
}

.dark-mode .flatpickr-current-month .flatpickr-monthDropdown-months {
  background: #1e1e1e !important;
}

.dark-mode .flatpickr-current-month .flatpickr-monthDropdown-month {
  background: #1e1e1e !important;
}

/* ============================================
   SETTINGS & TEAM INFO MODAL REFINEMENTS
   ============================================ */

.settings-team-item {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  transition: transform 0.2s;
}

.dark-mode .settings-team-item {
  background: rgba(30, 41, 59, 0.5);
  /* Matching styled dark blue/grey */
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
}

.team-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.team-sub {
  font-size: 0.85rem;
  color: #888;
}

.team-creds {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.dark-mode .team-creds {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.cred-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.cred-label {
  font-weight: 600;
  width: 40px;
  color: #666;
}

.dark-mode .cred-label {
  color: #aaa;
}

.team-id-display {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.team-id-display code {
  background: #f5f5f5;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: "Roboto Mono", monospace;
  border: 1px solid #e0e0e0;
  color: var(--primary-color);
  flex: 1;
}

.dark-mode .team-id-display code {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  color: #60a5fa;
}

.input-readonly {
  background-color: #f9f9f9;
  color: #666;
  cursor: default;
}

.dark-mode .input-readonly {
  background-color: rgba(0, 0, 0, 0.2);
  color: #aaa;
  border-color: #444;
}

/* Fix Material Icons alignment in buttons */
.btn-manage-gear,
.btn-icon-small {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  display: flex;
  /* Flex for centering */
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 4px;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn-manage-gear:hover,
.btn-icon-small:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--primary-color);
}

.dark-mode .btn-manage-gear:hover,
.dark-mode .btn-icon-small:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Modal Headers Icons */
.modal-header h2 {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-header {
  color: var(--primary-color);
  font-size: 1.5rem;
}

/* ============================================
   MODERN HEADER ICONS (Activity & Theme)
   ============================================ */

.btn-header-modern {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: #888;
  display: flex;
  /* Centering */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.dark-mode .btn-header-modern {
  color: #aaa;
  /* Muted dark mode text */
  background: var(--card-bg);
  /* Dark surface */
}

.btn-header-modern:hover {
  background: var(--hover-bg);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  color: var(--primary-color);
}

.dark-mode .btn-header-modern:hover {
  color: var(--primary-color);
  background: #1e293b;
  /* Slightly lighter than deep navy */
}

.btn-header-modern .material-symbols-outlined {
  font-size: 20px;
  transition: color 0.2s;
}

/* Theme Toggle Orb */
.theme-orb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  transform: rotate(45deg);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-header-modern:hover .theme-orb {
  transform: rotate(225deg);
  /* 180 + 45 */
}

.theme-orb-half.solid {
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--primary-color);
}

.theme-orb-half.glass {
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background: #60a5fa;
  opacity: 0.4;
  backdrop-filter: blur(2px);
}

/* ============================================
   DARK MODE REFINEMENTS: TEAM INFO & DROPDOWN
   ============================================ */

/* 1. Team Info Modal - Member List Items */
.team-member {
  background: #f9f9f9;
  border: 1px solid #eee;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dark-mode .team-member {
  background: #1a2232;
  /* User specified color */
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.member-main {
  display: flex;
  flex-direction: column;
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.member-role {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
  text-transform: uppercase;
  font-weight: 700;
  width: fit-content;
}

.member-role.owner {
  background: #bbdefb;
  color: #1976d2;
}

.member-role.member {
  background: #f5f5f5;
  color: #616161;
}

.dark-mode .member-role.member {
  background: #334155;
  color: #cbd5e1;
}

.member-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #666;
}

.dark-mode .member-contact {
  color: #aaa;
}

/* 2. Calendar Dropdown Highlight Color Override */
.dark-mode .team-option.active {
  background: #1a2232 !important;
  /* User specified color overriding previous #1f304c */
}

/* Compact Team Member Layout (Reverted) */
.team-member.compact {
  padding: 8px 12px;
  align-items: center;
  /* Center vertically */
}

.member-info-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
  /* Text overflow handling */
}

.member-email-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-email {
  font-size: 0.8rem;
  color: #888;
}

.dark-mode .member-email {
  color: #aaa;
}

.member-status-right {
  display: flex;
  align-items: center;
}

.btn-icon-tiny {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.btn-icon-tiny:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--primary-color);
}

.dark-mode .btn-icon-tiny:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Ensure role badge is vertical centered */
.member-role {
  margin-top: 0;
  font-size: 0.7rem;
}

/* Updated Flat Icon Buttons for Toolbar */
.icon-btn-flat {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #666;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn-flat:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
}

.dark-mode .icon-btn-flat {
  color: #aaa;
}

.dark-mode .icon-btn-flat:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

/* Ensure Add Tab button uses flex for icon centering */
.add-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   FIX: HOLIDAY BUTTON & BUTTON VISIBILITY
   ============================================ */

/* 1. Reset btn-icon-circle to be visible */
.btn-icon-circle {
  background: var(--brand-gradient);
  color: white;
}

/* 2. Style specifically for Holiday Toggle (Sun Umbrella / Beach Access) */
.toggle-holidays-btn.active {
  background: var(--brand-gradient);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.toggle-holidays-btn:not(.active) {
  background: #ccc;
  /* Greyed out when inactive */
  box-shadow: none;
}

.dark-mode .toggle-holidays-btn:not(.active) {
  background: #334155;
  color: #94a3b8;
}

/* Override for consistent visibility */
.btn-icon-circle:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* ============================================
   FIX: COMPACT TEAM MEMBER LAYOUT
   ============================================ */
.team-member.compact {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 8px 12px !important;
}

.member-info-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  max-width: 70%;
}

.member-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
}

.member-email-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.member-email {
  font-size: 0.8rem;
  color: #888;
  line-height: 1.2;
}

.dark-mode .member-email {
  color: #aaa;
}

.member-status-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-shrink: 0;
}

.btn-icon-tiny {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.btn-icon-tiny:hover {
  opacity: 1;
  color: var(--primary-color);
}

/* ============================================
   FIX: FORCE ROW LAYOUT FOR TEAM MEMBERS
   ============================================ */
.team-member.compact {
  display: flex !important;
  flex-direction: row !important;
  /* Force row direction */
  justify-content: space-between !important;
  align-items: center !important;
  width: 100% !important;
}

.member-info-left {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  /* Force left alignment */
  text-align: left !important;
  flex-grow: 1 !important;
}

.member-status-right {
  flex-shrink: 0 !important;
  margin-left: 10px !important;
}

/* ============================================
   ADD HOLIDAY GROUP MODAL (NEW DESIGN)
   ============================================ */

/* Header */
.holiday-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.header-content-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-icon-orange {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8f00, #ff6f00);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 6px -1px rgba(255, 111, 0, 0.3);
}

.header-icon-orange .material-symbols-outlined {
  font-size: 28px;
}

.header-text h2 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.subtitle {
  margin: 0;
  color: #888;
  font-size: 0.9rem;
}

.dark-mode .subtitle {
  color: #aaa;
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 25px;
  margin-top: 20px;
}

.label-caps {
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .label-caps {
  color: #abc;
}

.input-with-icon {
  position: relative;
}

.input-with-icon input {
  padding-right: 30px;
}

.input-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  color: #aaa;
  pointer-events: none;
}

/* Custom Color Picker */
.color-picker-custom {
  position: relative;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--card-bg);
  min-height: 48px;
}

.dark-mode .color-picker-custom {
  border-color: #334155;
  background: #1e293b;
}

.color-picker-custom:hover {
  border-color: var(--primary-color);
}

.color-picker-custom input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dropdown-arrow {
  color: #aaa;
}

/* Holidays Wrapper */
.holiday-entries-wrapper {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

.dark-mode .holiday-entries-wrapper {
  background: #0f172a;
  border-color: #1e293b;
}

/* Entries Header */
.entries-header-modern {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.entries-header-modern .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
}

.dark-mode .entries-header-modern .header-left {
  color: #94a3b8;
}

.header-icon {
  font-size: 20px;
}

.entries-header-modern h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin: 0;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
  font-weight: 600;
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-outline-primary:hover {
  background: rgba(59, 130, 246, 0.1);
}

.btn-outline-primary .material-symbols-outlined {
  font-size: 18px;
}

/* Timeline & Card List */
.holiday-timeline-list {
  display: flex;
  flex-direction: column;
}

.holiday-card-row {
  display: flex;
  gap: 15px;
  position: relative;
  padding-bottom: 10px;
}

.timeline-connector {
  position: relative;
  width: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 25px;
  /* Align dot with card center approx */
}

/* The vertical Line */
.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
      transparent 0%,
      #cbd5e1 20%,
      #cbd5e1 80%,
      transparent 100%);
  opacity: 0.5;
}

.dark-mode .timeline-line {
  background: linear-gradient(to bottom,
      transparent 0%,
      #334155 20%,
      #334155 80%,
      transparent 100%);
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  z-index: 2;
  border: 2px solid var(--card-bg);
  /* Cutout effect */
}

.timeline-dot.active {
  background: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Card Style */
.holiday-card {
  flex: 1;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 15px;
  display: flex;
  gap: 20px;
  align-items: center;
  position: relative;
}

.dark-mode .holiday-card {
  background: #1e293b;
  border-color: #334155;
}

.card-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.card-field input {
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-color);
  border-radius: 0;
}

.card-field input:focus {
  box-shadow: none;
  border-bottom: 1px solid var(--primary-color);
}

.date-input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.dark-mode .date-input-wrapper {
  background: #0f172a;
}

.date-input-wrapper:focus-within {
  border-color: var(--primary-color);
}

.date-icon {
  font-size: 18px;
  color: #94a3b8;
}

.date-input-wrapper input {
  border-bottom: none !important;
  /* Reset focus underline for this one */
  font-family: "Roboto Mono", monospace;
  font-size: 0.9rem;
}

.delete-span {
  opacity: 0;
  transition: opacity 0.2s;
  color: #ef4444;
}

.dark-mode .delete-span {
  color: #f87171;
}

.holiday-card:hover .delete-span {
  opacity: 1;
}

/* Buttons */
.btn-ghost {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #64748b;
  padding: 10px 24px;
}

.dark-mode .btn-ghost {
  border-color: #334155;
  color: #94a3b8;
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-color);
}

.dark-mode .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: white;
}

/* ============================================
   DETAILED MONTH VIEW STYLES
   ============================================ */
.month-header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--month-header-bg);
  color: var(--month-header-text);
  padding: 10px 12px;
  /* margin-bottom: 10px; Removed to attach to grid */
}

.month h2 {
  margin-bottom: 0;
}

.btn-icon-tiny.month-action {
  opacity: 1;
  /* Fully visible */
  transition:
    opacity 0.2s,
    background 0.2s,
    transform 0.2s;
  background: transparent;
  /* Blends with header */
  border: none;
  border-radius: 4px;
  padding: 4px;
  color: white;
  /* Clean white icon */
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-tiny.month-action .material-symbols-outlined {
  font-size: 14px;
  /* Reduced to roughly half size */
}

.month .btn-icon-tiny.month-action:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.1);
}

.dark-mode .btn-icon-tiny.month-action {
  background: transparent;
  color: white;
}

.dark-mode .month .btn-icon-tiny.month-action:hover {
  background: var(--primary-color);
  color: white;
}

/* -- DETAILED VIEW CONTAINER -- */
.gantt-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--card-bg);
  position: relative;
}

.gantt-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.gantt-nav-month-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.gantt-content-wrapper {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex: 1;
  overflow: hidden;
}

.gantt-left-pane {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.detail-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.detail-nav h2 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--text-color);
}

.nav-buttons {
  display: flex;
  gap: 5px;
}

.btn-nav-arrow {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-color);
  transition: all 0.2s;
}

.btn-nav-arrow:hover {
  background: var(--hover-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-color);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back:hover {
  background: var(--hover-bg);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

/* -- DETAILED GRID -- */
.detailed-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: auto;
  gap: 1px;
  background: var(--border-color);
  /* Grid lines */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  flex: 1;
  /* Fill remaining height */
}

/* Day Header in Detail View */
.detail-day-header {
  background: var(--card-bg);
  padding: 10px;
  text-align: center;
  font-weight: 600;
  color: #64748b;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dark-mode .detail-day-header {
  color: #94a3b8;
}

/* Detailed Day Cell */
.detail-day {
  background: var(--card-bg);
  /* Reset bg */
  min-height: 120px;
  /* Bigger cells */
  padding: 8px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.detail-day:hover {
  background: var(--hover-bg);
}

.detail-day.empty {
  background: #f8fafc;
}

.dark-mode .detail-day.empty {
  background: #0f172a;
}

.detail-day-number {
  font-weight: 600;
  font-size: 1rem;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 4px;
}

.detail-day.today .detail-day-number {
  background: var(--primary-color);
  color: white;
}

/* -- PLAN BARS -- */
.plan-bar {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition:
    transform 0.1s,
    box-shadow 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 2px;
}

.plan-bar:hover {
  transform: scale(1.02);
  z-index: 5;
  filter: brightness(1.1);
}

/* ============================================
   FIX: CALENDAR CONTAINER FOR DETAILED VIEW
   ============================================ */
#calendarContainer.detailed-view-active {
  display: block;
  /* Override grid layout */
  max-width: 100%;
  /* Use available width (sidebar still takes space) */
  padding: 0;
  background: transparent;
  box-shadow: none;
}

#calendarContainer.detailed-view-active .month-detail-container {
  width: 100%;
  height: auto;
  min-height: calc(100vh - 150px);
}

/* ============================================
   PAGE FOOTER STYLES
   ============================================ */
.page-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  transition: all 0.3s ease;
}

.footer-collapsed,
.footer-expanded {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 10px 20px;
}

.footer-collapsed {
  height: 44px;
}

.footer-expanded {
  height: 60px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-logo-img {
  width: 24px;
  height: 24px;
}

.footer-logo-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-color);
}

.footer-categories {
  display: flex;
  gap: 8px;
}

.footer-category-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s;
}

.footer-category-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-footer-expand {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.6;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px;
}

.btn-footer-expand:hover {
  opacity: 1;
}

/* Footer Modal Specific Styles */
.footer-modal .modal-content {
  max-width: 700px;
  width: 90%;
}

.footer-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.footer-modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-color);
}

.footer-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--tab-bg);
  overflow-x: auto;
}

.footer-tab-btn {
  background: transparent;
  border: none;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
  opacity: 0.7;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.footer-tab-btn:hover {
  opacity: 1;
  background: var(--hover-bg);
}

.footer-tab-btn.active {
  opacity: 1;
  border-bottom-color: var(--primary-color);
  color: var(--primary-color);
}

.footer-tab-content {
  padding: 24px;
  min-height: 250px;
  max-height: 400px;
  overflow-y: auto;
}

.footer-tab-content h4 {
  margin: 0 0 12px 0;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.footer-tab-content p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  color: var(--text-color);
  opacity: 0.85;
}

.footer-tab-content ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
}

.footer-tab-content li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: var(--text-color);
  opacity: 0.85;
}

/* Dark Mode Adjustments */
.dark-mode .footer-category-btn {
  border-color: var(--border-color);
}

.dark-mode .footer-tab-nav {
  background: #1e293b;
}

.dark-mode .footer-tab-btn.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
}

/* ============================================
   FOOTER MODAL VISIBILITY CONTROL
   ============================================ */
.footer-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  /* Hidden by default */
}

.footer-modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}

.footer-modal .modal-content {
  position: relative;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  z-index: 1001;
}

.footer-modal .modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px 8px;
}

.footer-modal .modal-close:hover {
  opacity: 1;
}

/* Footer Quick Tips */
.footer-tips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.7;
}

.tip-item {
  white-space: nowrap;
}

.tip-item strong {
  color: var(--primary-color);
}

.tip-separator {
  color: var(--border-color);
  font-weight: 300;
}

/* Responsive: hide tips on small screens */
@media (max-width: 900px) {
  .footer-tips {
    display: none;
  }
}

/* ============================================
   PLAN BAR ACTION BUTTONS (Month View)
   ============================================ */
.plan-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.plan-bar-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-bar-actions {
  display: none;
  gap: 2px;
  margin-left: 4px;
}

.plan-bar:hover .plan-bar-actions {
  display: flex;
}

.plan-bar-btn {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}

.plan-bar-btn .material-symbols-outlined {
  font-size: 14px;
}

.plan-bar-btn:hover {
  background: rgba(255, 255, 255, 0.5);
}

.plan-bar-btn-delete:hover {
  background: rgba(239, 68, 68, 0.8);
}

/* ============================================
   DETAILED GRID WITH WEEK NUMBERS
   ============================================ */
.detailed-grid {
  grid-template-columns: 40px repeat(7, 1fr) !important;
}

.detail-week-header {
  background: var(--tab-bg);
  padding: 8px 4px;
  text-align: center;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-color);
  opacity: 0.6;
}

.detail-week-number {
  background: var(--tab-bg);
  padding: 8px 4px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-color);
  opacity: 0.5;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12px;
}

/* ============================================
   ACTIVITY SIDEBAR STYLES
   ============================================ */
.activity-sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 60px);
  /* Fill space below header */
  overflow: hidden;
}

.activity-sidebar.hidden {
  display: none;
}

.activity-sidebar .sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.activity-sidebar .sidebar-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.btn-close-sidebar {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-color);
  opacity: 0.5;
  padding: 0 4px;
}

.btn-close-sidebar:hover {
  opacity: 1;
}

.activity-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.activity-empty {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-color);
  opacity: 0.5;
  font-size: 0.85rem;
}

.activity-item {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--tab-bg);
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.activity-item:hover {
  background: var(--hover-bg);
}

.activity-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.activity-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.activity-user {
  font-weight: 600;
  color: var(--primary-color);
}

.activity-action {
  color: var(--text-color);
}

.activity-target {
  color: var(--text-color);
  font-style: italic;
  opacity: 0.8;
}

.activity-time {
  font-size: 0.7rem;
  color: var(--text-color);
  opacity: 0.5;
  margin-top: 2px;
}

/* Alert style for team deletions */
.activity-item.activity-alert {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
}

.activity-item.activity-alert .activity-action {
  color: #ef4444;
  font-weight: 600;
}

.dark-mode .activity-item.activity-alert {
  background: rgba(239, 68, 68, 0.15);
}

/* ============================================
   CUSTOM PLAN TOOLTIP
   ============================================ */
.plan-tooltip {
  position: fixed;
  z-index: 9999;
  display: none;
  padding: 12px 16px;
  border-radius: 12px;
  color: white;
  font-size: 0.8rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  max-width: 280px;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.plan-tooltip-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.plan-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  opacity: 0.95;
}

.plan-tooltip-row .material-symbols-outlined {
  font-size: 14px;
  opacity: 0.8;
}

.plan-tooltip-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-style: italic;
}

/* ============================================
   STRATEGY CARD COLOR PICKER & HEADER
   ============================================ */
#strategyCardDateRange {
  color: rgba(0, 0, 0, 0.65);
  /* Darker grey as requested */
  font-weight: 500;
}

.strategy-header-color-picker-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.15);
  margin-right: 8px;
  transition: background 0.2s;
  color: #000;
}

.strategy-header-color-picker-wrapper:hover {
  background: rgba(0, 0, 0, 0.25);
}

.strategy-header-color-picker-wrapper input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ============================================
   TAB COLOR PICKER
   ============================================ */
.tab-color-picker {
  position: fixed;
  z-index: 1000;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 12px;
  display: none;
}

.color-picker-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 10px;
  text-align: center;
}

.color-picker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.color-option {
  width: 28px;
  height: 28px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s;
}

.color-option:hover {
  transform: scale(1.15);
  border-color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.color-option.color-clear {
  background: var(--tab-bg);
  border: 2px dashed var(--border-color);
  font-size: 0.8rem;
  color: var(--text-color);
  opacity: 0.6;
}

.color-option.color-clear:hover {
  opacity: 1;
  border-color: var(--text-color);
}

/* Tab with color applied */
.tab-item[style*="border-left"] {
  padding-left: 10px;
}

/* ============================================
   USER REQUEST: BUTTON GLOW & STYLING UPDATE
   ============================================ */

/* 1. Add Glow to Plus Buttons (Holiday Add & Calendar Add) */
#addHolidayBtn,
.add-tab-btn {
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4) !important;
  background: var(--brand-gradient) !important;
  color: white !important;
  border: none;
}

/* Ensure add-tab-btn is circular and styled properly */
.add-tab-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.add-tab-btn:hover,
#addHolidayBtn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.6) !important;
}

/* 2. Style Utility Buttons (Export, Screenshot, Clear) to match Brand Style */
.icon-btn-flat {
  background: var(--brand-gradient) !important;
  color: white !important;
  /* Make icons white */
  border: none !important;
  border-radius: 8px !important;
  /* Soft rounded corners */
  width: 36px;
  /* consistent size */
  height: 36px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  margin-left: 4px;
}

.icon-btn-flat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  filter: brightness(1.1);
}

.icon-btn-flat span {
  font-size: 20px;
}

/* Dark mode adjustments if needed */
body.dark-mode .icon-btn-flat {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ============================================
   FIX: SIMPLIFY COLOR PICKER UI
   ============================================ */

/* Center the color dot since text is removed */
.color-picker-custom .color-display-row {
  justify-content: center !important;
  width: 100%;
}

/* Make the dot slightly larger for better visibility */
.color-dot {
  width: 28px !important;
  height: 28px !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Ensure the wrapper handles the simplified layout */
.color-picker-custom {
  cursor: pointer;
  background: white;
  transition: border-color 0.2s;
}

.color-picker-custom:hover {
  border-color: #aaa;
}

/* ============================================
   FIX: REDUCE LEGEND SPACING AS REQUESTED
   ============================================ */
.legend {
  display: flex;
  align-items: center;
  gap: 8px !important;
  /* Tighter spacing between items */
}

/* Ensure no extra margins on buttons */
.legend button {
  margin: 0 !important;
}

/* ============================================
   FIX: COLOR PICKER SIZING & CLICK AREA
   ============================================ */

/* Make the picker narrower (not full width) */
.color-picker-custom {
  width: auto !important;
  display: inline-flex !important;
  min-width: 100px;
  /* enough space for dot and arrow */
  max-width: 120px;
}

/* CRITICAL: Make the input cover the ENTIRE box so clicks work anywhere */
.color-picker-custom input[type="color"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  opacity: 0;
  cursor: pointer;
  z-index: 20;
  /* Ensure on top of everything */
  padding: 0;
  margin: 0;
  border: none;
  display: block;
}

/* Ensure the wrapper is positioned to contain the absolute input */
.color-picker-custom {
  position: relative;
  overflow: hidden;
  /* contain the input */
}

/* ============================================
   FIX: TEAM DROPDOWN EMPTY STATE
   ============================================ */
.team-empty {
  color: #64748b !important;
  /* Soft dark grey */
  padding: 12px 20px !important;
  /* Align with other menu items */
  font-size: 0.9rem;
  font-style: italic;
  background: transparent;
}

/* ============================================
   FEATURE: STRATEGY CARD MODAL (OPEN IN FULL)
   ============================================ */

.strategy-card {
  max-width: 900px !important;
  width: 95% !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  /* Prevent overflow on small screens */
}

.strategy-header {
  background: #f8f9fa;
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
}

/* Close button and palette icon inside coloured strategy header should be black */
.strategy-header .modal-close {
  color: #000;
}

.strategy-header .modal-close:hover {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}

.strategy-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  padding: 30px;
  overflow-y: auto;
  /* Allow scrolling content */
}

.strategy-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.meta-card {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-large {
  font-size: 1.2rem;
  padding: 12px;
  font-weight: 600;
}

.select-modern {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  font-size: 0.95rem;
  cursor: pointer;
}

.strategy-actions {
  padding: 20px 30px;
  /* Reduced padding from standard modal */
  background: white;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Mobile responsiveness for strategy card */
@media (max-width: 768px) {
  .strategy-card {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
  }

  .strategy-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .strategy-header {
    padding: 15px;
  }

  .strategy-actions {
    padding: 15px;
    flex-direction: column-reverse;
    /* Stack buttons, delete at bottom */
    gap: 15px;
  }

  .actions-right {
    width: 100%;
    justify-content: space-between;
  }

  .actions-right button {
    flex: 1;
  }

  .btn-delete-plan {
    width: 100%;
    text-align: center;
  }
}

.actions-right {
  display: flex;
  gap: 10px;
}

.btn-delete-plan {
  color: #ff5252;
}

.btn-delete-plan:hover {
  background: #fff0f0;
  color: #d32f2f;
}

.header-icon-blue {
  background: rgba(33, 150, 243, 0.1);
  color: #2196f3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.input-icon-left {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 1.2rem;
}

.input-with-icon input {
  padding-left: 36px !important;
}

/* ============================================
   INVITE UI STYLES
   ============================================ */
.invite-inputs-container {
  max-height: 200px;
  /* Show about 4-5 rows then scroll */
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 4px;
  /* Space for scrollbar */
}

/* Custom scrollbar for invite list */
.invite-inputs-container::-webkit-scrollbar {
  width: 4px;
}

.invite-inputs-container::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 2px;
}

.invite-input-row {
  margin-bottom: 10px;
  /* Space between emails */
}

.invite-email-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.9rem;
  /* Smaller font as requested */
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s;
}

.invite-email-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.btn-link-action {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--primary-color);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 0;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
}

.btn-link-action:hover {
  text-decoration: underline;
  opacity: 0.8;
}

/* Dark Mode fixes for Invite UI */
.dark-mode .invite-email-input {
  background-color: var(--bg-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

.dark-mode .btn-link-action {
  color: #64b5f6;
  /* Lighter blue for dark mode readability */
}

/* ============================================
   STRATEGY CARD DARK MODE OVERRIDES
   ============================================ */

.dark-mode .strategy-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

.dark-mode .strategy-actions {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
}

/* Ensure the modal content itself has dark background */
.dark-mode .strategy-card {
  background: var(--card-bg);
  color: var(--text-color);
}

.dark-mode .meta-card {
  background: var(--header-bg);
  /* Slightly lighter/darker depending on theme */
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

/* Inputs and Selects in Dark Mode */
.dark-mode .input-large,
.dark-mode .select-modern,
.dark-mode .strategy-column textarea,
.dark-mode .strategy-column input {
  background-color: var(--bg-color);
  /* Very dark for inputs */
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.dark-mode .input-large:focus,
.dark-mode .select-modern:focus,
.dark-mode .strategy-column textarea:focus {
  border-color: var(--primary-color);
  background-color: var(--bg-color);
}

/* Placeholder color in dark mode */
.dark-mode ::placeholder {
  color: #666;
}

/* Fix Labels */
.dark-mode .card-label,
.dark-mode label {
  color: #aaa;
  /* Dimmer text for labels */
}

/* Fix Icon in inputs */
.dark-mode .input-icon-left {
  color: #aaa;
}

/* Modal Close Button in Dark Mode */
.dark-mode .strategy-header .close-modal {
  color: var(--text-color);
}

.dark-mode .strategy-header .close-modal:hover {
  color: #ff5252;
}

/* Specific styling for the priority/confidence options if we wanted custom dropdowns, 
   but native select is fine for "Light" UI principle */

/* ============================================
   SETTINGS TEAM CARD STYLES
   ============================================ */
.settings-team-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 15px;
  /* Compact padding */
  margin-bottom: 10px;
}

.dark-mode .settings-team-card {
  background: var(--card-bg);
  /* Or darker */
  border-color: var(--border-color);
}

.team-card-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Tighter gap */
  flex: 1;
}

.team-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-color);
}

.team-card-creds {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cred-row-compact {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.cred-label-tiny {
  font-weight: 600;
  color: #666;
  min-width: 35px;
}

.dark-mode .cred-label-tiny {
  color: #aaa;
}

.cred-value {
  background: #eaeaea;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.9em;
  color: #333;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dark-mode .cred-value {
  background: #333;
  color: #eee;
}

.btn-icon-tiny-copy {
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  padding: 0;
  display: flex;
  align-items: center;
}

.btn-icon-tiny-copy span {
  font-size: 14px;
}

.btn-icon-tiny-copy:hover {
  color: var(--primary-color);
}

.team-card-right {
  margin-left: 15px;
}

.btn-gear-large-round {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-gear-large-round:hover {
  background: rgba(0, 0, 0, 0.05);
  /* Light grey hover */
  color: var(--text-color);
  border-color: #eee;
}

/* Text Danger Button (Compact Delete/Leave) */
.btn-text-danger {
  background: transparent;
  border: none;
  color: #ff5252;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  transition:
    background 0.2s,
    color 0.2s;
  height: auto;
  /* ensure no fixed height */
  line-height: normal;
}

.btn-text-danger:hover {
  background: rgba(255, 82, 82, 0.1);
  color: #d32f2f;
}

/* Custom Modal Footer */
.modal-footer-custom {
  border-top: 1px solid #eee;
  padding-top: 15px;
  margin-top: 15px;
}

.dark-mode .modal-footer-custom {
  border-color: var(--border-color);
}

/* Legend Actions */
.legend-item {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding-right: 8px;
}

.legend-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 8px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.legend-item:hover .legend-actions,
.legend-actions:hover {
  opacity: 1;
}

/* Tiny Icon Button */
.btn-icon-tiny {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: transparent;
  color: var(--text-color);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.btn-icon-tiny:hover {
  background-color: var(--hover-bg);
  color: var(--primary-color);
  transform: scale(1.1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-icon-tiny .material-symbols-outlined {
  font-size: 16px;
}

.delete-span {
  color: #ef5350;
}

.delete-span:hover {
  background-color: rgba(239, 83, 80, 0.1);
  color: #d32f2f;
}

/* Holiday Dots - Multiple holidays per date */
.holiday-dots {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  align-items: center;
  z-index: 5;
}

.holiday-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.holiday-dot-more {
  font-size: 8px;
  font-weight: 700;
  color: #666;
  margin-left: 1px;
}

/* Detailed month view - larger dots */
.detail-day .holiday-dots {
  bottom: 4px;
  gap: 3px;
}

.detail-day .holiday-dot {
  width: 8px;
  height: 8px;
}

.detail-day .holiday-dot-more {
  font-size: 10px;
}

/* Dark mode adjustments */
.dark-mode .holiday-dot {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.dark-mode .holiday-dot-more {
  color: #aaa;
}

/* Color Picker Grid for Settings */
.color-picker-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-option:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.color-option.selected {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(17, 82, 212, 0.3);
}

/* Color option backgrounds using saturated range start colors */
.color-option.range-1 {
  background-color: var(--range-1-start);
}

.color-option.range-2 {
  background-color: var(--range-2-start);
}

.color-option.range-3 {
  background-color: var(--range-3-start);
}

.color-option.range-4 {
  background-color: var(--range-4-start);
}

.color-option.range-5 {
  background-color: var(--range-5-start);
}

.color-option.range-6 {
  background-color: var(--range-6-start);
}

.color-option.range-7 {
  background-color: var(--range-7-start);
}

.color-option.range-8 {
  background-color: var(--range-8-start);
}

.color-option.range-9 {
  background-color: var(--range-9-start);
}

.color-option.range-random {
  background: linear-gradient(135deg,
      var(--range-1-start) 0%,
      var(--range-3-start) 25%,
      var(--range-5-start) 50%,
      var(--range-7-start) 75%,
      var(--range-9-start) 100%);
  color: white;
}

.dark-mode .color-option.range-random {
  color: #ccc;
}

/* Show Plans Toggle Button */
.show-plans-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 0.2s,
    filter 0.2s,
    background-color 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  background: #374151;
  /* Default state: dark gray */
  font-size: 14px;
}

.dark-mode .show-plans-btn {
  background: #1f2937;
}

.show-plans-btn:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.show-plans-btn.active {
  background: var(--brand-gradient);
  /* Active state: brand color */
}

/* Month Card */
.month {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: visible;
  /* Changed from hidden to allow balloons to pop out */
  position: relative;
  z-index: 1;
  /* Base z-index */
}

/* Ensure header keeps rounded corners since container overflow is visible */
.month-header-wrapper {
  background-color: var(--month-header-bg);
  color: var(--month-header-text);
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 10px 10px 0 0;
  /* Add rounded corners to top */
}

/* ... existing month h2 styles ... */

.month h2 {
  background-color: transparent;
  /* Moved to wrapper */
  color: inherit;
  padding: 0;
  font-size: 1rem;
  text-align: left;
  /* Changed from center */
  flex-grow: 1;
}

/* ... existing styles ... */

/* Plan Name Balloon - appears on start date of ranges */
.plan-balloon {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  margin-bottom: 2px;
  /* Close to date */
}

/* Edge Alignments */
.plan-balloon.align-left {
  left: 0;
  transform: none;
  border-bottom-left-radius: 0;
  /* Visual cue */
}

.plan-balloon.align-right {
  left: auto;
  right: 0;
  /* Align to right edge of cell */
  transform: none;
  border-bottom-right-radius: 0;
  /* Visual cue */
}

/* Arrows */
.plan-balloon::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

.plan-balloon.align-left::after {
  left: 10px;
  /* Arrow near left */
  transform: none;
}

.plan-balloon.align-right::after {
  left: auto;
  right: 10px;
  /* Arrow near right */
  transform: none;
}

/* Multi-plan balloon container - stacked balloons */
.plan-balloons-container {
  position: absolute;
  bottom: 100%;
  left: 50%;
  /* Default Center */
  transform: translateX(-50%);
  display: flex;
  flex-direction: column-reverse;
  /* Stack upwards */
  gap: 1px;
  z-index: 100;
  pointer-events: none;
  margin-bottom: 2px;
  align-items: center;
}

.plan-balloons-container .plan-balloon {
  position: static;
  transform: none;
  margin-bottom: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.plan-balloons-container .plan-balloon::after {
  display: none;
  /* Hide arrows on individual stacked balloons */
}

/* Container Alignments */
.plan-balloons-container.align-left {
  left: 0;
  transform: none;
  align-items: flex-start;
}

.plan-balloons-container.align-right {
  left: auto;
  right: 0;
  transform: none;
  align-items: flex-end;
}

/* Container Arrow */
.plan-balloons-container::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
  margin-top: -1px;
}

.plan-balloons-container.align-left::after {
  left: 10px;
  transform: none;
}

.plan-balloons-container.align-right::after {
  left: auto;
  right: 10px;
  transform: none;
}

/* ============================================
   MOBILE UI OPTIMIZATIONS
   ============================================ */

/* Utility Classes */
.desktop-only {
  display: flex !important;
}

.mobile-only {
  display: none !important;
}

/* Tab Bar Controls - Desktop Layout */
.tab-bar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.more-actions-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  /* Specific hide for footer on mobile to avoid layout issues on desktop */
  .page-footer {
    display: none !important;
  }

  /* Tab Bar Refactor - Mobile Override */
  .tab-bar-controls {
    margin-left: 0;
  }

  /* Header Optimization */
  header {
    padding: 10px 15px;
    height: 60px;
    position: sticky;
    top: 0;
  }

  .header-left {
    gap: 12px;
  }

  .header-center {
    flex: 1;
    justify-content: flex-end;
  }

  .btn-team-dropdown {
    padding: 6px 10px;
    max-width: 140px;
  }

  .logo-wrapper {
    gap: 8px;
  }

  .app-logo {
    width: 24px;
    height: 24px;
  }

  #calendarTitle {
    font-size: 1.2rem;
  }

  /* Mobile Menu Styles */
  .mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: flex-start;
    transition: opacity 0.3s ease;
  }

  .mobile-menu-overlay.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
  }

  .mobile-menu-content {
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: var(--card-bg);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    animation: slideRight 0.3s ease-out;
  }

  @keyframes slideRight {
    from {
      transform: translateX(-100%);
    }

    to {
      transform: translateX(0);
    }
  }

  .mobile-menu-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
  }

  .menu-logo {
    height: 32px;
  }

  .mobile-menu-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
  }

  .menu-section {
    padding: 10px 0;
  }

  .menu-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
  }

  .menu-logout-spacer {
    flex: 1;
  }

  /* Legend Collapsible */
  .legend-collapsible {
    width: 100%;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    overflow: hidden;
  }

  .legend-toggle {
    width: 100%;
    padding: 12px 15px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
  }

  .legend-toggle .arrow {
    margin-left: auto;
    transition: transform 0.3s;
  }

  .legend-collapsible.active .arrow {
    transform: rotate(180deg);
  }

  .legend-content {
    display: none;
    padding: 10px 15px;
    border-top: 1px solid var(--border-color);
  }

  .legend-collapsible.active .legend-content {
    display: block;
  }

  .legend {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px !important;
  }

  /* Tab Bar Refactor */
  .tab-bar {
    padding: 8px 10px;
    gap: 10px;
    height: auto;
  }

  .tab-list {
    min-width: 0;
    /* Allow shrinking */
  }

  .tab-bar-controls {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .more-actions-container {
    position: relative;
  }

  .tab-actions-group {
    position: absolute;
    top: calc(100% + 10px);
    bottom: auto;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 12px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 2100;
  }

  .tab-actions-group.visible {
    display: flex;
  }

  .icon-btn-flat {
    width: 100% !important;
    justify-content: flex-start !important;
    padding: 0 15px !important;
    border-radius: 8px !important;
  }

  /* Monthly View Scaling */
  .month-detail-container {
    padding: 5px !important;
  }

  .detailed-grid {
    grid-template-columns: 28px repeat(7, 1fr) !important;
    /* Narrower week col */
    gap: 0px !important;
    /* Remove gaps to fit */
    border: 1px solid var(--border-color);
  }

  .day {
    padding: 4px 1px !important;
    font-size: 0.7rem !important;
    min-height: 48px !important;
    /* Thumb friendly height */
  }

  .detail-week-header,
  .day-header {
    font-size: 0.6rem !important;
    padding: 4px 1px !important;
  }

  .month-header-wrapper {
    padding: 8px 12px !important;
  }

  .month h2 {
    font-size: 0.9rem !important;
  }

  /* Fix overflows */
  .main-layout {
    min-height: auto;
  }

  #calendarContainer {
    padding: 10px 5px;
  }
}

/* Specific fix for extremely small screens */
@media (max-width: 360px) {
  .day {
    font-size: 0.65rem !important;
  }

  .detailed-grid {
    grid-template-columns: 20px repeat(7, 1fr) !important;
  }
}

/* =========================================
   GANTT CHART VIEW STYLES
   ========================================= */

.gantt-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin: 15px;
  overflow: hidden;
  max-width: calc(100% - var(--panel-width) - 30px);
  position: relative;
  /* Sync heights */
  height: calc(100vh - 170px);
}

.gantt-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 15px;
  border-bottom: 2px solid var(--border-color);
  background: var(--header-bg);
  flex-shrink: 0;
}

.gantt-nav-month-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
}

.gantt-content-wrapper {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
}

.gantt-left-pane {
  /* 72(CW) + 40(Dur) + 60(Start) + 60(End) + 10(padding) + 2(border) + 36(buffer) = 280px fixed */
  width: calc(var(--gantt-user-w, 150px) + var(--gantt-task-w, 200px) + 280px);
  min-width: 400px;
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  z-index: 10;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
}

.gantt-right-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  position: relative;
}

.gantt-left-header,
.gantt-timeline-header {
  height: 40px;
  background: var(--header-bg);
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--text-color);
  position: sticky;
  top: 0;
  z-index: 5;
}

.gantt-left-header {
  padding-left: 0;
}

/* Column Toggle Button */
.gantt-col-toggle-wrapper {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin: 0 2px 0 6px;
}

.gantt-col-toggle-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-color);
  opacity: 0.55;
  transition: all 0.2s;
  padding: 0;
}

.gantt-col-toggle-btn:hover {
  opacity: 1;
  background: var(--hover-bg);
}

.gantt-col-toggle-btn .material-symbols-outlined {
  font-size: 18px;
}

.gantt-col-toggle-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  z-index: 200;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gantt-col-toggle-dropdown.hidden {
  display: none;
}

.gantt-col-toggle-dropdown label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
  user-select: none;
}

.gantt-col-toggle-dropdown label:hover {
  background: var(--hover-bg);
}

.gantt-col-toggle-dropdown input[type="checkbox"] {
  accent-color: var(--primary-color);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* Column hiding classes — applied to .gantt-left-pane */
.gantt-left-pane.hide-col-user .gantt-col-user {
  display: none;
}

.gantt-left-pane.hide-col-task .gantt-col-task {
  display: none;
}

.gantt-left-pane.hide-col-cw .gantt-col-cw {
  display: none;
}

.gantt-left-pane.hide-col-dur .gantt-col-dur {
  display: none;
}

.gantt-left-pane.hide-col-start .gantt-col-start {
  display: none;
}

.gantt-left-pane.hide-col-end .gantt-col-end {
  display: none;
}

.gantt-col {
  padding: 0 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  position: relative;
  flex-shrink: 0;
}

.gantt-col-user {
  width: var(--gantt-user-w, 150px);
  min-width: 60px;
}

.gantt-col-task {
  width: var(--gantt-task-w, 200px);
  min-width: 80px;
}

.gantt-col-cw {
  width: 72px;
  text-align: center;
  font-size: 0.72rem;
}

.gantt-col-dur {
  width: 40px;
  text-align: center;
}

.gantt-col-start {
  width: 60px;
  text-align: center;
  font-size: 0.75rem;
}

.gantt-col-end {
  width: 60px;
  text-align: center;
  font-size: 0.75rem;
}

/* Column resize handle */
.gantt-col-resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 10;
  border-right: 2px solid transparent;
  transition: border-color 0.15s;
}

.gantt-col-resize-handle:hover,
.gantt-col-resize-handle.dragging {
  border-right-color: var(--primary-color);
}

.gantt-left-body,
.gantt-timeline-body {
  flex: 1;
  overflow-y: auto;
}

/* Hide scrollbar on left body to avoid double scrollbars, will sync via JS */
.gantt-left-body::-webkit-scrollbar {
  display: none;
}

.gantt-left-body {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gantt-left-row {
  display: flex;
  align-items: center;
  height: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-left: 0;
  font-size: 0.8rem;
  transition: background-color 0.2s;
  cursor: pointer;
  box-sizing: border-box;
}

.gantt-left-row:hover {
  background-color: var(--hover-bg);
}

/* Row eye toggle button */
.gantt-row-eye-btn {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  color: var(--text-color);
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
  margin: 0 2px 0 6px;
  padding: 0;
  flex-shrink: 0;
}

.gantt-left-row:hover .gantt-row-eye-btn {
  opacity: 0.4;
}

.gantt-row-eye-btn:hover {
  opacity: 1 !important;
  background: var(--hover-bg);
}

.gantt-row-eye-btn .material-symbols-outlined {
  font-size: 16px;
}

/* Hidden row state */
.gantt-left-row.gantt-row-hidden,
.gantt-row.gantt-row-hidden {
  display: none;
}

/* Hidden rows counter badge */
.gantt-hidden-badge {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  margin-left: 4px;
}

.gantt-hidden-badge:hover {
  background: #fca5a5;
  transform: scale(1.05);
}

.gantt-hidden-badge .material-symbols-outlined {
  font-size: 14px;
}

.dark-mode .gantt-hidden-badge {
  background: #3b1111;
  color: #fca5a5;
}

.dark-mode .gantt-hidden-badge:hover {
  background: #5a1515;
}

.gantt-row {
  height: 40px;
  border-bottom: 1px solid var(--border-color);
  position: relative;
  display: flex;
  box-sizing: border-box;
}

.gantt-sub-row {
  height: 30px;
  position: relative;
  border-bottom: 1px dashed var(--border-color);
  box-sizing: border-box;
}

.gantt-sub-row:last-child {
  border-bottom: none;
}

.gantt-row.grouped-row {
  height: auto;
  flex-direction: column;
}

.gantt-timeline-header {
  display: flex;
  flex-direction: column;
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  z-index: 5;
}

.gantt-timeline-header-row {
  display: flex;
  height: 25px;
  border-bottom: 1px solid var(--border-color);
  box-sizing: border-box;
}

.gantt-timeline-header-row:last-child {
  border-bottom: none;
}

.gantt-timeline-header-col {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border-color);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
  box-sizing: border-box;
  transition: background-color 0.15s;
  user-select: none;
}

.gantt-timeline-header-col:hover {
  background-color: rgba(59, 130, 246, 0.08);
}

.gantt-timeline-header-col.gantt-header-active {
  background-color: rgba(59, 130, 246, 0.18);
  color: #2563eb;
}

/* Vertical highlight overlay for clicked day/week */
.gantt-highlight {
  position: absolute;
  top: 0;
  bottom: 0;
  background-color: rgba(147, 197, 253, 0.30);
  border-left: 1.5px solid rgba(59, 130, 246, 0.35);
  border-right: 1.5px solid rgba(59, 130, 246, 0.35);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.2s;
}

.gantt-timeline-grid-cell {
  border-right: 1px solid var(--border-color);
  height: 100%;
  flex-shrink: 0;
}

.gantt-timeline-grid-cell.weekend {
  background-color: var(--weekend-bg);
}

.gantt-bar {
  position: absolute;
  top: 6px;
  height: 28px;
  border-radius: 4px;
  color: white;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.2s,
    filter 0.2s;
  white-space: nowrap;
  /* Remove overflow hidden so labels can pop out */
  /* overflow: hidden; */
  /* text-overflow: ellipsis; */
  z-index: 2;
  /* Ensure a default color exists if range color class fails */
  background-color: var(--accent-color, #4a90e2);
  box-sizing: border-box;
}

.gantt-bar:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.gantt-sub-row .gantt-bar {
  top: 4px;
  height: 22px;
}

.gantt-milestone {
  position: absolute;
  z-index: 3;
  cursor: pointer;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.gantt-milestone::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bar-color, currentColor);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  /* Circle shape instead of diamond */
  box-sizing: border-box;
  transition: transform 0.2s, filter 0.2s;
}

.gantt-milestone:hover::before {
  filter: brightness(1.2);
  transform: scale(1.1);
}

.gantt-milestone .gantt-bar-title {
  transform: translateY(-50%);
  position: absolute;
  left: 100%;
  top: 50%;
  margin-left: 12px;
  white-space: nowrap;
}

.gantt-bar-title {
  display: none;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  /* The border-left-color will be set dynamically via JS */
  border-left: 4px solid transparent;
  margin-left: 5px;
}

.gantt-show-names .gantt-bar-title {
  display: inline-block;
}

.gantt-today-indicator {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--today-border);
  z-index: 4;
  pointer-events: none;
}

.gantt-today-indicator::before {
  content: "";
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--today-border);
}

.gantt-timeline-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  z-index: 0;
  pointer-events: none;
}

/* Specific buttons coloring */
.gantt-month-btn {
  color: #00bcd4;
}

.gantt-year-btn {
  color: #9c27b0;
}

/* ── Gantt Drag-to-Reschedule ───────────────────────── */

/* Show grab cursor on normal bars to hint draggability */
.gantt-bar:not(.gantt-milestone) {
  cursor: grab;
}

/* Active drag state: glow + slight scale */
.gantt-bar-dragging {
  cursor: grabbing !important;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.45) !important;
  transform: scaleY(1.18);
  z-index: 50 !important;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
  border-radius: 6px !important;
}

/* Floating date preview tooltip shown while dragging */
.gantt-drag-tooltip {
  position: fixed;
  background: rgba(15, 15, 25, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
  transform: translateY(-130%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ── User Notes ───────────────────────────────────────── */

.notes-container {
  padding: 20px 40px;
  flex: 1;
  overflow-y: auto;
  background: var(--bg-primary);
}

.notes-header-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.notes-take-wrapper {
  width: 100%;
  max-width: 600px;
}

.notes-take-note {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: text;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.notes-take-note:hover {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.notes-grid {
  columns: 4;
  gap: 16px;
}

@media (max-width: 1400px) {
  .notes-grid {
    columns: 3;
  }
}

@media (max-width: 1100px) {
  .notes-grid {
    columns: 2;
  }
}

@media (max-width: 768px) {
  .notes-grid {
    columns: 1;
  }
}

.note-card {
  break-inside: avoid;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  cursor: pointer;
  position: relative;
  transition: box-shadow 0.2s, transform 0.1s;
  display: flex;
  flex-direction: column;
}

.note-card:hover {
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.15);
}

.note-card.dragging {
  opacity: 0.5;
  transform: scale(0.95);
}

.note-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  word-wrap: break-word;
}

.note-card-body {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-wrap: break-word;
  max-height: 300px;
  overflow: hidden;
  position: relative;
}

.note-card-pin {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.2s;
}

.note-card:hover .note-card-pin,
.note-card.is-pinned .note-card-pin {
  opacity: 1;
}

.note-card.is-pinned .note-card-pin {
  color: var(--accent-primary);
}

/* Note Editor Modal */
.note-editor-modal .modal-content {
  max-width: 600px;
  width: 95%;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  background: var(--bg-secondary);
}

.note-editor-top {
  padding: 16px 16px 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.note-editor-title {
  flex: 1;
  font-size: 1.4rem;
  font-weight: 500;
  border: none;
  outline: none;
  background: transparent;
  min-height: 1.5em;
}

.note-editor-title:empty:before {
  content: attr(data-placeholder);
  color: var(--text-secondary);
}

.note-editor-body {
  padding: 8px 16px 16px;
  font-size: 1rem;
  line-height: 1.5;
  border: none;
  outline: none;
  background: transparent;
  min-height: 100px;
  max-height: 60vh;
  overflow-y: auto;
}

.note-editor-body:empty:before {
  content: attr(data-placeholder);
  color: var(--text-secondary);
}

#noteFormattingToolbar.hidden {
  display: none;
}

.note-editor-toolbar {
  padding: 8px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(0, 0, 0, 0.02);
}

.toolbar-btn {
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s;
}

.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.toolbar-btn b {
  font-weight: 800;
}

.toolbar-btn i {
  font-style: italic;
}

.toolbar-btn u {
  text-decoration: underline;
}

.toolbar-divider {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 4px;
}

.note-editor-footer {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.note-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.note-footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.note-timestamp {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 8px;
}

.btn-text-only {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--text-primary) !important;
  font-weight: 500 !important;
  padding: 6px 12px !important;
  font-size: 0.95rem !important;
}

.btn-text-only:hover {
  background: rgba(0, 0, 0, 0.05) !important;
}

.btn-icon-plain {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.btn-icon-plain:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
}

.btn-icon-plain.active {
  color: var(--accent-primary);
}

.note-color-picker {
  position: absolute;
  bottom: 44px;
  left: 0;
  background: var(--card-bg);
  /* Use card-bg which is solid white/dark */
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  /* Slightly stronger shadow for depth */
  z-index: 100;
}

.note-color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.1s, border-color 0.1s;
}

.note-color-swatch:hover {
  transform: scale(1.1);
}

.note-color-swatch.active {
  border-color: var(--accent-primary);
}

.note-color-swatch.no-color {
  background: #fff;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-color-swatch.no-color:before {
  content: '\e14c';
  /* format_clear or similar */
  font-family: 'Material Symbols Outlined';
  font-size: 14px;
  color: #888;
}

/* Todo styling */
.note-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.note-todo-cb {
  margin-top: 4px;
  cursor: pointer;
}

.todo-done {
  text-decoration: line-through;
  opacity: 0.6;
}

/* Color Classes */
.note-color-default {
  background-color: var(--card-bg) !important;
  color: var(--text-color) !important;
}

.note-color-coral {
  background-color: #faafa8 !important;
  color: #3c4043 !important;
}

.note-color-peach {
  background-color: #f39f76 !important;
  color: #3c4043 !important;
}

.note-color-sand {
  background-color: #fff8b8 !important;
  color: #3c4043 !important;
}

.note-color-sage {
  background-color: #e2f6d3 !important;
  color: #3c4043 !important;
}

.note-color-mint {
  background-color: #b4ddd3 !important;
  color: #3c4043 !important;
}

.note-color-denim {
  background-color: #d4e4ed !important;
  color: #3c4043 !important;
}

.note-color-lilac {
  background-color: #aeccdc !important;
  color: #3c4043 !important;
}

.note-color-wisteria {
  background-color: #d3bfdb !important;
  color: #3c4043 !important;
}

.note-color-blush {
  background-color: #f6e2dd !important;
  color: #3c4043 !important;
}

.note-color-bisque {
  background-color: #e9e3d4 !important;
  color: #3c4043 !important;
}

/* Remove dimming effect for note editor modal */
.note-editor-modal .modal-overlay {
  background: transparent;
}

/* Note Dragging & Effects */
.note-long-pressed {
  transform: scale(1.03) !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
  z-index: 10;
  transition: all 0.2s ease;
  cursor: grab !important;
}

.note-card.dragging {
  opacity: 0.5;
  transform: scale(0.95) !important;
  cursor: grabbing !important;
}

.note-card.drag-over {
  border-left: 3px solid var(--primary-color);
  transform: translateX(4px);
  transition: all 0.2s ease;
}

/* ============================================
   IMPORT PLANS MODAL
   ============================================ */

.import-modal {
  max-width: 720px;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
}

.import-header {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  border-radius: 12px 12px 0 0;
}

.import-header .subtitle {
  color: #1a1a1a;
}

.header-icon-green {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

/* Drop Zone */
.import-drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  margin: 20px;
  background: var(--bg-color);
}

.import-drop-zone:hover,
.import-drop-zone.drag-over {
  border-color: var(--primary-color);
  background: var(--hover-bg);
  transform: scale(1.01);
}

.import-drop-icon {
  font-size: 48px;
  color: var(--primary-color);
  opacity: 0.6;
  display: block;
  margin-bottom: 12px;
}

.import-drop-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.import-drop-subtitle {
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Error State */
.import-error-box {
  margin: 20px;
  padding: 20px;
  border-radius: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.dark-mode .import-error-box {
  background: #2d1515;
  border-color: #5a2020;
}

.import-error-header {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dc2626;
  margin-bottom: 12px;
  font-size: 1rem;
}

.import-error-header .material-symbols-outlined {
  font-size: 22px;
}

.import-error-box p {
  margin-bottom: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.import-required-cols {
  background: rgba(0, 0, 0, 0.04);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  line-height: 1.8;
}

.dark-mode .import-required-cols {
  background: rgba(255, 255, 255, 0.05);
}

.import-required-cols p {
  margin: 0;
}

/* Preview */
.import-preview {
  margin: 16px 20px;
}

.import-summary-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-color);
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  align-items: center;
}

.import-stat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.import-stat .material-symbols-outlined {
  font-size: 18px;
  opacity: 0.7;
}

.import-warnings {
  margin-bottom: 12px;
}

.import-warning-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: #b45309;
  background: #fffbeb;
  border-radius: 6px;
  margin-bottom: 4px;
}

.dark-mode .import-warning-item {
  background: #2d2305;
  color: #fbbf24;
}

.import-warning-item .material-symbols-outlined {
  font-size: 16px;
  flex-shrink: 0;
}

.import-table-wrapper {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.import-preview-table th {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border-color);
  z-index: 1;
}

.import-preview-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.import-preview-table tr:hover td {
  background: var(--hover-bg);
}

.import-obj-cell {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.7;
}

.import-more-row td {
  text-align: center;
  font-style: italic;
  opacity: 0.6;
  padding: 12px;
}

.import-actions {
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
}

/* Success Toast */
.import-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, #047857, #059669);
  color: white;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 30px rgba(4, 120, 87, 0.35);
  z-index: 10000;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.import-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.import-toast .material-symbols-outlined {
  font-size: 22px;
}

/* Spinning animation for loading state */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
  display: inline-block;
}